Skip to content

Commit

Permalink
[GitHub Bot] Generated java SDK (#92)
Browse files Browse the repository at this point in the history
Co-authored-by: API Team <[email protected]>
  • Loading branch information
mpragosa-te and API Team authored Oct 8, 2024
1 parent 612089b commit f8d870e
Show file tree
Hide file tree
Showing 71 changed files with 689 additions and 47 deletions.
2 changes: 1 addition & 1 deletion administrative/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Administrative API

- API version: 7.0.22
- API version: 7.0.25

Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API.
This API provides the following operations to manage your organization:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import java.time.OffsetDateTime;
import com.thousandeyes.sdk.account.management.administrative.model.UnauthorizedError;
import com.thousandeyes.sdk.account.management.administrative.model.ValidationError;
import com.thousandeyes.sdk.account.management.administrative.model.UserEvent;
import com.thousandeyes.sdk.pagination.Paginator;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand Down Expand Up @@ -60,6 +62,21 @@ public UserEventsApi(ApiClient apiClient) {
this.apiClient = apiClient;
}

/**
* List activity log events with pagination
* Returns a list of activity log events in the current account group. If &#x60;useAllPermittedAids&#x3D;true&#x60; query parameter is passed and the user has permission &#x60;View activity log for all users in account group&#x60; the logs returned include events across all the account groups they belong to. For more information about changing the account group context, see [Account Context](https://developer.thousandeyes.com/v7/#/accountcontext).
* @param aid A unique identifier associated with your account group. You can retrieve your &#x60;AccountGroupId&#x60; from the &#x60;/account-groups&#x60; endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional)
* @param useAllPermittedAids Set to &#x60;true&#x60; to load data from all accounts the user has access to. (optional, default to false)
* @param window A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: &#x60;s&#x60; for seconds (default if no type is specified), &#x60;m&#x60; for minutes, &#x60;h&#x60; for hours, &#x60;d&#x60; for days, and &#x60;w&#x60; for weeks. For a precise date range, use &#x60;startDate&#x60; and &#x60;endDate&#x60;. (optional)
* @param startDate Use with the &#x60;endDate&#x60; parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can&#39;t be used with &#x60;window&#x60;. (optional)
* @param endDate Defaults to current time the request is made. Use with the &#x60;startDate&#x60; parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can&#39;t be used with &#x60;window&#x60;. (optional)
* @return Paginator<UserEvent, AuditUserEvents>
*/
public Paginator<UserEvent, AuditUserEvents> getUserEventsPaginated(String aid, Boolean useAllPermittedAids, String window, OffsetDateTime startDate, OffsetDateTime endDate) {
return new Paginator<>(cursor -> getUserEvents(aid, useAllPermittedAids, window, startDate, endDate, cursor),
AuditUserEvents::getAuditEvents);

}
/**
* List activity log events
* Returns a list of activity log events in the current account group. If &#x60;useAllPermittedAids&#x3D;true&#x60; query parameter is passed and the user has permission &#x60;View activity log for all users in account group&#x60; the logs returned include events across all the account groups they belong to. For more information about changing the account group context, see [Account Context](https://developer.thousandeyes.com/v7/#/accountcontext).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import java.time.OffsetDateTime;
import com.thousandeyes.sdk.account.management.administrative.model.UnauthorizedError;
import com.thousandeyes.sdk.account.management.administrative.model.ValidationError;
import com.thousandeyes.sdk.account.management.administrative.model.UserEvent;
import com.thousandeyes.sdk.pagination.Paginator;
import static com.github.tomakehurst.wiremock.client.WireMock.*;
import static com.github.tomakehurst.wiremock.common.ContentTypes.AUTHORIZATION;
import static com.github.tomakehurst.wiremock.common.ContentTypes.CONTENT_TYPE;
Expand Down
2 changes: 1 addition & 1 deletion agents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Agents API

- API version: 7.0.22
- API version: 7.0.25


## Overview
Expand Down
2 changes: 1 addition & 1 deletion alerts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Alerts API

- API version: 7.0.22
- API version: 7.0.25

You can manage the following alert functionalities on the ThousandEyes platform using the Alerts API:

Expand Down
12 changes: 8 additions & 4 deletions alerts/docs/AlertsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ ApiResponse<[**AlertDetail**](AlertDetail.md)>

## getAlerts

> Alerts getAlerts(aid, window, startDate, endDate, max, state)
> Alerts getAlerts(aid, window, startDate, endDate, max, cursor, state)
List active alerts

Expand Down Expand Up @@ -203,9 +203,10 @@ public class Example {
OffsetDateTime startDate = OffsetDateTime.parse("2022-07-17T22:00:54Z"); // OffsetDateTime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.
OffsetDateTime endDate = OffsetDateTime.parse("2022-07-18T22:00:54Z"); // OffsetDateTime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.
Integer max = 5; // Integer | (Optional) Maximum number of objects to return.
String cursor = "cursor_example"; // String | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.
State state = new State(); // State | Optional parameter to match a specific alert state. If not specified, it defaults to `trigger`.
try {
Alerts result = apiInstance.getAlerts(aid, window, startDate, endDate, max, state);
Alerts result = apiInstance.getAlerts(aid, window, startDate, endDate, max, cursor, state);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AlertsApi#getAlerts");
Expand All @@ -228,6 +229,7 @@ public class Example {
| **startDate** | **OffsetDateTime**| Use with the &#x60;endDate&#x60; parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can&#39;t be used with &#x60;window&#x60;. | [optional] |
| **endDate** | **OffsetDateTime**| Defaults to current time the request is made. Use with the &#x60;startDate&#x60; parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can&#39;t be used with &#x60;window&#x60;. | [optional] |
| **max** | **Integer**| (Optional) Maximum number of objects to return. | [optional] |
| **cursor** | **String**| (Optional) Opaque cursor used for pagination. Clients should use &#x60;next&#x60; value from &#x60;_links&#x60; instead of this parameter. | [optional] |
| **state** | [**State**](.md)| Optional parameter to match a specific alert state. If not specified, it defaults to &#x60;trigger&#x60;. | [optional] |

### Return type
Expand Down Expand Up @@ -256,7 +258,7 @@ public class Example {

## getAlertsWithHttpInfo

> ApiResponse<Alerts> getAlerts getAlertsWithHttpInfo(aid, window, startDate, endDate, max, state)
> ApiResponse<Alerts> getAlerts getAlertsWithHttpInfo(aid, window, startDate, endDate, max, cursor, state)
List active alerts

Expand Down Expand Up @@ -289,9 +291,10 @@ public class Example {
OffsetDateTime startDate = OffsetDateTime.parse("2022-07-17T22:00:54Z"); // OffsetDateTime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.
OffsetDateTime endDate = OffsetDateTime.parse("2022-07-18T22:00:54Z"); // OffsetDateTime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.
Integer max = 5; // Integer | (Optional) Maximum number of objects to return.
String cursor = "cursor_example"; // String | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.
State state = new State(); // State | Optional parameter to match a specific alert state. If not specified, it defaults to `trigger`.
try {
ApiResponse<Alerts> response = apiInstance.getAlertsWithHttpInfo(aid, window, startDate, endDate, max, state);
ApiResponse<Alerts> response = apiInstance.getAlertsWithHttpInfo(aid, window, startDate, endDate, max, cursor, state);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
Expand All @@ -316,6 +319,7 @@ public class Example {
| **startDate** | **OffsetDateTime**| Use with the &#x60;endDate&#x60; parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can&#39;t be used with &#x60;window&#x60;. | [optional] |
| **endDate** | **OffsetDateTime**| Defaults to current time the request is made. Use with the &#x60;startDate&#x60; parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can&#39;t be used with &#x60;window&#x60;. | [optional] |
| **max** | **Integer**| (Optional) Maximum number of objects to return. | [optional] |
| **cursor** | **String**| (Optional) Opaque cursor used for pagination. Clients should use &#x60;next&#x60; value from &#x60;_links&#x60; instead of this parameter. | [optional] |
| **state** | [**State**](.md)| Optional parameter to match a specific alert state. If not specified, it defaults to &#x60;trigger&#x60;. | [optional] |

### Return type
Expand Down
31 changes: 26 additions & 5 deletions alerts/src/main/java/com/thousandeyes/sdk/alerts/AlertsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import com.thousandeyes.sdk.alerts.model.State;
import java.util.UUID;
import com.thousandeyes.sdk.alerts.model.UnauthorizedError;
import com.thousandeyes.sdk.alerts.model.Alert;
import com.thousandeyes.sdk.pagination.Paginator;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand Down Expand Up @@ -117,6 +119,22 @@ private ApiRequest.ApiRequestBuilder getAlertRequestBuilder(UUID alertId, String
requestBuilder.header("User-Agent", List.of(Config.USER_AGENT));
return requestBuilder;
}
/**
* List active alerts with pagination
* Returns a list of active alerts. If no alerts are active within the specified time range, an empty response is returned. Note that time filters (&#x60;window&#x60;, &#x60;startDate&#x60;, or &#x60;endDate&#x60;) are only applied to cleared alerts.
* @param aid A unique identifier associated with your account group. You can retrieve your &#x60;AccountGroupId&#x60; from the &#x60;/account-groups&#x60; endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional)
* @param window A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: &#x60;s&#x60; for seconds (default if no type is specified), &#x60;m&#x60; for minutes, &#x60;h&#x60; for hours, &#x60;d&#x60; for days, and &#x60;w&#x60; for weeks. For a precise date range, use &#x60;startDate&#x60; and &#x60;endDate&#x60;. (optional)
* @param startDate Use with the &#x60;endDate&#x60; parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can&#39;t be used with &#x60;window&#x60;. (optional)
* @param endDate Defaults to current time the request is made. Use with the &#x60;startDate&#x60; parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can&#39;t be used with &#x60;window&#x60;. (optional)
* @param max (Optional) Maximum number of objects to return. (optional)
* @param state Optional parameter to match a specific alert state. If not specified, it defaults to &#x60;trigger&#x60;. (optional)
* @return Paginator<Alert, Alerts>
*/
public Paginator<Alert, Alerts> getAlertsPaginated(String aid, String window, OffsetDateTime startDate, OffsetDateTime endDate, Integer max, State state) {
return new Paginator<>(cursor -> getAlerts(aid, window, startDate, endDate, max, cursor, state),
Alerts::getAlerts);

}
/**
* List active alerts
* Returns a list of active alerts. If no alerts are active within the specified time range, an empty response is returned. Note that time filters (&#x60;window&#x60;, &#x60;startDate&#x60;, or &#x60;endDate&#x60;) are only applied to cleared alerts.
Expand All @@ -125,12 +143,13 @@ private ApiRequest.ApiRequestBuilder getAlertRequestBuilder(UUID alertId, String
* @param startDate Use with the &#x60;endDate&#x60; parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can&#39;t be used with &#x60;window&#x60;. (optional)
* @param endDate Defaults to current time the request is made. Use with the &#x60;startDate&#x60; parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can&#39;t be used with &#x60;window&#x60;. (optional)
* @param max (Optional) Maximum number of objects to return. (optional)
* @param cursor (Optional) Opaque cursor used for pagination. Clients should use &#x60;next&#x60; value from &#x60;_links&#x60; instead of this parameter. (optional)
* @param state Optional parameter to match a specific alert state. If not specified, it defaults to &#x60;trigger&#x60;. (optional)
* @return Alerts
* @throws ApiException if fails to make API call
*/
public Alerts getAlerts(String aid, String window, OffsetDateTime startDate, OffsetDateTime endDate, Integer max, State state) throws ApiException {
ApiResponse<Alerts> response = getAlertsWithHttpInfo(aid, window, startDate, endDate, max, state);
public Alerts getAlerts(String aid, String window, OffsetDateTime startDate, OffsetDateTime endDate, Integer max, String cursor, State state) throws ApiException {
ApiResponse<Alerts> response = getAlertsWithHttpInfo(aid, window, startDate, endDate, max, cursor, state);
return response.getData();
}

Expand All @@ -142,22 +161,23 @@ public Alerts getAlerts(String aid, String window, OffsetDateTime startDate, Off
* @param startDate Use with the &#x60;endDate&#x60; parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can&#39;t be used with &#x60;window&#x60;. (optional)
* @param endDate Defaults to current time the request is made. Use with the &#x60;startDate&#x60; parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can&#39;t be used with &#x60;window&#x60;. (optional)
* @param max (Optional) Maximum number of objects to return. (optional)
* @param cursor (Optional) Opaque cursor used for pagination. Clients should use &#x60;next&#x60; value from &#x60;_links&#x60; instead of this parameter. (optional)
* @param state Optional parameter to match a specific alert state. If not specified, it defaults to &#x60;trigger&#x60;. (optional)
* @return ApiResponse&lt;Alerts&gt;
* @throws ApiException if fails to make API call
*/
public ApiResponse<Alerts> getAlertsWithHttpInfo(String aid, String window, OffsetDateTime startDate, OffsetDateTime endDate, Integer max, State state) throws ApiException {
public ApiResponse<Alerts> getAlertsWithHttpInfo(String aid, String window, OffsetDateTime startDate, OffsetDateTime endDate, Integer max, String cursor, State state) throws ApiException {
getAlertsValidateRequest();

var requestBuilder = getAlertsRequestBuilder(aid, window, startDate, endDate, max, state);
var requestBuilder = getAlertsRequestBuilder(aid, window, startDate, endDate, max, cursor, state);

return apiClient.send(requestBuilder.build(), Alerts.class);
}

private void getAlertsValidateRequest() throws ApiException {
}

private ApiRequest.ApiRequestBuilder getAlertsRequestBuilder(String aid, String window, OffsetDateTime startDate, OffsetDateTime endDate, Integer max, State state) throws ApiException {
private ApiRequest.ApiRequestBuilder getAlertsRequestBuilder(String aid, String window, OffsetDateTime startDate, OffsetDateTime endDate, Integer max, String cursor, State state) throws ApiException {
ApiRequest.ApiRequestBuilder requestBuilder = ApiRequest.builder()
.method("GET");

Expand All @@ -170,6 +190,7 @@ private ApiRequest.ApiRequestBuilder getAlertsRequestBuilder(String aid, String
localVarQueryParams.addAll(parameterToPairs("startDate", startDate));
localVarQueryParams.addAll(parameterToPairs("endDate", endDate));
localVarQueryParams.addAll(parameterToPairs("max", max));
localVarQueryParams.addAll(parameterToPairs("cursor", cursor));
localVarQueryParams.addAll(parameterToPairs("state", state));

if (!localVarQueryParams.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.thousandeyes.sdk.alerts.model.CustomWebhookIntegrationType;
import java.util.UUID;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;


Expand All @@ -36,7 +37,7 @@
@jakarta.annotation.Generated(value = "com.thousandeyes.api.codegen.ThousandeyesJavaGenerator")
public class NotificationCustomWebhook {
public static final String JSON_PROPERTY_INTEGRATION_ID = "integrationId";
private String integrationId;
private UUID integrationId;

public static final String JSON_PROPERTY_INTEGRATION_TYPE = "integrationType";
private CustomWebhookIntegrationType integrationType;
Expand All @@ -50,7 +51,7 @@ public class NotificationCustomWebhook {
public NotificationCustomWebhook() {
}

public NotificationCustomWebhook integrationId(String integrationId) {
public NotificationCustomWebhook integrationId(UUID integrationId) {
this.integrationId = integrationId;
return this;
}
Expand All @@ -63,14 +64,14 @@ public NotificationCustomWebhook integrationId(String integrationId) {
@JsonProperty(JSON_PROPERTY_INTEGRATION_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public String getIntegrationId() {
public UUID getIntegrationId() {
return integrationId;
}


@JsonProperty(JSON_PROPERTY_INTEGRATION_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setIntegrationId(String integrationId) {
public void setIntegrationId(UUID integrationId) {
this.integrationId = integrationId;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public enum ThirdPartyIntegrationType {

APP_DYNAMICS("app-dynamics"),

SERVICE_NOW("service-now"),

UNKNOWN("unknown");

private String value;
Expand Down
Loading

0 comments on commit f8d870e

Please sign in to comment.