diff --git a/.apigentools-info b/.apigentools-info
index b5ba7cf76ce..be25437e4ca 100644
--- a/.apigentools-info
+++ b/.apigentools-info
@@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
- "regenerated": "2025-01-16 23:13:39.398933",
- "spec_repo_commit": "0ad24d9f"
+ "regenerated": "2025-01-17 14:24:04.348476",
+ "spec_repo_commit": "60205e12"
},
"v2": {
"apigentools_version": "1.6.6",
- "regenerated": "2025-01-16 23:13:39.417483",
- "spec_repo_commit": "0ad24d9f"
+ "regenerated": "2025-01-17 14:24:04.364670",
+ "spec_repo_commit": "60205e12"
}
}
}
\ No newline at end of file
diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml
index 763dc802779..c0f7b54f032 100644
--- a/.generator/schemas/v2/openapi.yaml
+++ b/.generator/schemas/v2/openapi.yaml
@@ -206,6 +206,13 @@ components:
required: true
schema:
type: string
+ ConnectionId:
+ description: The ID of the action connection
+ in: path
+ name: connection_id
+ required: true
+ schema:
+ type: string
CustomDestinationId:
description: The ID of the custom destination.
in: path
@@ -1210,6 +1217,64 @@ components:
required:
- data
type: object
+ AWSAssumeRole:
+ description: The definition of `AWSAssumeRole` object.
+ properties:
+ account_id:
+ description: AWS account the connection is created for
+ example: '111222333444'
+ pattern: ^\d{12}$
+ type: string
+ external_id:
+ description: External ID used to scope which connection can be used to assume
+ the role
+ example: 33a1011635c44b38a064cf14e82e1d8f
+ readOnly: true
+ type: string
+ principal_id:
+ description: AWS account that will assume the role
+ example: '123456789012'
+ readOnly: true
+ type: string
+ role:
+ description: Role to assume
+ example: my-role
+ type: string
+ type:
+ $ref: '#/components/schemas/AWSAssumeRoleType'
+ required:
+ - type
+ - account_id
+ - role
+ type: object
+ AWSAssumeRoleType:
+ description: The definition of `AWSAssumeRoleType` object.
+ enum:
+ - AWSAssumeRole
+ example: AWSAssumeRole
+ type: string
+ x-enum-varnames:
+ - AWSASSUMEROLE
+ AWSAssumeRoleUpdate:
+ description: The definition of `AWSAssumeRoleUpdate` object.
+ properties:
+ account_id:
+ description: AWS account the connection is created for
+ example: '111222333444'
+ pattern: ^\d{12}$
+ type: string
+ generate_new_external_id:
+ description: The `AWSAssumeRoleUpdate` `generate_new_external_id`.
+ type: boolean
+ role:
+ description: Role to assume
+ example: my-role
+ type: string
+ type:
+ $ref: '#/components/schemas/AWSAssumeRoleType'
+ required:
+ - type
+ type: object
AWSAuthConfig:
description: AWS Authentication config.
oneOf:
@@ -1248,6 +1313,43 @@ components:
required:
- role_name
type: object
+ AWSCredentials:
+ description: The definition of `AWSCredentials` object.
+ oneOf:
+ - $ref: '#/components/schemas/AWSAssumeRole'
+ AWSCredentialsUpdate:
+ description: The definition of `AWSCredentialsUpdate` object.
+ oneOf:
+ - $ref: '#/components/schemas/AWSAssumeRoleUpdate'
+ AWSIntegration:
+ description: The definition of `AWSIntegration` object.
+ properties:
+ credentials:
+ $ref: '#/components/schemas/AWSCredentials'
+ type:
+ $ref: '#/components/schemas/AWSIntegrationType'
+ required:
+ - type
+ - credentials
+ type: object
+ AWSIntegrationType:
+ description: The definition of `AWSIntegrationType` object.
+ enum:
+ - AWS
+ example: AWS
+ type: string
+ x-enum-varnames:
+ - AWS
+ AWSIntegrationUpdate:
+ description: The definition of `AWSIntegrationUpdate` object.
+ properties:
+ credentials:
+ $ref: '#/components/schemas/AWSCredentialsUpdate'
+ type:
+ $ref: '#/components/schemas/AWSIntegrationType'
+ required:
+ - type
+ type: object
AWSLambdaForwarderConfig:
description: 'Log Autosubscription configuration for Datadog Forwarder Lambda
functions. Automatically set up triggers for existing
@@ -1561,6 +1663,73 @@ components:
xray_services:
$ref: '#/components/schemas/XRayServicesList'
type: object
+ ActionConnectionAttributes:
+ description: The definition of `ActionConnectionAttributes` object.
+ properties:
+ integration:
+ $ref: '#/components/schemas/ActionConnectionIntegration'
+ name:
+ description: Name of the connection
+ example: My AWS Connection
+ type: string
+ required:
+ - name
+ - integration
+ type: object
+ ActionConnectionAttributesUpdate:
+ description: The definition of `ActionConnectionAttributesUpdate` object.
+ properties:
+ integration:
+ $ref: '#/components/schemas/ActionConnectionIntegrationUpdate'
+ name:
+ description: Name of the connection
+ example: My AWS Connection
+ type: string
+ type: object
+ ActionConnectionData:
+ description: Data related to the connection.
+ properties:
+ attributes:
+ $ref: '#/components/schemas/ActionConnectionAttributes'
+ id:
+ description: The connection identifier
+ readOnly: true
+ type: string
+ type:
+ $ref: '#/components/schemas/ActionConnectionDataType'
+ required:
+ - type
+ - attributes
+ type: object
+ ActionConnectionDataType:
+ description: The definition of `ActionConnectionDataType` object.
+ enum:
+ - action_connection
+ example: action_connection
+ type: string
+ x-enum-varnames:
+ - ACTION_CONNECTION
+ ActionConnectionDataUpdate:
+ description: Data related to the connection update.
+ properties:
+ attributes:
+ $ref: '#/components/schemas/ActionConnectionAttributesUpdate'
+ type:
+ $ref: '#/components/schemas/ActionConnectionDataType'
+ required:
+ - type
+ - attributes
+ type: object
+ ActionConnectionIntegration:
+ description: The definition of `ActionConnectionIntegration` object.
+ oneOf:
+ - $ref: '#/components/schemas/AWSIntegration'
+ - $ref: '#/components/schemas/HTTPIntegration'
+ ActionConnectionIntegrationUpdate:
+ description: The definition of `ActionConnectionIntegrationUpdate` object.
+ oneOf:
+ - $ref: '#/components/schemas/AWSIntegrationUpdate'
+ - $ref: '#/components/schemas/HTTPIntegrationUpdate'
ActiveBillingDimensionsAttributes:
description: List of active billing dimensions.
properties:
@@ -7020,6 +7189,20 @@ components:
type: string
x-enum-varnames:
- COST_BY_ORG
+ CreateActionConnectionRequest:
+ description: Request used to create an action connection.
+ properties:
+ data:
+ $ref: '#/components/schemas/ActionConnectionData'
+ required:
+ - data
+ type: object
+ CreateActionConnectionResponse:
+ description: The response for a created connection
+ properties:
+ data:
+ $ref: '#/components/schemas/ActionConnectionData'
+ type: object
CreateAppRequest:
description: The definition of `CreateAppRequest` object.
example:
@@ -12230,6 +12413,12 @@ components:
type: string
x-enum-varnames:
- GCP_SERVICE_ACCOUNT
+ GetActionConnectionResponse:
+ description: The response for found connection
+ properties:
+ data:
+ $ref: '#/components/schemas/ActionConnectionData'
+ type: object
GetAppResponse:
description: The definition of `GetAppResponse` object.
properties:
@@ -12524,6 +12713,18 @@ components:
example: env:production
type: string
type: array
+ HTTPBody:
+ description: The definition of `HTTPBody` object.
+ properties:
+ content:
+ description: Serialized body content
+ example: '{"some-json": "with-value"}'
+ type: string
+ content_type:
+ description: Content type of the body
+ example: application/json
+ type: string
+ type: object
HTTPCIAppError:
description: List of errors.
properties:
@@ -12549,6 +12750,88 @@ components:
$ref: '#/components/schemas/HTTPCIAppError'
type: array
type: object
+ HTTPCredentials:
+ description: The definition of `HTTPCredentials` object.
+ oneOf:
+ - $ref: '#/components/schemas/HTTPTokenAuth'
+ HTTPCredentialsUpdate:
+ description: The definition of `HTTPCredentialsUpdate` object.
+ oneOf:
+ - $ref: '#/components/schemas/HTTPTokenAuthUpdate'
+ HTTPHeader:
+ description: The definition of `HTTPHeader` object.
+ properties:
+ name:
+ description: The `HTTPHeader` `name`.
+ example: MyHttpHeader
+ pattern: ^[A-Za-z][A-Za-z\\d\\-\\_]*$
+ type: string
+ value:
+ description: The `HTTPHeader` `value`.
+ example: Some header value
+ type: string
+ required:
+ - name
+ - value
+ type: object
+ HTTPHeaderUpdate:
+ description: The definition of `HTTPHeaderUpdate` object.
+ properties:
+ deleted:
+ description: Should the header be deleted.
+ type: boolean
+ name:
+ description: The `HTTPHeaderUpdate` `name`.
+ example: MyHttpHeader
+ pattern: ^[A-Za-z][A-Za-z\\d\\-\\_]*$
+ type: string
+ value:
+ description: The `HTTPHeaderUpdate` `value`.
+ example: Updated Header Value
+ type: string
+ required:
+ - name
+ type: object
+ HTTPIntegration:
+ description: The definition of `HTTPIntegration` object.
+ properties:
+ base_url:
+ description: Base HTTP url for the integration
+ example: http://datadoghq.com
+ pattern: url
+ type: string
+ credentials:
+ $ref: '#/components/schemas/HTTPCredentials'
+ type:
+ $ref: '#/components/schemas/HTTPIntegrationType'
+ required:
+ - type
+ - base_url
+ - credentials
+ type: object
+ HTTPIntegrationType:
+ description: The definition of `HTTPIntegrationType` object.
+ enum:
+ - HTTP
+ example: HTTP
+ type: string
+ x-enum-varnames:
+ - HTTP
+ HTTPIntegrationUpdate:
+ description: The definition of `HTTPIntegrationUpdate` object.
+ properties:
+ base_url:
+ description: Base HTTP url for the integration
+ example: http://datadoghq.com
+ pattern: url
+ type: string
+ credentials:
+ $ref: '#/components/schemas/HTTPCredentialsUpdate'
+ type:
+ $ref: '#/components/schemas/HTTPIntegrationType'
+ required:
+ - type
+ type: object
HTTPLog:
description: Structured log message.
items:
@@ -12625,6 +12908,105 @@ components:
required:
- message
type: object
+ HTTPToken:
+ description: The definition of `HTTPToken` object.
+ properties:
+ name:
+ description: The `HTTPToken` `name`.
+ example: MyToken
+ pattern: ^[A-Za-z][A-Za-z\\d]*$
+ type: string
+ type:
+ $ref: '#/components/schemas/TokenType'
+ value:
+ description: The `HTTPToken` `value`.
+ example: Some Token Value
+ type: string
+ required:
+ - name
+ - value
+ - type
+ type: object
+ HTTPTokenAuth:
+ description: The definition of `HTTPTokenAuth` object.
+ properties:
+ body:
+ $ref: '#/components/schemas/HTTPBody'
+ headers:
+ description: The `HTTPTokenAuth` `headers`.
+ items:
+ $ref: '#/components/schemas/HTTPHeader'
+ type: array
+ tokens:
+ description: The `HTTPTokenAuth` `tokens`.
+ items:
+ $ref: '#/components/schemas/HTTPToken'
+ type: array
+ type:
+ $ref: '#/components/schemas/HTTPTokenAuthType'
+ url_parameters:
+ description: The `HTTPTokenAuth` `url_parameters`.
+ items:
+ $ref: '#/components/schemas/UrlParam'
+ type: array
+ required:
+ - type
+ type: object
+ HTTPTokenAuthType:
+ description: The definition of `HTTPTokenAuthType` object.
+ enum:
+ - HTTPTokenAuth
+ example: HTTPTokenAuth
+ type: string
+ x-enum-varnames:
+ - HTTPTOKENAUTH
+ HTTPTokenAuthUpdate:
+ description: The definition of `HTTPTokenAuthUpdate` object.
+ properties:
+ body:
+ $ref: '#/components/schemas/HTTPBody'
+ headers:
+ description: The `HTTPTokenAuthUpdate` `headers`.
+ items:
+ $ref: '#/components/schemas/HTTPHeaderUpdate'
+ type: array
+ tokens:
+ description: The `HTTPTokenAuthUpdate` `tokens`.
+ items:
+ $ref: '#/components/schemas/HTTPTokenUpdate'
+ type: array
+ type:
+ $ref: '#/components/schemas/HTTPTokenAuthType'
+ url_parameters:
+ description: The `HTTPTokenAuthUpdate` `url_parameters`.
+ items:
+ $ref: '#/components/schemas/UrlParamUpdate'
+ type: array
+ required:
+ - type
+ type: object
+ HTTPTokenUpdate:
+ description: The definition of `HTTPTokenUpdate` object.
+ properties:
+ deleted:
+ description: Should the header be deleted.
+ type: boolean
+ name:
+ description: The `HTTPToken` `name`.
+ example: MyToken
+ pattern: ^[A-Za-z][A-Za-z\\d]*$
+ type: string
+ type:
+ $ref: '#/components/schemas/TokenType'
+ value:
+ description: The `HTTPToken` `value`.
+ example: Some Token Value
+ type: string
+ required:
+ - name
+ - type
+ - value
+ type: object
HistoricalJobDataType:
description: Type of payload.
enum:
@@ -28735,6 +29117,19 @@ components:
items:
$ref: '#/components/schemas/TimeseriesResponseValues'
type: array
+ TokenName:
+ description: Name for tokens.
+ example: MyTokenName
+ pattern: ^[A-Za-z][A-Za-z\\d]*$
+ type: string
+ TokenType:
+ description: The definition of `TokenType` object.
+ enum:
+ - SECRET
+ example: SECRET
+ type: string
+ x-enum-varnames:
+ - SECRET
Unit:
description: Object containing the metric unit family, scale factor, name, and
short name.
@@ -28763,6 +29158,20 @@ components:
example: min
type: string
type: object
+ UpdateActionConnectionRequest:
+ description: Request used to update an action connection.
+ properties:
+ data:
+ $ref: '#/components/schemas/ActionConnectionDataUpdate'
+ required:
+ - data
+ type: object
+ UpdateActionConnectionResponse:
+ description: The response for an updated connection.
+ properties:
+ data:
+ $ref: '#/components/schemas/ActionConnectionData'
+ type: object
UpdateAppRequest:
description: The definition of `UpdateAppRequest` object.
example:
@@ -29033,6 +29442,36 @@ components:
description: Upsert entity response included item.
oneOf:
- $ref: '#/components/schemas/EntityResponseIncludedSchema'
+ UrlParam:
+ description: The definition of `UrlParam` object.
+ properties:
+ name:
+ $ref: '#/components/schemas/TokenName'
+ example: MyUrlParameter
+ value:
+ description: The `UrlParam` `value`.
+ example: Some Url Parameter value
+ type: string
+ required:
+ - name
+ - value
+ type: object
+ UrlParamUpdate:
+ description: The definition of `UrlParamUpdate` object.
+ properties:
+ deleted:
+ description: Should the header be deleted.
+ type: boolean
+ name:
+ $ref: '#/components/schemas/TokenName'
+ example: MyUrlParameter
+ value:
+ description: The `UrlParamUpdate` `value`.
+ example: Some Url Parameter value
+ type: string
+ required:
+ - name
+ type: object
UsageApplicationSecurityMonitoringResponse:
description: Application Security Monitoring usage response.
properties:
@@ -30274,6 +30713,163 @@ info:
version: '1.0'
openapi: 3.0.0
paths:
+ /api/v2/actions/connections:
+ post:
+ description: Create a new Action Connection
+ operationId: CreateActionConnection
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CreateActionConnectionRequest'
+ required: true
+ responses:
+ '201':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CreateActionConnectionResponse'
+ description: Successfully created Action Connection
+ '400':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Bad Request
+ '403':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Forbidden
+ '429':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Too Many Request
+ summary: Create a new Action Connection
+ tags:
+ - Action Connection
+ /api/v2/actions/connections/{connection_id}:
+ delete:
+ description: Delete an existing Action Connection
+ operationId: DeleteActionConnection
+ parameters:
+ - $ref: '#/components/parameters/ConnectionId'
+ responses:
+ '204':
+ description: The resource was deleted successfully.
+ '403':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Forbidden
+ '404':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Not Found
+ '429':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Too Many Request
+ summary: Delete an existing Action Connection
+ tags:
+ - Action Connection
+ x-permission:
+ operator: OR
+ permissions:
+ - connection_write
+ get:
+ description: Get an existing Action Connection
+ operationId: GetActionConnection
+ parameters:
+ - $ref: '#/components/parameters/ConnectionId'
+ responses:
+ '200':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/GetActionConnectionResponse'
+ description: Successfully get Action Connection
+ '400':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Bad Request
+ '403':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Forbidden
+ '404':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Not Found
+ '429':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Too Many Request
+ summary: Get an existing Action Connection
+ tags:
+ - Action Connection
+ patch:
+ description: Update an existing Action Connection
+ operationId: UpdateActionConnection
+ parameters:
+ - $ref: '#/components/parameters/ConnectionId'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/UpdateActionConnectionRequest'
+ description: Update an existing Action Connection request body
+ required: true
+ responses:
+ '200':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/UpdateActionConnectionResponse'
+ description: Successfully updated Action Connection
+ '400':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Bad Request
+ '403':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Forbidden
+ '404':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Not Found
+ '429':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Too Many Request
+ summary: Update an existing Action Connection
+ tags:
+ - Action Connection
/api/v2/agentless_scanning/accounts/aws:
get:
description: Fetches the scan options configured for AWS accounts.
@@ -48218,6 +48814,17 @@ tags:
externalDocs:
url: https://docs.datadoghq.com/integrations/amazon_web_services/#log-collection
name: AWS Logs Integration
+- description: "Action connections extend your installed integrations and allow you
+ to take action in your third-party systems\n(e.g. AWS, GitLab, and Statuspage)
+ with Datadog\u2019s Workflow Automation and App Builder products.\n\nDatadog\u2019s
+ Integrations automatically provide authentication for Slack, Microsoft Teams,
+ PagerDuty, Opsgenie,\nJIRA, GitHub, and Statuspage. You do not need additional
+ connections in order to access these tools within\nWorkflow Automation and App
+ Builder.\n\nWe offer granular access control for editing and resolving connections."
+ externalDocs:
+ description: Find out more at
+ url: https://docs.datadoghq.com/service_management/workflows/connections/
+ name: Action Connection
- description: "Datadog Agentless Scanning provides visibility into risks and vulnerabilities\nwithin
your hosts, running containers, and serverless functions\u2014all without\nrequiring
teams to install Agents on every host or where Agents cannot be installed.\nGo
diff --git a/examples/v2/action-connection/CreateActionConnection.java b/examples/v2/action-connection/CreateActionConnection.java
new file mode 100644
index 00000000000..ba3ebb320f5
--- /dev/null
+++ b/examples/v2/action-connection/CreateActionConnection.java
@@ -0,0 +1,53 @@
+// Create a new Action Connection returns "Successfully created Action Connection" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ActionConnectionApi;
+import com.datadog.api.client.v2.model.AWSAssumeRole;
+import com.datadog.api.client.v2.model.AWSAssumeRoleType;
+import com.datadog.api.client.v2.model.AWSCredentials;
+import com.datadog.api.client.v2.model.AWSIntegration;
+import com.datadog.api.client.v2.model.AWSIntegrationType;
+import com.datadog.api.client.v2.model.ActionConnectionAttributes;
+import com.datadog.api.client.v2.model.ActionConnectionData;
+import com.datadog.api.client.v2.model.ActionConnectionDataType;
+import com.datadog.api.client.v2.model.ActionConnectionIntegration;
+import com.datadog.api.client.v2.model.CreateActionConnectionRequest;
+import com.datadog.api.client.v2.model.CreateActionConnectionResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ ActionConnectionApi apiInstance = new ActionConnectionApi(defaultClient);
+
+ CreateActionConnectionRequest body =
+ new CreateActionConnectionRequest()
+ .data(
+ new ActionConnectionData()
+ .type(ActionConnectionDataType.ACTION_CONNECTION)
+ .attributes(
+ new ActionConnectionAttributes()
+ .name("Cassette Connection DELETE_ME")
+ .integration(
+ new ActionConnectionIntegration(
+ new AWSIntegration()
+ .type(AWSIntegrationType.AWS)
+ .credentials(
+ new AWSCredentials(
+ new AWSAssumeRole()
+ .type(AWSAssumeRoleType.AWSASSUMEROLE)
+ .role("MyRoleUpdated")
+ .accountId("123456789123")))))));
+
+ try {
+ CreateActionConnectionResponse result = apiInstance.createActionConnection(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ActionConnectionApi#createActionConnection");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/action-connection/DeleteActionConnection.java b/examples/v2/action-connection/DeleteActionConnection.java
new file mode 100644
index 00000000000..82c29b140fe
--- /dev/null
+++ b/examples/v2/action-connection/DeleteActionConnection.java
@@ -0,0 +1,22 @@
+// Delete an existing Action Connection returns "The resource was deleted successfully." response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ActionConnectionApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ ActionConnectionApi apiInstance = new ActionConnectionApi(defaultClient);
+
+ try {
+ apiInstance.deleteActionConnection("connection_id");
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ActionConnectionApi#deleteActionConnection");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/action-connection/DeleteActionConnection_2142905164.java b/examples/v2/action-connection/DeleteActionConnection_2142905164.java
new file mode 100644
index 00000000000..36251908ae8
--- /dev/null
+++ b/examples/v2/action-connection/DeleteActionConnection_2142905164.java
@@ -0,0 +1,25 @@
+// Delete an existing Action Connection returns "Successfully deleted Action Connection" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ActionConnectionApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ ActionConnectionApi apiInstance = new ActionConnectionApi(defaultClient);
+
+ // there is a valid "action_connection" in the system
+ String ACTION_CONNECTION_DATA_ID = System.getenv("ACTION_CONNECTION_DATA_ID");
+
+ try {
+ apiInstance.deleteActionConnection(ACTION_CONNECTION_DATA_ID);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ActionConnectionApi#deleteActionConnection");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/action-connection/GetActionConnection.java b/examples/v2/action-connection/GetActionConnection.java
new file mode 100644
index 00000000000..8435f61c17e
--- /dev/null
+++ b/examples/v2/action-connection/GetActionConnection.java
@@ -0,0 +1,25 @@
+// Get an existing Action Connection returns "Successfully get Action Connection" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ActionConnectionApi;
+import com.datadog.api.client.v2.model.GetActionConnectionResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ ActionConnectionApi apiInstance = new ActionConnectionApi(defaultClient);
+
+ try {
+ GetActionConnectionResponse result =
+ apiInstance.getActionConnection("cb460d51-3c88-4e87-adac-d47131d0423d");
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ActionConnectionApi#getActionConnection");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/action-connection/UpdateActionConnection.java b/examples/v2/action-connection/UpdateActionConnection.java
new file mode 100644
index 00000000000..7e76b9c6a09
--- /dev/null
+++ b/examples/v2/action-connection/UpdateActionConnection.java
@@ -0,0 +1,54 @@
+// Update an existing Action Connection returns "Successfully updated Action Connection" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ActionConnectionApi;
+import com.datadog.api.client.v2.model.AWSAssumeRoleType;
+import com.datadog.api.client.v2.model.AWSAssumeRoleUpdate;
+import com.datadog.api.client.v2.model.AWSCredentialsUpdate;
+import com.datadog.api.client.v2.model.AWSIntegrationType;
+import com.datadog.api.client.v2.model.AWSIntegrationUpdate;
+import com.datadog.api.client.v2.model.ActionConnectionAttributesUpdate;
+import com.datadog.api.client.v2.model.ActionConnectionDataType;
+import com.datadog.api.client.v2.model.ActionConnectionDataUpdate;
+import com.datadog.api.client.v2.model.ActionConnectionIntegrationUpdate;
+import com.datadog.api.client.v2.model.UpdateActionConnectionRequest;
+import com.datadog.api.client.v2.model.UpdateActionConnectionResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ ActionConnectionApi apiInstance = new ActionConnectionApi(defaultClient);
+
+ UpdateActionConnectionRequest body =
+ new UpdateActionConnectionRequest()
+ .data(
+ new ActionConnectionDataUpdate()
+ .type(ActionConnectionDataType.ACTION_CONNECTION)
+ .attributes(
+ new ActionConnectionAttributesUpdate()
+ .name("Cassette Connection")
+ .integration(
+ new ActionConnectionIntegrationUpdate(
+ new AWSIntegrationUpdate()
+ .type(AWSIntegrationType.AWS)
+ .credentials(
+ new AWSCredentialsUpdate(
+ new AWSAssumeRoleUpdate()
+ .type(AWSAssumeRoleType.AWSASSUMEROLE)
+ .role("MyRoleUpdated")
+ .accountId("123456789123")))))));
+
+ try {
+ UpdateActionConnectionResponse result =
+ apiInstance.updateActionConnection("cb460d51-3c88-4e87-adac-d47131d0423d", body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ActionConnectionApi#updateActionConnection");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/api/ActionConnectionApi.java b/src/main/java/com/datadog/api/client/v2/api/ActionConnectionApi.java
new file mode 100644
index 00000000000..cfecde0eace
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/api/ActionConnectionApi.java
@@ -0,0 +1,627 @@
+package com.datadog.api.client.v2.api;
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.ApiResponse;
+import com.datadog.api.client.Pair;
+import com.datadog.api.client.v2.model.CreateActionConnectionRequest;
+import com.datadog.api.client.v2.model.CreateActionConnectionResponse;
+import com.datadog.api.client.v2.model.GetActionConnectionResponse;
+import com.datadog.api.client.v2.model.UpdateActionConnectionRequest;
+import com.datadog.api.client.v2.model.UpdateActionConnectionResponse;
+import jakarta.ws.rs.client.Invocation;
+import jakarta.ws.rs.core.GenericType;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class ActionConnectionApi {
+ private ApiClient apiClient;
+
+ public ActionConnectionApi() {
+ this(ApiClient.getDefaultApiClient());
+ }
+
+ public ActionConnectionApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Get the API client.
+ *
+ * @return API client
+ */
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ /**
+ * Set the API client.
+ *
+ * @param apiClient an instance of API client
+ */
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Create a new Action Connection.
+ *
+ *
See {@link #createActionConnectionWithHttpInfo}.
+ *
+ * @param body (required)
+ * @return CreateActionConnectionResponse
+ * @throws ApiException if fails to make API call
+ */
+ public CreateActionConnectionResponse createActionConnection(CreateActionConnectionRequest body)
+ throws ApiException {
+ return createActionConnectionWithHttpInfo(body).getData();
+ }
+
+ /**
+ * Create a new Action Connection.
+ *
+ *
See {@link #createActionConnectionWithHttpInfoAsync}.
+ *
+ * @param body (required)
+ * @return CompletableFuture<CreateActionConnectionResponse>
+ */
+ public CompletableFuture createActionConnectionAsync(
+ CreateActionConnectionRequest body) {
+ return createActionConnectionWithHttpInfoAsync(body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Create a new Action Connection
+ *
+ * @param body (required)
+ * @return ApiResponse<CreateActionConnectionResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 201 | Successfully created Action Connection | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too Many Request | - |
+ *
+ */
+ public ApiResponse createActionConnectionWithHttpInfo(
+ CreateActionConnectionRequest body) throws ApiException {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'body' when calling createActionConnection");
+ }
+ // create path and map variables
+ String localVarPath = "/api/v2/actions/connections";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.ActionConnectionApi.createActionConnection",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Create a new Action Connection.
+ *
+ * See {@link #createActionConnectionWithHttpInfo}.
+ *
+ * @param body (required)
+ * @return CompletableFuture<ApiResponse<CreateActionConnectionResponse>>
+ */
+ public CompletableFuture>
+ createActionConnectionWithHttpInfoAsync(CreateActionConnectionRequest body) {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'body' when calling createActionConnection"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath = "/api/v2/actions/connections";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.ActionConnectionApi.createActionConnection",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Delete an existing Action Connection.
+ *
+ * See {@link #deleteActionConnectionWithHttpInfo}.
+ *
+ * @param connectionId The ID of the action connection (required)
+ * @throws ApiException if fails to make API call
+ */
+ public void deleteActionConnection(String connectionId) throws ApiException {
+ deleteActionConnectionWithHttpInfo(connectionId);
+ }
+
+ /**
+ * Delete an existing Action Connection.
+ *
+ *
See {@link #deleteActionConnectionWithHttpInfoAsync}.
+ *
+ * @param connectionId The ID of the action connection (required)
+ * @return CompletableFuture
+ */
+ public CompletableFuture deleteActionConnectionAsync(String connectionId) {
+ return deleteActionConnectionWithHttpInfoAsync(connectionId)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Delete an existing Action Connection
+ *
+ * @param connectionId The ID of the action connection (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 204 | The resource was deleted successfully. | - |
+ * | 403 | Forbidden | - |
+ * | 404 | Not Found | - |
+ * | 429 | Too Many Request | - |
+ *
+ */
+ public ApiResponse deleteActionConnectionWithHttpInfo(String connectionId)
+ throws ApiException {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'connectionId' is set
+ if (connectionId == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'connectionId' when calling deleteActionConnection");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/actions/connections/{connection_id}"
+ .replaceAll(
+ "\\{" + "connection_id" + "\\}", apiClient.escapeString(connectionId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.ActionConnectionApi.deleteActionConnection",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "DELETE",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Delete an existing Action Connection.
+ *
+ * See {@link #deleteActionConnectionWithHttpInfo}.
+ *
+ * @param connectionId The ID of the action connection (required)
+ * @return CompletableFuture<ApiResponse<Void>>
+ */
+ public CompletableFuture> deleteActionConnectionWithHttpInfoAsync(
+ String connectionId) {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'connectionId' is set
+ if (connectionId == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'connectionId' when calling deleteActionConnection"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/actions/connections/{connection_id}"
+ .replaceAll(
+ "\\{" + "connection_id" + "\\}", apiClient.escapeString(connectionId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.ActionConnectionApi.deleteActionConnection",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "DELETE",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Get an existing Action Connection.
+ *
+ * See {@link #getActionConnectionWithHttpInfo}.
+ *
+ * @param connectionId The ID of the action connection (required)
+ * @return GetActionConnectionResponse
+ * @throws ApiException if fails to make API call
+ */
+ public GetActionConnectionResponse getActionConnection(String connectionId) throws ApiException {
+ return getActionConnectionWithHttpInfo(connectionId).getData();
+ }
+
+ /**
+ * Get an existing Action Connection.
+ *
+ *
See {@link #getActionConnectionWithHttpInfoAsync}.
+ *
+ * @param connectionId The ID of the action connection (required)
+ * @return CompletableFuture<GetActionConnectionResponse>
+ */
+ public CompletableFuture getActionConnectionAsync(
+ String connectionId) {
+ return getActionConnectionWithHttpInfoAsync(connectionId)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Get an existing Action Connection
+ *
+ * @param connectionId The ID of the action connection (required)
+ * @return ApiResponse<GetActionConnectionResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | Successfully get Action Connection | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 404 | Not Found | - |
+ * | 429 | Too Many Request | - |
+ *
+ */
+ public ApiResponse getActionConnectionWithHttpInfo(
+ String connectionId) throws ApiException {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'connectionId' is set
+ if (connectionId == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'connectionId' when calling getActionConnection");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/actions/connections/{connection_id}"
+ .replaceAll(
+ "\\{" + "connection_id" + "\\}", apiClient.escapeString(connectionId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.ActionConnectionApi.getActionConnection",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Get an existing Action Connection.
+ *
+ * See {@link #getActionConnectionWithHttpInfo}.
+ *
+ * @param connectionId The ID of the action connection (required)
+ * @return CompletableFuture<ApiResponse<GetActionConnectionResponse>>
+ */
+ public CompletableFuture>
+ getActionConnectionWithHttpInfoAsync(String connectionId) {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'connectionId' is set
+ if (connectionId == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'connectionId' when calling getActionConnection"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/actions/connections/{connection_id}"
+ .replaceAll(
+ "\\{" + "connection_id" + "\\}", apiClient.escapeString(connectionId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.ActionConnectionApi.getActionConnection",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Update an existing Action Connection.
+ *
+ * See {@link #updateActionConnectionWithHttpInfo}.
+ *
+ * @param connectionId The ID of the action connection (required)
+ * @param body Update an existing Action Connection request body (required)
+ * @return UpdateActionConnectionResponse
+ * @throws ApiException if fails to make API call
+ */
+ public UpdateActionConnectionResponse updateActionConnection(
+ String connectionId, UpdateActionConnectionRequest body) throws ApiException {
+ return updateActionConnectionWithHttpInfo(connectionId, body).getData();
+ }
+
+ /**
+ * Update an existing Action Connection.
+ *
+ *
See {@link #updateActionConnectionWithHttpInfoAsync}.
+ *
+ * @param connectionId The ID of the action connection (required)
+ * @param body Update an existing Action Connection request body (required)
+ * @return CompletableFuture<UpdateActionConnectionResponse>
+ */
+ public CompletableFuture updateActionConnectionAsync(
+ String connectionId, UpdateActionConnectionRequest body) {
+ return updateActionConnectionWithHttpInfoAsync(connectionId, body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Update an existing Action Connection
+ *
+ * @param connectionId The ID of the action connection (required)
+ * @param body Update an existing Action Connection request body (required)
+ * @return ApiResponse<UpdateActionConnectionResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | Successfully updated Action Connection | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 404 | Not Found | - |
+ * | 429 | Too Many Request | - |
+ *
+ */
+ public ApiResponse updateActionConnectionWithHttpInfo(
+ String connectionId, UpdateActionConnectionRequest body) throws ApiException {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'connectionId' is set
+ if (connectionId == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'connectionId' when calling updateActionConnection");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'body' when calling updateActionConnection");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/actions/connections/{connection_id}"
+ .replaceAll(
+ "\\{" + "connection_id" + "\\}", apiClient.escapeString(connectionId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.ActionConnectionApi.updateActionConnection",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "PATCH",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Update an existing Action Connection.
+ *
+ * See {@link #updateActionConnectionWithHttpInfo}.
+ *
+ * @param connectionId The ID of the action connection (required)
+ * @param body Update an existing Action Connection request body (required)
+ * @return CompletableFuture<ApiResponse<UpdateActionConnectionResponse>>
+ */
+ public CompletableFuture>
+ updateActionConnectionWithHttpInfoAsync(
+ String connectionId, UpdateActionConnectionRequest body) {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'connectionId' is set
+ if (connectionId == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'connectionId' when calling updateActionConnection"));
+ return result;
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'body' when calling updateActionConnection"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/actions/connections/{connection_id}"
+ .replaceAll(
+ "\\{" + "connection_id" + "\\}", apiClient.escapeString(connectionId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.ActionConnectionApi.updateActionConnection",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "PATCH",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSAssumeRole.java b/src/main/java/com/datadog/api/client/v2/model/AWSAssumeRole.java
new file mode 100644
index 00000000000..0affa49aef1
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/AWSAssumeRole.java
@@ -0,0 +1,242 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** The definition of AWSAssumeRole object. */
+@JsonPropertyOrder({
+ AWSAssumeRole.JSON_PROPERTY_ACCOUNT_ID,
+ AWSAssumeRole.JSON_PROPERTY_EXTERNAL_ID,
+ AWSAssumeRole.JSON_PROPERTY_PRINCIPAL_ID,
+ AWSAssumeRole.JSON_PROPERTY_ROLE,
+ AWSAssumeRole.JSON_PROPERTY_TYPE
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class AWSAssumeRole {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id";
+ private String accountId;
+
+ public static final String JSON_PROPERTY_EXTERNAL_ID = "external_id";
+ private String externalId;
+
+ public static final String JSON_PROPERTY_PRINCIPAL_ID = "principal_id";
+ private String principalId;
+
+ public static final String JSON_PROPERTY_ROLE = "role";
+ private String role;
+
+ public static final String JSON_PROPERTY_TYPE = "type";
+ private AWSAssumeRoleType type;
+
+ public AWSAssumeRole() {}
+
+ @JsonCreator
+ public AWSAssumeRole(
+ @JsonProperty(required = true, value = JSON_PROPERTY_ACCOUNT_ID) String accountId,
+ @JsonProperty(required = true, value = JSON_PROPERTY_ROLE) String role,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) AWSAssumeRoleType type) {
+ this.accountId = accountId;
+ this.role = role;
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ }
+
+ public AWSAssumeRole accountId(String accountId) {
+ this.accountId = accountId;
+ return this;
+ }
+
+ /**
+ * AWS account the connection is created for
+ *
+ * @return accountId
+ */
+ @JsonProperty(JSON_PROPERTY_ACCOUNT_ID)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getAccountId() {
+ return accountId;
+ }
+
+ public void setAccountId(String accountId) {
+ this.accountId = accountId;
+ }
+
+ /**
+ * External ID used to scope which connection can be used to assume the role
+ *
+ * @return externalId
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_EXTERNAL_ID)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public String getExternalId() {
+ return externalId;
+ }
+
+ /**
+ * AWS account that will assume the role
+ *
+ * @return principalId
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_PRINCIPAL_ID)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public String getPrincipalId() {
+ return principalId;
+ }
+
+ public AWSAssumeRole role(String role) {
+ this.role = role;
+ return this;
+ }
+
+ /**
+ * Role to assume
+ *
+ * @return role
+ */
+ @JsonProperty(JSON_PROPERTY_ROLE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getRole() {
+ return role;
+ }
+
+ public void setRole(String role) {
+ this.role = role;
+ }
+
+ public AWSAssumeRole type(AWSAssumeRoleType type) {
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ return this;
+ }
+
+ /**
+ * The definition of AWSAssumeRoleType object.
+ *
+ * @return type
+ */
+ @JsonProperty(JSON_PROPERTY_TYPE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public AWSAssumeRoleType getType() {
+ return type;
+ }
+
+ public void setType(AWSAssumeRoleType type) {
+ if (!type.isValid()) {
+ this.unparsed = true;
+ }
+ this.type = type;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return AWSAssumeRole
+ */
+ @JsonAnySetter
+ public AWSAssumeRole putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this AWSAssumeRole object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ AWSAssumeRole awsAssumeRole = (AWSAssumeRole) o;
+ return Objects.equals(this.accountId, awsAssumeRole.accountId)
+ && Objects.equals(this.externalId, awsAssumeRole.externalId)
+ && Objects.equals(this.principalId, awsAssumeRole.principalId)
+ && Objects.equals(this.role, awsAssumeRole.role)
+ && Objects.equals(this.type, awsAssumeRole.type)
+ && Objects.equals(this.additionalProperties, awsAssumeRole.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(accountId, externalId, principalId, role, type, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class AWSAssumeRole {\n");
+ sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n");
+ sb.append(" externalId: ").append(toIndentedString(externalId)).append("\n");
+ sb.append(" principalId: ").append(toIndentedString(principalId)).append("\n");
+ sb.append(" role: ").append(toIndentedString(role)).append("\n");
+ sb.append(" type: ").append(toIndentedString(type)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSAssumeRoleType.java b/src/main/java/com/datadog/api/client/v2/model/AWSAssumeRoleType.java
new file mode 100644
index 00000000000..c961b062ece
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/AWSAssumeRoleType.java
@@ -0,0 +1,54 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.datadog.api.client.ModelEnum;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.StdSerializer;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+/** The definition of AWSAssumeRoleType object. */
+@JsonSerialize(using = AWSAssumeRoleType.AWSAssumeRoleTypeSerializer.class)
+public class AWSAssumeRoleType extends ModelEnum {
+
+ private static final Set allowedValues =
+ new HashSet(Arrays.asList("AWSAssumeRole"));
+
+ public static final AWSAssumeRoleType AWSASSUMEROLE = new AWSAssumeRoleType("AWSAssumeRole");
+
+ AWSAssumeRoleType(String value) {
+ super(value, allowedValues);
+ }
+
+ public static class AWSAssumeRoleTypeSerializer extends StdSerializer {
+ public AWSAssumeRoleTypeSerializer(Class t) {
+ super(t);
+ }
+
+ public AWSAssumeRoleTypeSerializer() {
+ this(null);
+ }
+
+ @Override
+ public void serialize(AWSAssumeRoleType value, JsonGenerator jgen, SerializerProvider provider)
+ throws IOException, JsonProcessingException {
+ jgen.writeObject(value.value);
+ }
+ }
+
+ @JsonCreator
+ public static AWSAssumeRoleType fromValue(String value) {
+ return new AWSAssumeRoleType(value);
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSAssumeRoleUpdate.java b/src/main/java/com/datadog/api/client/v2/model/AWSAssumeRoleUpdate.java
new file mode 100644
index 00000000000..0ac0c1b46c1
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/AWSAssumeRoleUpdate.java
@@ -0,0 +1,233 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** The definition of AWSAssumeRoleUpdate object. */
+@JsonPropertyOrder({
+ AWSAssumeRoleUpdate.JSON_PROPERTY_ACCOUNT_ID,
+ AWSAssumeRoleUpdate.JSON_PROPERTY_GENERATE_NEW_EXTERNAL_ID,
+ AWSAssumeRoleUpdate.JSON_PROPERTY_ROLE,
+ AWSAssumeRoleUpdate.JSON_PROPERTY_TYPE
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class AWSAssumeRoleUpdate {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id";
+ private String accountId;
+
+ public static final String JSON_PROPERTY_GENERATE_NEW_EXTERNAL_ID = "generate_new_external_id";
+ private Boolean generateNewExternalId;
+
+ public static final String JSON_PROPERTY_ROLE = "role";
+ private String role;
+
+ public static final String JSON_PROPERTY_TYPE = "type";
+ private AWSAssumeRoleType type;
+
+ public AWSAssumeRoleUpdate() {}
+
+ @JsonCreator
+ public AWSAssumeRoleUpdate(
+ @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) AWSAssumeRoleType type) {
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ }
+
+ public AWSAssumeRoleUpdate accountId(String accountId) {
+ this.accountId = accountId;
+ return this;
+ }
+
+ /**
+ * AWS account the connection is created for
+ *
+ * @return accountId
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_ACCOUNT_ID)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public String getAccountId() {
+ return accountId;
+ }
+
+ public void setAccountId(String accountId) {
+ this.accountId = accountId;
+ }
+
+ public AWSAssumeRoleUpdate generateNewExternalId(Boolean generateNewExternalId) {
+ this.generateNewExternalId = generateNewExternalId;
+ return this;
+ }
+
+ /**
+ * The AWSAssumeRoleUpdate generate_new_external_id.
+ *
+ * @return generateNewExternalId
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_GENERATE_NEW_EXTERNAL_ID)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public Boolean getGenerateNewExternalId() {
+ return generateNewExternalId;
+ }
+
+ public void setGenerateNewExternalId(Boolean generateNewExternalId) {
+ this.generateNewExternalId = generateNewExternalId;
+ }
+
+ public AWSAssumeRoleUpdate role(String role) {
+ this.role = role;
+ return this;
+ }
+
+ /**
+ * Role to assume
+ *
+ * @return role
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_ROLE)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public String getRole() {
+ return role;
+ }
+
+ public void setRole(String role) {
+ this.role = role;
+ }
+
+ public AWSAssumeRoleUpdate type(AWSAssumeRoleType type) {
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ return this;
+ }
+
+ /**
+ * The definition of AWSAssumeRoleType object.
+ *
+ * @return type
+ */
+ @JsonProperty(JSON_PROPERTY_TYPE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public AWSAssumeRoleType getType() {
+ return type;
+ }
+
+ public void setType(AWSAssumeRoleType type) {
+ if (!type.isValid()) {
+ this.unparsed = true;
+ }
+ this.type = type;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return AWSAssumeRoleUpdate
+ */
+ @JsonAnySetter
+ public AWSAssumeRoleUpdate putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this AWSAssumeRoleUpdate object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ AWSAssumeRoleUpdate awsAssumeRoleUpdate = (AWSAssumeRoleUpdate) o;
+ return Objects.equals(this.accountId, awsAssumeRoleUpdate.accountId)
+ && Objects.equals(this.generateNewExternalId, awsAssumeRoleUpdate.generateNewExternalId)
+ && Objects.equals(this.role, awsAssumeRoleUpdate.role)
+ && Objects.equals(this.type, awsAssumeRoleUpdate.type)
+ && Objects.equals(this.additionalProperties, awsAssumeRoleUpdate.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(accountId, generateNewExternalId, role, type, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class AWSAssumeRoleUpdate {\n");
+ sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n");
+ sb.append(" generateNewExternalId: ")
+ .append(toIndentedString(generateNewExternalId))
+ .append("\n");
+ sb.append(" role: ").append(toIndentedString(role)).append("\n");
+ sb.append(" type: ").append(toIndentedString(type)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSCredentials.java b/src/main/java/com/datadog/api/client/v2/model/AWSCredentials.java
new file mode 100644
index 00000000000..46bee42e01f
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/AWSCredentials.java
@@ -0,0 +1,208 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.datadog.api.client.AbstractOpenApiSchema;
+import com.datadog.api.client.JSON;
+import com.datadog.api.client.UnparsedObject;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.MapperFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
+import com.fasterxml.jackson.databind.ser.std.StdSerializer;
+import jakarta.ws.rs.core.GenericType;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+@JsonDeserialize(using = AWSCredentials.AWSCredentialsDeserializer.class)
+@JsonSerialize(using = AWSCredentials.AWSCredentialsSerializer.class)
+public class AWSCredentials extends AbstractOpenApiSchema {
+ private static final Logger log = Logger.getLogger(AWSCredentials.class.getName());
+
+ @JsonIgnore public boolean unparsed = false;
+
+ public static class AWSCredentialsSerializer extends StdSerializer {
+ public AWSCredentialsSerializer(Class t) {
+ super(t);
+ }
+
+ public AWSCredentialsSerializer() {
+ this(null);
+ }
+
+ @Override
+ public void serialize(AWSCredentials value, JsonGenerator jgen, SerializerProvider provider)
+ throws IOException, JsonProcessingException {
+ jgen.writeObject(value.getActualInstance());
+ }
+ }
+
+ public static class AWSCredentialsDeserializer extends StdDeserializer {
+ public AWSCredentialsDeserializer() {
+ this(AWSCredentials.class);
+ }
+
+ public AWSCredentialsDeserializer(Class> vc) {
+ super(vc);
+ }
+
+ @Override
+ public AWSCredentials deserialize(JsonParser jp, DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+ JsonNode tree = jp.readValueAsTree();
+ Object deserialized = null;
+ Object tmp = null;
+ boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS);
+ int match = 0;
+ JsonToken token = tree.traverse(jp.getCodec()).nextToken();
+ // deserialize AWSAssumeRole
+ try {
+ boolean attemptParsing = true;
+ // ensure that we respect type coercion as set on the client ObjectMapper
+ if (AWSAssumeRole.class.equals(Integer.class)
+ || AWSAssumeRole.class.equals(Long.class)
+ || AWSAssumeRole.class.equals(Float.class)
+ || AWSAssumeRole.class.equals(Double.class)
+ || AWSAssumeRole.class.equals(Boolean.class)
+ || AWSAssumeRole.class.equals(String.class)) {
+ attemptParsing = typeCoercion;
+ if (!attemptParsing) {
+ attemptParsing |=
+ ((AWSAssumeRole.class.equals(Integer.class)
+ || AWSAssumeRole.class.equals(Long.class))
+ && token == JsonToken.VALUE_NUMBER_INT);
+ attemptParsing |=
+ ((AWSAssumeRole.class.equals(Float.class)
+ || AWSAssumeRole.class.equals(Double.class))
+ && (token == JsonToken.VALUE_NUMBER_FLOAT
+ || token == JsonToken.VALUE_NUMBER_INT));
+ attemptParsing |=
+ (AWSAssumeRole.class.equals(Boolean.class)
+ && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
+ attemptParsing |=
+ (AWSAssumeRole.class.equals(String.class) && token == JsonToken.VALUE_STRING);
+ }
+ }
+ if (attemptParsing) {
+ tmp = tree.traverse(jp.getCodec()).readValueAs(AWSAssumeRole.class);
+ // TODO: there is no validation against JSON schema constraints
+ // (min, max, enum, pattern...), this does not perform a strict JSON
+ // validation, which means the 'match' count may be higher than it should be.
+ if (!((AWSAssumeRole) tmp).unparsed) {
+ deserialized = tmp;
+ match++;
+ }
+ log.log(Level.FINER, "Input data matches schema 'AWSAssumeRole'");
+ }
+ } catch (Exception e) {
+ // deserialization failed, continue
+ log.log(Level.FINER, "Input data does not match schema 'AWSAssumeRole'", e);
+ }
+
+ AWSCredentials ret = new AWSCredentials();
+ if (match == 1) {
+ ret.setActualInstance(deserialized);
+ } else {
+ Map res =
+ new ObjectMapper()
+ .readValue(
+ tree.traverse(jp.getCodec()).readValueAsTree().toString(),
+ new TypeReference