diff --git a/.apigentools-info b/.apigentools-info index b64be540968..06a189570d9 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -1,8 +1,8 @@ { "additional_stamps": [], - "apigentools_version": "0.8.0", - "codegen_version": "4.2.0", + "apigentools_version": "0.9.0", + "codegen_version": "4.2.2", "info_version": "1", - "image": "apigentools/apigentools:0.8.0", - "spec_repo_commit": "4dc820c" + "image": null, + "spec_repo_commit": "51bbed6" } \ No newline at end of file diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index ef8d7569d67..078bf8b7ddc 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0 \ No newline at end of file +4.2.2 \ No newline at end of file diff --git a/docs/AwsIntegrationApi.md b/docs/AwsIntegrationApi.md index 59414add473..0b696b9804a 100644 --- a/docs/AwsIntegrationApi.md +++ b/docs/AwsIntegrationApi.md @@ -13,7 +13,8 @@ Method | HTTP request | Description ## createAWSAccount -> AWSAccountCreateResponse createAWSAccount(awSAccount) + +> AWSAccountCreateResponse createAWSAccount(awSAccount).execute(); Create an AWS Account @@ -75,8 +76,9 @@ public class Example { AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient); AWSAccount awSAccount = new AWSAccount(); // AWSAccount | AWS request object - try { - AWSAccountCreateResponse result = apiInstance.createAWSAccount(awSAccount); + try { + AWSAccountCreateResponse result = api.createAWSAccount(awSAccount) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AwsIntegrationApi#createAWSAccount"); @@ -118,7 +120,8 @@ Name | Type | Description | Notes ## deleteAWSAccount -> Object deleteAWSAccount(awSAccount) + +> Object deleteAWSAccount(awSAccount).execute(); Delete an AWS Account @@ -161,8 +164,9 @@ public class Example { AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient); AWSAccount awSAccount = new AWSAccount(); // AWSAccount | AWS request object - try { - Object result = apiInstance.deleteAWSAccount(awSAccount); + try { + Object result = api.deleteAWSAccount(awSAccount) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AwsIntegrationApi#deleteAWSAccount"); @@ -204,7 +208,8 @@ Name | Type | Description | Notes ## getAllAWSAccounts -> AWSAccountListResponse getAllAWSAccounts(accountId, roleName, accessKeyId) + +> AWSAccountListResponse getAllAWSAccounts().accountId(accountId).roleName(roleName).accessKeyId(accessKeyId).execute(); Get Installed AWS Accounts @@ -252,8 +257,12 @@ public class Example { String accountId = "accountId_example"; // String | Only return AWS accounts that matches this account_id. String roleName = "roleName_example"; // String | Only return AWS accounts that matches this role_name. String accessKeyId = "accessKeyId_example"; // String | Only return AWS accounts that matches this access_key_id. - try { - AWSAccountListResponse result = apiInstance.getAllAWSAccounts(accountId, roleName, accessKeyId); + try { + AWSAccountListResponse result = api.getAllAWSAccounts() + .accountId(accountId) + .roleName(roleName) + .accessKeyId(accessKeyId) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AwsIntegrationApi#getAllAWSAccounts"); @@ -298,7 +307,8 @@ Name | Type | Description | Notes ## updateAWSAccount -> Object updateAWSAccount(awSAccount, accountId, roleName, accessKeyId) + +> Object updateAWSAccount(awSAccount).accountId(accountId).roleName(roleName).accessKeyId(accessKeyId).execute(); Update an AWS Account @@ -370,11 +380,15 @@ public class Example { AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient); AWSAccount awSAccount = new AWSAccount(); // AWSAccount | AWS request object - String accountId = "accountId_example"; // String | - String roleName = "roleName_example"; // String | - String accessKeyId = "accessKeyId_example"; // String | - try { - Object result = apiInstance.updateAWSAccount(awSAccount, accountId, roleName, accessKeyId); + String accountId = "accountId_example"; // String | Only return AWS accounts that matches this account_id. + String roleName = "roleName_example"; // String | Only return AWS accounts that matches this role_name. *It is required if account_id is specified.* + String accessKeyId = "accessKeyId_example"; // String | Only return AWS accounts that matches this access_key_id. *It required if none of the other two options are specified.* + try { + Object result = api.updateAWSAccount(awSAccount) + .accountId(accountId) + .roleName(roleName) + .accessKeyId(accessKeyId) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AwsIntegrationApi#updateAWSAccount"); @@ -393,9 +407,9 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **awSAccount** | [**AWSAccount**](AWSAccount.md)| AWS request object | - **accountId** | **String**| | [optional] - **roleName** | **String**| | [optional] - **accessKeyId** | **String**| | [optional] + **accountId** | **String**| Only return AWS accounts that matches this account_id. | [optional] + **roleName** | **String**| Only return AWS accounts that matches this role_name. *It is required if account_id is specified.* | [optional] + **accessKeyId** | **String**| Only return AWS accounts that matches this access_key_id. *It required if none of the other two options are specified.* | [optional] ### Return type diff --git a/docs/DowntimesApi.md b/docs/DowntimesApi.md index 8dd92d88559..e96c4b3ad51 100644 --- a/docs/DowntimesApi.md +++ b/docs/DowntimesApi.md @@ -15,7 +15,8 @@ Method | HTTP request | Description ## cancelDowntime -> cancelDowntime(downtimeId) + +> cancelDowntime(downtimeId).execute(); Cancel a downtime @@ -51,8 +52,10 @@ public class Example { DowntimesApi apiInstance = new DowntimesApi(defaultClient); Long downtimeId = 123456; // Long | ID of the downtime to cancel - try { - apiInstance.cancelDowntime(downtimeId); + try { + api.cancelDowntime(downtimeId) + .execute(); + } catch (ApiException e) { System.err.println("Exception when calling DowntimesApi#cancelDowntime"); System.err.println("Status code: " + e.getCode()); @@ -93,7 +96,8 @@ null (empty response body) ## cancelDowntimesByScope -> CanceledDowntimesIds cancelDowntimesByScope(cancelDowntimesByScopeRequest) + +> CanceledDowntimesIds cancelDowntimesByScope(cancelDowntimesByScopeRequest).execute(); Cancel downtimes by scope @@ -133,8 +137,9 @@ public class Example { DowntimesApi apiInstance = new DowntimesApi(defaultClient); CancelDowntimesByScopeRequest cancelDowntimesByScopeRequest = new CancelDowntimesByScopeRequest(); // CancelDowntimesByScopeRequest | Scope to cancel downtimes for - try { - CanceledDowntimesIds result = apiInstance.cancelDowntimesByScope(cancelDowntimesByScopeRequest); + try { + CanceledDowntimesIds result = api.cancelDowntimesByScope(cancelDowntimesByScopeRequest) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling DowntimesApi#cancelDowntimesByScope"); @@ -177,7 +182,8 @@ Name | Type | Description | Notes ## createDowntime -> Downtime createDowntime(downtime) + +> Downtime createDowntime(downtime).execute(); Schedule a downtime @@ -253,8 +259,9 @@ public class Example { DowntimesApi apiInstance = new DowntimesApi(defaultClient); Downtime downtime = new Downtime(); // Downtime | Downtime request object - try { - Downtime result = apiInstance.createDowntime(downtime); + try { + Downtime result = api.createDowntime(downtime) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling DowntimesApi#createDowntime"); @@ -296,15 +303,15 @@ Name | Type | Description | Notes ## getAllDowntimes -> List<Downtime> getAllDowntimes(currentOnly) + +> List<Downtime> getAllDowntimes().currentOnly(currentOnly).execute(); Get all downtimes ### Overview Get All Scheduled Downtimes ### Arguments -* **`current_only`** [*optional*, *default* = **False**]: Only return downtimes - that are active when the request is made.' +* **`current_only`** [*optional*, *default* = **False**]: Only return downtimes that are active when the request is made. ### Example @@ -335,9 +342,11 @@ public class Example { //appKeyAuth.setApiKeyPrefix("Token"); DowntimesApi apiInstance = new DowntimesApi(defaultClient); - Boolean currentOnly = true; // Boolean | - try { - List result = apiInstance.getAllDowntimes(currentOnly); + Boolean currentOnly = true; // Boolean | Only return downtimes that are active when the request is made. + try { + List result = api.getAllDowntimes() + .currentOnly(currentOnly) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling DowntimesApi#getAllDowntimes"); @@ -355,7 +364,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **currentOnly** | **Boolean**| | [optional] + **currentOnly** | **Boolean**| Only return downtimes that are active when the request is made. | [optional] ### Return type @@ -379,7 +388,8 @@ Name | Type | Description | Notes ## getDowntime -> Downtime getDowntime(downtimeId) + +> Downtime getDowntime(downtimeId).execute(); Get a downtime @@ -418,8 +428,9 @@ public class Example { DowntimesApi apiInstance = new DowntimesApi(defaultClient); Long downtimeId = 123456; // Long | ID of the downtime to fetch - try { - Downtime result = apiInstance.getDowntime(downtimeId); + try { + Downtime result = api.getDowntime(downtimeId) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling DowntimesApi#getDowntime"); @@ -461,7 +472,8 @@ Name | Type | Description | Notes ## updateDowntime -> Downtime updateDowntime(downtimeId, downtime) + +> Downtime updateDowntime(downtimeId, downtime).execute(); Update a downtime @@ -543,8 +555,9 @@ public class Example { DowntimesApi apiInstance = new DowntimesApi(defaultClient); Long downtimeId = 123456; // Long | ID of the downtime to update Downtime downtime = new Downtime(); // Downtime | Downtime request object - try { - Downtime result = apiInstance.updateDowntime(downtimeId, downtime); + try { + Downtime result = api.updateDowntime(downtimeId, downtime) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling DowntimesApi#updateDowntime"); diff --git a/docs/MonitorsApi.md b/docs/MonitorsApi.md index 8f0137200b2..e8abfcf53c8 100644 --- a/docs/MonitorsApi.md +++ b/docs/MonitorsApi.md @@ -15,7 +15,8 @@ Method | HTTP request | Description ## createMonitor -> Monitor createMonitor(monitor) + +> Monitor createMonitor(monitor).execute(); Create a new Monitor @@ -54,8 +55,9 @@ public class Example { MonitorsApi apiInstance = new MonitorsApi(defaultClient); Monitor monitor = new Monitor(); // Monitor | Monitor request object - try { - Monitor result = apiInstance.createMonitor(monitor); + try { + Monitor result = api.createMonitor(monitor) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling MonitorsApi#createMonitor"); @@ -97,7 +99,8 @@ Name | Type | Description | Notes ## deleteMonitor -> Map<String, Long> deleteMonitor(monitorId) + +> Map<String, Long> deleteMonitor(monitorId).execute(); Delete the specified monitor. @@ -136,8 +139,9 @@ public class Example { MonitorsApi apiInstance = new MonitorsApi(defaultClient); Long monitorId = 56L; // Long | The id of the monitor - try { - Map result = apiInstance.deleteMonitor(monitorId); + try { + Map result = api.deleteMonitor(monitorId) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling MonitorsApi#deleteMonitor"); @@ -181,7 +185,8 @@ Name | Type | Description | Notes ## editMonitor -> Monitor editMonitor(monitorId, monitor) + +> Monitor editMonitor(monitorId, monitor).execute(); Edit the specified monitor @@ -221,8 +226,9 @@ public class Example { MonitorsApi apiInstance = new MonitorsApi(defaultClient); Long monitorId = 56L; // Long | The id of the monitor Monitor monitor = new Monitor(); // Monitor | Monitor request object - try { - Monitor result = apiInstance.editMonitor(monitorId, monitor); + try { + Monitor result = api.editMonitor(monitorId, monitor) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling MonitorsApi#editMonitor"); @@ -267,7 +273,8 @@ Name | Type | Description | Notes ## getAllMonitors -> List<Monitor> getAllMonitors(groupStates, name, tags, monitorTags, withDowntimes) + +> List<Monitor> getAllMonitors().groupStates(groupStates).name(name).tags(tags).monitorTags(monitorTags).withDowntimes(withDowntimes).execute(); Get details about the specified monitor. @@ -310,12 +317,18 @@ public class Example { MonitorsApi apiInstance = new MonitorsApi(defaultClient); String groupStates = "groupStates_example"; // String | When specified, shows additional information about the group states. Choose one or more from `all`, `alert`, `warn`, and `no data`. - String name = "name_example"; // String | - String tags = "tags_example"; // String | - String monitorTags = "monitorTags_example"; // String | - Boolean withDowntimes = true; // Boolean | - try { - List result = apiInstance.getAllMonitors(groupStates, name, tags, monitorTags, withDowntimes); + String name = "name_example"; // String | A string to filter monitors by name. + String tags = "tags_example"; // String | A comma separated list indicating what tags, if any, should be used to filter the list of monitorsby scope, e.g. host:host0. + String monitorTags = "monitorTags_example"; // String | A comma separated list indicating what service and/or custom tags, if any, should be used to filter the list of monitors. Tags created in the Datadog UI automatically have the service key prepended (e.g. service:my-app). + Boolean withDowntimes = true; // Boolean | If this argument is set to true, then the returned data includes all current downtimes for each monitor. + try { + List result = api.getAllMonitors() + .groupStates(groupStates) + .name(name) + .tags(tags) + .monitorTags(monitorTags) + .withDowntimes(withDowntimes) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling MonitorsApi#getAllMonitors"); @@ -334,10 +347,10 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **groupStates** | **String**| When specified, shows additional information about the group states. Choose one or more from `all`, `alert`, `warn`, and `no data`. | [optional] - **name** | **String**| | [optional] - **tags** | **String**| | [optional] - **monitorTags** | **String**| | [optional] - **withDowntimes** | **Boolean**| | [optional] + **name** | **String**| A string to filter monitors by name. | [optional] + **tags** | **String**| A comma separated list indicating what tags, if any, should be used to filter the list of monitorsby scope, e.g. host:host0. | [optional] + **monitorTags** | **String**| A comma separated list indicating what service and/or custom tags, if any, should be used to filter the list of monitors. Tags created in the Datadog UI automatically have the service key prepended (e.g. service:my-app). | [optional] + **withDowntimes** | **Boolean**| If this argument is set to true, then the returned data includes all current downtimes for each monitor. | [optional] ### Return type @@ -361,7 +374,8 @@ Name | Type | Description | Notes ## getMonitor -> Monitor getMonitor(monitorId, groupStates) + +> Monitor getMonitor(monitorId).groupStates(groupStates).execute(); Get details about the specified monitor. @@ -402,8 +416,10 @@ public class Example { MonitorsApi apiInstance = new MonitorsApi(defaultClient); Long monitorId = 56L; // Long | The id of the monitor String groupStates = "groupStates_example"; // String | When specified, shows additional information about the group states. Choose one or more from `all`, `alert`, `warn`, and `no data`. - try { - Monitor result = apiInstance.getMonitor(monitorId, groupStates); + try { + Monitor result = api.getMonitor(monitorId) + .groupStates(groupStates) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling MonitorsApi#getMonitor"); @@ -447,7 +463,8 @@ Name | Type | Description | Notes ## validateMonitor -> Monitor validateMonitor(monitor) + +> Monitor validateMonitor(monitor).execute(); @@ -486,8 +503,9 @@ public class Example { MonitorsApi apiInstance = new MonitorsApi(defaultClient); Monitor monitor = new Monitor(); // Monitor | Monitor request object - try { - Monitor result = apiInstance.validateMonitor(monitor); + try { + Monitor result = api.validateMonitor(monitor) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling MonitorsApi#validateMonitor"); diff --git a/docs/UsersApi.md b/docs/UsersApi.md index 409d84ff894..08dd2e45129 100644 --- a/docs/UsersApi.md +++ b/docs/UsersApi.md @@ -14,7 +14,8 @@ Method | HTTP request | Description ## createUser -> UserResponse createUser(user) + +> UserResponse createUser(user).execute(); Create user @@ -64,8 +65,9 @@ public class Example { UsersApi apiInstance = new UsersApi(defaultClient); User user = new User(); // User | User object that needs to be created - try { - UserResponse result = apiInstance.createUser(user); + try { + UserResponse result = api.createUser(user) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UsersApi#createUser"); @@ -108,7 +110,8 @@ Name | Type | Description | Notes ## disableUser -> UserDisableResponse disableUser(userHandle) + +> UserDisableResponse disableUser(userHandle).execute(); Disable user @@ -149,8 +152,9 @@ public class Example { UsersApi apiInstance = new UsersApi(defaultClient); String userHandle = test@datadoghq.com; // String | The handle of the user - try { - UserDisableResponse result = apiInstance.disableUser(userHandle); + try { + UserDisableResponse result = api.disableUser(userHandle) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UsersApi#disableUser"); @@ -193,7 +197,8 @@ Name | Type | Description | Notes ## getAllUsers -> UserListResponse getAllUsers() + +> UserListResponse getAllUsers().execute(); Get all users @@ -231,8 +236,9 @@ public class Example { //appKeyAuth.setApiKeyPrefix("Token"); UsersApi apiInstance = new UsersApi(defaultClient); - try { - UserListResponse result = apiInstance.getAllUsers(); + try { + UserListResponse result = api.getAllUsers() + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UsersApi#getAllUsers"); @@ -272,7 +278,8 @@ This endpoint does not need any parameter. ## getUser -> UserResponse getUser(userHandle) + +> UserResponse getUser(userHandle).execute(); Get user @@ -311,8 +318,9 @@ public class Example { UsersApi apiInstance = new UsersApi(defaultClient); String userHandle = test@datadoghq.com; // String | The id of the user - try { - UserResponse result = apiInstance.getUser(userHandle); + try { + UserResponse result = api.getUser(userHandle) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UsersApi#getUser"); @@ -355,7 +363,8 @@ Name | Type | Description | Notes ## updateUser -> UserResponse updateUser(userHandle, user) + +> UserResponse updateUser(userHandle, user).execute(); Update user @@ -407,8 +416,9 @@ public class Example { UsersApi apiInstance = new UsersApi(defaultClient); String userHandle = test@datadoghq.com; // String | The id of the user User user = new User(); // User | Description of the update - try { - UserResponse result = apiInstance.updateUser(userHandle, user); + try { + UserResponse result = api.updateUser(userHandle, user) + .execute(); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UsersApi#updateUser"); diff --git a/src/main/java/com/datadog/api/v1/client/api/AwsIntegrationApi.java b/src/main/java/com/datadog/api/v1/client/api/AwsIntegrationApi.java index bdf4989eb1b..5d2a1602d6c 100644 --- a/src/main/java/com/datadog/api/v1/client/api/AwsIntegrationApi.java +++ b/src/main/java/com/datadog/api/v1/client/api/AwsIntegrationApi.java @@ -39,49 +39,14 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } - // CreateAWSAccountParams Parameters for the method 'createAWSAccount' - public static class CreateAWSAccountParams { - - - - } - - /** - * Create an AWS Account - * ### Overview Create the AWS Account with the provided values ### Arguments * **`account_id`** [*required*]: Your AWS Account ID without dashes. Consult the Datadog AWS integration to learn more about your AWS account ID. * **`role_name`** [*required*]: Your Datadog role delegation name. For more information about you AWS account Role name, see the Datadog AWS integration configuration info. * **`access_key_id`** [*optional*, *default* = **None**]: If your AWS account is a GovCloud or China account, enter the corresponding Access Key ID. * **`filter_tags`** [*optional*, *default* = **None**]: The array of EC2 tags (in the form key:value) defines a filter that Datadog uses when collecting metrics from EC2. Wildcards, such as ? (for single characters) and * (for multiple characters) can also be used. Only hosts that match one of the defined tags will be imported into Datadog. The rest will be ignored. Host matching a given tag can also be excluded by adding ! before the tag. e.x. env:production,instance-type:c1.*,!region:us-east-1 For more information on EC2 tagging, see the AWS tagging documentation * **`host_tags`** [*optional*, *default* = **None**]: Array of tags (in the form key:value) to add to all hosts and metrics reporting through this integration. * **`account_specific_namespace_rules`** [*optional*, *default* = **None**]: An object (in the form {\"namespace1\":true/false, \"namespace2\":true/false}) that enables or disables metric collection for specific AWS namespaces for this AWS account only. A list of namespaces can be found at the /v1/integration/aws/available_namespace_rules endpoint. - * @param awSAccount AWS request object (required) - * @return AWSAccountCreateResponse - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
- */ - public AWSAccountCreateResponse createAWSAccount(AWSAccount awSAccount, CreateAWSAccountParams localVarParams) throws ApiException { - return createAWSAccountWithHttpInfo(awSAccount, localVarParams).getData(); - } - - /** - * Create an AWS Account - * ### Overview Create the AWS Account with the provided values ### Arguments * **`account_id`** [*required*]: Your AWS Account ID without dashes. Consult the Datadog AWS integration to learn more about your AWS account ID. * **`role_name`** [*required*]: Your Datadog role delegation name. For more information about you AWS account Role name, see the Datadog AWS integration configuration info. * **`access_key_id`** [*optional*, *default* = **None**]: If your AWS account is a GovCloud or China account, enter the corresponding Access Key ID. * **`filter_tags`** [*optional*, *default* = **None**]: The array of EC2 tags (in the form key:value) defines a filter that Datadog uses when collecting metrics from EC2. Wildcards, such as ? (for single characters) and * (for multiple characters) can also be used. Only hosts that match one of the defined tags will be imported into Datadog. The rest will be ignored. Host matching a given tag can also be excluded by adding ! before the tag. e.x. env:production,instance-type:c1.*,!region:us-east-1 For more information on EC2 tagging, see the AWS tagging documentation * **`host_tags`** [*optional*, *default* = **None**]: Array of tags (in the form key:value) to add to all hosts and metrics reporting through this integration. * **`account_specific_namespace_rules`** [*optional*, *default* = **None**]: An object (in the form {\"namespace1\":true/false, \"namespace2\":true/false}) that enables or disables metric collection for specific AWS namespaces for this AWS account only. A list of namespaces can be found at the /v1/integration/aws/available_namespace_rules endpoint. - * @param awSAccount AWS request object (required) - * @return ApiResponse<AWSAccountCreateResponse> - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
- */ - public ApiResponse createAWSAccountWithHttpInfo(AWSAccount awSAccount, CreateAWSAccountParams localVarParams) throws ApiException { +private ApiResponse createAWSAccountWithHttpInfo(AWSAccount awSAccount) throws ApiException { Object localVarPostBody = awSAccount; + // verify the required parameter 'awSAccount' is set if (awSAccount == null) { throw new ApiException(400, "Missing the required parameter 'awSAccount' when calling createAWSAccount"); } + // create path and map variables String localVarPath = "/api/v1/integration/aws"; @@ -110,49 +75,72 @@ public ApiResponse createAWSAccountWithHttpInfo(AWSAcc GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } - // DeleteAWSAccountParams Parameters for the method 'deleteAWSAccount' - public static class DeleteAWSAccountParams { - + public class APIcreateAWSAccountRequest { + private AWSAccount awSAccount; + + private APIcreateAWSAccountRequest(AWSAccount awSAccount) { + this.awSAccount = awSAccount; + } + + /** + * Execute createAWSAccount request + * @return AWSAccountCreateResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ + */ + + public AWSAccountCreateResponse execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute createAWSAccount request with HTTP info returned + * @return ApiResponse<AWSAccountCreateResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ + */ + + public ApiResponse executeWithHttpInfo() throws ApiException { + return createAWSAccountWithHttpInfo(awSAccount); + } } /** - * Delete an AWS Account - * ### Overview Delete the AWS Account matching the specified account_id and role_name parameters ### Arguments * **`account_id`** [*required*, *default* = **None**]: Delete the AWS account that matches this account_id. * **`role_name`** [*required*, *default* = **None**]: Delete the AWS account that matches this role_name. - * @param awSAccount AWS request object (required) - * @return Object + * Create an AWS Account + * ### Overview Create the AWS Account with the provided values ### Arguments * **`account_id`** [*required*]: Your AWS Account ID without dashes. Consult the Datadog AWS integration to learn more about your AWS account ID. * **`role_name`** [*required*]: Your Datadog role delegation name. For more information about you AWS account Role name, see the Datadog AWS integration configuration info. * **`access_key_id`** [*optional*, *default* = **None**]: If your AWS account is a GovCloud or China account, enter the corresponding Access Key ID. * **`filter_tags`** [*optional*, *default* = **None**]: The array of EC2 tags (in the form key:value) defines a filter that Datadog uses when collecting metrics from EC2. Wildcards, such as ? (for single characters) and * (for multiple characters) can also be used. Only hosts that match one of the defined tags will be imported into Datadog. The rest will be ignored. Host matching a given tag can also be excluded by adding ! before the tag. e.x. env:production,instance-type:c1.*,!region:us-east-1 For more information on EC2 tagging, see the AWS tagging documentation * **`host_tags`** [*optional*, *default* = **None**]: Array of tags (in the form key:value) to add to all hosts and metrics reporting through this integration. * **`account_specific_namespace_rules`** [*optional*, *default* = **None**]: An object (in the form {\"namespace1\":true/false, \"namespace2\":true/false}) that enables or disables metric collection for specific AWS namespaces for this AWS account only. A list of namespaces can be found at the /v1/integration/aws/available_namespace_rules endpoint. + * @param awSAccount AWS request object (require) + * @return createAWSAccountRequest * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
404 Item Not Found -
+ + */ - public Object deleteAWSAccount(AWSAccount awSAccount, DeleteAWSAccountParams localVarParams) throws ApiException { - return deleteAWSAccountWithHttpInfo(awSAccount, localVarParams).getData(); + + public APIcreateAWSAccountRequest createAWSAccount(AWSAccount awSAccount) throws ApiException { + return new APIcreateAWSAccountRequest(awSAccount); } - /** - * Delete an AWS Account - * ### Overview Delete the AWS Account matching the specified account_id and role_name parameters ### Arguments * **`account_id`** [*required*, *default* = **None**]: Delete the AWS account that matches this account_id. * **`role_name`** [*required*, *default* = **None**]: Delete the AWS account that matches this role_name. - * @param awSAccount AWS request object (required) - * @return ApiResponse<Object> - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
404 Item Not Found -
- */ - public ApiResponse deleteAWSAccountWithHttpInfo(AWSAccount awSAccount, DeleteAWSAccountParams localVarParams) throws ApiException { +private ApiResponse deleteAWSAccountWithHttpInfo(AWSAccount awSAccount) throws ApiException { Object localVarPostBody = awSAccount; + // verify the required parameter 'awSAccount' is set if (awSAccount == null) { throw new ApiException(400, "Missing the required parameter 'awSAccount' when calling deleteAWSAccount"); } + // create path and map variables String localVarPath = "/api/v1/integration/aws"; @@ -181,72 +169,67 @@ public ApiResponse deleteAWSAccountWithHttpInfo(AWSAccount awSAccount, D GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } - // GetAllAWSAccountsParams Parameters for the method 'getAllAWSAccounts' - public static class GetAllAWSAccountsParams { - - public String accountId; - - public String roleName; - - public String accessKeyId; - - - public GetAllAWSAccountsParams accountId(String accountId) { - this.accountId = accountId; - return this; + public class APIdeleteAWSAccountRequest { + private AWSAccount awSAccount; + + private APIdeleteAWSAccountRequest(AWSAccount awSAccount) { + this.awSAccount = awSAccount; } - public GetAllAWSAccountsParams roleName(String roleName) { - this.roleName = roleName; - return this; + + /** + * Execute deleteAWSAccount request + * @return Object + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 Item Not Found -
+ + */ + + public Object execute() throws ApiException { + return this.executeWithHttpInfo().getData(); } - - public GetAllAWSAccountsParams accessKeyId(String accessKeyId) { - this.accessKeyId = accessKeyId; - return this; + + /** + * Execute deleteAWSAccount request with HTTP info returned + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 Item Not Found -
+ + */ + + public ApiResponse executeWithHttpInfo() throws ApiException { + return deleteAWSAccountWithHttpInfo(awSAccount); } - } /** - * Get Installed AWS Accounts - * ### Overview Get All Installed AWS Accounts ### Arguments * **`account_id`** [*optional*, *default* = **None**]: Only return AWS accounts that matches this account_id. * **`role_name`** [*optional*, *default* = **None**]: Only return AWS accounts that matches this role_name. * **`access_key_id`** [*optional*, *default* = **None**]: Only return AWS accounts that matches this access_key_id. - * @param accountId Only return AWS accounts that matches this account_id. (optional) - * @param roleName Only return AWS accounts that matches this role_name. (optional) - * @param accessKeyId Only return AWS accounts that matches this access_key_id. (optional) - * @return AWSAccountListResponse + * Delete an AWS Account + * ### Overview Delete the AWS Account matching the specified account_id and role_name parameters ### Arguments * **`account_id`** [*required*, *default* = **None**]: Delete the AWS account that matches this account_id. * **`role_name`** [*required*, *default* = **None**]: Delete the AWS account that matches this role_name. + * @param awSAccount AWS request object (require) + * @return deleteAWSAccountRequest * @throws ApiException if fails to make API call - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Item Not Found -
+ + */ - public AWSAccountListResponse getAllAWSAccounts(GetAllAWSAccountsParams localVarParams) throws ApiException { - return getAllAWSAccountsWithHttpInfo(localVarParams).getData(); + + public APIdeleteAWSAccountRequest deleteAWSAccount(AWSAccount awSAccount) throws ApiException { + return new APIdeleteAWSAccountRequest(awSAccount); } - /** - * Get Installed AWS Accounts - * ### Overview Get All Installed AWS Accounts ### Arguments * **`account_id`** [*optional*, *default* = **None**]: Only return AWS accounts that matches this account_id. * **`role_name`** [*optional*, *default* = **None**]: Only return AWS accounts that matches this role_name. * **`access_key_id`** [*optional*, *default* = **None**]: Only return AWS accounts that matches this access_key_id. - * @param accountId Only return AWS accounts that matches this account_id. (optional) - * @param roleName Only return AWS accounts that matches this role_name. (optional) - * @param accessKeyId Only return AWS accounts that matches this access_key_id. (optional) - * @return ApiResponse<AWSAccountListResponse> - * @throws ApiException if fails to make API call - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Item Not Found -
- */ - public ApiResponse getAllAWSAccountsWithHttpInfo(GetAllAWSAccountsParams localVarParams) throws ApiException { +private ApiResponse getAllAWSAccountsWithHttpInfo(String accountId, String roleName, String accessKeyId) throws ApiException { Object localVarPostBody = null; + // create path and map variables String localVarPath = "/api/v1/integration/aws"; @@ -256,9 +239,9 @@ public ApiResponse getAllAWSAccountsWithHttpInfo(GetAllA Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "account_id", localVarParams.accountId)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "role_name", localVarParams.roleName)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "access_key_id", localVarParams.accessKeyId)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "account_id", accountId)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "role_name", roleName)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "access_key_id", accessKeyId)); @@ -278,76 +261,108 @@ public ApiResponse getAllAWSAccountsWithHttpInfo(GetAllA GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } - // UpdateAWSAccountParams Parameters for the method 'updateAWSAccount' - public static class UpdateAWSAccountParams { - - public String accountId; - - public String roleName; - - public String accessKeyId; - + public class APIgetAllAWSAccountsRequest { + private String accountId; + private String roleName; + private String accessKeyId; + + private APIgetAllAWSAccountsRequest() { + } - public UpdateAWSAccountParams accountId(String accountId) { + + /** + * Set accountId + * @param accountId Only return AWS accounts that matches this account_id. (optional) + * @return APIgetAllAWSAccountsRequest + */ + public APIgetAllAWSAccountsRequest accountId(String accountId) { this.accountId = accountId; return this; } - public UpdateAWSAccountParams roleName(String roleName) { + + /** + * Set roleName + * @param roleName Only return AWS accounts that matches this role_name. (optional) + * @return APIgetAllAWSAccountsRequest + */ + public APIgetAllAWSAccountsRequest roleName(String roleName) { this.roleName = roleName; return this; } - public UpdateAWSAccountParams accessKeyId(String accessKeyId) { + + /** + * Set accessKeyId + * @param accessKeyId Only return AWS accounts that matches this access_key_id. (optional) + * @return APIgetAllAWSAccountsRequest + */ + public APIgetAllAWSAccountsRequest accessKeyId(String accessKeyId) { this.accessKeyId = accessKeyId; return this; } + + /** + * Execute getAllAWSAccounts request + * @return AWSAccountListResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Item Not Found -
+ + */ + + public AWSAccountListResponse execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute getAllAWSAccounts request with HTTP info returned + * @return ApiResponse<AWSAccountListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Item Not Found -
+ + */ + + public ApiResponse executeWithHttpInfo() throws ApiException { + return getAllAWSAccountsWithHttpInfo(accountId, roleName, accessKeyId); + } } /** - * Update an AWS Account - * ### Overview Update the AWS Account based on the provided values ### Arguments * **`account_id`** [*required if role_name is specified*, *default* = **None**]: Only return AWS accounts that matches this account_id. * **`role_name`** [*required if account_id is specified*, *default* = **None**]: Only return AWS accounts that matches this role_name. * **`access_key_id`** [*required if none of the other two options are specified*, *default* = **None**]: Only return AWS accounts that matches this access_key_id. ### Payload * **`account_id`** [*required*]: Your AWS Account ID without dashes. Consult the Datadog AWS integration to learn more about your AWS account ID. * **`role_name`** [*required*]: Your Datadog role delegation name. For more information about you AWS account Role name, see the Datadog AWS integration configuration info. * **`access_key_id`** [*optional*, *default* = **None**]: If your AWS account is a GovCloud or China account, enter the corresponding Access Key ID. * **`filter_tags`** [*optional*, *default* = **None**]: The array of EC2 tags (in the form key:value) defines a filter that Datadog uses when collecting metrics from EC2. Wildcards, such as ? (for single characters) and * (for multiple characters) can also be used. Only hosts that match one of the defined tags will be imported into Datadog. The rest will be ignored. Host matching a given tag can also be excluded by adding ! before the tag. e.g. env:production,instance-type:c1.*,!region:us-east-1 For more information on EC2 tagging, see the AWS tagging documentation. * **`host_tags`** [*optional*, *default* = **None**]: Array of tags (in the form key:value) to add to all hosts and metrics reporting through this integration. * **`account_specific_namespace_rules`** [*optional*, *default* = **None**]: An object (in the form {\"namespace1\":true/false, \"namespace2\":true/false}) that enables or disables metric collection for specific AWS namespaces for this AWS account only. A list of namespaces can be found at the /v1/integration/aws/available_namespace_rules endpoint. - * @param awSAccount AWS request object (required) - * @param accountId (optional) - * @param roleName (optional) - * @param accessKeyId (optional) - * @return Object + * Get Installed AWS Accounts + * ### Overview Get All Installed AWS Accounts ### Arguments * **`account_id`** [*optional*, *default* = **None**]: Only return AWS accounts that matches this account_id. * **`role_name`** [*optional*, *default* = **None**]: Only return AWS accounts that matches this role_name. * **`access_key_id`** [*optional*, *default* = **None**]: Only return AWS accounts that matches this access_key_id. + + * @return getAllAWSAccountsRequest * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ + */ - public Object updateAWSAccount(AWSAccount awSAccount, UpdateAWSAccountParams localVarParams) throws ApiException { - return updateAWSAccountWithHttpInfo(awSAccount, localVarParams).getData(); + + public APIgetAllAWSAccountsRequest getAllAWSAccounts() throws ApiException { + return new APIgetAllAWSAccountsRequest(); } - /** - * Update an AWS Account - * ### Overview Update the AWS Account based on the provided values ### Arguments * **`account_id`** [*required if role_name is specified*, *default* = **None**]: Only return AWS accounts that matches this account_id. * **`role_name`** [*required if account_id is specified*, *default* = **None**]: Only return AWS accounts that matches this role_name. * **`access_key_id`** [*required if none of the other two options are specified*, *default* = **None**]: Only return AWS accounts that matches this access_key_id. ### Payload * **`account_id`** [*required*]: Your AWS Account ID without dashes. Consult the Datadog AWS integration to learn more about your AWS account ID. * **`role_name`** [*required*]: Your Datadog role delegation name. For more information about you AWS account Role name, see the Datadog AWS integration configuration info. * **`access_key_id`** [*optional*, *default* = **None**]: If your AWS account is a GovCloud or China account, enter the corresponding Access Key ID. * **`filter_tags`** [*optional*, *default* = **None**]: The array of EC2 tags (in the form key:value) defines a filter that Datadog uses when collecting metrics from EC2. Wildcards, such as ? (for single characters) and * (for multiple characters) can also be used. Only hosts that match one of the defined tags will be imported into Datadog. The rest will be ignored. Host matching a given tag can also be excluded by adding ! before the tag. e.g. env:production,instance-type:c1.*,!region:us-east-1 For more information on EC2 tagging, see the AWS tagging documentation. * **`host_tags`** [*optional*, *default* = **None**]: Array of tags (in the form key:value) to add to all hosts and metrics reporting through this integration. * **`account_specific_namespace_rules`** [*optional*, *default* = **None**]: An object (in the form {\"namespace1\":true/false, \"namespace2\":true/false}) that enables or disables metric collection for specific AWS namespaces for this AWS account only. A list of namespaces can be found at the /v1/integration/aws/available_namespace_rules endpoint. - * @param awSAccount AWS request object (required) - * @param accountId (optional) - * @param roleName (optional) - * @param accessKeyId (optional) - * @return ApiResponse<Object> - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
- */ - public ApiResponse updateAWSAccountWithHttpInfo(AWSAccount awSAccount, UpdateAWSAccountParams localVarParams) throws ApiException { +private ApiResponse updateAWSAccountWithHttpInfo(AWSAccount awSAccount, String accountId, String roleName, String accessKeyId) throws ApiException { Object localVarPostBody = awSAccount; + // verify the required parameter 'awSAccount' is set if (awSAccount == null) { throw new ApiException(400, "Missing the required parameter 'awSAccount' when calling updateAWSAccount"); } + // create path and map variables String localVarPath = "/api/v1/integration/aws"; @@ -357,9 +372,9 @@ public ApiResponse updateAWSAccountWithHttpInfo(AWSAccount awSAccount, U Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "account_id", localVarParams.accountId)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "role_name", localVarParams.roleName)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "access_key_id", localVarParams.accessKeyId)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "account_id", accountId)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "role_name", roleName)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "access_key_id", accessKeyId)); @@ -379,4 +394,97 @@ public ApiResponse updateAWSAccountWithHttpInfo(AWSAccount awSAccount, U GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } + + public class APIupdateAWSAccountRequest { + private AWSAccount awSAccount; + private String accountId; + private String roleName; + private String accessKeyId; + + private APIupdateAWSAccountRequest(AWSAccount awSAccount) { + this.awSAccount = awSAccount; + } + + + /** + * Set accountId + * @param accountId Only return AWS accounts that matches this account_id. (optional) + * @return APIupdateAWSAccountRequest + */ + public APIupdateAWSAccountRequest accountId(String accountId) { + this.accountId = accountId; + return this; + } + + + /** + * Set roleName + * @param roleName Only return AWS accounts that matches this role_name. *It is required if account_id is specified.* (optional) + * @return APIupdateAWSAccountRequest + */ + public APIupdateAWSAccountRequest roleName(String roleName) { + this.roleName = roleName; + return this; + } + + + /** + * Set accessKeyId + * @param accessKeyId Only return AWS accounts that matches this access_key_id. *It required if none of the other two options are specified.* (optional) + * @return APIupdateAWSAccountRequest + */ + public APIupdateAWSAccountRequest accessKeyId(String accessKeyId) { + this.accessKeyId = accessKeyId; + return this; + } + + + /** + * Execute updateAWSAccount request + * @return Object + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ + */ + + public Object execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute updateAWSAccount request with HTTP info returned + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ + */ + + public ApiResponse executeWithHttpInfo() throws ApiException { + return updateAWSAccountWithHttpInfo(awSAccount, accountId, roleName, accessKeyId); + } + } + + /** + * Update an AWS Account + * ### Overview Update the AWS Account based on the provided values ### Arguments * **`account_id`** [*required if role_name is specified*, *default* = **None**]: Only return AWS accounts that matches this account_id. * **`role_name`** [*required if account_id is specified*, *default* = **None**]: Only return AWS accounts that matches this role_name. * **`access_key_id`** [*required if none of the other two options are specified*, *default* = **None**]: Only return AWS accounts that matches this access_key_id. ### Payload * **`account_id`** [*required*]: Your AWS Account ID without dashes. Consult the Datadog AWS integration to learn more about your AWS account ID. * **`role_name`** [*required*]: Your Datadog role delegation name. For more information about you AWS account Role name, see the Datadog AWS integration configuration info. * **`access_key_id`** [*optional*, *default* = **None**]: If your AWS account is a GovCloud or China account, enter the corresponding Access Key ID. * **`filter_tags`** [*optional*, *default* = **None**]: The array of EC2 tags (in the form key:value) defines a filter that Datadog uses when collecting metrics from EC2. Wildcards, such as ? (for single characters) and * (for multiple characters) can also be used. Only hosts that match one of the defined tags will be imported into Datadog. The rest will be ignored. Host matching a given tag can also be excluded by adding ! before the tag. e.g. env:production,instance-type:c1.*,!region:us-east-1 For more information on EC2 tagging, see the AWS tagging documentation. * **`host_tags`** [*optional*, *default* = **None**]: Array of tags (in the form key:value) to add to all hosts and metrics reporting through this integration. * **`account_specific_namespace_rules`** [*optional*, *default* = **None**]: An object (in the form {\"namespace1\":true/false, \"namespace2\":true/false}) that enables or disables metric collection for specific AWS namespaces for this AWS account only. A list of namespaces can be found at the /v1/integration/aws/available_namespace_rules endpoint. + * @param awSAccount AWS request object (require) + * @return updateAWSAccountRequest + * @throws ApiException if fails to make API call + + + */ + + public APIupdateAWSAccountRequest updateAWSAccount(AWSAccount awSAccount) throws ApiException { + return new APIupdateAWSAccountRequest(awSAccount); + } } diff --git a/src/main/java/com/datadog/api/v1/client/api/DowntimesApi.java b/src/main/java/com/datadog/api/v1/client/api/DowntimesApi.java index 13118822241..7354183f4f9 100644 --- a/src/main/java/com/datadog/api/v1/client/api/DowntimesApi.java +++ b/src/main/java/com/datadog/api/v1/client/api/DowntimesApi.java @@ -39,48 +39,14 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } - // CancelDowntimeParams Parameters for the method 'cancelDowntime' - public static class CancelDowntimeParams { - - - - } - - /** - * Cancel a downtime - * Cancel a Downtime - * @param downtimeId ID of the downtime to cancel (required) - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
204 OK -
404 Downtime not found error -
- */ - public void cancelDowntime(Long downtimeId, CancelDowntimeParams localVarParams) throws ApiException { - cancelDowntimeWithHttpInfo(downtimeId, localVarParams).getData(); - } - - /** - * Cancel a downtime - * Cancel a Downtime - * @param downtimeId ID of the downtime to cancel (required) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
204 OK -
404 Downtime not found error -
- */ - public ApiResponse cancelDowntimeWithHttpInfo(Long downtimeId, CancelDowntimeParams localVarParams) throws ApiException { +private ApiResponse cancelDowntimeWithHttpInfo(Long downtimeId) throws ApiException { Object localVarPostBody = null; + // verify the required parameter 'downtimeId' is set if (downtimeId == null) { throw new ApiException(400, "Missing the required parameter 'downtimeId' when calling cancelDowntime"); } + // create path and map variables String localVarPath = "/api/v1/downtime/{downtime_id}" .replaceAll("\\{" + "downtime_id" + "\\}", apiClient.escapeString(downtimeId.toString())); @@ -107,53 +73,76 @@ public ApiResponse cancelDowntimeWithHttpInfo(Long downtimeId, CancelDownt String[] localVarAuthNames = new String[] { "apiKeyAuth", "appKeyAuth" }; + return apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); } - // CancelDowntimesByScopeParams Parameters for the method 'cancelDowntimesByScope' - public static class CancelDowntimesByScopeParams { - + public class APIcancelDowntimeRequest { + private Long downtimeId; + + private APIcancelDowntimeRequest(Long downtimeId) { + this.downtimeId = downtimeId; + } + + /** + * Execute cancelDowntime request + + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
204 OK -
404 Downtime not found error -
+ + */ + + public void execute() throws ApiException { + this.executeWithHttpInfo().getData(); + } + + /** + * Execute cancelDowntime request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
204 OK -
404 Downtime not found error -
+ + */ + + public ApiResponse executeWithHttpInfo() throws ApiException { + return cancelDowntimeWithHttpInfo(downtimeId); + } } /** - * Cancel downtimes by scope - * ### Overview DELETE all Downtimes that match the scope of X ### Arguments * **`scope`** [*required*]: Cancel all downtimes with the given scope(s), e.g.: `env:prod`, `role:db,role:db-slave` - * @param cancelDowntimesByScopeRequest Scope to cancel downtimes for (required) - * @return CanceledDowntimesIds + * Cancel a downtime + * Cancel a Downtime + * @param downtimeId ID of the downtime to cancel (required) + + * @return cancelDowntimeRequest * @throws ApiException if fails to make API call - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 No downtimes found error -
+ + */ - public CanceledDowntimesIds cancelDowntimesByScope(CancelDowntimesByScopeRequest cancelDowntimesByScopeRequest, CancelDowntimesByScopeParams localVarParams) throws ApiException { - return cancelDowntimesByScopeWithHttpInfo(cancelDowntimesByScopeRequest, localVarParams).getData(); + + public APIcancelDowntimeRequest cancelDowntime(Long downtimeId) throws ApiException { + return new APIcancelDowntimeRequest(downtimeId); } - /** - * Cancel downtimes by scope - * ### Overview DELETE all Downtimes that match the scope of X ### Arguments * **`scope`** [*required*]: Cancel all downtimes with the given scope(s), e.g.: `env:prod`, `role:db,role:db-slave` - * @param cancelDowntimesByScopeRequest Scope to cancel downtimes for (required) - * @return ApiResponse<CanceledDowntimesIds> - * @throws ApiException if fails to make API call - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 No downtimes found error -
- */ - public ApiResponse cancelDowntimesByScopeWithHttpInfo(CancelDowntimesByScopeRequest cancelDowntimesByScopeRequest, CancelDowntimesByScopeParams localVarParams) throws ApiException { +private ApiResponse cancelDowntimesByScopeWithHttpInfo(CancelDowntimesByScopeRequest cancelDowntimesByScopeRequest) throws ApiException { Object localVarPostBody = cancelDowntimesByScopeRequest; + // verify the required parameter 'cancelDowntimesByScopeRequest' is set if (cancelDowntimesByScopeRequest == null) { throw new ApiException(400, "Missing the required parameter 'cancelDowntimesByScopeRequest' when calling cancelDowntimesByScope"); } + // create path and map variables String localVarPath = "/api/v1/downtime/cancel/by_scope"; @@ -182,49 +171,74 @@ public ApiResponse cancelDowntimesByScopeWithHttpInfo(Canc GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } - // CreateDowntimeParams Parameters for the method 'createDowntime' - public static class CreateDowntimeParams { - + public class APIcancelDowntimesByScopeRequest { + private CancelDowntimesByScopeRequest cancelDowntimesByScopeRequest; + + private APIcancelDowntimesByScopeRequest(CancelDowntimesByScopeRequest cancelDowntimesByScopeRequest) { + this.cancelDowntimesByScopeRequest = cancelDowntimesByScopeRequest; + } + + /** + * Execute cancelDowntimesByScope request + * @return CanceledDowntimesIds + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 No downtimes found error -
+ + */ + + public CanceledDowntimesIds execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute cancelDowntimesByScope request with HTTP info returned + * @return ApiResponse<CanceledDowntimesIds> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 No downtimes found error -
+ + */ + + public ApiResponse executeWithHttpInfo() throws ApiException { + return cancelDowntimesByScopeWithHttpInfo(cancelDowntimesByScopeRequest); + } } /** - * Schedule a downtime - * * **`scope`** [*required*]: The scope(s) to which the downtime applies, e.g. `host:app2`. Provide multiple scopes as a comma-separated list, e.g. `env:dev,env:prod`. The resulting downtime applies to sources that matches ALL provided scopes (i.e. `env:dev` **AND** `env:prod`), NOT any of them. * **`monitor_tags`** [*optional*, *default*=**no monitor tag filter**]: A comma-separated list of monitor tags, i.e. tags that are applied directly to monitors, *not* tags that are used in monitor queries (which are filtered by the `scope` parameter), to which the downtime applies. The resulting downtime applies to monitors that match ALL provided monitor tags (i.e. `service:postgres` **AND** `team:frontend`), NOT any of them. * **`monitor_id`** [*optional*, *default*=**None**]: A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors. * **`start`** [*optional*, *default*=**None**]: POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created. * **`end`** [*optional*, *default*=**None**]: POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely (i.e. until you cancel it). * **`message`** [*optional*, *default*=**None**]: A message to include with notifications for this downtime. Email notifications can be sent to specific users by using the same '@username' notation as events * **`timezone`** [*optional*, *default* = **UTC**]: The timezone for the downtime. * **`recurrence`** [*optional*, *default*=**None**]: An object defining the recurrence of the downtime with a variety of parameters: * **`type`** the type of recurrence. Choose from: `days`, `weeks`, `months`, `years`. * **`period`** how often to repeat as an integer. For example to repeat every 3 days, select a type of `days` and a period of `3`. * **`week_days`** (optional) a list of week days to repeat on. Choose from: `Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat` or `Sun`. Only applicable when `type` is `weeks`. **First letter must be capitalized.** * **`until_occurrences`** (optional) how many times the downtime is rescheduled. **`until_occurrences` and `until_date`** are mutually exclusive * **`until_date`** (optional) the date at which the recurrence should end as a POSIX timestmap. **`until_occurrences` and `until_date`** are mutually exclusive - * @param downtime Downtime request object (required) - * @return Downtime + * Cancel downtimes by scope + * ### Overview DELETE all Downtimes that match the scope of X ### Arguments * **`scope`** [*required*]: Cancel all downtimes with the given scope(s), e.g.: `env:prod`, `role:db,role:db-slave` + * @param cancelDowntimesByScopeRequest Scope to cancel downtimes for (require) + * @return cancelDowntimesByScopeRequest * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ + */ - public Downtime createDowntime(Downtime downtime, CreateDowntimeParams localVarParams) throws ApiException { - return createDowntimeWithHttpInfo(downtime, localVarParams).getData(); + + public APIcancelDowntimesByScopeRequest cancelDowntimesByScope(CancelDowntimesByScopeRequest cancelDowntimesByScopeRequest) throws ApiException { + return new APIcancelDowntimesByScopeRequest(cancelDowntimesByScopeRequest); } - /** - * Schedule a downtime - * * **`scope`** [*required*]: The scope(s) to which the downtime applies, e.g. `host:app2`. Provide multiple scopes as a comma-separated list, e.g. `env:dev,env:prod`. The resulting downtime applies to sources that matches ALL provided scopes (i.e. `env:dev` **AND** `env:prod`), NOT any of them. * **`monitor_tags`** [*optional*, *default*=**no monitor tag filter**]: A comma-separated list of monitor tags, i.e. tags that are applied directly to monitors, *not* tags that are used in monitor queries (which are filtered by the `scope` parameter), to which the downtime applies. The resulting downtime applies to monitors that match ALL provided monitor tags (i.e. `service:postgres` **AND** `team:frontend`), NOT any of them. * **`monitor_id`** [*optional*, *default*=**None**]: A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors. * **`start`** [*optional*, *default*=**None**]: POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created. * **`end`** [*optional*, *default*=**None**]: POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely (i.e. until you cancel it). * **`message`** [*optional*, *default*=**None**]: A message to include with notifications for this downtime. Email notifications can be sent to specific users by using the same '@username' notation as events * **`timezone`** [*optional*, *default* = **UTC**]: The timezone for the downtime. * **`recurrence`** [*optional*, *default*=**None**]: An object defining the recurrence of the downtime with a variety of parameters: * **`type`** the type of recurrence. Choose from: `days`, `weeks`, `months`, `years`. * **`period`** how often to repeat as an integer. For example to repeat every 3 days, select a type of `days` and a period of `3`. * **`week_days`** (optional) a list of week days to repeat on. Choose from: `Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat` or `Sun`. Only applicable when `type` is `weeks`. **First letter must be capitalized.** * **`until_occurrences`** (optional) how many times the downtime is rescheduled. **`until_occurrences` and `until_date`** are mutually exclusive * **`until_date`** (optional) the date at which the recurrence should end as a POSIX timestmap. **`until_occurrences` and `until_date`** are mutually exclusive - * @param downtime Downtime request object (required) - * @return ApiResponse<Downtime> - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
- */ - public ApiResponse createDowntimeWithHttpInfo(Downtime downtime, CreateDowntimeParams localVarParams) throws ApiException { +private ApiResponse createDowntimeWithHttpInfo(Downtime downtime) throws ApiException { Object localVarPostBody = downtime; + // verify the required parameter 'downtime' is set if (downtime == null) { throw new ApiException(400, "Missing the required parameter 'downtime' when calling createDowntime"); } + // create path and map variables String localVarPath = "/api/v1/downtime"; @@ -253,52 +267,67 @@ public ApiResponse createDowntimeWithHttpInfo(Downtime downtime, Creat GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } - // GetAllDowntimesParams Parameters for the method 'getAllDowntimes' - public static class GetAllDowntimesParams { - - public Boolean currentOnly; - - - public GetAllDowntimesParams currentOnly(Boolean currentOnly) { - this.currentOnly = currentOnly; - return this; + public class APIcreateDowntimeRequest { + private Downtime downtime; + + private APIcreateDowntimeRequest(Downtime downtime) { + this.downtime = downtime; } + + /** + * Execute createDowntime request + * @return Downtime + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ + */ + + public Downtime execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute createDowntime request with HTTP info returned + * @return ApiResponse<Downtime> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ + */ + + public ApiResponse executeWithHttpInfo() throws ApiException { + return createDowntimeWithHttpInfo(downtime); + } } /** - * Get all downtimes - * ### Overview Get All Scheduled Downtimes ### Arguments * **`current_only`** [*optional*, *default* = **False**]: Only return downtimes that are active when the request is made.' - * @param currentOnly (optional) - * @return List<Downtime> + * Schedule a downtime + * * **`scope`** [*required*]: The scope(s) to which the downtime applies, e.g. `host:app2`. Provide multiple scopes as a comma-separated list, e.g. `env:dev,env:prod`. The resulting downtime applies to sources that matches ALL provided scopes (i.e. `env:dev` **AND** `env:prod`), NOT any of them. * **`monitor_tags`** [*optional*, *default*=**no monitor tag filter**]: A comma-separated list of monitor tags, i.e. tags that are applied directly to monitors, *not* tags that are used in monitor queries (which are filtered by the `scope` parameter), to which the downtime applies. The resulting downtime applies to monitors that match ALL provided monitor tags (i.e. `service:postgres` **AND** `team:frontend`), NOT any of them. * **`monitor_id`** [*optional*, *default*=**None**]: A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors. * **`start`** [*optional*, *default*=**None**]: POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created. * **`end`** [*optional*, *default*=**None**]: POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely (i.e. until you cancel it). * **`message`** [*optional*, *default*=**None**]: A message to include with notifications for this downtime. Email notifications can be sent to specific users by using the same '@username' notation as events * **`timezone`** [*optional*, *default* = **UTC**]: The timezone for the downtime. * **`recurrence`** [*optional*, *default*=**None**]: An object defining the recurrence of the downtime with a variety of parameters: * **`type`** the type of recurrence. Choose from: `days`, `weeks`, `months`, `years`. * **`period`** how often to repeat as an integer. For example to repeat every 3 days, select a type of `days` and a period of `3`. * **`week_days`** (optional) a list of week days to repeat on. Choose from: `Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat` or `Sun`. Only applicable when `type` is `weeks`. **First letter must be capitalized.** * **`until_occurrences`** (optional) how many times the downtime is rescheduled. **`until_occurrences` and `until_date`** are mutually exclusive * **`until_date`** (optional) the date at which the recurrence should end as a POSIX timestmap. **`until_occurrences` and `until_date`** are mutually exclusive + * @param downtime Downtime request object (require) + * @return createDowntimeRequest * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ + */ - public List getAllDowntimes(GetAllDowntimesParams localVarParams) throws ApiException { - return getAllDowntimesWithHttpInfo(localVarParams).getData(); + + public APIcreateDowntimeRequest createDowntime(Downtime downtime) throws ApiException { + return new APIcreateDowntimeRequest(downtime); } - /** - * Get all downtimes - * ### Overview Get All Scheduled Downtimes ### Arguments * **`current_only`** [*optional*, *default* = **False**]: Only return downtimes that are active when the request is made.' - * @param currentOnly (optional) - * @return ApiResponse<List<Downtime>> - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
- */ - public ApiResponse> getAllDowntimesWithHttpInfo(GetAllDowntimesParams localVarParams) throws ApiException { +private ApiResponse> getAllDowntimesWithHttpInfo(Boolean currentOnly) throws ApiException { Object localVarPostBody = null; + // create path and map variables String localVarPath = "/api/v1/downtime"; @@ -308,7 +337,7 @@ public ApiResponse> getAllDowntimesWithHttpInfo(GetAllDowntimesPa Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "current_only", localVarParams.currentOnly)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "current_only", currentOnly)); @@ -328,49 +357,82 @@ public ApiResponse> getAllDowntimesWithHttpInfo(GetAllDowntimesPa GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } - // GetDowntimeParams Parameters for the method 'getDowntime' - public static class GetDowntimeParams { + + public class APIgetAllDowntimesRequest { + private Boolean currentOnly; + + private APIgetAllDowntimesRequest() { + } + /** + * Set currentOnly + * @param currentOnly Only return downtimes that are active when the request is made. (optional) + * @return APIgetAllDowntimesRequest + */ + public APIgetAllDowntimesRequest currentOnly(Boolean currentOnly) { + this.currentOnly = currentOnly; + return this; + } + + /** + * Execute getAllDowntimes request + * @return List<Downtime> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ + */ + + public List execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute getAllDowntimes request with HTTP info returned + * @return ApiResponse<List<Downtime>> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ + */ + + public ApiResponse> executeWithHttpInfo() throws ApiException { + return getAllDowntimesWithHttpInfo(currentOnly); + } } /** - * Get a downtime - * ### Overview Get Downtime Detail by downtime_id ### Arguments This endpoint takes no JSON arguments.\" - * @param downtimeId ID of the downtime to fetch (required) - * @return Downtime + * Get all downtimes + * ### Overview Get All Scheduled Downtimes ### Arguments * **`current_only`** [*optional*, *default* = **False**]: Only return downtimes that are active when the request is made. + + * @return getAllDowntimesRequest * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
404 Downtime not found error -
+ + */ - public Downtime getDowntime(Long downtimeId, GetDowntimeParams localVarParams) throws ApiException { - return getDowntimeWithHttpInfo(downtimeId, localVarParams).getData(); + + public APIgetAllDowntimesRequest getAllDowntimes() throws ApiException { + return new APIgetAllDowntimesRequest(); } - /** - * Get a downtime - * ### Overview Get Downtime Detail by downtime_id ### Arguments This endpoint takes no JSON arguments.\" - * @param downtimeId ID of the downtime to fetch (required) - * @return ApiResponse<Downtime> - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
404 Downtime not found error -
- */ - public ApiResponse getDowntimeWithHttpInfo(Long downtimeId, GetDowntimeParams localVarParams) throws ApiException { +private ApiResponse getDowntimeWithHttpInfo(Long downtimeId) throws ApiException { Object localVarPostBody = null; + // verify the required parameter 'downtimeId' is set if (downtimeId == null) { throw new ApiException(400, "Missing the required parameter 'downtimeId' when calling getDowntime"); } + // create path and map variables String localVarPath = "/api/v1/downtime/{downtime_id}" .replaceAll("\\{" + "downtime_id" + "\\}", apiClient.escapeString(downtimeId.toString())); @@ -400,57 +462,78 @@ public ApiResponse getDowntimeWithHttpInfo(Long downtimeId, GetDowntim GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } - // UpdateDowntimeParams Parameters for the method 'updateDowntime' - public static class UpdateDowntimeParams { - + public class APIgetDowntimeRequest { + private Long downtimeId; + + private APIgetDowntimeRequest(Long downtimeId) { + this.downtimeId = downtimeId; + } + + /** + * Execute getDowntime request + * @return Downtime + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 Downtime not found error -
+ + */ + + public Downtime execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute getDowntime request with HTTP info returned + * @return ApiResponse<Downtime> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
404 Downtime not found error -
+ + */ + + public ApiResponse executeWithHttpInfo() throws ApiException { + return getDowntimeWithHttpInfo(downtimeId); + } } /** - * Update a downtime - * ### Overview Update a single Downtime by downtime_id. ### Arguments * **`id`** [*required*]: The integer id of the downtime to be updated * **`scope`** [*required*]: The scope to which the downtime applies, e.g. 'host:app2'. Provide multiple scopes as a comma-separated list, e.g. 'env:dev,env:prod'. The resulting downtime applies to sources that matches ALL provided scopes (i.e. env:dev AND env:prod), NOT any of them. * **`monitor_tags`** [*optional*, *default*=**no monitor tag filter**]: A comma-separated list of monitor tags, i.e. tags that are applied directly to monitors, *not* tags that are used in monitor queries (which are filtered by the `scope` parameter), to which the downtime applies. The resulting downtime applies to monitors that match ALL provided monitor tags (i.e. `service:postgres` **AND** `team:frontend`), NOT any of them. * **`monitor_id`** [*optional*, *default*=**None**]: A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors. * **`start`** [*optional*, *default* = **original start**]: POSIX timestamp to start the downtime. * **`end`** [*optional*, *default* = **original end**]: POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely (i.e. until you cancel it). * **`message`** [*required*, *default* = **original message**]: A message to include with notifications for this downtime. Email notifications can be sent to specific users by using the same '@username' notation as events * **`timezone`** [*optional*, default = **original timezone** ]: The timezone for the downtime. * **`recurrence`** [*optional*, *default* = **original recurrence**]: An object defining the recurrence of the downtime with a variety of parameters: * **`type`** the type of recurrence. Choose from: `days`, `weeks`, `months`, `years`. * **`period`** how often to repeat as an integer. For example to repeat every 3 days, select a type of `days` and a period of `3`. * **`week_days`** (optional) a list of week days to repeat on. Choose from: `Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat` or `Sun`. Only applicable when `type` is `weeks`. **First letter must be capitalized.** * **`until_occurrences`** (optional) how many times the downtime is rescheduled. **`until_occurrences` and `until_date`** are mutually exclusive * **`until_date`** (optional) the date at which the recurrence should end as a POSIX timestmap. **`until_occurrences` and `until_date`** are mutually exclusive - * @param downtimeId ID of the downtime to update (required) - * @param downtime Downtime request object (required) - * @return Downtime + * Get a downtime + * ### Overview Get Downtime Detail by downtime_id ### Arguments This endpoint takes no JSON arguments.\" + * @param downtimeId ID of the downtime to fetch (required) + + * @return getDowntimeRequest * @throws ApiException if fails to make API call - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Downtime not found error -
+ + */ - public Downtime updateDowntime(Long downtimeId, Downtime downtime, UpdateDowntimeParams localVarParams) throws ApiException { - return updateDowntimeWithHttpInfo(downtimeId, downtime, localVarParams).getData(); + + public APIgetDowntimeRequest getDowntime(Long downtimeId) throws ApiException { + return new APIgetDowntimeRequest(downtimeId); } - /** - * Update a downtime - * ### Overview Update a single Downtime by downtime_id. ### Arguments * **`id`** [*required*]: The integer id of the downtime to be updated * **`scope`** [*required*]: The scope to which the downtime applies, e.g. 'host:app2'. Provide multiple scopes as a comma-separated list, e.g. 'env:dev,env:prod'. The resulting downtime applies to sources that matches ALL provided scopes (i.e. env:dev AND env:prod), NOT any of them. * **`monitor_tags`** [*optional*, *default*=**no monitor tag filter**]: A comma-separated list of monitor tags, i.e. tags that are applied directly to monitors, *not* tags that are used in monitor queries (which are filtered by the `scope` parameter), to which the downtime applies. The resulting downtime applies to monitors that match ALL provided monitor tags (i.e. `service:postgres` **AND** `team:frontend`), NOT any of them. * **`monitor_id`** [*optional*, *default*=**None**]: A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors. * **`start`** [*optional*, *default* = **original start**]: POSIX timestamp to start the downtime. * **`end`** [*optional*, *default* = **original end**]: POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely (i.e. until you cancel it). * **`message`** [*required*, *default* = **original message**]: A message to include with notifications for this downtime. Email notifications can be sent to specific users by using the same '@username' notation as events * **`timezone`** [*optional*, default = **original timezone** ]: The timezone for the downtime. * **`recurrence`** [*optional*, *default* = **original recurrence**]: An object defining the recurrence of the downtime with a variety of parameters: * **`type`** the type of recurrence. Choose from: `days`, `weeks`, `months`, `years`. * **`period`** how often to repeat as an integer. For example to repeat every 3 days, select a type of `days` and a period of `3`. * **`week_days`** (optional) a list of week days to repeat on. Choose from: `Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat` or `Sun`. Only applicable when `type` is `weeks`. **First letter must be capitalized.** * **`until_occurrences`** (optional) how many times the downtime is rescheduled. **`until_occurrences` and `until_date`** are mutually exclusive * **`until_date`** (optional) the date at which the recurrence should end as a POSIX timestmap. **`until_occurrences` and `until_date`** are mutually exclusive - * @param downtimeId ID of the downtime to update (required) - * @param downtime Downtime request object (required) - * @return ApiResponse<Downtime> - * @throws ApiException if fails to make API call - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Downtime not found error -
- */ - public ApiResponse updateDowntimeWithHttpInfo(Long downtimeId, Downtime downtime, UpdateDowntimeParams localVarParams) throws ApiException { +private ApiResponse updateDowntimeWithHttpInfo(Long downtimeId, Downtime downtime) throws ApiException { Object localVarPostBody = downtime; + // verify the required parameter 'downtimeId' is set if (downtimeId == null) { throw new ApiException(400, "Missing the required parameter 'downtimeId' when calling updateDowntime"); } + // verify the required parameter 'downtime' is set if (downtime == null) { throw new ApiException(400, "Missing the required parameter 'downtime' when calling updateDowntime"); } + // create path and map variables String localVarPath = "/api/v1/downtime/{downtime_id}" .replaceAll("\\{" + "downtime_id" + "\\}", apiClient.escapeString(downtimeId.toString())); @@ -480,4 +563,66 @@ public ApiResponse updateDowntimeWithHttpInfo(Long downtimeId, Downtim GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } + + public class APIupdateDowntimeRequest { + private Long downtimeId; + private Downtime downtime; + + private APIupdateDowntimeRequest(Long downtimeId, Downtime downtime) { + this.downtimeId = downtimeId; + this.downtime = downtime; + } + + + /** + * Execute updateDowntime request + * @return Downtime + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Downtime not found error -
+ + */ + + public Downtime execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute updateDowntime request with HTTP info returned + * @return ApiResponse<Downtime> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Downtime not found error -
+ + */ + + public ApiResponse executeWithHttpInfo() throws ApiException { + return updateDowntimeWithHttpInfo(downtimeId, downtime); + } + } + + /** + * Update a downtime + * ### Overview Update a single Downtime by downtime_id. ### Arguments * **`id`** [*required*]: The integer id of the downtime to be updated * **`scope`** [*required*]: The scope to which the downtime applies, e.g. 'host:app2'. Provide multiple scopes as a comma-separated list, e.g. 'env:dev,env:prod'. The resulting downtime applies to sources that matches ALL provided scopes (i.e. env:dev AND env:prod), NOT any of them. * **`monitor_tags`** [*optional*, *default*=**no monitor tag filter**]: A comma-separated list of monitor tags, i.e. tags that are applied directly to monitors, *not* tags that are used in monitor queries (which are filtered by the `scope` parameter), to which the downtime applies. The resulting downtime applies to monitors that match ALL provided monitor tags (i.e. `service:postgres` **AND** `team:frontend`), NOT any of them. * **`monitor_id`** [*optional*, *default*=**None**]: A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors. * **`start`** [*optional*, *default* = **original start**]: POSIX timestamp to start the downtime. * **`end`** [*optional*, *default* = **original end**]: POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely (i.e. until you cancel it). * **`message`** [*required*, *default* = **original message**]: A message to include with notifications for this downtime. Email notifications can be sent to specific users by using the same '@username' notation as events * **`timezone`** [*optional*, default = **original timezone** ]: The timezone for the downtime. * **`recurrence`** [*optional*, *default* = **original recurrence**]: An object defining the recurrence of the downtime with a variety of parameters: * **`type`** the type of recurrence. Choose from: `days`, `weeks`, `months`, `years`. * **`period`** how often to repeat as an integer. For example to repeat every 3 days, select a type of `days` and a period of `3`. * **`week_days`** (optional) a list of week days to repeat on. Choose from: `Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat` or `Sun`. Only applicable when `type` is `weeks`. **First letter must be capitalized.** * **`until_occurrences`** (optional) how many times the downtime is rescheduled. **`until_occurrences` and `until_date`** are mutually exclusive * **`until_date`** (optional) the date at which the recurrence should end as a POSIX timestmap. **`until_occurrences` and `until_date`** are mutually exclusive + * @param downtimeId ID of the downtime to update (required) + * @param downtime Downtime request object (require) + * @return updateDowntimeRequest + * @throws ApiException if fails to make API call + + + */ + + public APIupdateDowntimeRequest updateDowntime(Long downtimeId, Downtime downtime) throws ApiException { + return new APIupdateDowntimeRequest(downtimeId, downtime); + } } diff --git a/src/main/java/com/datadog/api/v1/client/api/MonitorsApi.java b/src/main/java/com/datadog/api/v1/client/api/MonitorsApi.java index 40d668777a4..635ed65cb99 100644 --- a/src/main/java/com/datadog/api/v1/client/api/MonitorsApi.java +++ b/src/main/java/com/datadog/api/v1/client/api/MonitorsApi.java @@ -39,49 +39,14 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } - // CreateMonitorParams Parameters for the method 'createMonitor' - public static class CreateMonitorParams { - - - - } - - /** - * Create a new Monitor - * ### Overview Create a monitor using the specified options ### Arguments * **`Monitor`** [*required*] The Monitor Object to create - * @param monitor Monitor request object (required) - * @return Monitor - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
- */ - public Monitor createMonitor(Monitor monitor, CreateMonitorParams localVarParams) throws ApiException { - return createMonitorWithHttpInfo(monitor, localVarParams).getData(); - } - - /** - * Create a new Monitor - * ### Overview Create a monitor using the specified options ### Arguments * **`Monitor`** [*required*] The Monitor Object to create - * @param monitor Monitor request object (required) - * @return ApiResponse<Monitor> - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
- */ - public ApiResponse createMonitorWithHttpInfo(Monitor monitor, CreateMonitorParams localVarParams) throws ApiException { +private ApiResponse createMonitorWithHttpInfo(Monitor monitor) throws ApiException { Object localVarPostBody = monitor; + // verify the required parameter 'monitor' is set if (monitor == null) { throw new ApiException(400, "Missing the required parameter 'monitor' when calling createMonitor"); } + // create path and map variables String localVarPath = "/api/v1/monitor"; @@ -110,53 +75,72 @@ public ApiResponse createMonitorWithHttpInfo(Monitor monitor, CreateMon GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } - // DeleteMonitorParams Parameters for the method 'deleteMonitor' - public static class DeleteMonitorParams { - + public class APIcreateMonitorRequest { + private Monitor monitor; + + private APIcreateMonitorRequest(Monitor monitor) { + this.monitor = monitor; + } + + /** + * Execute createMonitor request + * @return Monitor + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ + */ + + public Monitor execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute createMonitor request with HTTP info returned + * @return ApiResponse<Monitor> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ + */ + + public ApiResponse executeWithHttpInfo() throws ApiException { + return createMonitorWithHttpInfo(monitor); + } } /** - * Delete the specified monitor. - * ### Overview Delete the specified monitor ### Arguments * **`monitor_id`** [*required*]: The id of the monitor. - * @param monitorId The id of the monitor (required) - * @return Map<String, Long> + * Create a new Monitor + * ### Overview Create a monitor using the specified options ### Arguments * **`Monitor`** [*required*] The Monitor Object to create + * @param monitor Monitor request object (require) + * @return createMonitorRequest * @throws ApiException if fails to make API call - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Authentication error -
404 Item not found error -
+ + */ - public Map deleteMonitor(Long monitorId, DeleteMonitorParams localVarParams) throws ApiException { - return deleteMonitorWithHttpInfo(monitorId, localVarParams).getData(); + + public APIcreateMonitorRequest createMonitor(Monitor monitor) throws ApiException { + return new APIcreateMonitorRequest(monitor); } - /** - * Delete the specified monitor. - * ### Overview Delete the specified monitor ### Arguments * **`monitor_id`** [*required*]: The id of the monitor. - * @param monitorId The id of the monitor (required) - * @return ApiResponse<Map<String, Long>> - * @throws ApiException if fails to make API call - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Authentication error -
404 Item not found error -
- */ - public ApiResponse> deleteMonitorWithHttpInfo(Long monitorId, DeleteMonitorParams localVarParams) throws ApiException { +private ApiResponse> deleteMonitorWithHttpInfo(Long monitorId) throws ApiException { Object localVarPostBody = null; + // verify the required parameter 'monitorId' is set if (monitorId == null) { throw new ApiException(400, "Missing the required parameter 'monitorId' when calling deleteMonitor"); } + // create path and map variables String localVarPath = "/api/v1/monitor/{monitor_id}" .replaceAll("\\{" + "monitor_id" + "\\}", apiClient.escapeString(monitorId.toString())); @@ -186,59 +170,82 @@ public ApiResponse> deleteMonitorWithHttpInfo(Long monitorId, GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } - // EditMonitorParams Parameters for the method 'editMonitor' - public static class EditMonitorParams { - + public class APIdeleteMonitorRequest { + private Long monitorId; + + private APIdeleteMonitorRequest(Long monitorId) { + this.monitorId = monitorId; + } + + /** + * Execute deleteMonitor request + * @return Map<String, Long> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Authentication error -
404 Item not found error -
+ + */ + + public Map execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute deleteMonitor request with HTTP info returned + * @return ApiResponse<Map<String, Long>> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Authentication error -
404 Item not found error -
+ + */ + + public ApiResponse> executeWithHttpInfo() throws ApiException { + return deleteMonitorWithHttpInfo(monitorId); + } } /** - * Edit the specified monitor - * ### Overview Edit the specified monitor. ### Arguments * **`monitor_id`** [*required*]: The id of the monitor. + * Delete the specified monitor. + * ### Overview Delete the specified monitor ### Arguments * **`monitor_id`** [*required*]: The id of the monitor. * @param monitorId The id of the monitor (required) - * @param monitor Monitor request object (required) - * @return Monitor + + * @return deleteMonitorRequest * @throws ApiException if fails to make API call - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Authentication error -
404 Monitor Not Found error -
+ + */ - public Monitor editMonitor(Long monitorId, Monitor monitor, EditMonitorParams localVarParams) throws ApiException { - return editMonitorWithHttpInfo(monitorId, monitor, localVarParams).getData(); + + public APIdeleteMonitorRequest deleteMonitor(Long monitorId) throws ApiException { + return new APIdeleteMonitorRequest(monitorId); } - /** - * Edit the specified monitor - * ### Overview Edit the specified monitor. ### Arguments * **`monitor_id`** [*required*]: The id of the monitor. - * @param monitorId The id of the monitor (required) - * @param monitor Monitor request object (required) - * @return ApiResponse<Monitor> - * @throws ApiException if fails to make API call - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Authentication error -
404 Monitor Not Found error -
- */ - public ApiResponse editMonitorWithHttpInfo(Long monitorId, Monitor monitor, EditMonitorParams localVarParams) throws ApiException { +private ApiResponse editMonitorWithHttpInfo(Long monitorId, Monitor monitor) throws ApiException { Object localVarPostBody = monitor; + // verify the required parameter 'monitorId' is set if (monitorId == null) { throw new ApiException(400, "Missing the required parameter 'monitorId' when calling editMonitor"); } + // verify the required parameter 'monitor' is set if (monitor == null) { throw new ApiException(400, "Missing the required parameter 'monitor' when calling editMonitor"); } + // create path and map variables String localVarPath = "/api/v1/monitor/{monitor_id}" .replaceAll("\\{" + "monitor_id" + "\\}", apiClient.escapeString(monitorId.toString())); @@ -268,88 +275,74 @@ public ApiResponse editMonitorWithHttpInfo(Long monitorId, Monitor moni GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } - // GetAllMonitorsParams Parameters for the method 'getAllMonitors' - public static class GetAllMonitorsParams { - - public String groupStates; - - public String name; - - public String tags; - - public String monitorTags; - - public Boolean withDowntimes; - - - public GetAllMonitorsParams groupStates(String groupStates) { - this.groupStates = groupStates; - return this; - } - - public GetAllMonitorsParams name(String name) { - this.name = name; - return this; - } - - public GetAllMonitorsParams tags(String tags) { - this.tags = tags; - return this; + public class APIeditMonitorRequest { + private Long monitorId; + private Monitor monitor; + + private APIeditMonitorRequest(Long monitorId, Monitor monitor) { + this.monitorId = monitorId; + this.monitor = monitor; } - public GetAllMonitorsParams monitorTags(String monitorTags) { - this.monitorTags = monitorTags; - return this; + + /** + * Execute editMonitor request + * @return Monitor + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Authentication error -
404 Monitor Not Found error -
+ + */ + + public Monitor execute() throws ApiException { + return this.executeWithHttpInfo().getData(); } - - public GetAllMonitorsParams withDowntimes(Boolean withDowntimes) { - this.withDowntimes = withDowntimes; - return this; + + /** + * Execute editMonitor request with HTTP info returned + * @return ApiResponse<Monitor> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Authentication error -
404 Monitor Not Found error -
+ + */ + + public ApiResponse executeWithHttpInfo() throws ApiException { + return editMonitorWithHttpInfo(monitorId, monitor); } - } /** - * Get details about the specified monitor. - * ### Overview Get details about the specified monitor from your organization. ### Arguments * **`group_states`** [*optional* *default*=**None**] If this argument is set, the returned data includes additional information (if available) regarding the specified group states, including the last notification timestamp, last resolution timestamp and details about the last time the monitor was triggered. The argument should include a string list indicating what, if any, group states to include. Choose one or more from all, alert, warn, or no data. Example 'alert,warn' * **`name`** [*optional* *default*==**None**] A string to filter monitors by name * **`tags`** [*optional* *default*==**None**] A comma separated list indicating what tags, if any, should be used to filter the list of monitorsby scope, e.g. host:host0 * **`monitor_tags`** [*optional* *default*==**None**] A comma separated list indicating what service and/or custom tags, if any, should be used to filter the list of monitors. Tags created in the Datadog UI automatically have the service key prepended (e.g. service:my-app) * **`with_downtimes`** [*optional* *default*==**true**] If this argument is set to true, then the returned data includes all current downtimes for each monitor. - * @param groupStates When specified, shows additional information about the group states. Choose one or more from `all`, `alert`, `warn`, and `no data`. (optional) - * @param name (optional) - * @param tags (optional) - * @param monitorTags (optional) - * @param withDowntimes (optional) - * @return List<Monitor> + * Edit the specified monitor + * ### Overview Edit the specified monitor. ### Arguments * **`monitor_id`** [*required*]: The id of the monitor. + * @param monitorId The id of the monitor (required) + * @param monitor Monitor request object (require) + * @return editMonitorRequest * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ + */ - public List getAllMonitors(GetAllMonitorsParams localVarParams) throws ApiException { - return getAllMonitorsWithHttpInfo(localVarParams).getData(); + + public APIeditMonitorRequest editMonitor(Long monitorId, Monitor monitor) throws ApiException { + return new APIeditMonitorRequest(monitorId, monitor); } - /** - * Get details about the specified monitor. - * ### Overview Get details about the specified monitor from your organization. ### Arguments * **`group_states`** [*optional* *default*=**None**] If this argument is set, the returned data includes additional information (if available) regarding the specified group states, including the last notification timestamp, last resolution timestamp and details about the last time the monitor was triggered. The argument should include a string list indicating what, if any, group states to include. Choose one or more from all, alert, warn, or no data. Example 'alert,warn' * **`name`** [*optional* *default*==**None**] A string to filter monitors by name * **`tags`** [*optional* *default*==**None**] A comma separated list indicating what tags, if any, should be used to filter the list of monitorsby scope, e.g. host:host0 * **`monitor_tags`** [*optional* *default*==**None**] A comma separated list indicating what service and/or custom tags, if any, should be used to filter the list of monitors. Tags created in the Datadog UI automatically have the service key prepended (e.g. service:my-app) * **`with_downtimes`** [*optional* *default*==**true**] If this argument is set to true, then the returned data includes all current downtimes for each monitor. - * @param groupStates When specified, shows additional information about the group states. Choose one or more from `all`, `alert`, `warn`, and `no data`. (optional) - * @param name (optional) - * @param tags (optional) - * @param monitorTags (optional) - * @param withDowntimes (optional) - * @return ApiResponse<List<Monitor>> - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
- */ - public ApiResponse> getAllMonitorsWithHttpInfo(GetAllMonitorsParams localVarParams) throws ApiException { +private ApiResponse> getAllMonitorsWithHttpInfo(String groupStates, String name, String tags, String monitorTags, Boolean withDowntimes) throws ApiException { Object localVarPostBody = null; + // create path and map variables String localVarPath = "/api/v1/monitor"; @@ -359,11 +352,11 @@ public ApiResponse> getAllMonitorsWithHttpInfo(GetAllMonitorsParam Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "group_states", localVarParams.groupStates)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "name", localVarParams.name)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "tags", localVarParams.tags)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "monitor_tags", localVarParams.monitorTags)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "with_downtimes", localVarParams.withDowntimes)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "group_states", groupStates)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "name", name)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "tags", tags)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "monitor_tags", monitorTags)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "with_downtimes", withDowntimes)); @@ -383,60 +376,130 @@ public ApiResponse> getAllMonitorsWithHttpInfo(GetAllMonitorsParam GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } - // GetMonitorParams Parameters for the method 'getMonitor' - public static class GetMonitorParams { + + public class APIgetAllMonitorsRequest { + private String groupStates; + private String name; + private String tags; + private String monitorTags; + private Boolean withDowntimes; + + private APIgetAllMonitorsRequest() { + } - public String groupStates; + + /** + * Set groupStates + * @param groupStates When specified, shows additional information about the group states. Choose one or more from `all`, `alert`, `warn`, and `no data`. (optional) + * @return APIgetAllMonitorsRequest + */ + public APIgetAllMonitorsRequest groupStates(String groupStates) { + this.groupStates = groupStates; + return this; + } + /** + * Set name + * @param name A string to filter monitors by name. (optional) + * @return APIgetAllMonitorsRequest + */ + public APIgetAllMonitorsRequest name(String name) { + this.name = name; + return this; + } - public GetMonitorParams groupStates(String groupStates) { - this.groupStates = groupStates; + + /** + * Set tags + * @param tags A comma separated list indicating what tags, if any, should be used to filter the list of monitorsby scope, e.g. host:host0. (optional) + * @return APIgetAllMonitorsRequest + */ + public APIgetAllMonitorsRequest tags(String tags) { + this.tags = tags; + return this; + } + + + /** + * Set monitorTags + * @param monitorTags A comma separated list indicating what service and/or custom tags, if any, should be used to filter the list of monitors. Tags created in the Datadog UI automatically have the service key prepended (e.g. service:my-app). (optional) + * @return APIgetAllMonitorsRequest + */ + public APIgetAllMonitorsRequest monitorTags(String monitorTags) { + this.monitorTags = monitorTags; + return this; + } + + + /** + * Set withDowntimes + * @param withDowntimes If this argument is set to true, then the returned data includes all current downtimes for each monitor. (optional) + * @return APIgetAllMonitorsRequest + */ + public APIgetAllMonitorsRequest withDowntimes(Boolean withDowntimes) { + this.withDowntimes = withDowntimes; return this; } + + /** + * Execute getAllMonitors request + * @return List<Monitor> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ + */ + + public List execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute getAllMonitors request with HTTP info returned + * @return ApiResponse<List<Monitor>> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
+ + */ + + public ApiResponse> executeWithHttpInfo() throws ApiException { + return getAllMonitorsWithHttpInfo(groupStates, name, tags, monitorTags, withDowntimes); + } } /** * Get details about the specified monitor. - * ### Overview Get details about the specified monitor from your organization. ### Arguments * **`monitor_id`** [*required*]: The id of the monitor. * **`group_states`** [*optional* *default*=**None**] If this argument is set, the returned data includes additional information (if available) regarding the specified group states, including the last notification timestamp, last resolution timestamp and details about the last time the monitor was triggered. The argument should include a string list indicating what, if any, group states to include. Choose one or more from all, alert, warn, or no data. Example 'alert,warn' - * @param monitorId The id of the monitor (required) - * @param groupStates When specified, shows additional information about the group states. Choose one or more from `all`, `alert`, `warn`, and `no data`. (optional) - * @return Monitor + * ### Overview Get details about the specified monitor from your organization. ### Arguments * **`group_states`** [*optional* *default*=**None**] If this argument is set, the returned data includes additional information (if available) regarding the specified group states, including the last notification timestamp, last resolution timestamp and details about the last time the monitor was triggered. The argument should include a string list indicating what, if any, group states to include. Choose one or more from all, alert, warn, or no data. Example 'alert,warn' * **`name`** [*optional* *default*==**None**] A string to filter monitors by name * **`tags`** [*optional* *default*==**None**] A comma separated list indicating what tags, if any, should be used to filter the list of monitorsby scope, e.g. host:host0 * **`monitor_tags`** [*optional* *default*==**None**] A comma separated list indicating what service and/or custom tags, if any, should be used to filter the list of monitors. Tags created in the Datadog UI automatically have the service key prepended (e.g. service:my-app) * **`with_downtimes`** [*optional* *default*==**true**] If this argument is set to true, then the returned data includes all current downtimes for each monitor. + + * @return getAllMonitorsRequest * @throws ApiException if fails to make API call - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Authentication error -
+ + */ - public Monitor getMonitor(Long monitorId, GetMonitorParams localVarParams) throws ApiException { - return getMonitorWithHttpInfo(monitorId, localVarParams).getData(); + + public APIgetAllMonitorsRequest getAllMonitors() throws ApiException { + return new APIgetAllMonitorsRequest(); } - /** - * Get details about the specified monitor. - * ### Overview Get details about the specified monitor from your organization. ### Arguments * **`monitor_id`** [*required*]: The id of the monitor. * **`group_states`** [*optional* *default*=**None**] If this argument is set, the returned data includes additional information (if available) regarding the specified group states, including the last notification timestamp, last resolution timestamp and details about the last time the monitor was triggered. The argument should include a string list indicating what, if any, group states to include. Choose one or more from all, alert, warn, or no data. Example 'alert,warn' - * @param monitorId The id of the monitor (required) - * @param groupStates When specified, shows additional information about the group states. Choose one or more from `all`, `alert`, `warn`, and `no data`. (optional) - * @return ApiResponse<Monitor> - * @throws ApiException if fails to make API call - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Authentication error -
- */ - public ApiResponse getMonitorWithHttpInfo(Long monitorId, GetMonitorParams localVarParams) throws ApiException { +private ApiResponse getMonitorWithHttpInfo(Long monitorId, String groupStates) throws ApiException { Object localVarPostBody = null; + // verify the required parameter 'monitorId' is set if (monitorId == null) { throw new ApiException(400, "Missing the required parameter 'monitorId' when calling getMonitor"); } + // create path and map variables String localVarPath = "/api/v1/monitor/{monitor_id}" .replaceAll("\\{" + "monitor_id" + "\\}", apiClient.escapeString(monitorId.toString())); @@ -447,7 +510,7 @@ public ApiResponse getMonitorWithHttpInfo(Long monitorId, GetMonitorPar Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "group_states", localVarParams.groupStates)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "group_states", groupStates)); @@ -467,49 +530,87 @@ public ApiResponse getMonitorWithHttpInfo(Long monitorId, GetMonitorPar GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } - // ValidateMonitorParams Parameters for the method 'validateMonitor' - public static class ValidateMonitorParams { + + public class APIgetMonitorRequest { + private Long monitorId; + private String groupStates; + + private APIgetMonitorRequest(Long monitorId) { + this.monitorId = monitorId; + } + /** + * Set groupStates + * @param groupStates When specified, shows additional information about the group states. Choose one or more from `all`, `alert`, `warn`, and `no data`. (optional) + * @return APIgetMonitorRequest + */ + public APIgetMonitorRequest groupStates(String groupStates) { + this.groupStates = groupStates; + return this; + } + + /** + * Execute getMonitor request + * @return Monitor + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Authentication error -
+ + */ + + public Monitor execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute getMonitor request with HTTP info returned + * @return ApiResponse<Monitor> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Authentication error -
+ + */ + + public ApiResponse executeWithHttpInfo() throws ApiException { + return getMonitorWithHttpInfo(monitorId, groupStates); + } } /** - * - * ### Overview Validate the monitor provided in the request ### Arguments * **`Monitor`** [*required*] The Monitor Object to validate summary: Validate the provided monitor - * @param monitor Monitor request object (required) - * @return Monitor + * Get details about the specified monitor. + * ### Overview Get details about the specified monitor from your organization. ### Arguments * **`monitor_id`** [*required*]: The id of the monitor. * **`group_states`** [*optional* *default*=**None**] If this argument is set, the returned data includes additional information (if available) regarding the specified group states, including the last notification timestamp, last resolution timestamp and details about the last time the monitor was triggered. The argument should include a string list indicating what, if any, group states to include. Choose one or more from all, alert, warn, or no data. Example 'alert,warn' + * @param monitorId The id of the monitor (required) + + * @return getMonitorRequest * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
400 Invalid JSON -
+ + */ - public Monitor validateMonitor(Monitor monitor, ValidateMonitorParams localVarParams) throws ApiException { - return validateMonitorWithHttpInfo(monitor, localVarParams).getData(); + + public APIgetMonitorRequest getMonitor(Long monitorId) throws ApiException { + return new APIgetMonitorRequest(monitorId); } - /** - * - * ### Overview Validate the monitor provided in the request ### Arguments * **`Monitor`** [*required*] The Monitor Object to validate summary: Validate the provided monitor - * @param monitor Monitor request object (required) - * @return ApiResponse<Monitor> - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK -
400 Invalid JSON -
- */ - public ApiResponse validateMonitorWithHttpInfo(Monitor monitor, ValidateMonitorParams localVarParams) throws ApiException { +private ApiResponse validateMonitorWithHttpInfo(Monitor monitor) throws ApiException { Object localVarPostBody = monitor; + // verify the required parameter 'monitor' is set if (monitor == null) { throw new ApiException(400, "Missing the required parameter 'monitor' when calling validateMonitor"); } + // create path and map variables String localVarPath = "/api/v1/monitor/validate"; @@ -538,4 +639,61 @@ public ApiResponse validateMonitorWithHttpInfo(Monitor monitor, Validat GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } + + public class APIvalidateMonitorRequest { + private Monitor monitor; + + private APIvalidateMonitorRequest(Monitor monitor) { + this.monitor = monitor; + } + + + /** + * Execute validateMonitor request + * @return Monitor + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
400 Invalid JSON -
+ + */ + + public Monitor execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute validateMonitor request with HTTP info returned + * @return ApiResponse<Monitor> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
400 Invalid JSON -
+ + */ + + public ApiResponse executeWithHttpInfo() throws ApiException { + return validateMonitorWithHttpInfo(monitor); + } + } + + /** + * + * ### Overview Validate the monitor provided in the request ### Arguments * **`Monitor`** [*required*] The Monitor Object to validate summary: Validate the provided monitor + * @param monitor Monitor request object (require) + * @return validateMonitorRequest + * @throws ApiException if fails to make API call + + + */ + + public APIvalidateMonitorRequest validateMonitor(Monitor monitor) throws ApiException { + return new APIvalidateMonitorRequest(monitor); + } } diff --git a/src/main/java/com/datadog/api/v1/client/api/UsersApi.java b/src/main/java/com/datadog/api/v1/client/api/UsersApi.java index 1bd1b2cc3f7..04f92c2171d 100644 --- a/src/main/java/com/datadog/api/v1/client/api/UsersApi.java +++ b/src/main/java/com/datadog/api/v1/client/api/UsersApi.java @@ -40,51 +40,14 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } - // CreateUserParams Parameters for the method 'createUser' - public static class CreateUserParams { - - - - } - - /** - * Create user - * ### Overview Create a user for your organization. ### Arguments * **`handle`** [*required*]: The user handle, must be a valid email. * **`name`** [*optional*, *default*=**None**]: The name of the user. * **`access_role`** [*optional*, *default*=**st**]: The access role of the user. Choose from: * **st** (standard user), * **adm** (admin user), * **ro** (read-only user). **Note**: users can be created with admin access role only with application keys belonging to administrators. - * @param user User object that needs to be created (required) - * @return UserResponse - * @throws ApiException if fails to make API call - * @http.response.details - - - - - -
Status Code Description Response Headers
200 User created -
400 Bad Request -
403 Authentication error -
- */ - public UserResponse createUser(User user, CreateUserParams localVarParams) throws ApiException { - return createUserWithHttpInfo(user, localVarParams).getData(); - } - - /** - * Create user - * ### Overview Create a user for your organization. ### Arguments * **`handle`** [*required*]: The user handle, must be a valid email. * **`name`** [*optional*, *default*=**None**]: The name of the user. * **`access_role`** [*optional*, *default*=**st**]: The access role of the user. Choose from: * **st** (standard user), * **adm** (admin user), * **ro** (read-only user). **Note**: users can be created with admin access role only with application keys belonging to administrators. - * @param user User object that needs to be created (required) - * @return ApiResponse<UserResponse> - * @throws ApiException if fails to make API call - * @http.response.details - - - - - -
Status Code Description Response Headers
200 User created -
400 Bad Request -
403 Authentication error -
- */ - public ApiResponse createUserWithHttpInfo(User user, CreateUserParams localVarParams) throws ApiException { +private ApiResponse createUserWithHttpInfo(User user) throws ApiException { Object localVarPostBody = user; + // verify the required parameter 'user' is set if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling createUser"); } + // create path and map variables String localVarPath = "/api/v1/user"; @@ -113,51 +76,74 @@ public ApiResponse createUserWithHttpInfo(User user, CreateUserPar GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } - // DisableUserParams Parameters for the method 'disableUser' - public static class DisableUserParams { + + public class APIcreateUserRequest { + private User user; + + private APIcreateUserRequest(User user) { + this.user = user; + } + /** + * Execute createUser request + * @return UserResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 User created -
400 Bad Request -
403 Authentication error -
+ + */ + public UserResponse execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute createUser request with HTTP info returned + * @return ApiResponse<UserResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 User created -
400 Bad Request -
403 Authentication error -
+ + */ + + public ApiResponse executeWithHttpInfo() throws ApiException { + return createUserWithHttpInfo(user); + } } /** - * Disable user - * ### Overview Delete a user from an organization. **Note**: This endpoint can only be used with application keys belonging to administrators. ### Arguments * **`id`** [*required*]: The handle of the user. - * @param userHandle The handle of the user (required) - * @return UserDisableResponse + * Create user + * ### Overview Create a user for your organization. ### Arguments * **`handle`** [*required*]: The user handle, must be a valid email. * **`name`** [*optional*, *default*=**None**]: The name of the user. * **`access_role`** [*optional*, *default*=**st**]: The access role of the user. Choose from: * **st** (standard user), * **adm** (admin user), * **ro** (read-only user). **Note**: users can be created with admin access role only with application keys belonging to administrators. + * @param user User object that needs to be created (require) + * @return createUserRequest * @throws ApiException if fails to make API call - * @http.response.details - - - - - -
Status Code Description Response Headers
200 User disabled -
400 Bad Request -
403 Authentication error -
+ + */ - public UserDisableResponse disableUser(String userHandle, DisableUserParams localVarParams) throws ApiException { - return disableUserWithHttpInfo(userHandle, localVarParams).getData(); + + public APIcreateUserRequest createUser(User user) throws ApiException { + return new APIcreateUserRequest(user); } - /** - * Disable user - * ### Overview Delete a user from an organization. **Note**: This endpoint can only be used with application keys belonging to administrators. ### Arguments * **`id`** [*required*]: The handle of the user. - * @param userHandle The handle of the user (required) - * @return ApiResponse<UserDisableResponse> - * @throws ApiException if fails to make API call - * @http.response.details - - - - - -
Status Code Description Response Headers
200 User disabled -
400 Bad Request -
403 Authentication error -
- */ - public ApiResponse disableUserWithHttpInfo(String userHandle, DisableUserParams localVarParams) throws ApiException { +private ApiResponse disableUserWithHttpInfo(String userHandle) throws ApiException { Object localVarPostBody = null; + // verify the required parameter 'userHandle' is set if (userHandle == null) { throw new ApiException(400, "Missing the required parameter 'userHandle' when calling disableUser"); } + // create path and map variables String localVarPath = "/api/v1/user/{user_handle}" .replaceAll("\\{" + "user_handle" + "\\}", apiClient.escapeString(userHandle.toString())); @@ -187,45 +173,70 @@ public ApiResponse disableUserWithHttpInfo(String userHandl GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } - // GetAllUsersParams Parameters for the method 'getAllUsers' - public static class GetAllUsersParams { + + public class APIdisableUserRequest { + private String userHandle; + + private APIdisableUserRequest(String userHandle) { + this.userHandle = userHandle; + } + /** + * Execute disableUser request + * @return UserDisableResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 User disabled -
400 Bad Request -
403 Authentication error -
+ + */ + public UserDisableResponse execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute disableUser request with HTTP info returned + * @return ApiResponse<UserDisableResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 User disabled -
400 Bad Request -
403 Authentication error -
+ + */ + + public ApiResponse executeWithHttpInfo() throws ApiException { + return disableUserWithHttpInfo(userHandle); + } } /** - * Get all users - * ### Overview Get all users for your organization. ### Arguments This endpoint takes no JSON argument. - * @return UserListResponse + * Disable user + * ### Overview Delete a user from an organization. **Note**: This endpoint can only be used with application keys belonging to administrators. ### Arguments * **`id`** [*required*]: The handle of the user. + * @param userHandle The handle of the user (required) + + * @return disableUserRequest * @throws ApiException if fails to make API call - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Authentication error -
+ + */ - public UserListResponse getAllUsers(GetAllUsersParams localVarParams) throws ApiException { - return getAllUsersWithHttpInfo(localVarParams).getData(); + + public APIdisableUserRequest disableUser(String userHandle) throws ApiException { + return new APIdisableUserRequest(userHandle); } - /** - * Get all users - * ### Overview Get all users for your organization. ### Arguments This endpoint takes no JSON argument. - * @return ApiResponse<UserListResponse> - * @throws ApiException if fails to make API call - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Authentication error -
- */ - public ApiResponse getAllUsersWithHttpInfo(GetAllUsersParams localVarParams) throws ApiException { +private ApiResponse getAllUsersWithHttpInfo() throws ApiException { Object localVarPostBody = null; + // create path and map variables String localVarPath = "/api/v1/user"; @@ -254,51 +265,72 @@ public ApiResponse getAllUsersWithHttpInfo(GetAllUsersParams l GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } - // GetUserParams Parameters for the method 'getUser' - public static class GetUserParams { + + public class APIgetAllUsersRequest { + + private APIgetAllUsersRequest() { + } + + + /** + * Execute getAllUsers request + * @return UserListResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Authentication error -
+ + */ + public UserListResponse execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + /** + * Execute getAllUsers request with HTTP info returned + * @return ApiResponse<UserListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Authentication error -
+ + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getAllUsersWithHttpInfo(); + } } /** - * Get user - * ### Overview Get a user details. ### Arguments * **`user_handle`** [*required*]: The handle of the user. - * @param userHandle The id of the user (required) - * @return UserResponse + * Get all users + * ### Overview Get all users for your organization. ### Arguments This endpoint takes no JSON argument. + + * @return getAllUsersRequest * @throws ApiException if fails to make API call - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK for get user -
400 Bad Request -
403 Authentication error -
+ + */ - public UserResponse getUser(String userHandle, GetUserParams localVarParams) throws ApiException { - return getUserWithHttpInfo(userHandle, localVarParams).getData(); + + public APIgetAllUsersRequest getAllUsers() throws ApiException { + return new APIgetAllUsersRequest(); } - /** - * Get user - * ### Overview Get a user details. ### Arguments * **`user_handle`** [*required*]: The handle of the user. - * @param userHandle The id of the user (required) - * @return ApiResponse<UserResponse> - * @throws ApiException if fails to make API call - * @http.response.details - - - - - -
Status Code Description Response Headers
200 OK for get user -
400 Bad Request -
403 Authentication error -
- */ - public ApiResponse getUserWithHttpInfo(String userHandle, GetUserParams localVarParams) throws ApiException { +private ApiResponse getUserWithHttpInfo(String userHandle) throws ApiException { Object localVarPostBody = null; + // verify the required parameter 'userHandle' is set if (userHandle == null) { throw new ApiException(400, "Missing the required parameter 'userHandle' when calling getUser"); } + // create path and map variables String localVarPath = "/api/v1/user/{user_handle}" .replaceAll("\\{" + "user_handle" + "\\}", apiClient.escapeString(userHandle.toString())); @@ -328,57 +360,80 @@ public ApiResponse getUserWithHttpInfo(String userHandle, GetUserP GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } - // UpdateUserParams Parameters for the method 'updateUser' - public static class UpdateUserParams { + + public class APIgetUserRequest { + private String userHandle; + + private APIgetUserRequest(String userHandle) { + this.userHandle = userHandle; + } + /** + * Execute getUser request + * @return UserResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK for get user -
400 Bad Request -
403 Authentication error -
+ + */ + public UserResponse execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute getUser request with HTTP info returned + * @return ApiResponse<UserResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK for get user -
400 Bad Request -
403 Authentication error -
+ + */ + + public ApiResponse executeWithHttpInfo() throws ApiException { + return getUserWithHttpInfo(userHandle); + } } /** - * Update user - * ### Overview Update a user informations. **Note**: It can only be used with application keys belonging to administrators. ### Arguments * **`id`** [*required*]: The handle of the user. * **`name`** [*optional*, *default*=**None**]: The new name of the user. * **`email`** [*optional*, *default*=**None**]: The new email of the user. * **`disabled`** [*optional*, *default*=**None**]: The new disabled status of the user. * **`access_role`** [*optional*, *default*=**st**]: The access role of the user. Choose from: * **st** (standard user) * **adm** (admin user) * **ro** (read-only user) + * Get user + * ### Overview Get a user details. ### Arguments * **`user_handle`** [*required*]: The handle of the user. * @param userHandle The id of the user (required) - * @param user Description of the update (required) - * @return UserResponse + + * @return getUserRequest * @throws ApiException if fails to make API call - * @http.response.details - - - - - -
Status Code Description Response Headers
200 User updated -
400 Bad Request -
403 Authentication error -
+ + */ - public UserResponse updateUser(String userHandle, User user, UpdateUserParams localVarParams) throws ApiException { - return updateUserWithHttpInfo(userHandle, user, localVarParams).getData(); + + public APIgetUserRequest getUser(String userHandle) throws ApiException { + return new APIgetUserRequest(userHandle); } - /** - * Update user - * ### Overview Update a user informations. **Note**: It can only be used with application keys belonging to administrators. ### Arguments * **`id`** [*required*]: The handle of the user. * **`name`** [*optional*, *default*=**None**]: The new name of the user. * **`email`** [*optional*, *default*=**None**]: The new email of the user. * **`disabled`** [*optional*, *default*=**None**]: The new disabled status of the user. * **`access_role`** [*optional*, *default*=**st**]: The access role of the user. Choose from: * **st** (standard user) * **adm** (admin user) * **ro** (read-only user) - * @param userHandle The id of the user (required) - * @param user Description of the update (required) - * @return ApiResponse<UserResponse> - * @throws ApiException if fails to make API call - * @http.response.details - - - - - -
Status Code Description Response Headers
200 User updated -
400 Bad Request -
403 Authentication error -
- */ - public ApiResponse updateUserWithHttpInfo(String userHandle, User user, UpdateUserParams localVarParams) throws ApiException { +private ApiResponse updateUserWithHttpInfo(String userHandle, User user) throws ApiException { Object localVarPostBody = user; + // verify the required parameter 'userHandle' is set if (userHandle == null) { throw new ApiException(400, "Missing the required parameter 'userHandle' when calling updateUser"); } + // verify the required parameter 'user' is set if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling updateUser"); } + // create path and map variables String localVarPath = "/api/v1/user/{user_handle}" .replaceAll("\\{" + "user_handle" + "\\}", apiClient.escapeString(userHandle.toString())); @@ -408,4 +463,66 @@ public ApiResponse updateUserWithHttpInfo(String userHandle, User GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } + + public class APIupdateUserRequest { + private String userHandle; + private User user; + + private APIupdateUserRequest(String userHandle, User user) { + this.userHandle = userHandle; + this.user = user; + } + + + /** + * Execute updateUser request + * @return UserResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 User updated -
400 Bad Request -
403 Authentication error -
+ + */ + + public UserResponse execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute updateUser request with HTTP info returned + * @return ApiResponse<UserResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 User updated -
400 Bad Request -
403 Authentication error -
+ + */ + + public ApiResponse executeWithHttpInfo() throws ApiException { + return updateUserWithHttpInfo(userHandle, user); + } + } + + /** + * Update user + * ### Overview Update a user informations. **Note**: It can only be used with application keys belonging to administrators. ### Arguments * **`id`** [*required*]: The handle of the user. * **`name`** [*optional*, *default*=**None**]: The new name of the user. * **`email`** [*optional*, *default*=**None**]: The new email of the user. * **`disabled`** [*optional*, *default*=**None**]: The new disabled status of the user. * **`access_role`** [*optional*, *default*=**st**]: The access role of the user. Choose from: * **st** (standard user) * **adm** (admin user) * **ro** (read-only user) + * @param userHandle The id of the user (required) + * @param user Description of the update (require) + * @return updateUserRequest + * @throws ApiException if fails to make API call + + + */ + + public APIupdateUserRequest updateUser(String userHandle, User user) throws ApiException { + return new APIupdateUserRequest(userHandle, user); + } } diff --git a/src/test/java/com/datadog/api/v1/client/api/AwsIntegrationApiTest.java b/src/test/java/com/datadog/api/v1/client/api/AwsIntegrationApiTest.java index 0e13b0b4ab2..05d69b4ab3d 100644 --- a/src/test/java/com/datadog/api/v1/client/api/AwsIntegrationApiTest.java +++ b/src/test/java/com/datadog/api/v1/client/api/AwsIntegrationApiTest.java @@ -40,7 +40,7 @@ public static void initApi() { @After public void removeAccounts() throws ApiException { for (AWSAccount account: accountsToDelete) { - api.deleteAWSAccount(account, null); + api.deleteAWSAccount(account).execute(); } } @@ -72,7 +72,7 @@ public void createAWSAccountTest() throws ApiException { awsAccount.setAccountId("java_8234563"); awsAccount.setRoleName("java_testRoleName"); - AWSAccountCreateResponse createResponse = api.createAWSAccount(awsAccount, null); + AWSAccountCreateResponse createResponse = api.createAWSAccount(awsAccount).execute(); accountsToDelete.add(awsAccount); assertNotNull(createResponse.getExternalId()); @@ -88,7 +88,7 @@ public void createAWSAccountTest() throws ApiException { awsAccountFull.setHostTags(hostTags); awsAccountFull.addFilterTagsItem("dontCollect:java"); awsAccountFull.setAccountSpecificNamespaceRules(accountSpecificNamespaceRules); - AWSAccountCreateResponse createResponse2 = api.createAWSAccount(awsAccountFull, null); + AWSAccountCreateResponse createResponse2 = api.createAWSAccount(awsAccountFull).execute(); accountsToDelete.add(awsAccountFull); assertNotNull(createResponse2.getExternalId()); } @@ -107,7 +107,7 @@ public void createAWSAccountMissingIDTest() throws ApiException { //Test an exception is thrown if you're missing the account_id field AWSAccount awsAccount = new AWSAccount(); awsAccount.setRoleName("java_testRoleName"); - api.createAWSAccount(awsAccount, null); + api.createAWSAccount(awsAccount).execute(); } /** @@ -124,7 +124,7 @@ public void createAWSAccountMissingRoleNameTest() throws ApiException { //Test an exception is thrown if you're missing the role_name field AWSAccount awsAccount = new AWSAccount(); awsAccount.setAccountId("java_1234569"); - api.createAWSAccount(awsAccount, null); + api.createAWSAccount(awsAccount).execute(); } /** @@ -151,12 +151,11 @@ public void getAllAWSAccountsTest() throws ApiException { awsAccounts.get(i).addFilterTagsItem("dontCollect:java"); awsAccounts.get(i).setHostTags(hostTags); awsAccounts.get(i).setAccountSpecificNamespaceRules(accountSpecificNamespaceRules); - api.createAWSAccount(awsAccounts.get(i), null); + api.createAWSAccount(awsAccounts.get(i)).execute(); accountsToDelete.add(awsAccounts.get(i)); } - AwsIntegrationApi.GetAllAWSAccountsParams opts = new AwsIntegrationApi.GetAllAWSAccountsParams(); - List awsAllAccounts = api.getAllAWSAccounts(opts).getAccounts(); + List awsAllAccounts = api.getAllAWSAccounts().execute().getAccounts(); assertTrue(awsAllAccounts.size() >= 5); for (AWSAccount account: awsAccounts) { assertAccountIn(account, awsAllAccounts); @@ -178,7 +177,7 @@ public void updateAWSAccountTest() throws ApiException { awsAccount.setAccountId("java_1234565"); awsAccount.setRoleName("java_testRoleName"); - api.createAWSAccount(awsAccount, null); + api.createAWSAccount(awsAccount).execute(); accountsToDelete.add(awsAccount); List hostTags = new ArrayList(); @@ -186,15 +185,9 @@ public void updateAWSAccountTest() throws ApiException { hostTags.add("java:success"); awsAccount.setHostTags(hostTags); - AwsIntegrationApi.UpdateAWSAccountParams updateParams = new AwsIntegrationApi.UpdateAWSAccountParams() - .accountId(awsAccount.getAccountId()) - .roleName(awsAccount.getRoleName()); - api.updateAWSAccount(awsAccount, updateParams); + api.updateAWSAccount(awsAccount).accountId(awsAccount.getAccountId()).roleName(awsAccount.getRoleName()).execute(); - AwsIntegrationApi.GetAllAWSAccountsParams getParams = new AwsIntegrationApi.GetAllAWSAccountsParams() - .accountId(awsAccount.getAccountId()) - .roleName(awsAccount.getRoleName()); - AWSAccount newAccount = api.getAllAWSAccounts(getParams).getAccounts().get(0); + AWSAccount newAccount = api.getAllAWSAccounts().accountId(awsAccount.getAccountId()).roleName(awsAccount.getRoleName()).execute().getAccounts().get(0); // collection fields are intialized to null on the objects, but returned as empty list/map by API awsAccount.setAccountSpecificNamespaceRules(new HashMap()); awsAccount.setFilterTags(new ArrayList()); diff --git a/src/test/java/com/datadog/api/v1/client/api/DowntimesApiTest.java b/src/test/java/com/datadog/api/v1/client/api/DowntimesApiTest.java index cef4dff92ad..0b5c997403b 100644 --- a/src/test/java/com/datadog/api/v1/client/api/DowntimesApiTest.java +++ b/src/test/java/com/datadog/api/v1/client/api/DowntimesApiTest.java @@ -57,12 +57,12 @@ public void deleteDowntimes() throws ApiException { if (deleteDowntimes != null) { for (Long id : deleteDowntimes) { try { - api.getDowntime(id, null); + api.getDowntime(id).execute(); } catch (ApiException e) { // doesn't exist => continue continue; } - api.cancelDowntime(id, null); + api.cancelDowntime(id).execute(); } } } @@ -85,12 +85,12 @@ public void createModifyCancelDowntimeTest() throws ApiException { .recurrence(recurrence); // test creating downtime - Downtime obtained = api.createDowntime(downtime, null); + Downtime obtained = api.createDowntime(downtime).execute(); Long downtimeId = obtained.getId(); deleteDowntimes.add(downtimeId); // test getting downtime - obtained = api.getDowntime(downtimeId, null); + obtained = api.getDowntime(downtimeId).execute(); assertEquals(testingDowntimeScope, obtained.getScope()); assertEquals(testingDowntimeMessage, obtained.getMessage()); assertEquals(testingDowntimeStart, obtained.getStart()); @@ -102,7 +102,7 @@ public void createModifyCancelDowntimeTest() throws ApiException { // test updating downtime downtime.setMessage("New message"); - obtained = api.updateDowntime(downtimeId, downtime, null); + obtained = api.updateDowntime(downtimeId, downtime).execute(); assertEquals(testingDowntimeScope, obtained.getScope()); assertEquals("New message", obtained.getMessage()); @@ -114,8 +114,8 @@ public void createModifyCancelDowntimeTest() throws ApiException { assertEquals(testingUntilDowntimeRecurrenceOccurrences, obtained.getRecurrence().getUntilOccurrences()); // test canceling downtime - api.cancelDowntime(downtimeId, null); - obtained = api.getDowntime(downtimeId, null); + api.cancelDowntime(downtimeId).execute(); + obtained = api.getDowntime(downtimeId).execute(); assertNotNull(obtained.getCanceled()); } @@ -129,11 +129,10 @@ public void getAllDowntimesTest() throws ApiException { Downtime downtime = new Downtime() .scope(testingDowntimeScope) .message(prefix + testingDowntimeMessage); - Downtime created = api.createDowntime(downtime, null); + Downtime created = api.createDowntime(downtime).execute(); deleteDowntimes.add(created.getId()); } - DowntimesApi.GetAllDowntimesParams opts = new DowntimesApi.GetAllDowntimesParams().currentOnly(false); - List allDowntimes = api.getAllDowntimes(opts); + List allDowntimes = api.getAllDowntimes().currentOnly(false).execute(); for (String prefix: prefixes) { boolean found = false; for (Downtime downtime: allDowntimes) { @@ -157,16 +156,15 @@ public void cancelDowntimesByScopeTest() throws ApiException { Downtime downtime = new Downtime() .scope(prefix == "3" ? differentScope : testingDowntimeScope) .message(prefix + testingDowntimeMessage); - Downtime created = api.createDowntime(downtime, null); + Downtime created = api.createDowntime(downtime).execute(); deleteDowntimes.add(created.getId()); } // cancel downtimes 1 and 2 - api.cancelDowntimesByScope(new CancelDowntimesByScopeRequest().scope(testingDowntimeScope.get(0)), null); + api.cancelDowntimesByScope(new CancelDowntimesByScopeRequest().scope(testingDowntimeScope.get(0))).execute(); // verify that downtimes 1 and 2 are canceled - DowntimesApi.GetAllDowntimesParams opts = new DowntimesApi.GetAllDowntimesParams().currentOnly(false); - List allDowntimes = api.getAllDowntimes(opts); + List allDowntimes = api.getAllDowntimes().currentOnly(false).execute(); for (String prefix: prefixes) { boolean found = false; for (Downtime downtime: allDowntimes) { diff --git a/src/test/java/com/datadog/api/v1/client/api/MonitorsApiTest.java b/src/test/java/com/datadog/api/v1/client/api/MonitorsApiTest.java index 4cd7d3a7288..2048330ad6e 100644 --- a/src/test/java/com/datadog/api/v1/client/api/MonitorsApiTest.java +++ b/src/test/java/com/datadog/api/v1/client/api/MonitorsApiTest.java @@ -55,14 +55,12 @@ public void deleteMonitors() throws ApiException { if (deleteMonitors != null) { for (Long id : deleteMonitors) { try { - MonitorsApi.GetMonitorParams opts = new MonitorsApi.GetMonitorParams() - .groupStates("all"); - api.getMonitor(id, opts); + api.getMonitor(id).groupStates("all").execute(); } catch (ApiException e) { // doesn't exist => continue continue; } - api.deleteMonitor(id, null); + api.deleteMonitor(id).execute(); } } } @@ -85,13 +83,12 @@ public void monitorCreateModifyDeleteTest() throws ApiException { .options(options); // test creating monitor - Monitor obtained = api.createMonitor(monitor, null); + Monitor obtained = api.createMonitor(monitor).execute(); Long monitorId = obtained.getId(); deleteMonitors.add(monitorId); // test getting monitor - MonitorsApi.GetMonitorParams opts = new MonitorsApi.GetMonitorParams().groupStates("all"); - obtained = api.getMonitor(monitorId, opts); + obtained = api.getMonitor(monitorId).groupStates("all").execute(); assertEquals(testingMonitorName, obtained.getName()); assertEquals(testingMonitorType, obtained.getType()); assertEquals(testingMonitorQuery, obtained.getQuery()); @@ -102,7 +99,7 @@ public void monitorCreateModifyDeleteTest() throws ApiException { // test updating monitor obtained.setName("New name"); - obtained = api.editMonitor(monitorId, obtained, null); + obtained = api.editMonitor(monitorId, obtained).execute(); assertEquals("New name", obtained.getName()); assertEquals(testingMonitorType, obtained.getType()); @@ -113,10 +110,9 @@ public void monitorCreateModifyDeleteTest() throws ApiException { assertEquals(testingMonitorOptionsNoDataTimeframe, obtained.getOptions().getNoDataTimeframe()); // test deleting monitor - api.deleteMonitor(monitorId, null); + api.deleteMonitor(monitorId).execute(); try { - opts = new MonitorsApi.GetMonitorParams().groupStates("all"); - api.getMonitor(monitorId, opts); + api.getMonitor(monitorId).groupStates("all").execute(); // junit 4 doesn't have better support for asserting that method threw an error assertTrue(false); } catch (ApiException e) { @@ -135,11 +131,10 @@ public void getAllMonitorsTest() throws ApiException { .name(prefix + testingMonitorName) .type(testingMonitorType) .query(testingMonitorQuery); - Monitor created = api.createMonitor(monitor, null); + Monitor created = api.createMonitor(monitor).execute(); deleteMonitors.add(created.getId()); } - MonitorsApi.GetAllMonitorsParams opts = new MonitorsApi.GetAllMonitorsParams(); - List allMonitors = api.getAllMonitors(opts); + List allMonitors = api.getAllMonitors().execute(); for (String prefix: prefixes) { boolean found = false; for (Monitor monitor: allMonitors) { @@ -170,11 +165,11 @@ public void validateMonitorTest() throws ApiException { .options(options); // if this doesn't throw exception, everything is fine - api.validateMonitor(monitor, null); + api.validateMonitor(monitor).execute(); monitor.setQuery("avg(last_5m):sum:system.net.bytes_rcvd{host:host0} ><><>< whaaaaaaa?"); try { - api.validateMonitor(monitor, null); + api.validateMonitor(monitor).execute(); // junit 4 doesn't have better support for asserting that method threw an error assertTrue(false); } catch (ApiException e) { diff --git a/src/test/java/com/datadog/api/v1/client/api/UsersApiTest.java b/src/test/java/com/datadog/api/v1/client/api/UsersApiTest.java index 783e08eb7ca..7cac0d92530 100644 --- a/src/test/java/com/datadog/api/v1/client/api/UsersApiTest.java +++ b/src/test/java/com/datadog/api/v1/client/api/UsersApiTest.java @@ -50,9 +50,9 @@ public static void initApi() { public void disableUsers() throws ApiException { if (disableUsers != null) { for (String handle: disableUsers) { - UserResponse ugr = api.getUser(handle, null); + UserResponse ugr = api.getUser(handle).execute(); if (!ugr.getUser().getDisabled()) { - api.disableUser(handle, null); + api.disableUser(handle).execute(); } } } @@ -68,7 +68,7 @@ public void userCreateModifyDisableTest() throws ApiException { user.setAccessRole(testingUserAR); user.setHandle(testingUserHandle); user.setName(testingUserName); - UserResponse response = api.createUser(user, null); + UserResponse response = api.createUser(user).execute(); // If something fails, make sure we disable the user disableUsers.add(testingUserHandle); @@ -80,20 +80,20 @@ public void userCreateModifyDisableTest() throws ApiException { // Now test updating user user.setName("Updated Name"); user.setDisabled(false); - response = api.updateUser(user.getHandle(), user, null); + response = api.updateUser(user.getHandle(), user).execute(); assertEquals("Updated Name", response.getUser().getName()); // Now test getting user - response = api.getUser(user.getHandle(), null); + response = api.getUser(user.getHandle()).execute(); assertEquals(testingUserHandle, response.getUser().getHandle()); assertEquals("Updated Name", response.getUser().getName()); assertEquals(testingUserAR.toString(), response.getUser().getAccessRole().toString()); assertEquals(false, response.getUser().getDisabled()); // Now test disabling user - api.disableUser(user.getHandle(), null); - response = api.getUser(user.getHandle(), null); + api.disableUser(user.getHandle()).execute(); + response = api.getUser(user.getHandle()).execute(); assertEquals(true, response.getUser().getDisabled()); } @@ -108,10 +108,10 @@ public void getAllUsersTest() throws ApiException { user.setAccessRole(testingUserAR); user.setHandle(prefix + testingUserHandle); user.setName(prefix + testingUserName); - UserResponse response = api.createUser(user, null); + UserResponse response = api.createUser(user).execute(); disableUsers.add(response.getUser().getHandle()); } - UserListResponse response = api.getAllUsers(null); + UserListResponse response = api.getAllUsers().execute(); List users = response.getUsers(); for (String prefix: prefixes) { boolean found = false;