Skip to content

Commit

Permalink
Add missing query parameters for ListEvents (#463)
Browse files Browse the repository at this point in the history
* Updated Gradle dependencies

* Added missing query params for PC lists

* Renamed ListsResponse
  • Loading branch information
SMadani authored Jun 30, 2023
1 parent 212cb3e commit 48bd7c9
Show file tree
Hide file tree
Showing 21 changed files with 600 additions and 162 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

# [7.6.0] - 2023-06-29
# [7.6.0] - 2023-06-30
- Added Proactive Connect API implementation
- Added Meetings API implementation
- Updated Subaccounts name & secret validation logic
Expand Down
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ repositories {
dependencies {
compileOnly 'jakarta.servlet:jakarta.servlet-api:4.0.4'

implementation 'commons-codec:commons-codec:1.15'
implementation 'commons-codec:commons-codec:1.16.0'
implementation 'org.apache.httpcomponents:httpclient:4.5.14'
implementation 'org.apache.httpcomponents:httpmime:4.5.14'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
Expand All @@ -36,7 +36,6 @@ dependencies {

testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-inline:4.11.0'
testImplementation 'org.hamcrest:hamcrest-all:1.3'
testImplementation 'org.springframework:spring-test:5.3.28'
testImplementation 'org.springframework:spring-web:5.3.28'
testImplementation 'jakarta.servlet:jakarta.servlet-api:4.0.4'
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/com/vonage/client/meetings/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@

/**
* This package contains classes and sub-packages to support usage of the
* <a href=https://developer.vonage.com/api/meetings>Meetings API</a>.
* <br>
* Please refer to <a href=https://developer.vonage.com/en/meetings/overview>
* the developer documentation</a> for an overview of the concepts.
* <a href=https://developer.vonage.com/api/meetings>Meetings API</a>. Please refer to
* <a href=https://developer.vonage.com/en/meetings/overview>the developer documentation</a>
* for an overview of the concepts.
*
* @since 7.6.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public String getRecipientId() {
}

/**
* {@code src_ctx} field.
* The name of the segment or matcher.
*
* @return The source context or {@code null} if unknown.
*/
Expand Down
39 changes: 39 additions & 0 deletions src/main/java/com/vonage/client/proactiveconnect/EventType.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,54 @@
* Represents values for {@link Event#getType()}.
*/
public enum EventType {
/**
* Action call succeeded
*/
ACTION_CALL_SUCCEEDED,

/**
* Action call failed
*/
ACTION_CALL_FAILED,

/**
* Action call info
*/
ACTION_CALL_INFO,

/**
* Recipient response
*/
RECIPIENT_RESPONSE,

/**
* Run item skipped
*/
RUN_ITEM_SKIPPED,

/**
* Run item failed
*/
RUN_ITEM_FAILED,

/**
* Run item submitted
*/
RUN_ITEM_SUBMITTED,

/**
* Run items total
*/
RUN_ITEMS_TOTAL,

/**
* Run items ready
*/
RUN_ITEMS_READY,

/**
* Run items excluded
*/
RUN_ITEMS_EXCLUDED;

@JsonCreator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@

class HalRequestWrapper {
final Integer page, pageSize;
final SortOrder order;
final String id;

HalRequestWrapper(Integer page, Integer pageSize, String id) {
HalRequestWrapper(Integer page, Integer pageSize, SortOrder order, String id) {
this.page = page;
this.pageSize = pageSize;
this.order = order;
this.id = id;
}

Expand All @@ -34,6 +36,9 @@ RequestBuilder addParams(RequestBuilder builder) {
if (pageSize != null) {
builder.addParameter("page_size", pageSize.toString());
}
if (order != null) {
builder.addParameter("order", order.toString());
}
return builder;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.apache.http.client.methods.RequestBuilder;
import java.io.IOException;

class ListEventsEndpoint extends AbstractMethod<HalRequestWrapper, ListEventsResponse> {
class ListEventsEndpoint extends AbstractMethod<ListEventsFilter, ListEventsResponse> {
private static final Class<?>[] ALLOWED_AUTH_METHODS = {JWTAuthMethod.class};
private static final String PATH = "/v0.1/bulk/events";

Expand All @@ -36,10 +36,9 @@ protected Class<?>[] getAcceptableAuthMethods() {
}

@Override
public RequestBuilder makeRequest(HalRequestWrapper request) {
public RequestBuilder makeRequest(ListEventsFilter request) {
String uri = httpWrapper.getHttpConfig().getApiEuBaseUri() + PATH;
return request.addParams(RequestBuilder.get(uri))
.setHeader("Accept", "application/json");
return request.addParams(RequestBuilder.get(uri)).setHeader("Accept", "application/json");
}

@Override
Expand Down
Loading

0 comments on commit 48bd7c9

Please sign in to comment.