diff --git a/.apigentools-info b/.apigentools-info index 6841a869f7e..c6c91df6430 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-11-12 10:03:20.235642", - "spec_repo_commit": "67b7e114" + "regenerated": "2024-11-12 20:16:44.110501", + "spec_repo_commit": "9a869b6b" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-11-12 10:03:20.254391", - "spec_repo_commit": "67b7e114" + "regenerated": "2024-11-12 20:16:44.128994", + "spec_repo_commit": "9a869b6b" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a3a38ebca93..ad1dba70f7c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -84,6 +84,13 @@ components: required: false schema: $ref: '#/components/schemas/APIKeysSort' + AWSAccountConfigIDPathParameter: + description: Unique Datadog ID of the AWS Account Integration Config + in: path + name: aws_account_config_id + required: true + schema: + type: string ApplicationKeyFilterCreatedAtEndParameter: description: Only include application keys created on or before the specified date. @@ -983,6 +990,536 @@ components: type: string x-enum-varnames: - API_KEYS + AWSAccountConfigID: + description: Unique Datadog ID of the AWS Account Integration Config + example: 00000000-abcd-0001-0000-000000000000 + type: string + AWSAccountCreateRequest: + description: AWS Account Create Request body + properties: + data: + $ref: '#/components/schemas/AWSAccountCreateRequestData' + required: + - data + type: object + AWSAccountCreateRequestAttributes: + description: The AWS Account Integration Config to be created + properties: + account_tags: + $ref: '#/components/schemas/AWSAccountTags' + auth_config: + $ref: '#/components/schemas/AWSAuthConfig' + aws_account_id: + $ref: '#/components/schemas/AWSAccountID' + aws_partition: + $ref: '#/components/schemas/AWSAccountPartition' + aws_regions: + $ref: '#/components/schemas/AWSRegions' + logs_config: + $ref: '#/components/schemas/AWSLogsConfig' + metrics_config: + $ref: '#/components/schemas/AWSMetricsConfig' + resources_config: + $ref: '#/components/schemas/AWSResourcesConfig' + traces_config: + $ref: '#/components/schemas/AWSTracesConfig' + required: + - aws_account_id + - aws_partition + - auth_config + type: object + AWSAccountCreateRequestData: + description: AWS Account Create Request data + properties: + attributes: + $ref: '#/components/schemas/AWSAccountCreateRequestAttributes' + type: + $ref: '#/components/schemas/AWSAccountType' + required: + - attributes + - type + type: object + AWSAccountID: + description: AWS Account ID + example: '123456789012' + type: string + AWSAccountPartition: + default: aws + description: AWS Account partition + enum: + - aws + - aws-cn + - aws-us-gov + example: aws + type: string + x-enum-varnames: + - AWS + - AWS_CN + - AWS_US_GOV + AWSAccountResponse: + description: AWS Account response body + properties: + data: + $ref: '#/components/schemas/AWSAccountResponseData' + required: + - data + type: object + AWSAccountResponseAttributes: + description: The AWS Account Integration Config + properties: + account_tags: + $ref: '#/components/schemas/AWSAccountTags' + auth_config: + $ref: '#/components/schemas/AWSAuthConfig' + aws_account_id: + $ref: '#/components/schemas/AWSAccountID' + aws_partition: + $ref: '#/components/schemas/AWSAccountPartition' + aws_regions: + $ref: '#/components/schemas/AWSRegions' + created_at: + description: Timestamp of when the account integration was created + format: date-time + readOnly: true + type: string + logs_config: + $ref: '#/components/schemas/AWSLogsConfig' + metrics_config: + $ref: '#/components/schemas/AWSMetricsConfig' + modified_at: + description: Timestamp of when the account integration was updated + format: date-time + readOnly: true + type: string + resources_config: + $ref: '#/components/schemas/AWSResourcesConfig' + traces_config: + $ref: '#/components/schemas/AWSTracesConfig' + required: + - aws_account_id + type: object + AWSAccountResponseData: + description: AWS Account Response body + properties: + attributes: + $ref: '#/components/schemas/AWSAccountResponseAttributes' + id: + $ref: '#/components/schemas/AWSAccountConfigID' + type: + $ref: '#/components/schemas/AWSAccountType' + required: + - id + - type + type: object + AWSAccountTags: + description: Tags to apply to all metrics in the account + items: + description: Tag to apply to all metrics in the account + example: key:value + type: string + nullable: true + type: array + AWSAccountType: + default: account + description: AWS Account resource type. + enum: + - account + example: account + type: string + x-enum-varnames: + - ACCOUNT + AWSAccountUpdateRequest: + description: AWS Account Update Request body + properties: + data: + $ref: '#/components/schemas/AWSAccountUpdateRequestData' + required: + - data + type: object + AWSAccountUpdateRequestAttributes: + description: The AWS Account Integration Config to be updated + properties: + account_tags: + $ref: '#/components/schemas/AWSAccountTags' + auth_config: + $ref: '#/components/schemas/AWSAuthConfig' + aws_account_id: + $ref: '#/components/schemas/AWSAccountID' + aws_partition: + $ref: '#/components/schemas/AWSAccountPartition' + aws_regions: + $ref: '#/components/schemas/AWSRegions' + logs_config: + $ref: '#/components/schemas/AWSLogsConfig' + metrics_config: + $ref: '#/components/schemas/AWSMetricsConfig' + resources_config: + $ref: '#/components/schemas/AWSResourcesConfig' + traces_config: + $ref: '#/components/schemas/AWSTracesConfig' + required: + - aws_account_id + type: object + AWSAccountUpdateRequestData: + description: AWS Account Update Request data + properties: + attributes: + $ref: '#/components/schemas/AWSAccountUpdateRequestAttributes' + id: + $ref: '#/components/schemas/AWSAccountConfigID' + type: + $ref: '#/components/schemas/AWSAccountType' + required: + - attributes + - type + type: object + AWSAccountsResponse: + description: AWS Accounts response body + properties: + data: + description: List of AWS Account Integration Configs + items: + $ref: '#/components/schemas/AWSAccountResponseData' + type: array + required: + - data + type: object + AWSAuthConfig: + description: AWS Authentication config + oneOf: + - $ref: '#/components/schemas/AWSAuthConfigKeys' + - $ref: '#/components/schemas/AWSAuthConfigRole' + AWSAuthConfigKeys: + description: AWS Authentication config for key-based account + properties: + access_key_id: + description: AWS Access Key ID + example: AKIAIOSFODNN7EXAMPLE + type: string + secret_access_key: + description: AWS Secret Access Key + example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY + minLength: 1 + type: string + writeOnly: true + required: + - access_key_id + type: object + AWSAuthConfigRole: + description: AWS Authentication config for role-based account + properties: + external_id: + description: AWS IAM External ID for associated role + type: string + role_name: + description: AWS IAM Role name + example: DatadogIntegrationRole + maxLength: 576 + minLength: 1 + type: string + required: + - role_name + type: object + AWSLambdaForwarderConfig: + description: AWS Lambda forwarder + properties: + lambdas: + description: List of Datadog Lambda Log Forwarder ARNs + items: + example: arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder + type: string + type: array + sources: + description: List of AWS services that will send logs to the Datadog Lambda + Log Forwarder + items: + example: s3 + type: string + type: array + type: object + AWSLogsConfig: + description: AWS Logs config + properties: + lambda_forwarder: + $ref: '#/components/schemas/AWSLambdaForwarderConfig' + type: object + AWSLogsServicesResponse: + description: AWS Logs Services response body + properties: + data: + $ref: '#/components/schemas/AWSLogsServicesResponseData' + required: + - data + type: object + AWSLogsServicesResponseAttributes: + description: AWS Logs Services response body + properties: + logs_services: + description: List of AWS services that can send logs to Datadog + example: + - s3 + items: + example: s3 + type: string + type: array + required: + - logs_services + type: object + AWSLogsServicesResponseData: + description: AWS Logs Services response body + properties: + attributes: + $ref: '#/components/schemas/AWSLogsServicesResponseAttributes' + id: + default: logs_services + description: The `AWSLogsServicesResponseData` `id`. + example: logs_services + type: string + type: + $ref: '#/components/schemas/AWSLogsServicesResponseDataType' + required: + - id + - type + type: object + AWSLogsServicesResponseDataType: + default: logs_services + description: The `AWSLogsServicesResponseData` `type`. + enum: + - logs_services + example: logs_services + type: string + x-enum-varnames: + - LOGS_SERVICES + AWSMetricsConfig: + description: AWS Metrics config + properties: + automute_enabled: + description: Enable EC2 automute for AWS metrics + example: true + type: boolean + collect_cloudwatch_alarms: + description: Enable CloudWatch alarms collection + example: true + type: boolean + collect_custom_metrics: + description: Enable custom metrics collection + example: true + type: boolean + enabled: + description: Enable AWS metrics collection + example: true + type: boolean + namespace_filters: + $ref: '#/components/schemas/AWSNamespaceFilters' + tag_filters: + description: AWS Metrics tag filters list + items: + $ref: '#/components/schemas/AWSNamespaceTagFilter' + type: array + type: object + AWSNamespaceFilters: + description: AWS Metrics namespace filters + oneOf: + - $ref: '#/components/schemas/AWSNamespaceFiltersExcludeAll' + - $ref: '#/components/schemas/AWSNamespaceFiltersExcludeOnly' + - $ref: '#/components/schemas/AWSNamespaceFiltersIncludeAll' + - $ref: '#/components/schemas/AWSNamespaceFiltersIncludeOnly' + AWSNamespaceFiltersExcludeAll: + description: Exclude all namespaces + properties: + exclude_all: + description: Exclude all namespaces + example: false + type: boolean + required: + - exclude_all + AWSNamespaceFiltersExcludeOnly: + description: Exclude only these namespaces + properties: + exclude_only: + description: Exclude only these namespaces + example: + - AWS/EC2 + items: + example: AWS/EC2 + type: string + type: array + required: + - exclude_only + AWSNamespaceFiltersIncludeAll: + description: Include all namespaces + properties: + include_all: + description: Include all namespaces + example: false + type: boolean + required: + - include_all + AWSNamespaceFiltersIncludeOnly: + description: Include only these namespaces + properties: + include_only: + description: Include only these namespaces + example: + - AWS/EC2 + items: + example: AWS/EC2 + type: string + type: array + required: + - include_only + AWSNamespaceTagFilter: + description: AWS Metrics tag filters + properties: + namespace: + description: The AWS Namespace to apply the tag filters against + example: AWS/EC2 + type: string + tags: + description: The tags to filter based on + items: + example: key:value + type: string + nullable: true + type: array + type: object + AWSNamespacesResponse: + description: AWS Namespaces response body + properties: + data: + $ref: '#/components/schemas/AWSNamespacesResponseData' + required: + - data + type: object + AWSNamespacesResponseAttributes: + description: AWS Namespaces response body + properties: + namespaces: + description: AWS CloudWatch namespace + example: + - AWS/ApiGateway + items: + example: AWS/ApiGateway + type: string + type: array + required: + - namespaces + type: object + AWSNamespacesResponseData: + description: AWS Namespaces response body + properties: + attributes: + $ref: '#/components/schemas/AWSNamespacesResponseAttributes' + id: + default: namespaces + description: The `AWSNamespacesResponseData` `id`. + example: namespaces + type: string + type: + $ref: '#/components/schemas/AWSNamespacesResponseDataType' + required: + - id + - type + type: object + AWSNamespacesResponseDataType: + default: namespaces + description: The `AWSNamespacesResponseData` `type`. + enum: + - namespaces + example: namespaces + type: string + x-enum-varnames: + - NAMESPACES + AWSNewExternalIDResponse: + description: AWS External ID response body + properties: + data: + $ref: '#/components/schemas/AWSNewExternalIDResponseData' + required: + - data + type: object + AWSNewExternalIDResponseAttributes: + description: AWS External ID response body + properties: + external_id: + description: AWS IAM External ID for associated role + example: acb8f6b8a844443dbb726d07dcb1a870 + type: string + required: + - external_id + type: object + AWSNewExternalIDResponseData: + description: AWS External ID response body + properties: + attributes: + $ref: '#/components/schemas/AWSNewExternalIDResponseAttributes' + id: + default: external_id + description: The `AWSNewExternalIDResponseData` `id`. + example: external_id + type: string + type: + $ref: '#/components/schemas/AWSNewExternalIDResponseDataType' + required: + - id + - type + type: object + AWSNewExternalIDResponseDataType: + default: external_id + description: The `AWSNewExternalIDResponseData` `type`. + enum: + - external_id + example: external_id + type: string + x-enum-varnames: + - EXTERNAL_ID + AWSRegions: + description: AWS Regions to collect data from + oneOf: + - $ref: '#/components/schemas/AWSRegionsIncludeAll' + - $ref: '#/components/schemas/AWSRegionsIncludeOnly' + AWSRegionsIncludeAll: + description: Include all regions + properties: + include_all: + description: Include all regions + example: false + type: boolean + required: + - include_all + AWSRegionsIncludeOnly: + description: Include only these regions + properties: + include_only: + description: Include only these regions + example: + - us-east-1 + items: + example: us-east-1 + type: string + type: array + required: + - include_only + AWSResourcesConfig: + description: AWS Resources config + properties: + cloud_security_posture_management_collection: + description: Whether Datadog collects cloud security posture management + resources from your AWS account. + example: false + type: boolean + extended_collection: + description: Whether Datadog collects additional attributes and configuration + information about the resources in your AWS account. Required for `cspm_resource_collection`. + example: false + type: boolean + type: object + AWSTracesConfig: + description: AWS Traces config + properties: + xray_services: + $ref: '#/components/schemas/XRayServicesList' + type: object ActiveBillingDimensionsAttributes: description: List of active billing dimensions. properties: @@ -26567,6 +27104,34 @@ components: description: The id of the instance. type: string type: object + XRayServicesIncludeAll: + description: Include all services + properties: + include_all: + description: Include all services + example: false + type: boolean + required: + - include_all + XRayServicesIncludeOnly: + description: Include only these services + nullable: true + properties: + include_only: + description: Include only these services + example: + - AWS/AppSync + items: + example: AWS/AppSync + type: string + type: array + required: + - include_only + XRayServicesList: + description: AWS X-Ray services to collect traces from + oneOf: + - $ref: '#/components/schemas/XRayServicesIncludeAll' + - $ref: '#/components/schemas/XRayServicesIncludeOnly' securitySchemes: AuthZ: description: This API uses OAuth 2 with the implicit grant flow. @@ -31589,6 +32154,244 @@ paths: x-unstable: '**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/integration/aws/accounts: + get: + description: Get a list of AWS Account Integration Configs. + operationId: ListAWSAccounts + parameters: + - description: Optional query filter accounts by AWS Account ID + example: '123456789012' + in: query + name: aws_account_id + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSAccountsResponse' + description: AWS Accounts List object + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List all AWS integrations + tags: + - AWS Integration + x-permission: + operator: OR + permissions: + - aws_configuration_read + x-unstable: '**Note: This endpoint is in public beta. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).**' + post: + description: Create a new AWS Account Integration Config. + operationId: CreateAWSAccount + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AWSAccountCreateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSAccountResponse' + description: AWS Account object + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '409': + $ref: '#/components/responses/ConflictResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create an AWS integration + tags: + - AWS Integration + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - aws_configurations_manage + x-unstable: '**Note: This endpoint is in public beta. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).**' + /api/v2/integration/aws/accounts/{aws_account_config_id}: + delete: + description: Delete an AWS Account Integration Config + operationId: DeleteAWSAccount + parameters: + - $ref: '#/components/parameters/AWSAccountConfigIDPathParameter' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete an AWS integration + tags: + - AWS Integration + x-permission: + operator: OR + permissions: + - aws_configurations_manage + x-unstable: '**Note: This endpoint is in public beta. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).**' + get: + description: Get an AWS Account Integration Config + operationId: GetAWSAccount + parameters: + - $ref: '#/components/parameters/AWSAccountConfigIDPathParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSAccountResponse' + description: AWS Account object + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get an AWS integration by config ID + tags: + - AWS Integration + x-permission: + operator: OR + permissions: + - aws_configuration_read + x-unstable: '**Note: This endpoint is in public beta. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).**' + patch: + description: Update an AWS Account Integration Config + operationId: UpdateAWSAccount + parameters: + - $ref: '#/components/parameters/AWSAccountConfigIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AWSAccountUpdateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSAccountResponse' + description: AWS Account object + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update an AWS integration + tags: + - AWS Integration + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - aws_configuration_edit + x-unstable: '**Note: This endpoint is in public beta. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).**' + /api/v2/integration/aws/available_namespaces: + get: + description: Get a list of available AWS CloudWatch namespaces that can send + metrics to Datadog. + operationId: ListAWSNamespaces + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSNamespacesResponse' + description: AWS Namespaces List object + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List available namespaces + tags: + - AWS Integration + x-permission: + operator: OR + permissions: + - aws_configuration_read + x-unstable: '**Note: This endpoint is in public beta. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).**' + /api/v2/integration/aws/generate_new_external_id: + post: + description: Generate a new external ID for AWS role-based authentication. + operationId: CreateNewAWSExternalID + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSNewExternalIDResponse' + description: AWS External ID object + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Generate a new external ID + tags: + - AWS Integration + x-permission: + operator: OR + permissions: + - aws_configuration_edit + x-unstable: '**Note: This endpoint is in public beta. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).**' + /api/v2/integration/aws/logs/services: + get: + description: Get a list of AWS services that can send logs to Datadog. + operationId: ListAWSLogsServices + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSLogsServicesResponse' + description: AWS Logs Services List object + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get list of AWS log ready services + tags: + - AWS Logs Integration + x-permission: + operator: OR + permissions: + - aws_configuration_read + x-unstable: '**Note: This endpoint is in public beta. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).**' /api/v2/integration/gcp/accounts: get: description: List all GCP STS-enabled service accounts configured in your Datadog @@ -42857,6 +43660,18 @@ tags: description: Find out more at url: https://docs.datadoghq.com/tracing/trace_pipeline/trace_retention/ name: APM Retention Filters +- description: 'Configure your Datadog-AWS integration directly through the Datadog + API. + + For more information, see the [AWS integration page](https://docs.datadoghq.com/integrations/amazon_web_services).' + name: AWS Integration +- description: 'Configure your Datadog-AWS-Logs integration directly through Datadog + API. + + For more information, see the [AWS integration page](https://docs.datadoghq.com/integrations/amazon_web_services/#log-collection).' + externalDocs: + url: https://docs.datadoghq.com/integrations/amazon_web_services/#log-collection + name: AWS Logs Integration - description: Search your Audit Logs events over HTTP. name: Audit - description: '[The AuthN Mappings API](https://docs.datadoghq.com/account_management/authn_mapping/?tab=example) diff --git a/examples/v2/aws-integration/CreateAWSAccount.java b/examples/v2/aws-integration/CreateAWSAccount.java new file mode 100644 index 00000000000..d7b9892c73b --- /dev/null +++ b/examples/v2/aws-integration/CreateAWSAccount.java @@ -0,0 +1,80 @@ +// Create an AWS integration returns "AWS Account object" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AwsIntegrationApi; +import com.datadog.api.client.v2.model.AWSAccountCreateRequest; +import com.datadog.api.client.v2.model.AWSAccountCreateRequestAttributes; +import com.datadog.api.client.v2.model.AWSAccountCreateRequestData; +import com.datadog.api.client.v2.model.AWSAccountPartition; +import com.datadog.api.client.v2.model.AWSAccountResponse; +import com.datadog.api.client.v2.model.AWSAccountType; +import com.datadog.api.client.v2.model.AWSAuthConfig; +import com.datadog.api.client.v2.model.AWSAuthConfigKeys; +import com.datadog.api.client.v2.model.AWSLambdaForwarderConfig; +import com.datadog.api.client.v2.model.AWSLogsConfig; +import com.datadog.api.client.v2.model.AWSMetricsConfig; +import com.datadog.api.client.v2.model.AWSNamespaceTagFilter; +import com.datadog.api.client.v2.model.AWSResourcesConfig; +import com.datadog.api.client.v2.model.AWSTracesConfig; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createAWSAccount", true); + AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient); + + AWSAccountCreateRequest body = + new AWSAccountCreateRequest() + .data( + new AWSAccountCreateRequestData() + .attributes( + new AWSAccountCreateRequestAttributes() + .accountTags(Collections.singletonList("key:value")) + .authConfig( + new AWSAuthConfig( + new AWSAuthConfigKeys() + .accessKeyId("AKIAIOSFODNN7EXAMPLE") + .secretAccessKey( + "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"))) + .awsAccountId("123456789012") + .awsPartition(AWSAccountPartition.AWS) + .logsConfig( + new AWSLogsConfig() + .lambdaForwarder( + new AWSLambdaForwarderConfig() + .lambdas( + Collections.singletonList( + "arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder")) + .sources(Collections.singletonList("s3")))) + .metricsConfig( + new AWSMetricsConfig() + .automuteEnabled(true) + .collectCloudwatchAlarms(true) + .collectCustomMetrics(true) + .enabled(true) + .tagFilters( + Collections.singletonList( + new AWSNamespaceTagFilter() + .namespace("AWS/EC2") + .tags(Collections.singletonList("key:value"))))) + .resourcesConfig( + new AWSResourcesConfig() + .cloudSecurityPostureManagementCollection(false) + .extendedCollection(false)) + .tracesConfig(new AWSTracesConfig())) + .type(AWSAccountType.ACCOUNT)); + + try { + AWSAccountResponse result = apiInstance.createAWSAccount(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AwsIntegrationApi#createAWSAccount"); + 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/aws-integration/CreateAWSAccount_1716720881.java b/examples/v2/aws-integration/CreateAWSAccount_1716720881.java new file mode 100644 index 00000000000..3c80753aed5 --- /dev/null +++ b/examples/v2/aws-integration/CreateAWSAccount_1716720881.java @@ -0,0 +1,77 @@ +// Create an AWS account returns "AWS Account object" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AwsIntegrationApi; +import com.datadog.api.client.v2.model.AWSAccountCreateRequest; +import com.datadog.api.client.v2.model.AWSAccountCreateRequestAttributes; +import com.datadog.api.client.v2.model.AWSAccountCreateRequestData; +import com.datadog.api.client.v2.model.AWSAccountPartition; +import com.datadog.api.client.v2.model.AWSAccountResponse; +import com.datadog.api.client.v2.model.AWSAccountType; +import com.datadog.api.client.v2.model.AWSAuthConfig; +import com.datadog.api.client.v2.model.AWSAuthConfigRole; +import com.datadog.api.client.v2.model.AWSLambdaForwarderConfig; +import com.datadog.api.client.v2.model.AWSLogsConfig; +import com.datadog.api.client.v2.model.AWSMetricsConfig; +import com.datadog.api.client.v2.model.AWSNamespaceTagFilter; +import com.datadog.api.client.v2.model.AWSResourcesConfig; +import com.datadog.api.client.v2.model.AWSTracesConfig; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createAWSAccount", true); + AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient); + + AWSAccountCreateRequest body = + new AWSAccountCreateRequest() + .data( + new AWSAccountCreateRequestData() + .attributes( + new AWSAccountCreateRequestAttributes() + .accountTags(Collections.singletonList("key:value")) + .authConfig( + new AWSAuthConfig( + new AWSAuthConfigRole().roleName("DatadogIntegrationRole"))) + .awsAccountId("123456789012") + .awsPartition(AWSAccountPartition.AWS) + .logsConfig( + new AWSLogsConfig() + .lambdaForwarder( + new AWSLambdaForwarderConfig() + .lambdas( + Collections.singletonList( + "arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder")) + .sources(Collections.singletonList("s3")))) + .metricsConfig( + new AWSMetricsConfig() + .automuteEnabled(true) + .collectCloudwatchAlarms(true) + .collectCustomMetrics(true) + .enabled(true) + .tagFilters( + Collections.singletonList( + new AWSNamespaceTagFilter() + .namespace("AWS/EC2") + .tags(Collections.singletonList("key:value"))))) + .resourcesConfig( + new AWSResourcesConfig() + .cloudSecurityPostureManagementCollection(false) + .extendedCollection(false)) + .tracesConfig(new AWSTracesConfig())) + .type(AWSAccountType.ACCOUNT)); + + try { + AWSAccountResponse result = apiInstance.createAWSAccount(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AwsIntegrationApi#createAWSAccount"); + 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/aws-integration/CreateNewAWSExternalID.java b/examples/v2/aws-integration/CreateNewAWSExternalID.java new file mode 100644 index 00000000000..f67211e5ed9 --- /dev/null +++ b/examples/v2/aws-integration/CreateNewAWSExternalID.java @@ -0,0 +1,25 @@ +// Generate a new external ID returns "AWS External ID object" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AwsIntegrationApi; +import com.datadog.api.client.v2.model.AWSNewExternalIDResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createNewAWSExternalID", true); + AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient); + + try { + AWSNewExternalIDResponse result = apiInstance.createNewAWSExternalID(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AwsIntegrationApi#createNewAWSExternalID"); + 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/aws-integration/CreateNewAWSExternalID_364713854.java b/examples/v2/aws-integration/CreateNewAWSExternalID_364713854.java new file mode 100644 index 00000000000..975598f3430 --- /dev/null +++ b/examples/v2/aws-integration/CreateNewAWSExternalID_364713854.java @@ -0,0 +1,25 @@ +// Generate new external ID returns "AWS External ID object" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AwsIntegrationApi; +import com.datadog.api.client.v2.model.AWSNewExternalIDResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createNewAWSExternalID", true); + AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient); + + try { + AWSNewExternalIDResponse result = apiInstance.createNewAWSExternalID(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AwsIntegrationApi#createNewAWSExternalID"); + 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/aws-integration/DeleteAWSAccount.java b/examples/v2/aws-integration/DeleteAWSAccount.java new file mode 100644 index 00000000000..b2797ab97c3 --- /dev/null +++ b/examples/v2/aws-integration/DeleteAWSAccount.java @@ -0,0 +1,26 @@ +// Delete an AWS integration returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AwsIntegrationApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.deleteAWSAccount", true); + AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient); + + // there is a valid "aws_account_v2" in the system + String AWS_ACCOUNT_V2_DATA_ID = System.getenv("AWS_ACCOUNT_V2_DATA_ID"); + + try { + apiInstance.deleteAWSAccount(AWS_ACCOUNT_V2_DATA_ID); + } catch (ApiException e) { + System.err.println("Exception when calling AwsIntegrationApi#deleteAWSAccount"); + 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/aws-integration/GetAWSAccount.java b/examples/v2/aws-integration/GetAWSAccount.java new file mode 100644 index 00000000000..bd3fccc67df --- /dev/null +++ b/examples/v2/aws-integration/GetAWSAccount.java @@ -0,0 +1,28 @@ +// Get an AWS integration by config ID returns "AWS Account object" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AwsIntegrationApi; +import com.datadog.api.client.v2.model.AWSAccountResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getAWSAccount", true); + AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient); + + // there is a valid "aws_account_v2" in the system + String AWS_ACCOUNT_V2_DATA_ID = System.getenv("AWS_ACCOUNT_V2_DATA_ID"); + + try { + AWSAccountResponse result = apiInstance.getAWSAccount(AWS_ACCOUNT_V2_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AwsIntegrationApi#getAWSAccount"); + 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/aws-integration/ListAWSAccounts.java b/examples/v2/aws-integration/ListAWSAccounts.java new file mode 100644 index 00000000000..9e0ef915841 --- /dev/null +++ b/examples/v2/aws-integration/ListAWSAccounts.java @@ -0,0 +1,25 @@ +// List all AWS integrations returns "AWS Accounts List object" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AwsIntegrationApi; +import com.datadog.api.client.v2.model.AWSAccountsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listAWSAccounts", true); + AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient); + + try { + AWSAccountsResponse result = apiInstance.listAWSAccounts(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AwsIntegrationApi#listAWSAccounts"); + 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/aws-integration/ListAWSNamespaces.java b/examples/v2/aws-integration/ListAWSNamespaces.java new file mode 100644 index 00000000000..8c8a84abaa8 --- /dev/null +++ b/examples/v2/aws-integration/ListAWSNamespaces.java @@ -0,0 +1,25 @@ +// List available namespaces returns "AWS Namespaces List object" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AwsIntegrationApi; +import com.datadog.api.client.v2.model.AWSNamespacesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listAWSNamespaces", true); + AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient); + + try { + AWSNamespacesResponse result = apiInstance.listAWSNamespaces(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AwsIntegrationApi#listAWSNamespaces"); + 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/aws-integration/ListAWSNamespaces_3031307873.java b/examples/v2/aws-integration/ListAWSNamespaces_3031307873.java new file mode 100644 index 00000000000..796119cc50d --- /dev/null +++ b/examples/v2/aws-integration/ListAWSNamespaces_3031307873.java @@ -0,0 +1,25 @@ +// List namespaces returns "AWS Namespaces List object" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AwsIntegrationApi; +import com.datadog.api.client.v2.model.AWSNamespacesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listAWSNamespaces", true); + AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient); + + try { + AWSNamespacesResponse result = apiInstance.listAWSNamespaces(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AwsIntegrationApi#listAWSNamespaces"); + 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/aws-integration/UpdateAWSAccount.java b/examples/v2/aws-integration/UpdateAWSAccount.java new file mode 100644 index 00000000000..8eaa1a87ce5 --- /dev/null +++ b/examples/v2/aws-integration/UpdateAWSAccount.java @@ -0,0 +1,80 @@ +// Update an AWS integration returns "AWS Account object" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AwsIntegrationApi; +import com.datadog.api.client.v2.model.AWSAccountPartition; +import com.datadog.api.client.v2.model.AWSAccountResponse; +import com.datadog.api.client.v2.model.AWSAccountType; +import com.datadog.api.client.v2.model.AWSAccountUpdateRequest; +import com.datadog.api.client.v2.model.AWSAccountUpdateRequestAttributes; +import com.datadog.api.client.v2.model.AWSAccountUpdateRequestData; +import com.datadog.api.client.v2.model.AWSAuthConfig; +import com.datadog.api.client.v2.model.AWSAuthConfigRole; +import com.datadog.api.client.v2.model.AWSLambdaForwarderConfig; +import com.datadog.api.client.v2.model.AWSLogsConfig; +import com.datadog.api.client.v2.model.AWSMetricsConfig; +import com.datadog.api.client.v2.model.AWSNamespaceTagFilter; +import com.datadog.api.client.v2.model.AWSResourcesConfig; +import com.datadog.api.client.v2.model.AWSTracesConfig; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateAWSAccount", true); + AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient); + + // there is a valid "aws_account_v2" in the system + String AWS_ACCOUNT_V2_DATA_ID = System.getenv("AWS_ACCOUNT_V2_DATA_ID"); + + AWSAccountUpdateRequest body = + new AWSAccountUpdateRequest() + .data( + new AWSAccountUpdateRequestData() + .attributes( + new AWSAccountUpdateRequestAttributes() + .accountTags(Collections.singletonList("key:value")) + .authConfig( + new AWSAuthConfig( + new AWSAuthConfigRole().roleName("DatadogIntegrationRole"))) + .awsAccountId("123456789012") + .awsPartition(AWSAccountPartition.AWS) + .logsConfig( + new AWSLogsConfig() + .lambdaForwarder( + new AWSLambdaForwarderConfig() + .lambdas( + Collections.singletonList( + "arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder")) + .sources(Collections.singletonList("s3")))) + .metricsConfig( + new AWSMetricsConfig() + .automuteEnabled(true) + .collectCloudwatchAlarms(true) + .collectCustomMetrics(true) + .enabled(true) + .tagFilters( + Collections.singletonList( + new AWSNamespaceTagFilter() + .namespace("AWS/EC2") + .tags(Collections.singletonList("key:value"))))) + .resourcesConfig( + new AWSResourcesConfig() + .cloudSecurityPostureManagementCollection(false) + .extendedCollection(false)) + .tracesConfig(new AWSTracesConfig())) + .type(AWSAccountType.ACCOUNT)); + + try { + AWSAccountResponse result = apiInstance.updateAWSAccount(AWS_ACCOUNT_V2_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AwsIntegrationApi#updateAWSAccount"); + 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/aws-logs-integration/ListAWSLogsServices.java b/examples/v2/aws-logs-integration/ListAWSLogsServices.java new file mode 100644 index 00000000000..4cfbe95e1ec --- /dev/null +++ b/examples/v2/aws-logs-integration/ListAWSLogsServices.java @@ -0,0 +1,25 @@ +// Get list of AWS log ready services returns "AWS Logs Services List object" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AwsLogsIntegrationApi; +import com.datadog.api.client.v2.model.AWSLogsServicesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listAWSLogsServices", true); + AwsLogsIntegrationApi apiInstance = new AwsLogsIntegrationApi(defaultClient); + + try { + AWSLogsServicesResponse result = apiInstance.listAWSLogsServices(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AwsLogsIntegrationApi#listAWSLogsServices"); + 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/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 146b7d871ea..950c663b0bb 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -400,6 +400,14 @@ public class ApiClient { put("v2.updateIncidentIntegration", false); put("v2.updateIncidentTodo", false); put("v2.updateIncidentType", false); + put("v2.createAWSAccount", false); + put("v2.createNewAWSExternalID", false); + put("v2.deleteAWSAccount", false); + put("v2.getAWSAccount", false); + put("v2.listAWSAccounts", false); + put("v2.listAWSNamespaces", false); + put("v2.updateAWSAccount", false); + put("v2.listAWSLogsServices", false); put("v2.cancelHistoricalJob", false); put("v2.convertJobResultToSignal", false); put("v2.deleteHistoricalJob", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/AwsIntegrationApi.java b/src/main/java/com/datadog/api/client/v2/api/AwsIntegrationApi.java new file mode 100644 index 00000000000..0d61867588f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/AwsIntegrationApi.java @@ -0,0 +1,1134 @@ +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.AWSAccountCreateRequest; +import com.datadog.api.client.v2.model.AWSAccountResponse; +import com.datadog.api.client.v2.model.AWSAccountUpdateRequest; +import com.datadog.api.client.v2.model.AWSAccountsResponse; +import com.datadog.api.client.v2.model.AWSNamespacesResponse; +import com.datadog.api.client.v2.model.AWSNewExternalIDResponse; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +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 AwsIntegrationApi { + private ApiClient apiClient; + + public AwsIntegrationApi() { + this(ApiClient.getDefaultApiClient()); + } + + public AwsIntegrationApi(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 an AWS integration. + * + *

See {@link #createAWSAccountWithHttpInfo}. + * + * @param body (required) + * @return AWSAccountResponse + * @throws ApiException if fails to make API call + */ + public AWSAccountResponse createAWSAccount(AWSAccountCreateRequest body) throws ApiException { + return createAWSAccountWithHttpInfo(body).getData(); + } + + /** + * Create an AWS integration. + * + *

See {@link #createAWSAccountWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<AWSAccountResponse> + */ + public CompletableFuture createAWSAccountAsync(AWSAccountCreateRequest body) { + return createAWSAccountWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a new AWS Account Integration Config. + * + * @param body (required) + * @return ApiResponse<AWSAccountResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 AWS Account object -
400 Bad Request -
403 Forbidden -
409 Conflict -
429 Too many requests -
+ */ + public ApiResponse createAWSAccountWithHttpInfo(AWSAccountCreateRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "createAWSAccount"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createAWSAccount"); + } + // create path and map variables + String localVarPath = "/api/v2/integration/aws/accounts"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AwsIntegrationApi.createAWSAccount", + 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 an AWS integration. + * + *

See {@link #createAWSAccountWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<AWSAccountResponse>> + */ + public CompletableFuture> createAWSAccountWithHttpInfoAsync( + AWSAccountCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createAWSAccount"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + 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 createAWSAccount")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/integration/aws/accounts"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AwsIntegrationApi.createAWSAccount", + 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() {}); + } + + /** + * Generate a new external ID. + * + *

See {@link #createNewAWSExternalIDWithHttpInfo}. + * + * @return AWSNewExternalIDResponse + * @throws ApiException if fails to make API call + */ + public AWSNewExternalIDResponse createNewAWSExternalID() throws ApiException { + return createNewAWSExternalIDWithHttpInfo().getData(); + } + + /** + * Generate a new external ID. + * + *

See {@link #createNewAWSExternalIDWithHttpInfoAsync}. + * + * @return CompletableFuture<AWSNewExternalIDResponse> + */ + public CompletableFuture createNewAWSExternalIDAsync() { + return createNewAWSExternalIDWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Generate a new external ID for AWS role-based authentication. + * + * @return ApiResponse<AWSNewExternalIDResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 AWS External ID object -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse createNewAWSExternalIDWithHttpInfo() + throws ApiException { + // Check if unstable operation is enabled + String operationId = "createNewAWSExternalID"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/integration/aws/generate_new_external_id"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AwsIntegrationApi.createNewAWSExternalID", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Generate a new external ID. + * + *

See {@link #createNewAWSExternalIDWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<AWSNewExternalIDResponse>> + */ + public CompletableFuture> + createNewAWSExternalIDWithHttpInfoAsync() { + // Check if unstable operation is enabled + String operationId = "createNewAWSExternalID"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/integration/aws/generate_new_external_id"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AwsIntegrationApi.createNewAWSExternalID", + 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[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Delete an AWS integration. + * + *

See {@link #deleteAWSAccountWithHttpInfo}. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config (required) + * @throws ApiException if fails to make API call + */ + public void deleteAWSAccount(String awsAccountConfigId) throws ApiException { + deleteAWSAccountWithHttpInfo(awsAccountConfigId); + } + + /** + * Delete an AWS integration. + * + *

See {@link #deleteAWSAccountWithHttpInfoAsync}. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config (required) + * @return CompletableFuture + */ + public CompletableFuture deleteAWSAccountAsync(String awsAccountConfigId) { + return deleteAWSAccountWithHttpInfoAsync(awsAccountConfigId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete an AWS Account Integration Config + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteAWSAccountWithHttpInfo(String awsAccountConfigId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteAWSAccount"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'awsAccountConfigId' is set + if (awsAccountConfigId == null) { + throw new ApiException( + 400, "Missing the required parameter 'awsAccountConfigId' when calling deleteAWSAccount"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/aws/accounts/{aws_account_config_id}" + .replaceAll( + "\\{" + "aws_account_config_id" + "\\}", + apiClient.escapeString(awsAccountConfigId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AwsIntegrationApi.deleteAWSAccount", + 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 AWS integration. + * + *

See {@link #deleteAWSAccountWithHttpInfo}. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteAWSAccountWithHttpInfoAsync( + String awsAccountConfigId) { + // Check if unstable operation is enabled + String operationId = "deleteAWSAccount"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'awsAccountConfigId' is set + if (awsAccountConfigId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'awsAccountConfigId' when calling deleteAWSAccount")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/aws/accounts/{aws_account_config_id}" + .replaceAll( + "\\{" + "aws_account_config_id" + "\\}", + apiClient.escapeString(awsAccountConfigId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AwsIntegrationApi.deleteAWSAccount", + 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 AWS integration by config ID. + * + *

See {@link #getAWSAccountWithHttpInfo}. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config (required) + * @return AWSAccountResponse + * @throws ApiException if fails to make API call + */ + public AWSAccountResponse getAWSAccount(String awsAccountConfigId) throws ApiException { + return getAWSAccountWithHttpInfo(awsAccountConfigId).getData(); + } + + /** + * Get an AWS integration by config ID. + * + *

See {@link #getAWSAccountWithHttpInfoAsync}. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config (required) + * @return CompletableFuture<AWSAccountResponse> + */ + public CompletableFuture getAWSAccountAsync(String awsAccountConfigId) { + return getAWSAccountWithHttpInfoAsync(awsAccountConfigId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get an AWS Account Integration Config + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config (required) + * @return ApiResponse<AWSAccountResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 AWS Account object -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getAWSAccountWithHttpInfo(String awsAccountConfigId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getAWSAccount"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'awsAccountConfigId' is set + if (awsAccountConfigId == null) { + throw new ApiException( + 400, "Missing the required parameter 'awsAccountConfigId' when calling getAWSAccount"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/aws/accounts/{aws_account_config_id}" + .replaceAll( + "\\{" + "aws_account_config_id" + "\\}", + apiClient.escapeString(awsAccountConfigId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AwsIntegrationApi.getAWSAccount", + 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 AWS integration by config ID. + * + *

See {@link #getAWSAccountWithHttpInfo}. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config (required) + * @return CompletableFuture<ApiResponse<AWSAccountResponse>> + */ + public CompletableFuture> getAWSAccountWithHttpInfoAsync( + String awsAccountConfigId) { + // Check if unstable operation is enabled + String operationId = "getAWSAccount"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'awsAccountConfigId' is set + if (awsAccountConfigId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'awsAccountConfigId' when calling getAWSAccount")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/aws/accounts/{aws_account_config_id}" + .replaceAll( + "\\{" + "aws_account_config_id" + "\\}", + apiClient.escapeString(awsAccountConfigId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AwsIntegrationApi.getAWSAccount", + 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() {}); + } + + /** Manage optional parameters to listAWSAccounts. */ + public static class ListAWSAccountsOptionalParameters { + private String awsAccountId; + + /** + * Set awsAccountId. + * + * @param awsAccountId Optional query filter accounts by AWS Account ID (optional) + * @return ListAWSAccountsOptionalParameters + */ + public ListAWSAccountsOptionalParameters awsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + } + + /** + * List all AWS integrations. + * + *

See {@link #listAWSAccountsWithHttpInfo}. + * + * @return AWSAccountsResponse + * @throws ApiException if fails to make API call + */ + public AWSAccountsResponse listAWSAccounts() throws ApiException { + return listAWSAccountsWithHttpInfo(new ListAWSAccountsOptionalParameters()).getData(); + } + + /** + * List all AWS integrations. + * + *

See {@link #listAWSAccountsWithHttpInfoAsync}. + * + * @return CompletableFuture<AWSAccountsResponse> + */ + public CompletableFuture listAWSAccountsAsync() { + return listAWSAccountsWithHttpInfoAsync(new ListAWSAccountsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List all AWS integrations. + * + *

See {@link #listAWSAccountsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return AWSAccountsResponse + * @throws ApiException if fails to make API call + */ + public AWSAccountsResponse listAWSAccounts(ListAWSAccountsOptionalParameters parameters) + throws ApiException { + return listAWSAccountsWithHttpInfo(parameters).getData(); + } + + /** + * List all AWS integrations. + * + *

See {@link #listAWSAccountsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<AWSAccountsResponse> + */ + public CompletableFuture listAWSAccountsAsync( + ListAWSAccountsOptionalParameters parameters) { + return listAWSAccountsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a list of AWS Account Integration Configs. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<AWSAccountsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 AWS Accounts List object -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listAWSAccountsWithHttpInfo( + ListAWSAccountsOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listAWSAccounts"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + String awsAccountId = parameters.awsAccountId; + // create path and map variables + String localVarPath = "/api/v2/integration/aws/accounts"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "aws_account_id", awsAccountId)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AwsIntegrationApi.listAWSAccounts", + localVarPath, + localVarQueryParams, + 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() {}); + } + + /** + * List all AWS integrations. + * + *

See {@link #listAWSAccountsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<AWSAccountsResponse>> + */ + public CompletableFuture> listAWSAccountsWithHttpInfoAsync( + ListAWSAccountsOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listAWSAccounts"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + String awsAccountId = parameters.awsAccountId; + // create path and map variables + String localVarPath = "/api/v2/integration/aws/accounts"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "aws_account_id", awsAccountId)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AwsIntegrationApi.listAWSAccounts", + localVarPath, + localVarQueryParams, + 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() {}); + } + + /** + * List available namespaces. + * + *

See {@link #listAWSNamespacesWithHttpInfo}. + * + * @return AWSNamespacesResponse + * @throws ApiException if fails to make API call + */ + public AWSNamespacesResponse listAWSNamespaces() throws ApiException { + return listAWSNamespacesWithHttpInfo().getData(); + } + + /** + * List available namespaces. + * + *

See {@link #listAWSNamespacesWithHttpInfoAsync}. + * + * @return CompletableFuture<AWSNamespacesResponse> + */ + public CompletableFuture listAWSNamespacesAsync() { + return listAWSNamespacesWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a list of available AWS CloudWatch namespaces that can send metrics to Datadog. + * + * @return ApiResponse<AWSNamespacesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 AWS Namespaces List object -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listAWSNamespacesWithHttpInfo() throws ApiException { + // Check if unstable operation is enabled + String operationId = "listAWSNamespaces"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/integration/aws/available_namespaces"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AwsIntegrationApi.listAWSNamespaces", + 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() {}); + } + + /** + * List available namespaces. + * + *

See {@link #listAWSNamespacesWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<AWSNamespacesResponse>> + */ + public CompletableFuture> + listAWSNamespacesWithHttpInfoAsync() { + // Check if unstable operation is enabled + String operationId = "listAWSNamespaces"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/integration/aws/available_namespaces"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AwsIntegrationApi.listAWSNamespaces", + 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 AWS integration. + * + *

See {@link #updateAWSAccountWithHttpInfo}. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config (required) + * @param body (required) + * @return AWSAccountResponse + * @throws ApiException if fails to make API call + */ + public AWSAccountResponse updateAWSAccount( + String awsAccountConfigId, AWSAccountUpdateRequest body) throws ApiException { + return updateAWSAccountWithHttpInfo(awsAccountConfigId, body).getData(); + } + + /** + * Update an AWS integration. + * + *

See {@link #updateAWSAccountWithHttpInfoAsync}. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config (required) + * @param body (required) + * @return CompletableFuture<AWSAccountResponse> + */ + public CompletableFuture updateAWSAccountAsync( + String awsAccountConfigId, AWSAccountUpdateRequest body) { + return updateAWSAccountWithHttpInfoAsync(awsAccountConfigId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update an AWS Account Integration Config + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config (required) + * @param body (required) + * @return ApiResponse<AWSAccountResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 AWS Account object -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateAWSAccountWithHttpInfo( + String awsAccountConfigId, AWSAccountUpdateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateAWSAccount"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'awsAccountConfigId' is set + if (awsAccountConfigId == null) { + throw new ApiException( + 400, "Missing the required parameter 'awsAccountConfigId' when calling updateAWSAccount"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateAWSAccount"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/aws/accounts/{aws_account_config_id}" + .replaceAll( + "\\{" + "aws_account_config_id" + "\\}", + apiClient.escapeString(awsAccountConfigId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AwsIntegrationApi.updateAWSAccount", + 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 AWS integration. + * + *

See {@link #updateAWSAccountWithHttpInfo}. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<AWSAccountResponse>> + */ + public CompletableFuture> updateAWSAccountWithHttpInfoAsync( + String awsAccountConfigId, AWSAccountUpdateRequest body) { + // Check if unstable operation is enabled + String operationId = "updateAWSAccount"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'awsAccountConfigId' is set + if (awsAccountConfigId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'awsAccountConfigId' when calling updateAWSAccount")); + 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 updateAWSAccount")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/aws/accounts/{aws_account_config_id}" + .replaceAll( + "\\{" + "aws_account_config_id" + "\\}", + apiClient.escapeString(awsAccountConfigId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AwsIntegrationApi.updateAWSAccount", + 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/api/AwsLogsIntegrationApi.java b/src/main/java/com/datadog/api/client/v2/api/AwsLogsIntegrationApi.java new file mode 100644 index 00000000000..cb66b6bc36d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/AwsLogsIntegrationApi.java @@ -0,0 +1,173 @@ +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.AWSLogsServicesResponse; +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 AwsLogsIntegrationApi { + private ApiClient apiClient; + + public AwsLogsIntegrationApi() { + this(ApiClient.getDefaultApiClient()); + } + + public AwsLogsIntegrationApi(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; + } + + /** + * Get list of AWS log ready services. + * + *

See {@link #listAWSLogsServicesWithHttpInfo}. + * + * @return AWSLogsServicesResponse + * @throws ApiException if fails to make API call + */ + public AWSLogsServicesResponse listAWSLogsServices() throws ApiException { + return listAWSLogsServicesWithHttpInfo().getData(); + } + + /** + * Get list of AWS log ready services. + * + *

See {@link #listAWSLogsServicesWithHttpInfoAsync}. + * + * @return CompletableFuture<AWSLogsServicesResponse> + */ + public CompletableFuture listAWSLogsServicesAsync() { + return listAWSLogsServicesWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a list of AWS services that can send logs to Datadog. + * + * @return ApiResponse<AWSLogsServicesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 AWS Logs Services List object -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listAWSLogsServicesWithHttpInfo() + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listAWSLogsServices"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/integration/aws/logs/services"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AwsLogsIntegrationApi.listAWSLogsServices", + 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 list of AWS log ready services. + * + *

See {@link #listAWSLogsServicesWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<AWSLogsServicesResponse>> + */ + public CompletableFuture> + listAWSLogsServicesWithHttpInfoAsync() { + // Check if unstable operation is enabled + String operationId = "listAWSLogsServices"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/integration/aws/logs/services"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AwsLogsIntegrationApi.listAWSLogsServices", + 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() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSAccountCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/AWSAccountCreateRequest.java new file mode 100644 index 00000000000..449a09a1561 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSAccountCreateRequest.java @@ -0,0 +1,145 @@ +/* + * 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; + +/** AWS Account Create Request body */ +@JsonPropertyOrder({AWSAccountCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSAccountCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AWSAccountCreateRequestData data; + + public AWSAccountCreateRequest() {} + + @JsonCreator + public AWSAccountCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) AWSAccountCreateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public AWSAccountCreateRequest data(AWSAccountCreateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * AWS Account Create Request data + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AWSAccountCreateRequestData getData() { + return data; + } + + public void setData(AWSAccountCreateRequestData data) { + this.data = data; + } + + /** + * 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 AWSAccountCreateRequest + */ + @JsonAnySetter + public AWSAccountCreateRequest 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 AWSAccountCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSAccountCreateRequest awsAccountCreateRequest = (AWSAccountCreateRequest) o; + return Objects.equals(this.data, awsAccountCreateRequest.data) + && Objects.equals(this.additionalProperties, awsAccountCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSAccountCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/AWSAccountCreateRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AWSAccountCreateRequestAttributes.java new file mode 100644 index 00000000000..2c9c13cb858 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSAccountCreateRequestAttributes.java @@ -0,0 +1,413 @@ +/* + * 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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** The AWS Account Integration Config to be created */ +@JsonPropertyOrder({ + AWSAccountCreateRequestAttributes.JSON_PROPERTY_ACCOUNT_TAGS, + AWSAccountCreateRequestAttributes.JSON_PROPERTY_AUTH_CONFIG, + AWSAccountCreateRequestAttributes.JSON_PROPERTY_AWS_ACCOUNT_ID, + AWSAccountCreateRequestAttributes.JSON_PROPERTY_AWS_PARTITION, + AWSAccountCreateRequestAttributes.JSON_PROPERTY_AWS_REGIONS, + AWSAccountCreateRequestAttributes.JSON_PROPERTY_LOGS_CONFIG, + AWSAccountCreateRequestAttributes.JSON_PROPERTY_METRICS_CONFIG, + AWSAccountCreateRequestAttributes.JSON_PROPERTY_RESOURCES_CONFIG, + AWSAccountCreateRequestAttributes.JSON_PROPERTY_TRACES_CONFIG +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSAccountCreateRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACCOUNT_TAGS = "account_tags"; + private JsonNullable> accountTags = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_AUTH_CONFIG = "auth_config"; + private AWSAuthConfig authConfig; + + public static final String JSON_PROPERTY_AWS_ACCOUNT_ID = "aws_account_id"; + private String awsAccountId; + + public static final String JSON_PROPERTY_AWS_PARTITION = "aws_partition"; + private AWSAccountPartition awsPartition = AWSAccountPartition.AWS; + + public static final String JSON_PROPERTY_AWS_REGIONS = "aws_regions"; + private AWSRegions awsRegions; + + public static final String JSON_PROPERTY_LOGS_CONFIG = "logs_config"; + private AWSLogsConfig logsConfig; + + public static final String JSON_PROPERTY_METRICS_CONFIG = "metrics_config"; + private AWSMetricsConfig metricsConfig; + + public static final String JSON_PROPERTY_RESOURCES_CONFIG = "resources_config"; + private AWSResourcesConfig resourcesConfig; + + public static final String JSON_PROPERTY_TRACES_CONFIG = "traces_config"; + private AWSTracesConfig tracesConfig; + + public AWSAccountCreateRequestAttributes() {} + + @JsonCreator + public AWSAccountCreateRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_AUTH_CONFIG) AWSAuthConfig authConfig, + @JsonProperty(required = true, value = JSON_PROPERTY_AWS_ACCOUNT_ID) String awsAccountId, + @JsonProperty(required = true, value = JSON_PROPERTY_AWS_PARTITION) + AWSAccountPartition awsPartition) { + this.authConfig = authConfig; + this.unparsed |= authConfig.unparsed; + this.awsAccountId = awsAccountId; + this.awsPartition = awsPartition; + this.unparsed |= !awsPartition.isValid(); + } + + public AWSAccountCreateRequestAttributes accountTags(List accountTags) { + this.accountTags = JsonNullable.>of(accountTags); + return this; + } + + public AWSAccountCreateRequestAttributes addAccountTagsItem(String accountTagsItem) { + if (this.accountTags == null || !this.accountTags.isPresent()) { + this.accountTags = JsonNullable.>of(new ArrayList<>()); + } + try { + this.accountTags.get().add(accountTagsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Tags to apply to all metrics in the account + * + * @return accountTags + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getAccountTags() { + return accountTags.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ACCOUNT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getAccountTags_JsonNullable() { + return accountTags; + } + + @JsonProperty(JSON_PROPERTY_ACCOUNT_TAGS) + public void setAccountTags_JsonNullable(JsonNullable> accountTags) { + this.accountTags = accountTags; + } + + public void setAccountTags(List accountTags) { + this.accountTags = JsonNullable.>of(accountTags); + } + + public AWSAccountCreateRequestAttributes authConfig(AWSAuthConfig authConfig) { + this.authConfig = authConfig; + this.unparsed |= authConfig.unparsed; + return this; + } + + /** + * AWS Authentication config + * + * @return authConfig + */ + @JsonProperty(JSON_PROPERTY_AUTH_CONFIG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AWSAuthConfig getAuthConfig() { + return authConfig; + } + + public void setAuthConfig(AWSAuthConfig authConfig) { + this.authConfig = authConfig; + } + + public AWSAccountCreateRequestAttributes awsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * AWS Account ID + * + * @return awsAccountId + */ + @JsonProperty(JSON_PROPERTY_AWS_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAwsAccountId() { + return awsAccountId; + } + + public void setAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + } + + public AWSAccountCreateRequestAttributes awsPartition(AWSAccountPartition awsPartition) { + this.awsPartition = awsPartition; + this.unparsed |= !awsPartition.isValid(); + return this; + } + + /** + * AWS Account partition + * + * @return awsPartition + */ + @JsonProperty(JSON_PROPERTY_AWS_PARTITION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AWSAccountPartition getAwsPartition() { + return awsPartition; + } + + public void setAwsPartition(AWSAccountPartition awsPartition) { + if (!awsPartition.isValid()) { + this.unparsed = true; + } + this.awsPartition = awsPartition; + } + + public AWSAccountCreateRequestAttributes awsRegions(AWSRegions awsRegions) { + this.awsRegions = awsRegions; + this.unparsed |= awsRegions.unparsed; + return this; + } + + /** + * AWS Regions to collect data from + * + * @return awsRegions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AWS_REGIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSRegions getAwsRegions() { + return awsRegions; + } + + public void setAwsRegions(AWSRegions awsRegions) { + this.awsRegions = awsRegions; + } + + public AWSAccountCreateRequestAttributes logsConfig(AWSLogsConfig logsConfig) { + this.logsConfig = logsConfig; + this.unparsed |= logsConfig.unparsed; + return this; + } + + /** + * AWS Logs config + * + * @return logsConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOGS_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSLogsConfig getLogsConfig() { + return logsConfig; + } + + public void setLogsConfig(AWSLogsConfig logsConfig) { + this.logsConfig = logsConfig; + } + + public AWSAccountCreateRequestAttributes metricsConfig(AWSMetricsConfig metricsConfig) { + this.metricsConfig = metricsConfig; + this.unparsed |= metricsConfig.unparsed; + return this; + } + + /** + * AWS Metrics config + * + * @return metricsConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METRICS_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSMetricsConfig getMetricsConfig() { + return metricsConfig; + } + + public void setMetricsConfig(AWSMetricsConfig metricsConfig) { + this.metricsConfig = metricsConfig; + } + + public AWSAccountCreateRequestAttributes resourcesConfig(AWSResourcesConfig resourcesConfig) { + this.resourcesConfig = resourcesConfig; + this.unparsed |= resourcesConfig.unparsed; + return this; + } + + /** + * AWS Resources config + * + * @return resourcesConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESOURCES_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSResourcesConfig getResourcesConfig() { + return resourcesConfig; + } + + public void setResourcesConfig(AWSResourcesConfig resourcesConfig) { + this.resourcesConfig = resourcesConfig; + } + + public AWSAccountCreateRequestAttributes tracesConfig(AWSTracesConfig tracesConfig) { + this.tracesConfig = tracesConfig; + this.unparsed |= tracesConfig.unparsed; + return this; + } + + /** + * AWS Traces config + * + * @return tracesConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRACES_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSTracesConfig getTracesConfig() { + return tracesConfig; + } + + public void setTracesConfig(AWSTracesConfig tracesConfig) { + this.tracesConfig = tracesConfig; + } + + /** + * 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 AWSAccountCreateRequestAttributes + */ + @JsonAnySetter + public AWSAccountCreateRequestAttributes 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 AWSAccountCreateRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSAccountCreateRequestAttributes awsAccountCreateRequestAttributes = + (AWSAccountCreateRequestAttributes) o; + return Objects.equals(this.accountTags, awsAccountCreateRequestAttributes.accountTags) + && Objects.equals(this.authConfig, awsAccountCreateRequestAttributes.authConfig) + && Objects.equals(this.awsAccountId, awsAccountCreateRequestAttributes.awsAccountId) + && Objects.equals(this.awsPartition, awsAccountCreateRequestAttributes.awsPartition) + && Objects.equals(this.awsRegions, awsAccountCreateRequestAttributes.awsRegions) + && Objects.equals(this.logsConfig, awsAccountCreateRequestAttributes.logsConfig) + && Objects.equals(this.metricsConfig, awsAccountCreateRequestAttributes.metricsConfig) + && Objects.equals(this.resourcesConfig, awsAccountCreateRequestAttributes.resourcesConfig) + && Objects.equals(this.tracesConfig, awsAccountCreateRequestAttributes.tracesConfig) + && Objects.equals( + this.additionalProperties, awsAccountCreateRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + accountTags, + authConfig, + awsAccountId, + awsPartition, + awsRegions, + logsConfig, + metricsConfig, + resourcesConfig, + tracesConfig, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSAccountCreateRequestAttributes {\n"); + sb.append(" accountTags: ").append(toIndentedString(accountTags)).append("\n"); + sb.append(" authConfig: ").append(toIndentedString(authConfig)).append("\n"); + sb.append(" awsAccountId: ").append(toIndentedString(awsAccountId)).append("\n"); + sb.append(" awsPartition: ").append(toIndentedString(awsPartition)).append("\n"); + sb.append(" awsRegions: ").append(toIndentedString(awsRegions)).append("\n"); + sb.append(" logsConfig: ").append(toIndentedString(logsConfig)).append("\n"); + sb.append(" metricsConfig: ").append(toIndentedString(metricsConfig)).append("\n"); + sb.append(" resourcesConfig: ").append(toIndentedString(resourcesConfig)).append("\n"); + sb.append(" tracesConfig: ").append(toIndentedString(tracesConfig)).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/AWSAccountCreateRequestData.java b/src/main/java/com/datadog/api/client/v2/model/AWSAccountCreateRequestData.java new file mode 100644 index 00000000000..8dac7679846 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSAccountCreateRequestData.java @@ -0,0 +1,182 @@ +/* + * 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; + +/** AWS Account Create Request data */ +@JsonPropertyOrder({ + AWSAccountCreateRequestData.JSON_PROPERTY_ATTRIBUTES, + AWSAccountCreateRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSAccountCreateRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private AWSAccountCreateRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AWSAccountType type = AWSAccountType.ACCOUNT; + + public AWSAccountCreateRequestData() {} + + @JsonCreator + public AWSAccountCreateRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + AWSAccountCreateRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) AWSAccountType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AWSAccountCreateRequestData attributes(AWSAccountCreateRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The AWS Account Integration Config to be created + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AWSAccountCreateRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(AWSAccountCreateRequestAttributes attributes) { + this.attributes = attributes; + } + + public AWSAccountCreateRequestData type(AWSAccountType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * AWS Account resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AWSAccountType getType() { + return type; + } + + public void setType(AWSAccountType 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 AWSAccountCreateRequestData + */ + @JsonAnySetter + public AWSAccountCreateRequestData 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 AWSAccountCreateRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSAccountCreateRequestData awsAccountCreateRequestData = (AWSAccountCreateRequestData) o; + return Objects.equals(this.attributes, awsAccountCreateRequestData.attributes) + && Objects.equals(this.type, awsAccountCreateRequestData.type) + && Objects.equals( + this.additionalProperties, awsAccountCreateRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSAccountCreateRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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/AWSAccountPartition.java b/src/main/java/com/datadog/api/client/v2/model/AWSAccountPartition.java new file mode 100644 index 00000000000..5b6d72225ec --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSAccountPartition.java @@ -0,0 +1,57 @@ +/* + * 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; + +/** AWS Account partition */ +@JsonSerialize(using = AWSAccountPartition.AWSAccountPartitionSerializer.class) +public class AWSAccountPartition extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("aws", "aws-cn", "aws-us-gov")); + + public static final AWSAccountPartition AWS = new AWSAccountPartition("aws"); + public static final AWSAccountPartition AWS_CN = new AWSAccountPartition("aws-cn"); + public static final AWSAccountPartition AWS_US_GOV = new AWSAccountPartition("aws-us-gov"); + + AWSAccountPartition(String value) { + super(value, allowedValues); + } + + public static class AWSAccountPartitionSerializer extends StdSerializer { + public AWSAccountPartitionSerializer(Class t) { + super(t); + } + + public AWSAccountPartitionSerializer() { + this(null); + } + + @Override + public void serialize( + AWSAccountPartition value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AWSAccountPartition fromValue(String value) { + return new AWSAccountPartition(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSAccountResponse.java b/src/main/java/com/datadog/api/client/v2/model/AWSAccountResponse.java new file mode 100644 index 00000000000..f71be990c6f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSAccountResponse.java @@ -0,0 +1,145 @@ +/* + * 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; + +/** AWS Account response body */ +@JsonPropertyOrder({AWSAccountResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSAccountResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AWSAccountResponseData data; + + public AWSAccountResponse() {} + + @JsonCreator + public AWSAccountResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) AWSAccountResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public AWSAccountResponse data(AWSAccountResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * AWS Account Response body + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AWSAccountResponseData getData() { + return data; + } + + public void setData(AWSAccountResponseData data) { + this.data = data; + } + + /** + * 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 AWSAccountResponse + */ + @JsonAnySetter + public AWSAccountResponse 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 AWSAccountResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSAccountResponse awsAccountResponse = (AWSAccountResponse) o; + return Objects.equals(this.data, awsAccountResponse.data) + && Objects.equals(this.additionalProperties, awsAccountResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSAccountResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/AWSAccountResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AWSAccountResponseAttributes.java new file mode 100644 index 00000000000..2f300f693c0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSAccountResponseAttributes.java @@ -0,0 +1,446 @@ +/* + * 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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** The AWS Account Integration Config */ +@JsonPropertyOrder({ + AWSAccountResponseAttributes.JSON_PROPERTY_ACCOUNT_TAGS, + AWSAccountResponseAttributes.JSON_PROPERTY_AUTH_CONFIG, + AWSAccountResponseAttributes.JSON_PROPERTY_AWS_ACCOUNT_ID, + AWSAccountResponseAttributes.JSON_PROPERTY_AWS_PARTITION, + AWSAccountResponseAttributes.JSON_PROPERTY_AWS_REGIONS, + AWSAccountResponseAttributes.JSON_PROPERTY_CREATED_AT, + AWSAccountResponseAttributes.JSON_PROPERTY_LOGS_CONFIG, + AWSAccountResponseAttributes.JSON_PROPERTY_METRICS_CONFIG, + AWSAccountResponseAttributes.JSON_PROPERTY_MODIFIED_AT, + AWSAccountResponseAttributes.JSON_PROPERTY_RESOURCES_CONFIG, + AWSAccountResponseAttributes.JSON_PROPERTY_TRACES_CONFIG +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSAccountResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACCOUNT_TAGS = "account_tags"; + private JsonNullable> accountTags = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_AUTH_CONFIG = "auth_config"; + private AWSAuthConfig authConfig; + + public static final String JSON_PROPERTY_AWS_ACCOUNT_ID = "aws_account_id"; + private String awsAccountId; + + public static final String JSON_PROPERTY_AWS_PARTITION = "aws_partition"; + private AWSAccountPartition awsPartition = AWSAccountPartition.AWS; + + public static final String JSON_PROPERTY_AWS_REGIONS = "aws_regions"; + private AWSRegions awsRegions; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_LOGS_CONFIG = "logs_config"; + private AWSLogsConfig logsConfig; + + public static final String JSON_PROPERTY_METRICS_CONFIG = "metrics_config"; + private AWSMetricsConfig metricsConfig; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_RESOURCES_CONFIG = "resources_config"; + private AWSResourcesConfig resourcesConfig; + + public static final String JSON_PROPERTY_TRACES_CONFIG = "traces_config"; + private AWSTracesConfig tracesConfig; + + public AWSAccountResponseAttributes() {} + + @JsonCreator + public AWSAccountResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_AWS_ACCOUNT_ID) String awsAccountId) { + this.awsAccountId = awsAccountId; + } + + public AWSAccountResponseAttributes accountTags(List accountTags) { + this.accountTags = JsonNullable.>of(accountTags); + return this; + } + + public AWSAccountResponseAttributes addAccountTagsItem(String accountTagsItem) { + if (this.accountTags == null || !this.accountTags.isPresent()) { + this.accountTags = JsonNullable.>of(new ArrayList<>()); + } + try { + this.accountTags.get().add(accountTagsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Tags to apply to all metrics in the account + * + * @return accountTags + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getAccountTags() { + return accountTags.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ACCOUNT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getAccountTags_JsonNullable() { + return accountTags; + } + + @JsonProperty(JSON_PROPERTY_ACCOUNT_TAGS) + public void setAccountTags_JsonNullable(JsonNullable> accountTags) { + this.accountTags = accountTags; + } + + public void setAccountTags(List accountTags) { + this.accountTags = JsonNullable.>of(accountTags); + } + + public AWSAccountResponseAttributes authConfig(AWSAuthConfig authConfig) { + this.authConfig = authConfig; + this.unparsed |= authConfig.unparsed; + return this; + } + + /** + * AWS Authentication config + * + * @return authConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTH_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSAuthConfig getAuthConfig() { + return authConfig; + } + + public void setAuthConfig(AWSAuthConfig authConfig) { + this.authConfig = authConfig; + } + + public AWSAccountResponseAttributes awsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * AWS Account ID + * + * @return awsAccountId + */ + @JsonProperty(JSON_PROPERTY_AWS_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAwsAccountId() { + return awsAccountId; + } + + public void setAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + } + + public AWSAccountResponseAttributes awsPartition(AWSAccountPartition awsPartition) { + this.awsPartition = awsPartition; + this.unparsed |= !awsPartition.isValid(); + return this; + } + + /** + * AWS Account partition + * + * @return awsPartition + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AWS_PARTITION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSAccountPartition getAwsPartition() { + return awsPartition; + } + + public void setAwsPartition(AWSAccountPartition awsPartition) { + if (!awsPartition.isValid()) { + this.unparsed = true; + } + this.awsPartition = awsPartition; + } + + public AWSAccountResponseAttributes awsRegions(AWSRegions awsRegions) { + this.awsRegions = awsRegions; + this.unparsed |= awsRegions.unparsed; + return this; + } + + /** + * AWS Regions to collect data from + * + * @return awsRegions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AWS_REGIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSRegions getAwsRegions() { + return awsRegions; + } + + public void setAwsRegions(AWSRegions awsRegions) { + this.awsRegions = awsRegions; + } + + /** + * Timestamp of when the account integration was created + * + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public AWSAccountResponseAttributes logsConfig(AWSLogsConfig logsConfig) { + this.logsConfig = logsConfig; + this.unparsed |= logsConfig.unparsed; + return this; + } + + /** + * AWS Logs config + * + * @return logsConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOGS_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSLogsConfig getLogsConfig() { + return logsConfig; + } + + public void setLogsConfig(AWSLogsConfig logsConfig) { + this.logsConfig = logsConfig; + } + + public AWSAccountResponseAttributes metricsConfig(AWSMetricsConfig metricsConfig) { + this.metricsConfig = metricsConfig; + this.unparsed |= metricsConfig.unparsed; + return this; + } + + /** + * AWS Metrics config + * + * @return metricsConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METRICS_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSMetricsConfig getMetricsConfig() { + return metricsConfig; + } + + public void setMetricsConfig(AWSMetricsConfig metricsConfig) { + this.metricsConfig = metricsConfig; + } + + /** + * Timestamp of when the account integration was updated + * + * @return modifiedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public AWSAccountResponseAttributes resourcesConfig(AWSResourcesConfig resourcesConfig) { + this.resourcesConfig = resourcesConfig; + this.unparsed |= resourcesConfig.unparsed; + return this; + } + + /** + * AWS Resources config + * + * @return resourcesConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESOURCES_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSResourcesConfig getResourcesConfig() { + return resourcesConfig; + } + + public void setResourcesConfig(AWSResourcesConfig resourcesConfig) { + this.resourcesConfig = resourcesConfig; + } + + public AWSAccountResponseAttributes tracesConfig(AWSTracesConfig tracesConfig) { + this.tracesConfig = tracesConfig; + this.unparsed |= tracesConfig.unparsed; + return this; + } + + /** + * AWS Traces config + * + * @return tracesConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRACES_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSTracesConfig getTracesConfig() { + return tracesConfig; + } + + public void setTracesConfig(AWSTracesConfig tracesConfig) { + this.tracesConfig = tracesConfig; + } + + /** + * 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 AWSAccountResponseAttributes + */ + @JsonAnySetter + public AWSAccountResponseAttributes 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 AWSAccountResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSAccountResponseAttributes awsAccountResponseAttributes = (AWSAccountResponseAttributes) o; + return Objects.equals(this.accountTags, awsAccountResponseAttributes.accountTags) + && Objects.equals(this.authConfig, awsAccountResponseAttributes.authConfig) + && Objects.equals(this.awsAccountId, awsAccountResponseAttributes.awsAccountId) + && Objects.equals(this.awsPartition, awsAccountResponseAttributes.awsPartition) + && Objects.equals(this.awsRegions, awsAccountResponseAttributes.awsRegions) + && Objects.equals(this.createdAt, awsAccountResponseAttributes.createdAt) + && Objects.equals(this.logsConfig, awsAccountResponseAttributes.logsConfig) + && Objects.equals(this.metricsConfig, awsAccountResponseAttributes.metricsConfig) + && Objects.equals(this.modifiedAt, awsAccountResponseAttributes.modifiedAt) + && Objects.equals(this.resourcesConfig, awsAccountResponseAttributes.resourcesConfig) + && Objects.equals(this.tracesConfig, awsAccountResponseAttributes.tracesConfig) + && Objects.equals( + this.additionalProperties, awsAccountResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + accountTags, + authConfig, + awsAccountId, + awsPartition, + awsRegions, + createdAt, + logsConfig, + metricsConfig, + modifiedAt, + resourcesConfig, + tracesConfig, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSAccountResponseAttributes {\n"); + sb.append(" accountTags: ").append(toIndentedString(accountTags)).append("\n"); + sb.append(" authConfig: ").append(toIndentedString(authConfig)).append("\n"); + sb.append(" awsAccountId: ").append(toIndentedString(awsAccountId)).append("\n"); + sb.append(" awsPartition: ").append(toIndentedString(awsPartition)).append("\n"); + sb.append(" awsRegions: ").append(toIndentedString(awsRegions)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" logsConfig: ").append(toIndentedString(logsConfig)).append("\n"); + sb.append(" metricsConfig: ").append(toIndentedString(metricsConfig)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" resourcesConfig: ").append(toIndentedString(resourcesConfig)).append("\n"); + sb.append(" tracesConfig: ").append(toIndentedString(tracesConfig)).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/AWSAccountResponseData.java b/src/main/java/com/datadog/api/client/v2/model/AWSAccountResponseData.java new file mode 100644 index 00000000000..4776751e299 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSAccountResponseData.java @@ -0,0 +1,206 @@ +/* + * 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; + +/** AWS Account Response body */ +@JsonPropertyOrder({ + AWSAccountResponseData.JSON_PROPERTY_ATTRIBUTES, + AWSAccountResponseData.JSON_PROPERTY_ID, + AWSAccountResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSAccountResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private AWSAccountResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AWSAccountType type = AWSAccountType.ACCOUNT; + + public AWSAccountResponseData() {} + + @JsonCreator + public AWSAccountResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) AWSAccountType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AWSAccountResponseData attributes(AWSAccountResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The AWS Account Integration Config + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSAccountResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(AWSAccountResponseAttributes attributes) { + this.attributes = attributes; + } + + public AWSAccountResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Unique Datadog ID of the AWS Account Integration Config + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AWSAccountResponseData type(AWSAccountType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * AWS Account resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AWSAccountType getType() { + return type; + } + + public void setType(AWSAccountType 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 AWSAccountResponseData + */ + @JsonAnySetter + public AWSAccountResponseData 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 AWSAccountResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSAccountResponseData awsAccountResponseData = (AWSAccountResponseData) o; + return Objects.equals(this.attributes, awsAccountResponseData.attributes) + && Objects.equals(this.id, awsAccountResponseData.id) + && Objects.equals(this.type, awsAccountResponseData.type) + && Objects.equals(this.additionalProperties, awsAccountResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSAccountResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).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/AWSAccountType.java b/src/main/java/com/datadog/api/client/v2/model/AWSAccountType.java new file mode 100644 index 00000000000..d74f4981559 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSAccountType.java @@ -0,0 +1,53 @@ +/* + * 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; + +/** AWS Account resource type. */ +@JsonSerialize(using = AWSAccountType.AWSAccountTypeSerializer.class) +public class AWSAccountType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("account")); + + public static final AWSAccountType ACCOUNT = new AWSAccountType("account"); + + AWSAccountType(String value) { + super(value, allowedValues); + } + + public static class AWSAccountTypeSerializer extends StdSerializer { + public AWSAccountTypeSerializer(Class t) { + super(t); + } + + public AWSAccountTypeSerializer() { + this(null); + } + + @Override + public void serialize(AWSAccountType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AWSAccountType fromValue(String value) { + return new AWSAccountType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSAccountUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/AWSAccountUpdateRequest.java new file mode 100644 index 00000000000..958c125e44c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSAccountUpdateRequest.java @@ -0,0 +1,145 @@ +/* + * 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; + +/** AWS Account Update Request body */ +@JsonPropertyOrder({AWSAccountUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSAccountUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AWSAccountUpdateRequestData data; + + public AWSAccountUpdateRequest() {} + + @JsonCreator + public AWSAccountUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) AWSAccountUpdateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public AWSAccountUpdateRequest data(AWSAccountUpdateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * AWS Account Update Request data + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AWSAccountUpdateRequestData getData() { + return data; + } + + public void setData(AWSAccountUpdateRequestData data) { + this.data = data; + } + + /** + * 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 AWSAccountUpdateRequest + */ + @JsonAnySetter + public AWSAccountUpdateRequest 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 AWSAccountUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSAccountUpdateRequest awsAccountUpdateRequest = (AWSAccountUpdateRequest) o; + return Objects.equals(this.data, awsAccountUpdateRequest.data) + && Objects.equals(this.additionalProperties, awsAccountUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSAccountUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/AWSAccountUpdateRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AWSAccountUpdateRequestAttributes.java new file mode 100644 index 00000000000..9b7f6b0c670 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSAccountUpdateRequestAttributes.java @@ -0,0 +1,408 @@ +/* + * 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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** The AWS Account Integration Config to be updated */ +@JsonPropertyOrder({ + AWSAccountUpdateRequestAttributes.JSON_PROPERTY_ACCOUNT_TAGS, + AWSAccountUpdateRequestAttributes.JSON_PROPERTY_AUTH_CONFIG, + AWSAccountUpdateRequestAttributes.JSON_PROPERTY_AWS_ACCOUNT_ID, + AWSAccountUpdateRequestAttributes.JSON_PROPERTY_AWS_PARTITION, + AWSAccountUpdateRequestAttributes.JSON_PROPERTY_AWS_REGIONS, + AWSAccountUpdateRequestAttributes.JSON_PROPERTY_LOGS_CONFIG, + AWSAccountUpdateRequestAttributes.JSON_PROPERTY_METRICS_CONFIG, + AWSAccountUpdateRequestAttributes.JSON_PROPERTY_RESOURCES_CONFIG, + AWSAccountUpdateRequestAttributes.JSON_PROPERTY_TRACES_CONFIG +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSAccountUpdateRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACCOUNT_TAGS = "account_tags"; + private JsonNullable> accountTags = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_AUTH_CONFIG = "auth_config"; + private AWSAuthConfig authConfig; + + public static final String JSON_PROPERTY_AWS_ACCOUNT_ID = "aws_account_id"; + private String awsAccountId; + + public static final String JSON_PROPERTY_AWS_PARTITION = "aws_partition"; + private AWSAccountPartition awsPartition = AWSAccountPartition.AWS; + + public static final String JSON_PROPERTY_AWS_REGIONS = "aws_regions"; + private AWSRegions awsRegions; + + public static final String JSON_PROPERTY_LOGS_CONFIG = "logs_config"; + private AWSLogsConfig logsConfig; + + public static final String JSON_PROPERTY_METRICS_CONFIG = "metrics_config"; + private AWSMetricsConfig metricsConfig; + + public static final String JSON_PROPERTY_RESOURCES_CONFIG = "resources_config"; + private AWSResourcesConfig resourcesConfig; + + public static final String JSON_PROPERTY_TRACES_CONFIG = "traces_config"; + private AWSTracesConfig tracesConfig; + + public AWSAccountUpdateRequestAttributes() {} + + @JsonCreator + public AWSAccountUpdateRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_AWS_ACCOUNT_ID) String awsAccountId) { + this.awsAccountId = awsAccountId; + } + + public AWSAccountUpdateRequestAttributes accountTags(List accountTags) { + this.accountTags = JsonNullable.>of(accountTags); + return this; + } + + public AWSAccountUpdateRequestAttributes addAccountTagsItem(String accountTagsItem) { + if (this.accountTags == null || !this.accountTags.isPresent()) { + this.accountTags = JsonNullable.>of(new ArrayList<>()); + } + try { + this.accountTags.get().add(accountTagsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Tags to apply to all metrics in the account + * + * @return accountTags + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getAccountTags() { + return accountTags.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ACCOUNT_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getAccountTags_JsonNullable() { + return accountTags; + } + + @JsonProperty(JSON_PROPERTY_ACCOUNT_TAGS) + public void setAccountTags_JsonNullable(JsonNullable> accountTags) { + this.accountTags = accountTags; + } + + public void setAccountTags(List accountTags) { + this.accountTags = JsonNullable.>of(accountTags); + } + + public AWSAccountUpdateRequestAttributes authConfig(AWSAuthConfig authConfig) { + this.authConfig = authConfig; + this.unparsed |= authConfig.unparsed; + return this; + } + + /** + * AWS Authentication config + * + * @return authConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTH_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSAuthConfig getAuthConfig() { + return authConfig; + } + + public void setAuthConfig(AWSAuthConfig authConfig) { + this.authConfig = authConfig; + } + + public AWSAccountUpdateRequestAttributes awsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + return this; + } + + /** + * AWS Account ID + * + * @return awsAccountId + */ + @JsonProperty(JSON_PROPERTY_AWS_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAwsAccountId() { + return awsAccountId; + } + + public void setAwsAccountId(String awsAccountId) { + this.awsAccountId = awsAccountId; + } + + public AWSAccountUpdateRequestAttributes awsPartition(AWSAccountPartition awsPartition) { + this.awsPartition = awsPartition; + this.unparsed |= !awsPartition.isValid(); + return this; + } + + /** + * AWS Account partition + * + * @return awsPartition + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AWS_PARTITION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSAccountPartition getAwsPartition() { + return awsPartition; + } + + public void setAwsPartition(AWSAccountPartition awsPartition) { + if (!awsPartition.isValid()) { + this.unparsed = true; + } + this.awsPartition = awsPartition; + } + + public AWSAccountUpdateRequestAttributes awsRegions(AWSRegions awsRegions) { + this.awsRegions = awsRegions; + this.unparsed |= awsRegions.unparsed; + return this; + } + + /** + * AWS Regions to collect data from + * + * @return awsRegions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AWS_REGIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSRegions getAwsRegions() { + return awsRegions; + } + + public void setAwsRegions(AWSRegions awsRegions) { + this.awsRegions = awsRegions; + } + + public AWSAccountUpdateRequestAttributes logsConfig(AWSLogsConfig logsConfig) { + this.logsConfig = logsConfig; + this.unparsed |= logsConfig.unparsed; + return this; + } + + /** + * AWS Logs config + * + * @return logsConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOGS_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSLogsConfig getLogsConfig() { + return logsConfig; + } + + public void setLogsConfig(AWSLogsConfig logsConfig) { + this.logsConfig = logsConfig; + } + + public AWSAccountUpdateRequestAttributes metricsConfig(AWSMetricsConfig metricsConfig) { + this.metricsConfig = metricsConfig; + this.unparsed |= metricsConfig.unparsed; + return this; + } + + /** + * AWS Metrics config + * + * @return metricsConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METRICS_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSMetricsConfig getMetricsConfig() { + return metricsConfig; + } + + public void setMetricsConfig(AWSMetricsConfig metricsConfig) { + this.metricsConfig = metricsConfig; + } + + public AWSAccountUpdateRequestAttributes resourcesConfig(AWSResourcesConfig resourcesConfig) { + this.resourcesConfig = resourcesConfig; + this.unparsed |= resourcesConfig.unparsed; + return this; + } + + /** + * AWS Resources config + * + * @return resourcesConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESOURCES_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSResourcesConfig getResourcesConfig() { + return resourcesConfig; + } + + public void setResourcesConfig(AWSResourcesConfig resourcesConfig) { + this.resourcesConfig = resourcesConfig; + } + + public AWSAccountUpdateRequestAttributes tracesConfig(AWSTracesConfig tracesConfig) { + this.tracesConfig = tracesConfig; + this.unparsed |= tracesConfig.unparsed; + return this; + } + + /** + * AWS Traces config + * + * @return tracesConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRACES_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSTracesConfig getTracesConfig() { + return tracesConfig; + } + + public void setTracesConfig(AWSTracesConfig tracesConfig) { + this.tracesConfig = tracesConfig; + } + + /** + * 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 AWSAccountUpdateRequestAttributes + */ + @JsonAnySetter + public AWSAccountUpdateRequestAttributes 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 AWSAccountUpdateRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSAccountUpdateRequestAttributes awsAccountUpdateRequestAttributes = + (AWSAccountUpdateRequestAttributes) o; + return Objects.equals(this.accountTags, awsAccountUpdateRequestAttributes.accountTags) + && Objects.equals(this.authConfig, awsAccountUpdateRequestAttributes.authConfig) + && Objects.equals(this.awsAccountId, awsAccountUpdateRequestAttributes.awsAccountId) + && Objects.equals(this.awsPartition, awsAccountUpdateRequestAttributes.awsPartition) + && Objects.equals(this.awsRegions, awsAccountUpdateRequestAttributes.awsRegions) + && Objects.equals(this.logsConfig, awsAccountUpdateRequestAttributes.logsConfig) + && Objects.equals(this.metricsConfig, awsAccountUpdateRequestAttributes.metricsConfig) + && Objects.equals(this.resourcesConfig, awsAccountUpdateRequestAttributes.resourcesConfig) + && Objects.equals(this.tracesConfig, awsAccountUpdateRequestAttributes.tracesConfig) + && Objects.equals( + this.additionalProperties, awsAccountUpdateRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + accountTags, + authConfig, + awsAccountId, + awsPartition, + awsRegions, + logsConfig, + metricsConfig, + resourcesConfig, + tracesConfig, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSAccountUpdateRequestAttributes {\n"); + sb.append(" accountTags: ").append(toIndentedString(accountTags)).append("\n"); + sb.append(" authConfig: ").append(toIndentedString(authConfig)).append("\n"); + sb.append(" awsAccountId: ").append(toIndentedString(awsAccountId)).append("\n"); + sb.append(" awsPartition: ").append(toIndentedString(awsPartition)).append("\n"); + sb.append(" awsRegions: ").append(toIndentedString(awsRegions)).append("\n"); + sb.append(" logsConfig: ").append(toIndentedString(logsConfig)).append("\n"); + sb.append(" metricsConfig: ").append(toIndentedString(metricsConfig)).append("\n"); + sb.append(" resourcesConfig: ").append(toIndentedString(resourcesConfig)).append("\n"); + sb.append(" tracesConfig: ").append(toIndentedString(tracesConfig)).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/AWSAccountUpdateRequestData.java b/src/main/java/com/datadog/api/client/v2/model/AWSAccountUpdateRequestData.java new file mode 100644 index 00000000000..4a075239aa3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSAccountUpdateRequestData.java @@ -0,0 +1,209 @@ +/* + * 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; + +/** AWS Account Update Request data */ +@JsonPropertyOrder({ + AWSAccountUpdateRequestData.JSON_PROPERTY_ATTRIBUTES, + AWSAccountUpdateRequestData.JSON_PROPERTY_ID, + AWSAccountUpdateRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSAccountUpdateRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private AWSAccountUpdateRequestAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AWSAccountType type = AWSAccountType.ACCOUNT; + + public AWSAccountUpdateRequestData() {} + + @JsonCreator + public AWSAccountUpdateRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + AWSAccountUpdateRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) AWSAccountType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AWSAccountUpdateRequestData attributes(AWSAccountUpdateRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The AWS Account Integration Config to be updated + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AWSAccountUpdateRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(AWSAccountUpdateRequestAttributes attributes) { + this.attributes = attributes; + } + + public AWSAccountUpdateRequestData id(String id) { + this.id = id; + return this; + } + + /** + * Unique Datadog ID of the AWS Account Integration Config + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AWSAccountUpdateRequestData type(AWSAccountType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * AWS Account resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AWSAccountType getType() { + return type; + } + + public void setType(AWSAccountType 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 AWSAccountUpdateRequestData + */ + @JsonAnySetter + public AWSAccountUpdateRequestData 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 AWSAccountUpdateRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSAccountUpdateRequestData awsAccountUpdateRequestData = (AWSAccountUpdateRequestData) o; + return Objects.equals(this.attributes, awsAccountUpdateRequestData.attributes) + && Objects.equals(this.id, awsAccountUpdateRequestData.id) + && Objects.equals(this.type, awsAccountUpdateRequestData.type) + && Objects.equals( + this.additionalProperties, awsAccountUpdateRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSAccountUpdateRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).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/AWSAccountsResponse.java b/src/main/java/com/datadog/api/client/v2/model/AWSAccountsResponse.java new file mode 100644 index 00000000000..3c271e6c3aa --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSAccountsResponse.java @@ -0,0 +1,155 @@ +/* + * 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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** AWS Accounts response body */ +@JsonPropertyOrder({AWSAccountsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSAccountsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public AWSAccountsResponse() {} + + @JsonCreator + public AWSAccountsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public AWSAccountsResponse data(List data) { + this.data = data; + for (AWSAccountResponseData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public AWSAccountsResponse addDataItem(AWSAccountResponseData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of AWS Account Integration Configs + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * 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 AWSAccountsResponse + */ + @JsonAnySetter + public AWSAccountsResponse 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 AWSAccountsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSAccountsResponse awsAccountsResponse = (AWSAccountsResponse) o; + return Objects.equals(this.data, awsAccountsResponse.data) + && Objects.equals(this.additionalProperties, awsAccountsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSAccountsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/AWSAuthConfig.java b/src/main/java/com/datadog/api/client/v2/model/AWSAuthConfig.java new file mode 100644 index 00000000000..1c9c62bf68a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSAuthConfig.java @@ -0,0 +1,274 @@ +/* + * 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 = AWSAuthConfig.AWSAuthConfigDeserializer.class) +@JsonSerialize(using = AWSAuthConfig.AWSAuthConfigSerializer.class) +public class AWSAuthConfig extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(AWSAuthConfig.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class AWSAuthConfigSerializer extends StdSerializer { + public AWSAuthConfigSerializer(Class t) { + super(t); + } + + public AWSAuthConfigSerializer() { + this(null); + } + + @Override + public void serialize(AWSAuthConfig value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class AWSAuthConfigDeserializer extends StdDeserializer { + public AWSAuthConfigDeserializer() { + this(AWSAuthConfig.class); + } + + public AWSAuthConfigDeserializer(Class vc) { + super(vc); + } + + @Override + public AWSAuthConfig 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 AWSAuthConfigKeys + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (AWSAuthConfigKeys.class.equals(Integer.class) + || AWSAuthConfigKeys.class.equals(Long.class) + || AWSAuthConfigKeys.class.equals(Float.class) + || AWSAuthConfigKeys.class.equals(Double.class) + || AWSAuthConfigKeys.class.equals(Boolean.class) + || AWSAuthConfigKeys.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((AWSAuthConfigKeys.class.equals(Integer.class) + || AWSAuthConfigKeys.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((AWSAuthConfigKeys.class.equals(Float.class) + || AWSAuthConfigKeys.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (AWSAuthConfigKeys.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (AWSAuthConfigKeys.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(AWSAuthConfigKeys.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 (!((AWSAuthConfigKeys) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'AWSAuthConfigKeys'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'AWSAuthConfigKeys'", e); + } + + // deserialize AWSAuthConfigRole + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (AWSAuthConfigRole.class.equals(Integer.class) + || AWSAuthConfigRole.class.equals(Long.class) + || AWSAuthConfigRole.class.equals(Float.class) + || AWSAuthConfigRole.class.equals(Double.class) + || AWSAuthConfigRole.class.equals(Boolean.class) + || AWSAuthConfigRole.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((AWSAuthConfigRole.class.equals(Integer.class) + || AWSAuthConfigRole.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((AWSAuthConfigRole.class.equals(Float.class) + || AWSAuthConfigRole.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (AWSAuthConfigRole.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (AWSAuthConfigRole.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(AWSAuthConfigRole.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 (!((AWSAuthConfigRole) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'AWSAuthConfigRole'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'AWSAuthConfigRole'", e); + } + + AWSAuthConfig ret = new AWSAuthConfig(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public AWSAuthConfig getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "AWSAuthConfig cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public AWSAuthConfig() { + super("oneOf", Boolean.FALSE); + } + + public AWSAuthConfig(AWSAuthConfigKeys o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public AWSAuthConfig(AWSAuthConfigRole o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("AWSAuthConfigKeys", new GenericType() {}); + schemas.put("AWSAuthConfigRole", new GenericType() {}); + JSON.registerDescendants(AWSAuthConfig.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return AWSAuthConfig.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: AWSAuthConfigKeys, AWSAuthConfigRole + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(AWSAuthConfigKeys.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(AWSAuthConfigRole.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be AWSAuthConfigKeys, AWSAuthConfigRole"); + } + + /** + * Get the actual instance, which can be the following: AWSAuthConfigKeys, AWSAuthConfigRole + * + * @return The actual instance (AWSAuthConfigKeys, AWSAuthConfigRole) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `AWSAuthConfigKeys`. If the actual instance is not + * `AWSAuthConfigKeys`, the ClassCastException will be thrown. + * + * @return The actual instance of `AWSAuthConfigKeys` + * @throws ClassCastException if the instance is not `AWSAuthConfigKeys` + */ + public AWSAuthConfigKeys getAWSAuthConfigKeys() throws ClassCastException { + return (AWSAuthConfigKeys) super.getActualInstance(); + } + + /** + * Get the actual instance of `AWSAuthConfigRole`. If the actual instance is not + * `AWSAuthConfigRole`, the ClassCastException will be thrown. + * + * @return The actual instance of `AWSAuthConfigRole` + * @throws ClassCastException if the instance is not `AWSAuthConfigRole` + */ + public AWSAuthConfigRole getAWSAuthConfigRole() throws ClassCastException { + return (AWSAuthConfigRole) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSAuthConfigKeys.java b/src/main/java/com/datadog/api/client/v2/model/AWSAuthConfigKeys.java new file mode 100644 index 00000000000..eb74f5a1e82 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSAuthConfigKeys.java @@ -0,0 +1,172 @@ +/* + * 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; + +/** AWS Authentication config for key-based account */ +@JsonPropertyOrder({ + AWSAuthConfigKeys.JSON_PROPERTY_ACCESS_KEY_ID, + AWSAuthConfigKeys.JSON_PROPERTY_SECRET_ACCESS_KEY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSAuthConfigKeys { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACCESS_KEY_ID = "access_key_id"; + private String accessKeyId; + + public static final String JSON_PROPERTY_SECRET_ACCESS_KEY = "secret_access_key"; + private String secretAccessKey; + + public AWSAuthConfigKeys() {} + + @JsonCreator + public AWSAuthConfigKeys( + @JsonProperty(required = true, value = JSON_PROPERTY_ACCESS_KEY_ID) String accessKeyId) { + this.accessKeyId = accessKeyId; + } + + public AWSAuthConfigKeys accessKeyId(String accessKeyId) { + this.accessKeyId = accessKeyId; + return this; + } + + /** + * AWS Access Key ID + * + * @return accessKeyId + */ + @JsonProperty(JSON_PROPERTY_ACCESS_KEY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAccessKeyId() { + return accessKeyId; + } + + public void setAccessKeyId(String accessKeyId) { + this.accessKeyId = accessKeyId; + } + + public AWSAuthConfigKeys secretAccessKey(String secretAccessKey) { + this.secretAccessKey = secretAccessKey; + return this; + } + + /** + * AWS Secret Access Key + * + * @return secretAccessKey + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SECRET_ACCESS_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSecretAccessKey() { + return secretAccessKey; + } + + public void setSecretAccessKey(String secretAccessKey) { + this.secretAccessKey = secretAccessKey; + } + + /** + * 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 AWSAuthConfigKeys + */ + @JsonAnySetter + public AWSAuthConfigKeys 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 AWSAuthConfigKeys object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSAuthConfigKeys awsAuthConfigKeys = (AWSAuthConfigKeys) o; + return Objects.equals(this.accessKeyId, awsAuthConfigKeys.accessKeyId) + && Objects.equals(this.secretAccessKey, awsAuthConfigKeys.secretAccessKey) + && Objects.equals(this.additionalProperties, awsAuthConfigKeys.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessKeyId, secretAccessKey, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSAuthConfigKeys {\n"); + sb.append(" accessKeyId: ").append(toIndentedString(accessKeyId)).append("\n"); + sb.append(" secretAccessKey: ").append(toIndentedString(secretAccessKey)).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/AWSAuthConfigRole.java b/src/main/java/com/datadog/api/client/v2/model/AWSAuthConfigRole.java new file mode 100644 index 00000000000..cedf5bcb647 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSAuthConfigRole.java @@ -0,0 +1,172 @@ +/* + * 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; + +/** AWS Authentication config for role-based account */ +@JsonPropertyOrder({ + AWSAuthConfigRole.JSON_PROPERTY_EXTERNAL_ID, + AWSAuthConfigRole.JSON_PROPERTY_ROLE_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSAuthConfigRole { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_EXTERNAL_ID = "external_id"; + private String externalId; + + public static final String JSON_PROPERTY_ROLE_NAME = "role_name"; + private String roleName; + + public AWSAuthConfigRole() {} + + @JsonCreator + public AWSAuthConfigRole( + @JsonProperty(required = true, value = JSON_PROPERTY_ROLE_NAME) String roleName) { + this.roleName = roleName; + } + + public AWSAuthConfigRole externalId(String externalId) { + this.externalId = externalId; + return this; + } + + /** + * AWS IAM External ID for associated role + * + * @return externalId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXTERNAL_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExternalId() { + return externalId; + } + + public void setExternalId(String externalId) { + this.externalId = externalId; + } + + public AWSAuthConfigRole roleName(String roleName) { + this.roleName = roleName; + return this; + } + + /** + * AWS IAM Role name + * + * @return roleName + */ + @JsonProperty(JSON_PROPERTY_ROLE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRoleName() { + return roleName; + } + + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + /** + * 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 AWSAuthConfigRole + */ + @JsonAnySetter + public AWSAuthConfigRole 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 AWSAuthConfigRole object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSAuthConfigRole awsAuthConfigRole = (AWSAuthConfigRole) o; + return Objects.equals(this.externalId, awsAuthConfigRole.externalId) + && Objects.equals(this.roleName, awsAuthConfigRole.roleName) + && Objects.equals(this.additionalProperties, awsAuthConfigRole.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(externalId, roleName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSAuthConfigRole {\n"); + sb.append(" externalId: ").append(toIndentedString(externalId)).append("\n"); + sb.append(" roleName: ").append(toIndentedString(roleName)).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/AWSLambdaForwarderConfig.java b/src/main/java/com/datadog/api/client/v2/model/AWSLambdaForwarderConfig.java new file mode 100644 index 00000000000..f7feb5ba5ec --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSLambdaForwarderConfig.java @@ -0,0 +1,182 @@ +/* + * 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** AWS Lambda forwarder */ +@JsonPropertyOrder({ + AWSLambdaForwarderConfig.JSON_PROPERTY_LAMBDAS, + AWSLambdaForwarderConfig.JSON_PROPERTY_SOURCES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSLambdaForwarderConfig { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_LAMBDAS = "lambdas"; + private List lambdas = null; + + public static final String JSON_PROPERTY_SOURCES = "sources"; + private List sources = null; + + public AWSLambdaForwarderConfig lambdas(List lambdas) { + this.lambdas = lambdas; + return this; + } + + public AWSLambdaForwarderConfig addLambdasItem(String lambdasItem) { + if (this.lambdas == null) { + this.lambdas = new ArrayList<>(); + } + this.lambdas.add(lambdasItem); + return this; + } + + /** + * List of Datadog Lambda Log Forwarder ARNs + * + * @return lambdas + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAMBDAS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLambdas() { + return lambdas; + } + + public void setLambdas(List lambdas) { + this.lambdas = lambdas; + } + + public AWSLambdaForwarderConfig sources(List sources) { + this.sources = sources; + return this; + } + + public AWSLambdaForwarderConfig addSourcesItem(String sourcesItem) { + if (this.sources == null) { + this.sources = new ArrayList<>(); + } + this.sources.add(sourcesItem); + return this; + } + + /** + * List of AWS services that will send logs to the Datadog Lambda Log Forwarder + * + * @return sources + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOURCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSources() { + return sources; + } + + public void setSources(List sources) { + this.sources = sources; + } + + /** + * 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 AWSLambdaForwarderConfig + */ + @JsonAnySetter + public AWSLambdaForwarderConfig 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 AWSLambdaForwarderConfig object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSLambdaForwarderConfig awsLambdaForwarderConfig = (AWSLambdaForwarderConfig) o; + return Objects.equals(this.lambdas, awsLambdaForwarderConfig.lambdas) + && Objects.equals(this.sources, awsLambdaForwarderConfig.sources) + && Objects.equals(this.additionalProperties, awsLambdaForwarderConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(lambdas, sources, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSLambdaForwarderConfig {\n"); + sb.append(" lambdas: ").append(toIndentedString(lambdas)).append("\n"); + sb.append(" sources: ").append(toIndentedString(sources)).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/AWSLogsConfig.java b/src/main/java/com/datadog/api/client/v2/model/AWSLogsConfig.java new file mode 100644 index 00000000000..a915390f830 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSLogsConfig.java @@ -0,0 +1,136 @@ +/* + * 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.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; + +/** AWS Logs config */ +@JsonPropertyOrder({AWSLogsConfig.JSON_PROPERTY_LAMBDA_FORWARDER}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSLogsConfig { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_LAMBDA_FORWARDER = "lambda_forwarder"; + private AWSLambdaForwarderConfig lambdaForwarder; + + public AWSLogsConfig lambdaForwarder(AWSLambdaForwarderConfig lambdaForwarder) { + this.lambdaForwarder = lambdaForwarder; + this.unparsed |= lambdaForwarder.unparsed; + return this; + } + + /** + * AWS Lambda forwarder + * + * @return lambdaForwarder + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAMBDA_FORWARDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSLambdaForwarderConfig getLambdaForwarder() { + return lambdaForwarder; + } + + public void setLambdaForwarder(AWSLambdaForwarderConfig lambdaForwarder) { + this.lambdaForwarder = lambdaForwarder; + } + + /** + * 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 AWSLogsConfig + */ + @JsonAnySetter + public AWSLogsConfig 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 AWSLogsConfig object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSLogsConfig awsLogsConfig = (AWSLogsConfig) o; + return Objects.equals(this.lambdaForwarder, awsLogsConfig.lambdaForwarder) + && Objects.equals(this.additionalProperties, awsLogsConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(lambdaForwarder, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSLogsConfig {\n"); + sb.append(" lambdaForwarder: ").append(toIndentedString(lambdaForwarder)).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/AWSLogsServicesResponse.java b/src/main/java/com/datadog/api/client/v2/model/AWSLogsServicesResponse.java new file mode 100644 index 00000000000..ca3433db2cc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSLogsServicesResponse.java @@ -0,0 +1,145 @@ +/* + * 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; + +/** AWS Logs Services response body */ +@JsonPropertyOrder({AWSLogsServicesResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSLogsServicesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AWSLogsServicesResponseData data; + + public AWSLogsServicesResponse() {} + + @JsonCreator + public AWSLogsServicesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) AWSLogsServicesResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public AWSLogsServicesResponse data(AWSLogsServicesResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * AWS Logs Services response body + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AWSLogsServicesResponseData getData() { + return data; + } + + public void setData(AWSLogsServicesResponseData data) { + this.data = data; + } + + /** + * 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 AWSLogsServicesResponse + */ + @JsonAnySetter + public AWSLogsServicesResponse 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 AWSLogsServicesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSLogsServicesResponse awsLogsServicesResponse = (AWSLogsServicesResponse) o; + return Objects.equals(this.data, awsLogsServicesResponse.data) + && Objects.equals(this.additionalProperties, awsLogsServicesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSLogsServicesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/AWSLogsServicesResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AWSLogsServicesResponseAttributes.java new file mode 100644 index 00000000000..88307c8b2fd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSLogsServicesResponseAttributes.java @@ -0,0 +1,153 @@ +/* + * 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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** AWS Logs Services response body */ +@JsonPropertyOrder({AWSLogsServicesResponseAttributes.JSON_PROPERTY_LOGS_SERVICES}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSLogsServicesResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_LOGS_SERVICES = "logs_services"; + private List logsServices = new ArrayList<>(); + + public AWSLogsServicesResponseAttributes() {} + + @JsonCreator + public AWSLogsServicesResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_LOGS_SERVICES) + List logsServices) { + this.logsServices = logsServices; + } + + public AWSLogsServicesResponseAttributes logsServices(List logsServices) { + this.logsServices = logsServices; + return this; + } + + public AWSLogsServicesResponseAttributes addLogsServicesItem(String logsServicesItem) { + this.logsServices.add(logsServicesItem); + return this; + } + + /** + * List of AWS services that can send logs to Datadog + * + * @return logsServices + */ + @JsonProperty(JSON_PROPERTY_LOGS_SERVICES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getLogsServices() { + return logsServices; + } + + public void setLogsServices(List logsServices) { + this.logsServices = logsServices; + } + + /** + * 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 AWSLogsServicesResponseAttributes + */ + @JsonAnySetter + public AWSLogsServicesResponseAttributes 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 AWSLogsServicesResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSLogsServicesResponseAttributes awsLogsServicesResponseAttributes = + (AWSLogsServicesResponseAttributes) o; + return Objects.equals(this.logsServices, awsLogsServicesResponseAttributes.logsServices) + && Objects.equals( + this.additionalProperties, awsLogsServicesResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(logsServices, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSLogsServicesResponseAttributes {\n"); + sb.append(" logsServices: ").append(toIndentedString(logsServices)).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/AWSLogsServicesResponseData.java b/src/main/java/com/datadog/api/client/v2/model/AWSLogsServicesResponseData.java new file mode 100644 index 00000000000..fb389ac0be2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSLogsServicesResponseData.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.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; + +/** AWS Logs Services response body */ +@JsonPropertyOrder({ + AWSLogsServicesResponseData.JSON_PROPERTY_ATTRIBUTES, + AWSLogsServicesResponseData.JSON_PROPERTY_ID, + AWSLogsServicesResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSLogsServicesResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private AWSLogsServicesResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id = "logs_services"; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AWSLogsServicesResponseDataType type = AWSLogsServicesResponseDataType.LOGS_SERVICES; + + public AWSLogsServicesResponseData() {} + + @JsonCreator + public AWSLogsServicesResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + AWSLogsServicesResponseDataType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AWSLogsServicesResponseData attributes(AWSLogsServicesResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * AWS Logs Services response body + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSLogsServicesResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(AWSLogsServicesResponseAttributes attributes) { + this.attributes = attributes; + } + + public AWSLogsServicesResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The AWSLogsServicesResponseData id. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AWSLogsServicesResponseData type(AWSLogsServicesResponseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The AWSLogsServicesResponseData type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AWSLogsServicesResponseDataType getType() { + return type; + } + + public void setType(AWSLogsServicesResponseDataType 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 AWSLogsServicesResponseData + */ + @JsonAnySetter + public AWSLogsServicesResponseData 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 AWSLogsServicesResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSLogsServicesResponseData awsLogsServicesResponseData = (AWSLogsServicesResponseData) o; + return Objects.equals(this.attributes, awsLogsServicesResponseData.attributes) + && Objects.equals(this.id, awsLogsServicesResponseData.id) + && Objects.equals(this.type, awsLogsServicesResponseData.type) + && Objects.equals( + this.additionalProperties, awsLogsServicesResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSLogsServicesResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).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/AWSLogsServicesResponseDataType.java b/src/main/java/com/datadog/api/client/v2/model/AWSLogsServicesResponseDataType.java new file mode 100644 index 00000000000..b63d19f2993 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSLogsServicesResponseDataType.java @@ -0,0 +1,58 @@ +/* + * 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 AWSLogsServicesResponseData type. */ +@JsonSerialize( + using = AWSLogsServicesResponseDataType.AWSLogsServicesResponseDataTypeSerializer.class) +public class AWSLogsServicesResponseDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("logs_services")); + + public static final AWSLogsServicesResponseDataType LOGS_SERVICES = + new AWSLogsServicesResponseDataType("logs_services"); + + AWSLogsServicesResponseDataType(String value) { + super(value, allowedValues); + } + + public static class AWSLogsServicesResponseDataTypeSerializer + extends StdSerializer { + public AWSLogsServicesResponseDataTypeSerializer(Class t) { + super(t); + } + + public AWSLogsServicesResponseDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + AWSLogsServicesResponseDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AWSLogsServicesResponseDataType fromValue(String value) { + return new AWSLogsServicesResponseDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSMetricsConfig.java b/src/main/java/com/datadog/api/client/v2/model/AWSMetricsConfig.java new file mode 100644 index 00000000000..071d2805525 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSMetricsConfig.java @@ -0,0 +1,298 @@ +/* + * 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** AWS Metrics config */ +@JsonPropertyOrder({ + AWSMetricsConfig.JSON_PROPERTY_AUTOMUTE_ENABLED, + AWSMetricsConfig.JSON_PROPERTY_COLLECT_CLOUDWATCH_ALARMS, + AWSMetricsConfig.JSON_PROPERTY_COLLECT_CUSTOM_METRICS, + AWSMetricsConfig.JSON_PROPERTY_ENABLED, + AWSMetricsConfig.JSON_PROPERTY_NAMESPACE_FILTERS, + AWSMetricsConfig.JSON_PROPERTY_TAG_FILTERS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSMetricsConfig { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUTOMUTE_ENABLED = "automute_enabled"; + private Boolean automuteEnabled; + + public static final String JSON_PROPERTY_COLLECT_CLOUDWATCH_ALARMS = "collect_cloudwatch_alarms"; + private Boolean collectCloudwatchAlarms; + + public static final String JSON_PROPERTY_COLLECT_CUSTOM_METRICS = "collect_custom_metrics"; + private Boolean collectCustomMetrics; + + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_NAMESPACE_FILTERS = "namespace_filters"; + private AWSNamespaceFilters namespaceFilters; + + public static final String JSON_PROPERTY_TAG_FILTERS = "tag_filters"; + private List tagFilters = null; + + public AWSMetricsConfig automuteEnabled(Boolean automuteEnabled) { + this.automuteEnabled = automuteEnabled; + return this; + } + + /** + * Enable EC2 automute for AWS metrics + * + * @return automuteEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTOMUTE_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAutomuteEnabled() { + return automuteEnabled; + } + + public void setAutomuteEnabled(Boolean automuteEnabled) { + this.automuteEnabled = automuteEnabled; + } + + public AWSMetricsConfig collectCloudwatchAlarms(Boolean collectCloudwatchAlarms) { + this.collectCloudwatchAlarms = collectCloudwatchAlarms; + return this; + } + + /** + * Enable CloudWatch alarms collection + * + * @return collectCloudwatchAlarms + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLLECT_CLOUDWATCH_ALARMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCollectCloudwatchAlarms() { + return collectCloudwatchAlarms; + } + + public void setCollectCloudwatchAlarms(Boolean collectCloudwatchAlarms) { + this.collectCloudwatchAlarms = collectCloudwatchAlarms; + } + + public AWSMetricsConfig collectCustomMetrics(Boolean collectCustomMetrics) { + this.collectCustomMetrics = collectCustomMetrics; + return this; + } + + /** + * Enable custom metrics collection + * + * @return collectCustomMetrics + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLLECT_CUSTOM_METRICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCollectCustomMetrics() { + return collectCustomMetrics; + } + + public void setCollectCustomMetrics(Boolean collectCustomMetrics) { + this.collectCustomMetrics = collectCustomMetrics; + } + + public AWSMetricsConfig enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Enable AWS metrics collection + * + * @return enabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public AWSMetricsConfig namespaceFilters(AWSNamespaceFilters namespaceFilters) { + this.namespaceFilters = namespaceFilters; + this.unparsed |= namespaceFilters.unparsed; + return this; + } + + /** + * AWS Metrics namespace filters + * + * @return namespaceFilters + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAMESPACE_FILTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSNamespaceFilters getNamespaceFilters() { + return namespaceFilters; + } + + public void setNamespaceFilters(AWSNamespaceFilters namespaceFilters) { + this.namespaceFilters = namespaceFilters; + } + + public AWSMetricsConfig tagFilters(List tagFilters) { + this.tagFilters = tagFilters; + for (AWSNamespaceTagFilter item : tagFilters) { + this.unparsed |= item.unparsed; + } + return this; + } + + public AWSMetricsConfig addTagFiltersItem(AWSNamespaceTagFilter tagFiltersItem) { + if (this.tagFilters == null) { + this.tagFilters = new ArrayList<>(); + } + this.tagFilters.add(tagFiltersItem); + this.unparsed |= tagFiltersItem.unparsed; + return this; + } + + /** + * AWS Metrics tag filters list + * + * @return tagFilters + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAG_FILTERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTagFilters() { + return tagFilters; + } + + public void setTagFilters(List tagFilters) { + this.tagFilters = tagFilters; + } + + /** + * 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 AWSMetricsConfig + */ + @JsonAnySetter + public AWSMetricsConfig 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 AWSMetricsConfig object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSMetricsConfig awsMetricsConfig = (AWSMetricsConfig) o; + return Objects.equals(this.automuteEnabled, awsMetricsConfig.automuteEnabled) + && Objects.equals(this.collectCloudwatchAlarms, awsMetricsConfig.collectCloudwatchAlarms) + && Objects.equals(this.collectCustomMetrics, awsMetricsConfig.collectCustomMetrics) + && Objects.equals(this.enabled, awsMetricsConfig.enabled) + && Objects.equals(this.namespaceFilters, awsMetricsConfig.namespaceFilters) + && Objects.equals(this.tagFilters, awsMetricsConfig.tagFilters) + && Objects.equals(this.additionalProperties, awsMetricsConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + automuteEnabled, + collectCloudwatchAlarms, + collectCustomMetrics, + enabled, + namespaceFilters, + tagFilters, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSMetricsConfig {\n"); + sb.append(" automuteEnabled: ").append(toIndentedString(automuteEnabled)).append("\n"); + sb.append(" collectCloudwatchAlarms: ") + .append(toIndentedString(collectCloudwatchAlarms)) + .append("\n"); + sb.append(" collectCustomMetrics: ") + .append(toIndentedString(collectCustomMetrics)) + .append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" namespaceFilters: ").append(toIndentedString(namespaceFilters)).append("\n"); + sb.append(" tagFilters: ").append(toIndentedString(tagFilters)).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/AWSNamespaceFilters.java b/src/main/java/com/datadog/api/client/v2/model/AWSNamespaceFilters.java new file mode 100644 index 00000000000..d70117f6091 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSNamespaceFilters.java @@ -0,0 +1,427 @@ +/* + * 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 = AWSNamespaceFilters.AWSNamespaceFiltersDeserializer.class) +@JsonSerialize(using = AWSNamespaceFilters.AWSNamespaceFiltersSerializer.class) +public class AWSNamespaceFilters extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(AWSNamespaceFilters.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class AWSNamespaceFiltersSerializer extends StdSerializer { + public AWSNamespaceFiltersSerializer(Class t) { + super(t); + } + + public AWSNamespaceFiltersSerializer() { + this(null); + } + + @Override + public void serialize( + AWSNamespaceFilters value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class AWSNamespaceFiltersDeserializer extends StdDeserializer { + public AWSNamespaceFiltersDeserializer() { + this(AWSNamespaceFilters.class); + } + + public AWSNamespaceFiltersDeserializer(Class vc) { + super(vc); + } + + @Override + public AWSNamespaceFilters 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 AWSNamespaceFiltersExcludeAll + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (AWSNamespaceFiltersExcludeAll.class.equals(Integer.class) + || AWSNamespaceFiltersExcludeAll.class.equals(Long.class) + || AWSNamespaceFiltersExcludeAll.class.equals(Float.class) + || AWSNamespaceFiltersExcludeAll.class.equals(Double.class) + || AWSNamespaceFiltersExcludeAll.class.equals(Boolean.class) + || AWSNamespaceFiltersExcludeAll.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((AWSNamespaceFiltersExcludeAll.class.equals(Integer.class) + || AWSNamespaceFiltersExcludeAll.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((AWSNamespaceFiltersExcludeAll.class.equals(Float.class) + || AWSNamespaceFiltersExcludeAll.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (AWSNamespaceFiltersExcludeAll.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (AWSNamespaceFiltersExcludeAll.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(AWSNamespaceFiltersExcludeAll.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 (!((AWSNamespaceFiltersExcludeAll) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'AWSNamespaceFiltersExcludeAll'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'AWSNamespaceFiltersExcludeAll'", e); + } + + // deserialize AWSNamespaceFiltersExcludeOnly + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (AWSNamespaceFiltersExcludeOnly.class.equals(Integer.class) + || AWSNamespaceFiltersExcludeOnly.class.equals(Long.class) + || AWSNamespaceFiltersExcludeOnly.class.equals(Float.class) + || AWSNamespaceFiltersExcludeOnly.class.equals(Double.class) + || AWSNamespaceFiltersExcludeOnly.class.equals(Boolean.class) + || AWSNamespaceFiltersExcludeOnly.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((AWSNamespaceFiltersExcludeOnly.class.equals(Integer.class) + || AWSNamespaceFiltersExcludeOnly.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((AWSNamespaceFiltersExcludeOnly.class.equals(Float.class) + || AWSNamespaceFiltersExcludeOnly.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (AWSNamespaceFiltersExcludeOnly.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (AWSNamespaceFiltersExcludeOnly.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(AWSNamespaceFiltersExcludeOnly.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 (!((AWSNamespaceFiltersExcludeOnly) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'AWSNamespaceFiltersExcludeOnly'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, "Input data does not match schema 'AWSNamespaceFiltersExcludeOnly'", e); + } + + // deserialize AWSNamespaceFiltersIncludeAll + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (AWSNamespaceFiltersIncludeAll.class.equals(Integer.class) + || AWSNamespaceFiltersIncludeAll.class.equals(Long.class) + || AWSNamespaceFiltersIncludeAll.class.equals(Float.class) + || AWSNamespaceFiltersIncludeAll.class.equals(Double.class) + || AWSNamespaceFiltersIncludeAll.class.equals(Boolean.class) + || AWSNamespaceFiltersIncludeAll.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((AWSNamespaceFiltersIncludeAll.class.equals(Integer.class) + || AWSNamespaceFiltersIncludeAll.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((AWSNamespaceFiltersIncludeAll.class.equals(Float.class) + || AWSNamespaceFiltersIncludeAll.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (AWSNamespaceFiltersIncludeAll.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (AWSNamespaceFiltersIncludeAll.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(AWSNamespaceFiltersIncludeAll.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 (!((AWSNamespaceFiltersIncludeAll) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'AWSNamespaceFiltersIncludeAll'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'AWSNamespaceFiltersIncludeAll'", e); + } + + // deserialize AWSNamespaceFiltersIncludeOnly + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (AWSNamespaceFiltersIncludeOnly.class.equals(Integer.class) + || AWSNamespaceFiltersIncludeOnly.class.equals(Long.class) + || AWSNamespaceFiltersIncludeOnly.class.equals(Float.class) + || AWSNamespaceFiltersIncludeOnly.class.equals(Double.class) + || AWSNamespaceFiltersIncludeOnly.class.equals(Boolean.class) + || AWSNamespaceFiltersIncludeOnly.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((AWSNamespaceFiltersIncludeOnly.class.equals(Integer.class) + || AWSNamespaceFiltersIncludeOnly.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((AWSNamespaceFiltersIncludeOnly.class.equals(Float.class) + || AWSNamespaceFiltersIncludeOnly.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (AWSNamespaceFiltersIncludeOnly.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (AWSNamespaceFiltersIncludeOnly.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(AWSNamespaceFiltersIncludeOnly.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 (!((AWSNamespaceFiltersIncludeOnly) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'AWSNamespaceFiltersIncludeOnly'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, "Input data does not match schema 'AWSNamespaceFiltersIncludeOnly'", e); + } + + AWSNamespaceFilters ret = new AWSNamespaceFilters(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public AWSNamespaceFilters getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "AWSNamespaceFilters cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public AWSNamespaceFilters() { + super("oneOf", Boolean.FALSE); + } + + public AWSNamespaceFilters(AWSNamespaceFiltersExcludeAll o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public AWSNamespaceFilters(AWSNamespaceFiltersExcludeOnly o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public AWSNamespaceFilters(AWSNamespaceFiltersIncludeAll o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public AWSNamespaceFilters(AWSNamespaceFiltersIncludeOnly o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put( + "AWSNamespaceFiltersExcludeAll", new GenericType() {}); + schemas.put( + "AWSNamespaceFiltersExcludeOnly", new GenericType() {}); + schemas.put( + "AWSNamespaceFiltersIncludeAll", new GenericType() {}); + schemas.put( + "AWSNamespaceFiltersIncludeOnly", new GenericType() {}); + JSON.registerDescendants(AWSNamespaceFilters.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return AWSNamespaceFilters.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: AWSNamespaceFiltersExcludeAll, AWSNamespaceFiltersExcludeOnly, + * AWSNamespaceFiltersIncludeAll, AWSNamespaceFiltersIncludeOnly + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(AWSNamespaceFiltersExcludeAll.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + AWSNamespaceFiltersExcludeOnly.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(AWSNamespaceFiltersIncludeAll.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + AWSNamespaceFiltersIncludeOnly.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be AWSNamespaceFiltersExcludeAll," + + " AWSNamespaceFiltersExcludeOnly, AWSNamespaceFiltersIncludeAll," + + " AWSNamespaceFiltersIncludeOnly"); + } + + /** + * Get the actual instance, which can be the following: AWSNamespaceFiltersExcludeAll, + * AWSNamespaceFiltersExcludeOnly, AWSNamespaceFiltersIncludeAll, AWSNamespaceFiltersIncludeOnly + * + * @return The actual instance (AWSNamespaceFiltersExcludeAll, AWSNamespaceFiltersExcludeOnly, + * AWSNamespaceFiltersIncludeAll, AWSNamespaceFiltersIncludeOnly) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `AWSNamespaceFiltersExcludeAll`. If the actual instance is not + * `AWSNamespaceFiltersExcludeAll`, the ClassCastException will be thrown. + * + * @return The actual instance of `AWSNamespaceFiltersExcludeAll` + * @throws ClassCastException if the instance is not `AWSNamespaceFiltersExcludeAll` + */ + public AWSNamespaceFiltersExcludeAll getAWSNamespaceFiltersExcludeAll() + throws ClassCastException { + return (AWSNamespaceFiltersExcludeAll) super.getActualInstance(); + } + + /** + * Get the actual instance of `AWSNamespaceFiltersExcludeOnly`. If the actual instance is not + * `AWSNamespaceFiltersExcludeOnly`, the ClassCastException will be thrown. + * + * @return The actual instance of `AWSNamespaceFiltersExcludeOnly` + * @throws ClassCastException if the instance is not `AWSNamespaceFiltersExcludeOnly` + */ + public AWSNamespaceFiltersExcludeOnly getAWSNamespaceFiltersExcludeOnly() + throws ClassCastException { + return (AWSNamespaceFiltersExcludeOnly) super.getActualInstance(); + } + + /** + * Get the actual instance of `AWSNamespaceFiltersIncludeAll`. If the actual instance is not + * `AWSNamespaceFiltersIncludeAll`, the ClassCastException will be thrown. + * + * @return The actual instance of `AWSNamespaceFiltersIncludeAll` + * @throws ClassCastException if the instance is not `AWSNamespaceFiltersIncludeAll` + */ + public AWSNamespaceFiltersIncludeAll getAWSNamespaceFiltersIncludeAll() + throws ClassCastException { + return (AWSNamespaceFiltersIncludeAll) super.getActualInstance(); + } + + /** + * Get the actual instance of `AWSNamespaceFiltersIncludeOnly`. If the actual instance is not + * `AWSNamespaceFiltersIncludeOnly`, the ClassCastException will be thrown. + * + * @return The actual instance of `AWSNamespaceFiltersIncludeOnly` + * @throws ClassCastException if the instance is not `AWSNamespaceFiltersIncludeOnly` + */ + public AWSNamespaceFiltersIncludeOnly getAWSNamespaceFiltersIncludeOnly() + throws ClassCastException { + return (AWSNamespaceFiltersIncludeOnly) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSNamespaceFiltersExcludeAll.java b/src/main/java/com/datadog/api/client/v2/model/AWSNamespaceFiltersExcludeAll.java new file mode 100644 index 00000000000..1b965ba8da5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSNamespaceFiltersExcludeAll.java @@ -0,0 +1,144 @@ +/* + * 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; + +/** Exclude all namespaces */ +@JsonPropertyOrder({AWSNamespaceFiltersExcludeAll.JSON_PROPERTY_EXCLUDE_ALL}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSNamespaceFiltersExcludeAll { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_EXCLUDE_ALL = "exclude_all"; + private Boolean excludeAll; + + public AWSNamespaceFiltersExcludeAll() {} + + @JsonCreator + public AWSNamespaceFiltersExcludeAll( + @JsonProperty(required = true, value = JSON_PROPERTY_EXCLUDE_ALL) Boolean excludeAll) { + this.excludeAll = excludeAll; + } + + public AWSNamespaceFiltersExcludeAll excludeAll(Boolean excludeAll) { + this.excludeAll = excludeAll; + return this; + } + + /** + * Exclude all namespaces + * + * @return excludeAll + */ + @JsonProperty(JSON_PROPERTY_EXCLUDE_ALL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getExcludeAll() { + return excludeAll; + } + + public void setExcludeAll(Boolean excludeAll) { + this.excludeAll = excludeAll; + } + + /** + * 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 AWSNamespaceFiltersExcludeAll + */ + @JsonAnySetter + public AWSNamespaceFiltersExcludeAll 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 AWSNamespaceFiltersExcludeAll object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSNamespaceFiltersExcludeAll awsNamespaceFiltersExcludeAll = (AWSNamespaceFiltersExcludeAll) o; + return Objects.equals(this.excludeAll, awsNamespaceFiltersExcludeAll.excludeAll) + && Objects.equals( + this.additionalProperties, awsNamespaceFiltersExcludeAll.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(excludeAll, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSNamespaceFiltersExcludeAll {\n"); + sb.append(" excludeAll: ").append(toIndentedString(excludeAll)).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/AWSNamespaceFiltersExcludeOnly.java b/src/main/java/com/datadog/api/client/v2/model/AWSNamespaceFiltersExcludeOnly.java new file mode 100644 index 00000000000..a81ec275b17 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSNamespaceFiltersExcludeOnly.java @@ -0,0 +1,152 @@ +/* + * 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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Exclude only these namespaces */ +@JsonPropertyOrder({AWSNamespaceFiltersExcludeOnly.JSON_PROPERTY_EXCLUDE_ONLY}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSNamespaceFiltersExcludeOnly { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_EXCLUDE_ONLY = "exclude_only"; + private List excludeOnly = new ArrayList<>(); + + public AWSNamespaceFiltersExcludeOnly() {} + + @JsonCreator + public AWSNamespaceFiltersExcludeOnly( + @JsonProperty(required = true, value = JSON_PROPERTY_EXCLUDE_ONLY) List excludeOnly) { + this.excludeOnly = excludeOnly; + } + + public AWSNamespaceFiltersExcludeOnly excludeOnly(List excludeOnly) { + this.excludeOnly = excludeOnly; + return this; + } + + public AWSNamespaceFiltersExcludeOnly addExcludeOnlyItem(String excludeOnlyItem) { + this.excludeOnly.add(excludeOnlyItem); + return this; + } + + /** + * Exclude only these namespaces + * + * @return excludeOnly + */ + @JsonProperty(JSON_PROPERTY_EXCLUDE_ONLY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getExcludeOnly() { + return excludeOnly; + } + + public void setExcludeOnly(List excludeOnly) { + this.excludeOnly = excludeOnly; + } + + /** + * 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 AWSNamespaceFiltersExcludeOnly + */ + @JsonAnySetter + public AWSNamespaceFiltersExcludeOnly 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 AWSNamespaceFiltersExcludeOnly object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSNamespaceFiltersExcludeOnly awsNamespaceFiltersExcludeOnly = + (AWSNamespaceFiltersExcludeOnly) o; + return Objects.equals(this.excludeOnly, awsNamespaceFiltersExcludeOnly.excludeOnly) + && Objects.equals( + this.additionalProperties, awsNamespaceFiltersExcludeOnly.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(excludeOnly, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSNamespaceFiltersExcludeOnly {\n"); + sb.append(" excludeOnly: ").append(toIndentedString(excludeOnly)).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/AWSNamespaceFiltersIncludeAll.java b/src/main/java/com/datadog/api/client/v2/model/AWSNamespaceFiltersIncludeAll.java new file mode 100644 index 00000000000..97498af5ad4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSNamespaceFiltersIncludeAll.java @@ -0,0 +1,144 @@ +/* + * 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; + +/** Include all namespaces */ +@JsonPropertyOrder({AWSNamespaceFiltersIncludeAll.JSON_PROPERTY_INCLUDE_ALL}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSNamespaceFiltersIncludeAll { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_INCLUDE_ALL = "include_all"; + private Boolean includeAll; + + public AWSNamespaceFiltersIncludeAll() {} + + @JsonCreator + public AWSNamespaceFiltersIncludeAll( + @JsonProperty(required = true, value = JSON_PROPERTY_INCLUDE_ALL) Boolean includeAll) { + this.includeAll = includeAll; + } + + public AWSNamespaceFiltersIncludeAll includeAll(Boolean includeAll) { + this.includeAll = includeAll; + return this; + } + + /** + * Include all namespaces + * + * @return includeAll + */ + @JsonProperty(JSON_PROPERTY_INCLUDE_ALL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getIncludeAll() { + return includeAll; + } + + public void setIncludeAll(Boolean includeAll) { + this.includeAll = includeAll; + } + + /** + * 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 AWSNamespaceFiltersIncludeAll + */ + @JsonAnySetter + public AWSNamespaceFiltersIncludeAll 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 AWSNamespaceFiltersIncludeAll object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSNamespaceFiltersIncludeAll awsNamespaceFiltersIncludeAll = (AWSNamespaceFiltersIncludeAll) o; + return Objects.equals(this.includeAll, awsNamespaceFiltersIncludeAll.includeAll) + && Objects.equals( + this.additionalProperties, awsNamespaceFiltersIncludeAll.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(includeAll, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSNamespaceFiltersIncludeAll {\n"); + sb.append(" includeAll: ").append(toIndentedString(includeAll)).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/AWSNamespaceFiltersIncludeOnly.java b/src/main/java/com/datadog/api/client/v2/model/AWSNamespaceFiltersIncludeOnly.java new file mode 100644 index 00000000000..9313e7d6cd2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSNamespaceFiltersIncludeOnly.java @@ -0,0 +1,152 @@ +/* + * 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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Include only these namespaces */ +@JsonPropertyOrder({AWSNamespaceFiltersIncludeOnly.JSON_PROPERTY_INCLUDE_ONLY}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSNamespaceFiltersIncludeOnly { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_INCLUDE_ONLY = "include_only"; + private List includeOnly = new ArrayList<>(); + + public AWSNamespaceFiltersIncludeOnly() {} + + @JsonCreator + public AWSNamespaceFiltersIncludeOnly( + @JsonProperty(required = true, value = JSON_PROPERTY_INCLUDE_ONLY) List includeOnly) { + this.includeOnly = includeOnly; + } + + public AWSNamespaceFiltersIncludeOnly includeOnly(List includeOnly) { + this.includeOnly = includeOnly; + return this; + } + + public AWSNamespaceFiltersIncludeOnly addIncludeOnlyItem(String includeOnlyItem) { + this.includeOnly.add(includeOnlyItem); + return this; + } + + /** + * Include only these namespaces + * + * @return includeOnly + */ + @JsonProperty(JSON_PROPERTY_INCLUDE_ONLY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getIncludeOnly() { + return includeOnly; + } + + public void setIncludeOnly(List includeOnly) { + this.includeOnly = includeOnly; + } + + /** + * 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 AWSNamespaceFiltersIncludeOnly + */ + @JsonAnySetter + public AWSNamespaceFiltersIncludeOnly 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 AWSNamespaceFiltersIncludeOnly object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSNamespaceFiltersIncludeOnly awsNamespaceFiltersIncludeOnly = + (AWSNamespaceFiltersIncludeOnly) o; + return Objects.equals(this.includeOnly, awsNamespaceFiltersIncludeOnly.includeOnly) + && Objects.equals( + this.additionalProperties, awsNamespaceFiltersIncludeOnly.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(includeOnly, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSNamespaceFiltersIncludeOnly {\n"); + sb.append(" includeOnly: ").append(toIndentedString(includeOnly)).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/AWSNamespaceTagFilter.java b/src/main/java/com/datadog/api/client/v2/model/AWSNamespaceTagFilter.java new file mode 100644 index 00000000000..ffde93bf6cd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSNamespaceTagFilter.java @@ -0,0 +1,189 @@ +/* + * 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** AWS Metrics tag filters */ +@JsonPropertyOrder({ + AWSNamespaceTagFilter.JSON_PROPERTY_NAMESPACE, + AWSNamespaceTagFilter.JSON_PROPERTY_TAGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSNamespaceTagFilter { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAMESPACE = "namespace"; + private String namespace; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private JsonNullable> tags = JsonNullable.>undefined(); + + public AWSNamespaceTagFilter namespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * The AWS Namespace to apply the tag filters against + * + * @return namespace + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAMESPACE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNamespace() { + return namespace; + } + + public void setNamespace(String namespace) { + this.namespace = namespace; + } + + public AWSNamespaceTagFilter tags(List tags) { + this.tags = JsonNullable.>of(tags); + return this; + } + + public AWSNamespaceTagFilter addTagsItem(String tagsItem) { + if (this.tags == null || !this.tags.isPresent()) { + this.tags = JsonNullable.>of(new ArrayList<>()); + } + try { + this.tags.get().add(tagsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * The tags to filter based on + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getTags() { + return tags.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getTags_JsonNullable() { + return tags; + } + + @JsonProperty(JSON_PROPERTY_TAGS) + public void setTags_JsonNullable(JsonNullable> tags) { + this.tags = tags; + } + + public void setTags(List tags) { + this.tags = JsonNullable.>of(tags); + } + + /** + * 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 AWSNamespaceTagFilter + */ + @JsonAnySetter + public AWSNamespaceTagFilter 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 AWSNamespaceTagFilter object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSNamespaceTagFilter awsNamespaceTagFilter = (AWSNamespaceTagFilter) o; + return Objects.equals(this.namespace, awsNamespaceTagFilter.namespace) + && Objects.equals(this.tags, awsNamespaceTagFilter.tags) + && Objects.equals(this.additionalProperties, awsNamespaceTagFilter.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(namespace, tags, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSNamespaceTagFilter {\n"); + sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).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/AWSNamespacesResponse.java b/src/main/java/com/datadog/api/client/v2/model/AWSNamespacesResponse.java new file mode 100644 index 00000000000..a176a8adbaf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSNamespacesResponse.java @@ -0,0 +1,145 @@ +/* + * 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; + +/** AWS Namespaces response body */ +@JsonPropertyOrder({AWSNamespacesResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSNamespacesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AWSNamespacesResponseData data; + + public AWSNamespacesResponse() {} + + @JsonCreator + public AWSNamespacesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) AWSNamespacesResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public AWSNamespacesResponse data(AWSNamespacesResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * AWS Namespaces response body + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AWSNamespacesResponseData getData() { + return data; + } + + public void setData(AWSNamespacesResponseData data) { + this.data = data; + } + + /** + * 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 AWSNamespacesResponse + */ + @JsonAnySetter + public AWSNamespacesResponse 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 AWSNamespacesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSNamespacesResponse awsNamespacesResponse = (AWSNamespacesResponse) o; + return Objects.equals(this.data, awsNamespacesResponse.data) + && Objects.equals(this.additionalProperties, awsNamespacesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSNamespacesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/AWSNamespacesResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AWSNamespacesResponseAttributes.java new file mode 100644 index 00000000000..9aad0886a63 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSNamespacesResponseAttributes.java @@ -0,0 +1,152 @@ +/* + * 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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** AWS Namespaces response body */ +@JsonPropertyOrder({AWSNamespacesResponseAttributes.JSON_PROPERTY_NAMESPACES}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSNamespacesResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAMESPACES = "namespaces"; + private List namespaces = new ArrayList<>(); + + public AWSNamespacesResponseAttributes() {} + + @JsonCreator + public AWSNamespacesResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_NAMESPACES) List namespaces) { + this.namespaces = namespaces; + } + + public AWSNamespacesResponseAttributes namespaces(List namespaces) { + this.namespaces = namespaces; + return this; + } + + public AWSNamespacesResponseAttributes addNamespacesItem(String namespacesItem) { + this.namespaces.add(namespacesItem); + return this; + } + + /** + * AWS CloudWatch namespace + * + * @return namespaces + */ + @JsonProperty(JSON_PROPERTY_NAMESPACES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getNamespaces() { + return namespaces; + } + + public void setNamespaces(List namespaces) { + this.namespaces = namespaces; + } + + /** + * 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 AWSNamespacesResponseAttributes + */ + @JsonAnySetter + public AWSNamespacesResponseAttributes 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 AWSNamespacesResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSNamespacesResponseAttributes awsNamespacesResponseAttributes = + (AWSNamespacesResponseAttributes) o; + return Objects.equals(this.namespaces, awsNamespacesResponseAttributes.namespaces) + && Objects.equals( + this.additionalProperties, awsNamespacesResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(namespaces, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSNamespacesResponseAttributes {\n"); + sb.append(" namespaces: ").append(toIndentedString(namespaces)).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/AWSNamespacesResponseData.java b/src/main/java/com/datadog/api/client/v2/model/AWSNamespacesResponseData.java new file mode 100644 index 00000000000..f61cdae2f6a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSNamespacesResponseData.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.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; + +/** AWS Namespaces response body */ +@JsonPropertyOrder({ + AWSNamespacesResponseData.JSON_PROPERTY_ATTRIBUTES, + AWSNamespacesResponseData.JSON_PROPERTY_ID, + AWSNamespacesResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSNamespacesResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private AWSNamespacesResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id = "namespaces"; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AWSNamespacesResponseDataType type = AWSNamespacesResponseDataType.NAMESPACES; + + public AWSNamespacesResponseData() {} + + @JsonCreator + public AWSNamespacesResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + AWSNamespacesResponseDataType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AWSNamespacesResponseData attributes(AWSNamespacesResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * AWS Namespaces response body + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSNamespacesResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(AWSNamespacesResponseAttributes attributes) { + this.attributes = attributes; + } + + public AWSNamespacesResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The AWSNamespacesResponseData id. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AWSNamespacesResponseData type(AWSNamespacesResponseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The AWSNamespacesResponseData type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AWSNamespacesResponseDataType getType() { + return type; + } + + public void setType(AWSNamespacesResponseDataType 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 AWSNamespacesResponseData + */ + @JsonAnySetter + public AWSNamespacesResponseData 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 AWSNamespacesResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSNamespacesResponseData awsNamespacesResponseData = (AWSNamespacesResponseData) o; + return Objects.equals(this.attributes, awsNamespacesResponseData.attributes) + && Objects.equals(this.id, awsNamespacesResponseData.id) + && Objects.equals(this.type, awsNamespacesResponseData.type) + && Objects.equals( + this.additionalProperties, awsNamespacesResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSNamespacesResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).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/AWSNamespacesResponseDataType.java b/src/main/java/com/datadog/api/client/v2/model/AWSNamespacesResponseDataType.java new file mode 100644 index 00000000000..26b79cada55 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSNamespacesResponseDataType.java @@ -0,0 +1,56 @@ +/* + * 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 AWSNamespacesResponseData type. */ +@JsonSerialize(using = AWSNamespacesResponseDataType.AWSNamespacesResponseDataTypeSerializer.class) +public class AWSNamespacesResponseDataType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("namespaces")); + + public static final AWSNamespacesResponseDataType NAMESPACES = + new AWSNamespacesResponseDataType("namespaces"); + + AWSNamespacesResponseDataType(String value) { + super(value, allowedValues); + } + + public static class AWSNamespacesResponseDataTypeSerializer + extends StdSerializer { + public AWSNamespacesResponseDataTypeSerializer(Class t) { + super(t); + } + + public AWSNamespacesResponseDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + AWSNamespacesResponseDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AWSNamespacesResponseDataType fromValue(String value) { + return new AWSNamespacesResponseDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSNewExternalIDResponse.java b/src/main/java/com/datadog/api/client/v2/model/AWSNewExternalIDResponse.java new file mode 100644 index 00000000000..d50004ece06 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSNewExternalIDResponse.java @@ -0,0 +1,146 @@ +/* + * 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; + +/** AWS External ID response body */ +@JsonPropertyOrder({AWSNewExternalIDResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSNewExternalIDResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AWSNewExternalIDResponseData data; + + public AWSNewExternalIDResponse() {} + + @JsonCreator + public AWSNewExternalIDResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + AWSNewExternalIDResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public AWSNewExternalIDResponse data(AWSNewExternalIDResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * AWS External ID response body + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AWSNewExternalIDResponseData getData() { + return data; + } + + public void setData(AWSNewExternalIDResponseData data) { + this.data = data; + } + + /** + * 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 AWSNewExternalIDResponse + */ + @JsonAnySetter + public AWSNewExternalIDResponse 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 AWSNewExternalIDResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSNewExternalIDResponse awsNewExternalIdResponse = (AWSNewExternalIDResponse) o; + return Objects.equals(this.data, awsNewExternalIdResponse.data) + && Objects.equals(this.additionalProperties, awsNewExternalIdResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSNewExternalIDResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/AWSNewExternalIDResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AWSNewExternalIDResponseAttributes.java new file mode 100644 index 00000000000..7026aad5d3b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSNewExternalIDResponseAttributes.java @@ -0,0 +1,145 @@ +/* + * 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; + +/** AWS External ID response body */ +@JsonPropertyOrder({AWSNewExternalIDResponseAttributes.JSON_PROPERTY_EXTERNAL_ID}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSNewExternalIDResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_EXTERNAL_ID = "external_id"; + private String externalId; + + public AWSNewExternalIDResponseAttributes() {} + + @JsonCreator + public AWSNewExternalIDResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_EXTERNAL_ID) String externalId) { + this.externalId = externalId; + } + + public AWSNewExternalIDResponseAttributes externalId(String externalId) { + this.externalId = externalId; + return this; + } + + /** + * AWS IAM External ID for associated role + * + * @return externalId + */ + @JsonProperty(JSON_PROPERTY_EXTERNAL_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getExternalId() { + return externalId; + } + + public void setExternalId(String externalId) { + this.externalId = externalId; + } + + /** + * 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 AWSNewExternalIDResponseAttributes + */ + @JsonAnySetter + public AWSNewExternalIDResponseAttributes 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 AWSNewExternalIDResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSNewExternalIDResponseAttributes awsNewExternalIdResponseAttributes = + (AWSNewExternalIDResponseAttributes) o; + return Objects.equals(this.externalId, awsNewExternalIdResponseAttributes.externalId) + && Objects.equals( + this.additionalProperties, awsNewExternalIdResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(externalId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSNewExternalIDResponseAttributes {\n"); + sb.append(" externalId: ").append(toIndentedString(externalId)).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/AWSNewExternalIDResponseData.java b/src/main/java/com/datadog/api/client/v2/model/AWSNewExternalIDResponseData.java new file mode 100644 index 00000000000..226dbb3369b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSNewExternalIDResponseData.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.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; + +/** AWS External ID response body */ +@JsonPropertyOrder({ + AWSNewExternalIDResponseData.JSON_PROPERTY_ATTRIBUTES, + AWSNewExternalIDResponseData.JSON_PROPERTY_ID, + AWSNewExternalIDResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSNewExternalIDResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private AWSNewExternalIDResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id = "external_id"; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AWSNewExternalIDResponseDataType type = AWSNewExternalIDResponseDataType.EXTERNAL_ID; + + public AWSNewExternalIDResponseData() {} + + @JsonCreator + public AWSNewExternalIDResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + AWSNewExternalIDResponseDataType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AWSNewExternalIDResponseData attributes(AWSNewExternalIDResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * AWS External ID response body + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSNewExternalIDResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(AWSNewExternalIDResponseAttributes attributes) { + this.attributes = attributes; + } + + public AWSNewExternalIDResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The AWSNewExternalIDResponseData id. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AWSNewExternalIDResponseData type(AWSNewExternalIDResponseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The AWSNewExternalIDResponseData type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AWSNewExternalIDResponseDataType getType() { + return type; + } + + public void setType(AWSNewExternalIDResponseDataType 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 AWSNewExternalIDResponseData + */ + @JsonAnySetter + public AWSNewExternalIDResponseData 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 AWSNewExternalIDResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSNewExternalIDResponseData awsNewExternalIdResponseData = (AWSNewExternalIDResponseData) o; + return Objects.equals(this.attributes, awsNewExternalIdResponseData.attributes) + && Objects.equals(this.id, awsNewExternalIdResponseData.id) + && Objects.equals(this.type, awsNewExternalIdResponseData.type) + && Objects.equals( + this.additionalProperties, awsNewExternalIdResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSNewExternalIDResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).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/AWSNewExternalIDResponseDataType.java b/src/main/java/com/datadog/api/client/v2/model/AWSNewExternalIDResponseDataType.java new file mode 100644 index 00000000000..443a2c058c9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSNewExternalIDResponseDataType.java @@ -0,0 +1,58 @@ +/* + * 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 AWSNewExternalIDResponseData type. */ +@JsonSerialize( + using = AWSNewExternalIDResponseDataType.AWSNewExternalIDResponseDataTypeSerializer.class) +public class AWSNewExternalIDResponseDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("external_id")); + + public static final AWSNewExternalIDResponseDataType EXTERNAL_ID = + new AWSNewExternalIDResponseDataType("external_id"); + + AWSNewExternalIDResponseDataType(String value) { + super(value, allowedValues); + } + + public static class AWSNewExternalIDResponseDataTypeSerializer + extends StdSerializer { + public AWSNewExternalIDResponseDataTypeSerializer(Class t) { + super(t); + } + + public AWSNewExternalIDResponseDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + AWSNewExternalIDResponseDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AWSNewExternalIDResponseDataType fromValue(String value) { + return new AWSNewExternalIDResponseDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSRegions.java b/src/main/java/com/datadog/api/client/v2/model/AWSRegions.java new file mode 100644 index 00000000000..789a0175e07 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSRegions.java @@ -0,0 +1,277 @@ +/* + * 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 = AWSRegions.AWSRegionsDeserializer.class) +@JsonSerialize(using = AWSRegions.AWSRegionsSerializer.class) +public class AWSRegions extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(AWSRegions.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class AWSRegionsSerializer extends StdSerializer { + public AWSRegionsSerializer(Class t) { + super(t); + } + + public AWSRegionsSerializer() { + this(null); + } + + @Override + public void serialize(AWSRegions value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class AWSRegionsDeserializer extends StdDeserializer { + public AWSRegionsDeserializer() { + this(AWSRegions.class); + } + + public AWSRegionsDeserializer(Class vc) { + super(vc); + } + + @Override + public AWSRegions 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 AWSRegionsIncludeAll + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (AWSRegionsIncludeAll.class.equals(Integer.class) + || AWSRegionsIncludeAll.class.equals(Long.class) + || AWSRegionsIncludeAll.class.equals(Float.class) + || AWSRegionsIncludeAll.class.equals(Double.class) + || AWSRegionsIncludeAll.class.equals(Boolean.class) + || AWSRegionsIncludeAll.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((AWSRegionsIncludeAll.class.equals(Integer.class) + || AWSRegionsIncludeAll.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((AWSRegionsIncludeAll.class.equals(Float.class) + || AWSRegionsIncludeAll.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (AWSRegionsIncludeAll.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (AWSRegionsIncludeAll.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(AWSRegionsIncludeAll.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 (!((AWSRegionsIncludeAll) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'AWSRegionsIncludeAll'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'AWSRegionsIncludeAll'", e); + } + + // deserialize AWSRegionsIncludeOnly + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (AWSRegionsIncludeOnly.class.equals(Integer.class) + || AWSRegionsIncludeOnly.class.equals(Long.class) + || AWSRegionsIncludeOnly.class.equals(Float.class) + || AWSRegionsIncludeOnly.class.equals(Double.class) + || AWSRegionsIncludeOnly.class.equals(Boolean.class) + || AWSRegionsIncludeOnly.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((AWSRegionsIncludeOnly.class.equals(Integer.class) + || AWSRegionsIncludeOnly.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((AWSRegionsIncludeOnly.class.equals(Float.class) + || AWSRegionsIncludeOnly.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (AWSRegionsIncludeOnly.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (AWSRegionsIncludeOnly.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(AWSRegionsIncludeOnly.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 (!((AWSRegionsIncludeOnly) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'AWSRegionsIncludeOnly'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'AWSRegionsIncludeOnly'", e); + } + + AWSRegions ret = new AWSRegions(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public AWSRegions getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "AWSRegions cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public AWSRegions() { + super("oneOf", Boolean.FALSE); + } + + public AWSRegions(AWSRegionsIncludeAll o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public AWSRegions(AWSRegionsIncludeOnly o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("AWSRegionsIncludeAll", new GenericType() {}); + schemas.put("AWSRegionsIncludeOnly", new GenericType() {}); + JSON.registerDescendants(AWSRegions.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return AWSRegions.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: AWSRegionsIncludeAll, AWSRegionsIncludeOnly + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(AWSRegionsIncludeAll.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(AWSRegionsIncludeOnly.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be AWSRegionsIncludeAll, AWSRegionsIncludeOnly"); + } + + /** + * Get the actual instance, which can be the following: AWSRegionsIncludeAll, + * AWSRegionsIncludeOnly + * + * @return The actual instance (AWSRegionsIncludeAll, AWSRegionsIncludeOnly) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `AWSRegionsIncludeAll`. If the actual instance is not + * `AWSRegionsIncludeAll`, the ClassCastException will be thrown. + * + * @return The actual instance of `AWSRegionsIncludeAll` + * @throws ClassCastException if the instance is not `AWSRegionsIncludeAll` + */ + public AWSRegionsIncludeAll getAWSRegionsIncludeAll() throws ClassCastException { + return (AWSRegionsIncludeAll) super.getActualInstance(); + } + + /** + * Get the actual instance of `AWSRegionsIncludeOnly`. If the actual instance is not + * `AWSRegionsIncludeOnly`, the ClassCastException will be thrown. + * + * @return The actual instance of `AWSRegionsIncludeOnly` + * @throws ClassCastException if the instance is not `AWSRegionsIncludeOnly` + */ + public AWSRegionsIncludeOnly getAWSRegionsIncludeOnly() throws ClassCastException { + return (AWSRegionsIncludeOnly) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSRegionsIncludeAll.java b/src/main/java/com/datadog/api/client/v2/model/AWSRegionsIncludeAll.java new file mode 100644 index 00000000000..6770d13ebe8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSRegionsIncludeAll.java @@ -0,0 +1,143 @@ +/* + * 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; + +/** Include all regions */ +@JsonPropertyOrder({AWSRegionsIncludeAll.JSON_PROPERTY_INCLUDE_ALL}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSRegionsIncludeAll { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_INCLUDE_ALL = "include_all"; + private Boolean includeAll; + + public AWSRegionsIncludeAll() {} + + @JsonCreator + public AWSRegionsIncludeAll( + @JsonProperty(required = true, value = JSON_PROPERTY_INCLUDE_ALL) Boolean includeAll) { + this.includeAll = includeAll; + } + + public AWSRegionsIncludeAll includeAll(Boolean includeAll) { + this.includeAll = includeAll; + return this; + } + + /** + * Include all regions + * + * @return includeAll + */ + @JsonProperty(JSON_PROPERTY_INCLUDE_ALL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getIncludeAll() { + return includeAll; + } + + public void setIncludeAll(Boolean includeAll) { + this.includeAll = includeAll; + } + + /** + * 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 AWSRegionsIncludeAll + */ + @JsonAnySetter + public AWSRegionsIncludeAll 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 AWSRegionsIncludeAll object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSRegionsIncludeAll awsRegionsIncludeAll = (AWSRegionsIncludeAll) o; + return Objects.equals(this.includeAll, awsRegionsIncludeAll.includeAll) + && Objects.equals(this.additionalProperties, awsRegionsIncludeAll.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(includeAll, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSRegionsIncludeAll {\n"); + sb.append(" includeAll: ").append(toIndentedString(includeAll)).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/AWSRegionsIncludeOnly.java b/src/main/java/com/datadog/api/client/v2/model/AWSRegionsIncludeOnly.java new file mode 100644 index 00000000000..d5500a18974 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSRegionsIncludeOnly.java @@ -0,0 +1,150 @@ +/* + * 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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Include only these regions */ +@JsonPropertyOrder({AWSRegionsIncludeOnly.JSON_PROPERTY_INCLUDE_ONLY}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSRegionsIncludeOnly { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_INCLUDE_ONLY = "include_only"; + private List includeOnly = new ArrayList<>(); + + public AWSRegionsIncludeOnly() {} + + @JsonCreator + public AWSRegionsIncludeOnly( + @JsonProperty(required = true, value = JSON_PROPERTY_INCLUDE_ONLY) List includeOnly) { + this.includeOnly = includeOnly; + } + + public AWSRegionsIncludeOnly includeOnly(List includeOnly) { + this.includeOnly = includeOnly; + return this; + } + + public AWSRegionsIncludeOnly addIncludeOnlyItem(String includeOnlyItem) { + this.includeOnly.add(includeOnlyItem); + return this; + } + + /** + * Include only these regions + * + * @return includeOnly + */ + @JsonProperty(JSON_PROPERTY_INCLUDE_ONLY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getIncludeOnly() { + return includeOnly; + } + + public void setIncludeOnly(List includeOnly) { + this.includeOnly = includeOnly; + } + + /** + * 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 AWSRegionsIncludeOnly + */ + @JsonAnySetter + public AWSRegionsIncludeOnly 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 AWSRegionsIncludeOnly object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSRegionsIncludeOnly awsRegionsIncludeOnly = (AWSRegionsIncludeOnly) o; + return Objects.equals(this.includeOnly, awsRegionsIncludeOnly.includeOnly) + && Objects.equals(this.additionalProperties, awsRegionsIncludeOnly.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(includeOnly, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSRegionsIncludeOnly {\n"); + sb.append(" includeOnly: ").append(toIndentedString(includeOnly)).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/AWSResourcesConfig.java b/src/main/java/com/datadog/api/client/v2/model/AWSResourcesConfig.java new file mode 100644 index 00000000000..bec7bc44ad1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSResourcesConfig.java @@ -0,0 +1,173 @@ +/* + * 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.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; + +/** AWS Resources config */ +@JsonPropertyOrder({ + AWSResourcesConfig.JSON_PROPERTY_CLOUD_SECURITY_POSTURE_MANAGEMENT_COLLECTION, + AWSResourcesConfig.JSON_PROPERTY_EXTENDED_COLLECTION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSResourcesConfig { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CLOUD_SECURITY_POSTURE_MANAGEMENT_COLLECTION = + "cloud_security_posture_management_collection"; + private Boolean cloudSecurityPostureManagementCollection; + + public static final String JSON_PROPERTY_EXTENDED_COLLECTION = "extended_collection"; + private Boolean extendedCollection; + + public AWSResourcesConfig cloudSecurityPostureManagementCollection( + Boolean cloudSecurityPostureManagementCollection) { + this.cloudSecurityPostureManagementCollection = cloudSecurityPostureManagementCollection; + return this; + } + + /** + * Whether Datadog collects cloud security posture management resources from your AWS account. + * + * @return cloudSecurityPostureManagementCollection + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLOUD_SECURITY_POSTURE_MANAGEMENT_COLLECTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getCloudSecurityPostureManagementCollection() { + return cloudSecurityPostureManagementCollection; + } + + public void setCloudSecurityPostureManagementCollection( + Boolean cloudSecurityPostureManagementCollection) { + this.cloudSecurityPostureManagementCollection = cloudSecurityPostureManagementCollection; + } + + public AWSResourcesConfig extendedCollection(Boolean extendedCollection) { + this.extendedCollection = extendedCollection; + return this; + } + + /** + * Whether Datadog collects additional attributes and configuration information about the + * resources in your AWS account. Required for cspm_resource_collection. + * + * @return extendedCollection + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXTENDED_COLLECTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getExtendedCollection() { + return extendedCollection; + } + + public void setExtendedCollection(Boolean extendedCollection) { + this.extendedCollection = extendedCollection; + } + + /** + * 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 AWSResourcesConfig + */ + @JsonAnySetter + public AWSResourcesConfig 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 AWSResourcesConfig object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSResourcesConfig awsResourcesConfig = (AWSResourcesConfig) o; + return Objects.equals( + this.cloudSecurityPostureManagementCollection, + awsResourcesConfig.cloudSecurityPostureManagementCollection) + && Objects.equals(this.extendedCollection, awsResourcesConfig.extendedCollection) + && Objects.equals(this.additionalProperties, awsResourcesConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + cloudSecurityPostureManagementCollection, extendedCollection, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSResourcesConfig {\n"); + sb.append(" cloudSecurityPostureManagementCollection: ") + .append(toIndentedString(cloudSecurityPostureManagementCollection)) + .append("\n"); + sb.append(" extendedCollection: ").append(toIndentedString(extendedCollection)).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/AWSTracesConfig.java b/src/main/java/com/datadog/api/client/v2/model/AWSTracesConfig.java new file mode 100644 index 00000000000..5fd73c5e089 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSTracesConfig.java @@ -0,0 +1,136 @@ +/* + * 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.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; + +/** AWS Traces config */ +@JsonPropertyOrder({AWSTracesConfig.JSON_PROPERTY_XRAY_SERVICES}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSTracesConfig { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_XRAY_SERVICES = "xray_services"; + private XRayServicesList xrayServices; + + public AWSTracesConfig xrayServices(XRayServicesList xrayServices) { + this.xrayServices = xrayServices; + this.unparsed |= xrayServices.unparsed; + return this; + } + + /** + * AWS X-Ray services to collect traces from + * + * @return xrayServices + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_XRAY_SERVICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public XRayServicesList getXrayServices() { + return xrayServices; + } + + public void setXrayServices(XRayServicesList xrayServices) { + this.xrayServices = xrayServices; + } + + /** + * 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 AWSTracesConfig + */ + @JsonAnySetter + public AWSTracesConfig 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 AWSTracesConfig object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSTracesConfig awsTracesConfig = (AWSTracesConfig) o; + return Objects.equals(this.xrayServices, awsTracesConfig.xrayServices) + && Objects.equals(this.additionalProperties, awsTracesConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(xrayServices, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSTracesConfig {\n"); + sb.append(" xrayServices: ").append(toIndentedString(xrayServices)).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/XRayServicesIncludeAll.java b/src/main/java/com/datadog/api/client/v2/model/XRayServicesIncludeAll.java new file mode 100644 index 00000000000..804e23b6e88 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/XRayServicesIncludeAll.java @@ -0,0 +1,143 @@ +/* + * 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; + +/** Include all services */ +@JsonPropertyOrder({XRayServicesIncludeAll.JSON_PROPERTY_INCLUDE_ALL}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class XRayServicesIncludeAll { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_INCLUDE_ALL = "include_all"; + private Boolean includeAll; + + public XRayServicesIncludeAll() {} + + @JsonCreator + public XRayServicesIncludeAll( + @JsonProperty(required = true, value = JSON_PROPERTY_INCLUDE_ALL) Boolean includeAll) { + this.includeAll = includeAll; + } + + public XRayServicesIncludeAll includeAll(Boolean includeAll) { + this.includeAll = includeAll; + return this; + } + + /** + * Include all services + * + * @return includeAll + */ + @JsonProperty(JSON_PROPERTY_INCLUDE_ALL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getIncludeAll() { + return includeAll; + } + + public void setIncludeAll(Boolean includeAll) { + this.includeAll = includeAll; + } + + /** + * 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 XRayServicesIncludeAll + */ + @JsonAnySetter + public XRayServicesIncludeAll 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 XRayServicesIncludeAll object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + XRayServicesIncludeAll xRayServicesIncludeAll = (XRayServicesIncludeAll) o; + return Objects.equals(this.includeAll, xRayServicesIncludeAll.includeAll) + && Objects.equals(this.additionalProperties, xRayServicesIncludeAll.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(includeAll, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class XRayServicesIncludeAll {\n"); + sb.append(" includeAll: ").append(toIndentedString(includeAll)).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/XRayServicesIncludeOnly.java b/src/main/java/com/datadog/api/client/v2/model/XRayServicesIncludeOnly.java new file mode 100644 index 00000000000..082253e5de3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/XRayServicesIncludeOnly.java @@ -0,0 +1,150 @@ +/* + * 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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Include only these services */ +@JsonPropertyOrder({XRayServicesIncludeOnly.JSON_PROPERTY_INCLUDE_ONLY}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class XRayServicesIncludeOnly { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_INCLUDE_ONLY = "include_only"; + private List includeOnly = new ArrayList<>(); + + public XRayServicesIncludeOnly() {} + + @JsonCreator + public XRayServicesIncludeOnly( + @JsonProperty(required = true, value = JSON_PROPERTY_INCLUDE_ONLY) List includeOnly) { + this.includeOnly = includeOnly; + } + + public XRayServicesIncludeOnly includeOnly(List includeOnly) { + this.includeOnly = includeOnly; + return this; + } + + public XRayServicesIncludeOnly addIncludeOnlyItem(String includeOnlyItem) { + this.includeOnly.add(includeOnlyItem); + return this; + } + + /** + * Include only these services + * + * @return includeOnly + */ + @JsonProperty(JSON_PROPERTY_INCLUDE_ONLY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getIncludeOnly() { + return includeOnly; + } + + public void setIncludeOnly(List includeOnly) { + this.includeOnly = includeOnly; + } + + /** + * 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 XRayServicesIncludeOnly + */ + @JsonAnySetter + public XRayServicesIncludeOnly 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 XRayServicesIncludeOnly object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + XRayServicesIncludeOnly xRayServicesIncludeOnly = (XRayServicesIncludeOnly) o; + return Objects.equals(this.includeOnly, xRayServicesIncludeOnly.includeOnly) + && Objects.equals(this.additionalProperties, xRayServicesIncludeOnly.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(includeOnly, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class XRayServicesIncludeOnly {\n"); + sb.append(" includeOnly: ").append(toIndentedString(includeOnly)).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/XRayServicesList.java b/src/main/java/com/datadog/api/client/v2/model/XRayServicesList.java new file mode 100644 index 00000000000..6cee82595a6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/XRayServicesList.java @@ -0,0 +1,278 @@ +/* + * 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 = XRayServicesList.XRayServicesListDeserializer.class) +@JsonSerialize(using = XRayServicesList.XRayServicesListSerializer.class) +public class XRayServicesList extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(XRayServicesList.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class XRayServicesListSerializer extends StdSerializer { + public XRayServicesListSerializer(Class t) { + super(t); + } + + public XRayServicesListSerializer() { + this(null); + } + + @Override + public void serialize(XRayServicesList value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class XRayServicesListDeserializer extends StdDeserializer { + public XRayServicesListDeserializer() { + this(XRayServicesList.class); + } + + public XRayServicesListDeserializer(Class vc) { + super(vc); + } + + @Override + public XRayServicesList 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 XRayServicesIncludeAll + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (XRayServicesIncludeAll.class.equals(Integer.class) + || XRayServicesIncludeAll.class.equals(Long.class) + || XRayServicesIncludeAll.class.equals(Float.class) + || XRayServicesIncludeAll.class.equals(Double.class) + || XRayServicesIncludeAll.class.equals(Boolean.class) + || XRayServicesIncludeAll.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((XRayServicesIncludeAll.class.equals(Integer.class) + || XRayServicesIncludeAll.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((XRayServicesIncludeAll.class.equals(Float.class) + || XRayServicesIncludeAll.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (XRayServicesIncludeAll.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (XRayServicesIncludeAll.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(XRayServicesIncludeAll.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 (!((XRayServicesIncludeAll) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'XRayServicesIncludeAll'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'XRayServicesIncludeAll'", e); + } + + // deserialize XRayServicesIncludeOnly + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (XRayServicesIncludeOnly.class.equals(Integer.class) + || XRayServicesIncludeOnly.class.equals(Long.class) + || XRayServicesIncludeOnly.class.equals(Float.class) + || XRayServicesIncludeOnly.class.equals(Double.class) + || XRayServicesIncludeOnly.class.equals(Boolean.class) + || XRayServicesIncludeOnly.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((XRayServicesIncludeOnly.class.equals(Integer.class) + || XRayServicesIncludeOnly.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((XRayServicesIncludeOnly.class.equals(Float.class) + || XRayServicesIncludeOnly.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (XRayServicesIncludeOnly.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (XRayServicesIncludeOnly.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + attemptParsing |= (token == JsonToken.VALUE_NULL); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(XRayServicesIncludeOnly.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 (!((XRayServicesIncludeOnly) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'XRayServicesIncludeOnly'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'XRayServicesIncludeOnly'", e); + } + + XRayServicesList ret = new XRayServicesList(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public XRayServicesList getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "XRayServicesList cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public XRayServicesList() { + super("oneOf", Boolean.FALSE); + } + + public XRayServicesList(XRayServicesIncludeAll o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public XRayServicesList(XRayServicesIncludeOnly o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("XRayServicesIncludeAll", new GenericType() {}); + schemas.put("XRayServicesIncludeOnly", new GenericType() {}); + JSON.registerDescendants(XRayServicesList.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return XRayServicesList.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: XRayServicesIncludeAll, XRayServicesIncludeOnly + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(XRayServicesIncludeAll.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(XRayServicesIncludeOnly.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be XRayServicesIncludeAll, XRayServicesIncludeOnly"); + } + + /** + * Get the actual instance, which can be the following: XRayServicesIncludeAll, + * XRayServicesIncludeOnly + * + * @return The actual instance (XRayServicesIncludeAll, XRayServicesIncludeOnly) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `XRayServicesIncludeAll`. If the actual instance is not + * `XRayServicesIncludeAll`, the ClassCastException will be thrown. + * + * @return The actual instance of `XRayServicesIncludeAll` + * @throws ClassCastException if the instance is not `XRayServicesIncludeAll` + */ + public XRayServicesIncludeAll getXRayServicesIncludeAll() throws ClassCastException { + return (XRayServicesIncludeAll) super.getActualInstance(); + } + + /** + * Get the actual instance of `XRayServicesIncludeOnly`. If the actual instance is not + * `XRayServicesIncludeOnly`, the ClassCastException will be thrown. + * + * @return The actual instance of `XRayServicesIncludeOnly` + * @throws ClassCastException if the instance is not `XRayServicesIncludeOnly` + */ + public XRayServicesIncludeOnly getXRayServicesIncludeOnly() throws ClassCastException { + return (XRayServicesIncludeOnly) super.getActualInstance(); + } +} diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_AWS_Account_object_response.freeze b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_AWS_Account_object_response.freeze new file mode 100644 index 00000000000..466a5f73537 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_AWS_Account_object_response.freeze @@ -0,0 +1 @@ +2024-10-28T14:43:00.419Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_AWS_Account_object_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_AWS_Account_object_response.json new file mode 100644 index 00000000000..97e4959085e --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_AWS_Account_object_response.json @@ -0,0 +1,53 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"83eacdb0-09e6-4e72-bf2e-b2fbcdf438b7\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"2803c423184c499dbd123d346e5bd16f\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_all\":true},\"created_at\":\"2024-10-28T14:43:01.065460229Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":true,\"collect_cloudwatch_alarms\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"exclude_only\":[\"AWS/SQS\",\"AWS/ElasticMapReduce\"]}},\"modified_at\":\"2024-10-28T14:43:01.065463823Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c206b9cd-771e-14f0-5d18-42a3a48556ce" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/83eacdb0-09e6-4e72-bf2e-b2fbcdf438b7", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "529b9991-3bc3-184e-6335-4dbf6811fe72" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..225e608e0dd --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-10-28T14:43:01.350Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_Bad_Request_response.json new file mode 100644 index 00000000000..6015d51bb66 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws-invalid\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"invalid partition: aws-invalid\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f1ca6244-e46c-b3a2-86bf-65d4e9044ba5" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_Conflict_response.freeze b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_Conflict_response.freeze new file mode 100644 index 00000000000..0dbdfb53601 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_Conflict_response.freeze @@ -0,0 +1 @@ +2024-10-28T14:43:01.458Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_Conflict_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_Conflict_response.json new file mode 100644 index 00000000000..ce9543b22ad --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_Conflict_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":false,\"collect_custom_metrics\":false,\"enabled\":true,\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]},\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}},\"id\":\"00000000-abcd-0001-0000-000000000000\",\"type\":\"account\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"fa9e70b4-5fbb-499d-ba36-b802512cbc83\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"7fca00b8e534405e990889d4960d23f6\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"created_at\":\"2024-10-28T14:43:02.014523417Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"modified_at\":\"2024-10-28T14:43:02.014527511Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "194b15fb-fcae-9b9a-e1a7-0daa19dc9eed" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"409\",\"title\":\"Account already exists\",\"detail\":\"AWS account with provided id already exists\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 409, + "reasonPhrase": "Conflict" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c206b9cd-771e-14f0-5d18-42a3a48556d1" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/fa9e70b4-5fbb-499d-ba36-b802512cbc83", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "dc0986ee-9096-080b-bec1-d09548ae02de" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_with_invalid_aws_partition_returns_400_API_error_response.freeze b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_with_invalid_aws_partition_returns_400_API_error_response.freeze new file mode 100644 index 00000000000..520064df1eb --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_with_invalid_aws_partition_returns_400_API_error_response.freeze @@ -0,0 +1 @@ +2024-08-09T18:59:51.401Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_with_invalid_aws_partition_returns_400_API_error_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_with_invalid_aws_partition_returns_400_API_error_response.json new file mode 100644 index 00000000000..f339df6c9ee --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_with_invalid_aws_partition_returns_400_API_error_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"aws_account\":{\"account_tags\":[],\"auth_config\":{\"role_name\":\"test\"},\"aws_account_id\":\"172322422800\",\"aws_partition\":\"aws-test\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[],\"sources\":[\"s3\"]}},\"metrics_config\":{\"namespace_filters\":{\"exclude_only\":[\"AWS/EC2\"],\"include_only\":[\"AWS/EC2\"]},\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[]}]},\"resources_config\":{},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}},\"id\":\"172322422800\",\"type\":\"account\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"invalid partition: aws-test\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0c09c5cc-b492-25e7-3991-bad29229e4b3" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_with_valid_config_returns_AWS_Account_object_response.freeze b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_with_valid_config_returns_AWS_Account_object_response.freeze new file mode 100644 index 00000000000..2e16a115a03 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_with_valid_config_returns_AWS_Account_object_response.freeze @@ -0,0 +1 @@ +2024-08-09T18:59:51.926Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_with_valid_config_returns_AWS_Account_object_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_with_valid_config_returns_AWS_Account_object_response.json new file mode 100644 index 00000000000..23d5e65e419 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_with_valid_config_returns_AWS_Account_object_response.json @@ -0,0 +1,57 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"aws_account\":{\"account_tags\":[],\"auth_config\":{\"role_name\":\"test\"},\"aws_account_id\":\"172322422800\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[],\"sources\":[\"s3\"]}},\"metrics_config\":{\"namespace_filters\":{\"exclude_only\":[\"AWS/EC2\"],\"include_only\":[\"AWS/EC2\"]},\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[]}]},\"resources_config\":{},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}},\"id\":\"172322422800\",\"type\":\"account\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"create_account\",\"type\":\"account\",\"attributes\":{\"aws_account\":{\"account_tags\":null,\"aws_account_id\":\"172322422800\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"auth_config\":{\"role_name\":\"test\",\"external_id\":\"08df61ab19794766a0df51fa344ef31c\"},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":null}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"logs_config\":{\"lambda_forwarder\":{\"sources\":[\"s3\"]}},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}},\"resources_config\":{\"cloud_security_posture_management_collection\":false}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "706b0bfc-0259-1845-ad95-46af6d4b46bc" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/172322422800", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6d0f8815-ff97-8599-d87e-667f26b00dc4" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..279b77d56f6 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-10-28T14:43:02.940Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_Bad_Request_response.json new file mode 100644 index 00000000000..c82b6c27f29 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_Bad_Request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/not-a-uuid", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Invalid Parameter\",\"detail\":\"invalid parameter \\\"aws_account_config_id\\\" in \\\"path\\\"; expected type \\\"uuid\\\"\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "73fd406e-d686-10bd-50ee-83f2c499e8a9" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_No_Content_response.freeze b/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_No_Content_response.freeze new file mode 100644 index 00000000000..f5fe1a6f0b9 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_No_Content_response.freeze @@ -0,0 +1 @@ +2024-10-28T14:43:03.036Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_No_Content_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_No_Content_response.json new file mode 100644 index 00000000000..0d38d7d0a6a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_No_Content_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":false,\"collect_custom_metrics\":false,\"enabled\":true,\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]},\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}},\"id\":\"00000000-abcd-0001-0000-000000000000\",\"type\":\"account\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"ea195e91-95f9-4811-9161-cbcce608b8ed\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"cd09f429becf46babb7f30a4da51b5fb\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"created_at\":\"2024-10-28T14:43:03.638813736Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"modified_at\":\"2024-10-28T14:43:03.638829687Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "194b15fb-fcae-9b9a-e1a7-0daa19dc9eeb" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/ea195e91-95f9-4811-9161-cbcce608b8ed", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f7bd3d3d-3f46-ffe4-4f32-27bed9b98588" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/ea195e91-95f9-4811-9161-cbcce608b8ed", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Account not found\",\"detail\":\"AWS account with provided id is not integrated\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f7bd3d3d-3f46-ffe4-4f32-27bed9b98589" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..b8c3c7fbd4d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2024-10-28T14:43:04.053Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_Not_Found_response.json new file mode 100644 index 00000000000..4b3d079b84c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_Not_Found_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":false,\"collect_custom_metrics\":false,\"enabled\":true,\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]},\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}},\"id\":\"00000000-abcd-0001-0000-000000000000\",\"type\":\"account\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"615cc571-774b-4e40-bc94-ad3f178cbfc8\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"b4966eed30af4b1ba9f62a4a3e841cb8\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"created_at\":\"2024-10-28T14:43:04.618588959Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"modified_at\":\"2024-10-28T14:43:04.618593611Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "194b15fb-fcae-9b9a-e1a7-0daa19dc9eea" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/448169a8-251c-4344-abee-1c4edef39f7a", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Account not found\",\"detail\":\"AWS account with provided id is not integrated\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ab2123e3-6fb5-0f90-fe98-365e086c9c6f" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/615cc571-774b-4e40-bc94-ad3f178cbfc8", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "30d55ab3-d485-4583-347a-a4f3f1e4e363" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Generate_new_external_ID_returns_AWS_External_ID_object_response.freeze b/src/test/resources/cassettes/features/v2/AWS_Integration_Generate_new_external_ID_returns_AWS_External_ID_object_response.freeze new file mode 100644 index 00000000000..b9c80bdbbbf --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Generate_new_external_ID_returns_AWS_External_ID_object_response.freeze @@ -0,0 +1 @@ +2024-10-28T14:43:05.063Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Generate_new_external_ID_returns_AWS_External_ID_object_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Generate_new_external_ID_returns_AWS_External_ID_object_response.json new file mode 100644 index 00000000000..7bf88c684fb --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Generate_new_external_ID_returns_AWS_External_ID_object_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/generate_new_external_id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"external_id\",\"type\":\"external_id\",\"attributes\":{\"external_id\":\"46c7ca9418564d478f52b94479b3aae2\"}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a3ebb722-60eb-fa89-589a-ff3630e3a2ce" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_AWS_Account_object_response.freeze b/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_AWS_Account_object_response.freeze new file mode 100644 index 00000000000..ae44c8d586d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_AWS_Account_object_response.freeze @@ -0,0 +1 @@ +2024-10-28T14:43:05.156Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_AWS_Account_object_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_AWS_Account_object_response.json new file mode 100644 index 00000000000..70fc4d3589b --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_AWS_Account_object_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":false,\"collect_custom_metrics\":false,\"enabled\":true,\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]},\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}},\"id\":\"00000000-abcd-0001-0000-000000000000\",\"type\":\"account\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"35ed0f5a-6a49-4fd7-bdf6-cc8edc410ea0\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"34c9dbc0f2934cebb5d7a0690f3f333f\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"created_at\":\"2024-10-28T14:43:05.736496681Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"modified_at\":\"2024-10-28T14:43:05.736509432Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "194b15fb-fcae-9b9a-e1a7-0daa19dc9eec" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/integration/aws/accounts/35ed0f5a-6a49-4fd7-bdf6-cc8edc410ea0", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"35ed0f5a-6a49-4fd7-bdf6-cc8edc410ea0\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"34c9dbc0f2934cebb5d7a0690f3f333f\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"created_at\":\"2024-10-28T14:43:05.736497Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"modified_at\":\"2024-10-28T14:43:05.736509Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "990b9d30-693a-88f0-f686-050a5656f1c3" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/35ed0f5a-6a49-4fd7-bdf6-cc8edc410ea0", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "4eb223f3-5250-ed1f-fd9b-ee3c59d43fe2" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..3602f01ba0a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-10-28T14:43:06.192Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_Bad_Request_response.json new file mode 100644 index 00000000000..6352d5f0102 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_Bad_Request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/integration/aws/accounts/not-a-uuid", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Invalid Parameter\",\"detail\":\"invalid parameter \\\"aws_account_config_id\\\" in \\\"path\\\"; expected type \\\"uuid\\\"\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3d4d0603-9fed-1cc5-8004-086b9b6ef691" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..b4eaf08518d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2024-10-28T14:43:06.335Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_Not_Found_response.json new file mode 100644 index 00000000000..7e5c7b1234d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_Not_Found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/integration/aws/accounts/448169a8-251c-4344-abee-1c4edef39f7a", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Account not found\",\"detail\":\"AWS account with provided id is not integrated\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9b33b83c-c8bb-714f-cf71-33ab2f3af9d3" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Get_all_account_configs_returns_AWS_Accounts_List_object_response.freeze b/src/test/resources/cassettes/features/v2/AWS_Integration_Get_all_account_configs_returns_AWS_Accounts_List_object_response.freeze new file mode 100644 index 00000000000..684ec896f95 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Get_all_account_configs_returns_AWS_Accounts_List_object_response.freeze @@ -0,0 +1 @@ +2024-10-28T14:43:06.477Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Get_all_account_configs_returns_AWS_Accounts_List_object_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Get_all_account_configs_returns_AWS_Accounts_List_object_response.json new file mode 100644 index 00000000000..cb1a6e0b10f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Get_all_account_configs_returns_AWS_Accounts_List_object_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"e6daa8c4-58b6-42e1-970e-44e6fa812ce0\",\"type\":\"account\",\"attributes\":{\"account_tags\":[],\"auth_config\":{\"access_key_id\":\"AKIA514950102505\"},\"aws_account_id\":\"514950102505\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_all\":true},\"created_at\":\"2024-09-06T00:18:12.382448Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:1234567890:function:datadog-forwarder-Forwarder\"],\"sources\":[]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[],\"namespace_filters\":{\"exclude_only\":[\"AWS/ElasticMapReduce\",\"AWS/SQS\"]}},\"modified_at\":\"2024-09-06T00:18:17.536561Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}},{\"id\":\"a0c7f96e-a471-488e-84be-c3336e7ab693\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"$KEY:$VALUE\"],\"auth_config\":{\"role_name\":\"DatadogAWSIntegrationRole\",\"external_id\":\"859ffc73702c40f589cc3b74c5967e27\"},\"aws_account_id\":\"172830950700\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-2\",\"us-west-1\",\"eu-west-1\",\"eu-central-1\",\"ap-southeast-1\",\"ap-southeast-2\",\"ap-northeast-1\",\"ap-northeast-2\",\"ap-northeast-3\",\"sa-east-1\",\"ap-south-1\",\"ca-central-1\",\"eu-west-2\",\"eu-west-3\",\"eu-north-1\",\"af-south-1\",\"ap-east-1\",\"ap-south-2\",\"ap-southeast-3\",\"ap-southeast-4\",\"ap-southeast-5\",\"ca-west-1\",\"eu-central-2\",\"eu-south-1\",\"eu-south-2\",\"il-central-1\",\"me-central-1\",\"me-south-1\"]},\"created_at\":\"2024-10-07T13:58:28.577522Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[],\"sources\":[]}},\"metrics_config\":{\"enabled\":false,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"$KEY:$VALUE\"]}],\"namespace_filters\":{\"exclude_only\":[\"AWS/AutoScaling\",\"AWS/ElasticMapReduce\",\"AWS/SQS\"]}},\"modified_at\":\"2024-10-07T13:58:28.577526Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":true,\"extended_collection\":true},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}},{\"id\":\"3a3d5b83-2ad8-41d8-b82e-a3ba972a9783\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"$KEY:$VALUE\"],\"auth_config\":{\"role_name\":\"DatadogAWSIntegrationRole\",\"external_id\":\"be10a93f33a64b0ea872da2f48348979\"},\"aws_account_id\":\"172704974400\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-2\",\"us-west-1\",\"eu-west-1\",\"eu-central-1\",\"ap-southeast-1\",\"ap-southeast-2\",\"ap-northeast-1\",\"ap-northeast-2\",\"ap-northeast-3\",\"sa-east-1\",\"ap-south-1\",\"ca-central-1\",\"eu-west-2\",\"eu-west-3\",\"eu-north-1\",\"af-south-1\",\"ap-east-1\",\"ap-south-2\",\"ap-southeast-3\",\"ap-southeast-4\",\"ap-southeast-5\",\"ca-west-1\",\"eu-central-2\",\"eu-south-1\",\"eu-south-2\",\"il-central-1\",\"me-central-1\",\"me-south-1\"]},\"created_at\":\"2024-09-23T00:02:26.306293Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[],\"sources\":[]}},\"metrics_config\":{\"enabled\":false,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"$KEY:$VALUE\"]}],\"namespace_filters\":{\"exclude_only\":[\"AWS/AutoScaling\",\"AWS/ElasticMapReduce\",\"AWS/SQS\"]}},\"modified_at\":\"2024-09-23T00:02:26.306297Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":true,\"extended_collection\":true},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}},{\"id\":\"89a9dae5-cbe3-4fba-b1b2-aae8775ed319\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"filter:one\",\"filtertwo\"],\"auth_config\":{\"role_name\":\"DatadogAWSIntegrationRole\",\"external_id\":\"e31ada331546486f9099cd5c01eef257\"},\"aws_account_id\":\"001725901256\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-2\",\"us-west-2\",\"eu-west-1\",\"eu-central-1\",\"ap-southeast-1\",\"ap-southeast-2\",\"ap-northeast-1\",\"ap-northeast-2\",\"ap-northeast-3\",\"sa-east-1\",\"ap-south-1\",\"ca-central-1\",\"eu-west-2\",\"eu-west-3\",\"eu-north-1\",\"af-south-1\",\"ap-east-1\",\"ap-south-2\",\"ap-southeast-3\",\"ap-southeast-4\",\"ca-west-1\",\"eu-central-2\",\"eu-south-1\",\"eu-south-2\",\"il-central-1\",\"me-central-1\",\"me-south-1\"]},\"created_at\":\"2024-09-09T17:00:58.823444Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[],\"sources\":[]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"testTag\",\"test:Tag2\"]}],\"namespace_filters\":{\"exclude_only\":[\"AWS/ElasticMapReduce\",\"AWS/SQS\"]}},\"modified_at\":\"2024-10-16T14:55:17.947931Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}},{\"id\":\"7e1d660d-1142-45b1-a795-dc3900b6bd17\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"$KEY:$VALUE\"],\"auth_config\":{\"role_name\":\"DatadogAWSIntegrationRole\",\"external_id\":\"f61b52d768394db6851aed2f887ac6f6\"},\"aws_account_id\":\"172830950701\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"me-south-1\"]},\"created_at\":\"2024-10-17T15:08:40.917209Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[],\"sources\":[]}},\"metrics_config\":{\"enabled\":false,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"$KEY:$VALUE\"]}],\"namespace_filters\":{\"exclude_only\":[\"AWS/AutoScaling\",\"AWS/ElasticMapReduce\",\"AWS/SQS\"]}},\"modified_at\":\"2024-10-18T20:19:53.960435Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":true,\"extended_collection\":true},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}},{\"id\":\"d52e151c-c608-4e14-9f29-dfeff876bb39\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"$KEY:$VALUE\"],\"auth_config\":{\"role_name\":\"DatadogAWSIntegrationRole\",\"external_id\":\"c2909403ca9949db82c36adf6e8cdcfa\"},\"aws_account_id\":\"172772261200\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-2\",\"us-west-1\",\"eu-west-1\",\"eu-central-1\",\"ap-southeast-1\",\"ap-southeast-2\",\"ap-northeast-1\",\"ap-northeast-2\",\"ap-northeast-3\",\"sa-east-1\",\"ap-south-1\",\"ca-central-1\",\"eu-west-2\",\"eu-west-3\",\"eu-north-1\",\"af-south-1\",\"ap-east-1\",\"ap-south-2\",\"ap-southeast-3\",\"ap-southeast-4\",\"ap-southeast-5\",\"ca-west-1\",\"eu-central-2\",\"eu-south-1\",\"eu-south-2\",\"il-central-1\",\"me-central-1\",\"me-south-1\"]},\"created_at\":\"2024-09-30T18:56:55.042771Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[],\"sources\":[]}},\"metrics_config\":{\"enabled\":false,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"$KEY:$VALUE\"]}],\"namespace_filters\":{\"exclude_only\":[\"AWS/AutoScaling\",\"AWS/ElasticMapReduce\",\"AWS/SQS\"]}},\"modified_at\":\"2024-09-30T18:56:55.042775Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":true,\"extended_collection\":true},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}},{\"id\":\"d7d74617-832d-4c4d-a8c3-1e69d509ea52\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"$KEY:$VALUE\"],\"auth_config\":{\"role_name\":\"DatadogAWSIntegrationRole\",\"external_id\":\"2b1dd9fd35b0440ca4bf98ff70ac2e63\"},\"aws_account_id\":\"172772275700\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-2\",\"us-west-1\",\"eu-west-1\",\"eu-central-1\",\"ap-southeast-1\",\"ap-southeast-2\",\"ap-northeast-1\",\"ap-northeast-2\",\"ap-northeast-3\",\"sa-east-1\",\"ap-south-1\",\"ca-central-1\",\"eu-west-2\",\"eu-west-3\",\"eu-north-1\",\"af-south-1\",\"ap-east-1\",\"ap-south-2\",\"ap-southeast-3\",\"ap-southeast-4\",\"ap-southeast-5\",\"ca-west-1\",\"eu-central-2\",\"eu-south-1\",\"eu-south-2\",\"il-central-1\",\"me-central-1\",\"me-south-1\"]},\"created_at\":\"2024-09-30T18:59:18.175722Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[],\"sources\":[]}},\"metrics_config\":{\"enabled\":false,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"$KEY:$VALUE\"]}],\"namespace_filters\":{\"exclude_only\":[\"AWS/AutoScaling\",\"AWS/ElasticMapReduce\",\"AWS/SQS\"]}},\"modified_at\":\"2024-09-30T18:59:18.175727Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":true,\"extended_collection\":true},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}},{\"id\":\"7e5acac6-3ac8-4762-8100-479f03ccffc8\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"$KEY:$VALUE\"],\"auth_config\":{\"role_name\":\"DatadogAWSIntegrationRole\",\"external_id\":\"04548a334583412aa4e6f5548f4e9989\"},\"aws_account_id\":\"172532181900\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-2\",\"us-west-1\",\"eu-west-1\",\"eu-central-1\",\"ap-southeast-1\",\"ap-southeast-2\",\"ap-northeast-1\",\"ap-northeast-2\",\"ap-northeast-3\",\"sa-east-1\",\"ap-south-1\",\"ca-central-1\",\"eu-west-2\",\"eu-west-3\",\"eu-north-1\",\"af-south-1\",\"ap-east-1\",\"ap-south-2\",\"ap-southeast-3\",\"ap-southeast-4\",\"ca-west-1\",\"eu-central-2\",\"eu-south-1\",\"eu-south-2\",\"il-central-1\",\"me-central-1\",\"me-south-1\"]},\"created_at\":\"2024-09-03T00:03:40.248176Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[],\"sources\":[]}},\"metrics_config\":{\"enabled\":false,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"$KEY:$VALUE\"]}],\"namespace_filters\":{\"exclude_only\":[\"AWS/AutoScaling\",\"AWS/ElasticMapReduce\",\"AWS/SQS\"]}},\"modified_at\":\"2024-09-03T00:03:40.24818Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":true,\"extended_collection\":true},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "101a55f5-5a26-d616-5fb4-8d0451d83d11" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_List_available_namespaces_returns_AWS_Namespaces_List_object_response.freeze b/src/test/resources/cassettes/features/v2/AWS_Integration_List_available_namespaces_returns_AWS_Namespaces_List_object_response.freeze new file mode 100644 index 00000000000..cce7072482b --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_List_available_namespaces_returns_AWS_Namespaces_List_object_response.freeze @@ -0,0 +1 @@ +2024-10-28T14:43:06.671Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_List_available_namespaces_returns_AWS_Namespaces_List_object_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_List_available_namespaces_returns_AWS_Namespaces_List_object_response.json new file mode 100644 index 00000000000..96ea2f1d661 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_List_available_namespaces_returns_AWS_Namespaces_List_object_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/integration/aws/available_namespaces", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"namespaces\",\"type\":\"namespaces\",\"attributes\":{\"namespaces\":[\"AWS/ApiGateway\",\"AWS/AppRunner\",\"AWS/AppStream\",\"AWS/AppSync\",\"AWS/ApplicationELB\",\"AWS/Athena\",\"AWS/AutoScaling\",\"AWS/Backup\",\"AWS/Bedrock\",\"AWS/Billing\",\"AWS/CertificateManager\",\"AWS/ELB\",\"AWS/CloudFront\",\"AWS/CloudHSM\",\"AWS/CloudSearch\",\"AWS/CodeBuild\",\"AWS/CodeWhisperer\",\"AWS/Cognito\",\"AWS/Config\",\"AWS/Connect\",\"AWS/DMS\",\"AWS/DX\",\"AWS/DocDB\",\"AWS/DynamoDB\",\"AWS/DAX\",\"AWS/EC2\",\"AWS/EC2/API\",\"AWS/EC2/InfrastructurePerformance\",\"AWS/EC2Spot\",\"AWS/ElasticMapReduce\",\"AWS/ElastiCache\",\"AWS/ElasticBeanstalk\",\"AWS/EBS\",\"AWS/ECR\",\"AWS/ECS\",\"AWS/EFS\",\"AWS/ElasticTranscoder\",\"AWS/MediaConnect\",\"AWS/MediaConvert\",\"AWS/MediaLive\",\"AWS/MediaPackage\",\"AWS/MediaStore\",\"AWS/MediaTailor\",\"AWS/Events\",\"AWS/FSx\",\"AWS/GameLift\",\"AWS/GlobalAccelerator\",\"Glue\",\"AWS/Inspector\",\"AWS/IoT\",\"AWS/KMS\",\"AWS/Cassandra\",\"AWS/Kinesis\",\"AWS/KinesisAnalytics\",\"AWS/Firehose\",\"AWS/Lambda\",\"AWS/Lex\",\"AWS/AmazonMQ\",\"AWS/ML\",\"AWS/Kafka\",\"AmazonMWAA\",\"AWS/MemoryDB\",\"AWS/NATGateway\",\"AWS/Neptune\",\"AWS/NetworkFirewall\",\"AWS/NetworkELB\",\"AWS/Network Manager\",\"AWS/NetworkMonitor\",\"AWS/ES\",\"AWS/AOSS\",\"AWS/OpsWorks\",\"AWS/Polly\",\"AWS/PrivateLinkEndpoints\",\"AWS/PrivateLinkServices\",\"AWS/RDS\",\"AWS/RDS/Proxy\",\"AWS/Redshift\",\"AWS/Rekognition\",\"AWS/Route53\",\"AWS/Route53Resolver\",\"AWS/S3\",\"AWS/S3/Storage-Lens\",\"AWS/SageMaker\",\"/aws/sagemaker/Endpoints\",\"AWS/Sagemaker/LabelingJobs\",\"AWS/Sagemaker/ModelBuildingPipeline\",\"/aws/sagemaker/ProcessingJobs\",\"/aws/sagemaker/TrainingJobs\",\"/aws/sagemaker/TransformJobs\",\"AWS/SageMaker/Workteam\",\"AWS/ServiceQuotas\",\"AWS/DDoSProtection\",\"AWS/SES\",\"AWS/SNS\",\"AWS/SQS\",\"AWS/SWF\",\"AWS/States\",\"AWS/StorageGateway\",\"AWS/Textract\",\"AWS/TransitGateway\",\"AWS/Translate\",\"AWS/TrustedAdvisor\",\"AWS/VPN\",\"WAF\",\"AWS/WAFV2\",\"AWS/WorkSpaces\",\"AWS/X-Ray\"]}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d0ec7736-ef6c-d071-3390-4a5c3a301d0f" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_List_log_services_returns_AWS_Logs_Services_List_object_response.freeze b/src/test/resources/cassettes/features/v2/AWS_Integration_List_log_services_returns_AWS_Logs_Services_List_object_response.freeze new file mode 100644 index 00000000000..c1c6a30de5a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_List_log_services_returns_AWS_Logs_Services_List_object_response.freeze @@ -0,0 +1 @@ +2024-10-28T14:43:06.777Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_List_log_services_returns_AWS_Logs_Services_List_object_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_List_log_services_returns_AWS_Logs_Services_List_object_response.json new file mode 100644 index 00000000000..e05cab1201f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_List_log_services_returns_AWS_Logs_Services_List_object_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/integration/aws/logs/services", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"logs_services\",\"type\":\"logs_services\",\"attributes\":{\"logs_services\":[\"apigw-access-logs\",\"apigw-execution-logs\",\"cloudfront\",\"elb\",\"elbv2\",\"lambda\",\"redshift\",\"s3\",\"states\",\"waf\"]}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "03c3c0d9-a62f-5ac6-398b-e22a05d14d7b" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_List_namespaces_returns_AWS_Namespaces_List_object_response.freeze b/src/test/resources/cassettes/features/v2/AWS_Integration_List_namespaces_returns_AWS_Namespaces_List_object_response.freeze new file mode 100644 index 00000000000..9053e750470 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_List_namespaces_returns_AWS_Namespaces_List_object_response.freeze @@ -0,0 +1 @@ +2024-10-28T14:43:06.862Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_List_namespaces_returns_AWS_Namespaces_List_object_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_List_namespaces_returns_AWS_Namespaces_List_object_response.json new file mode 100644 index 00000000000..2e4479a46a7 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_List_namespaces_returns_AWS_Namespaces_List_object_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/integration/aws/available_namespaces", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"namespaces\",\"type\":\"namespaces\",\"attributes\":{\"namespaces\":[\"AWS/ApiGateway\",\"AWS/AppRunner\",\"AWS/AppStream\",\"AWS/AppSync\",\"AWS/ApplicationELB\",\"AWS/Athena\",\"AWS/AutoScaling\",\"AWS/Backup\",\"AWS/Bedrock\",\"AWS/Billing\",\"AWS/CertificateManager\",\"AWS/ELB\",\"AWS/CloudFront\",\"AWS/CloudHSM\",\"AWS/CloudSearch\",\"AWS/CodeBuild\",\"AWS/CodeWhisperer\",\"AWS/Cognito\",\"AWS/Config\",\"AWS/Connect\",\"AWS/DMS\",\"AWS/DX\",\"AWS/DocDB\",\"AWS/DynamoDB\",\"AWS/DAX\",\"AWS/EC2\",\"AWS/EC2/API\",\"AWS/EC2/InfrastructurePerformance\",\"AWS/EC2Spot\",\"AWS/ElasticMapReduce\",\"AWS/ElastiCache\",\"AWS/ElasticBeanstalk\",\"AWS/EBS\",\"AWS/ECR\",\"AWS/ECS\",\"AWS/EFS\",\"AWS/ElasticTranscoder\",\"AWS/MediaConnect\",\"AWS/MediaConvert\",\"AWS/MediaLive\",\"AWS/MediaPackage\",\"AWS/MediaStore\",\"AWS/MediaTailor\",\"AWS/Events\",\"AWS/FSx\",\"AWS/GameLift\",\"AWS/GlobalAccelerator\",\"Glue\",\"AWS/Inspector\",\"AWS/IoT\",\"AWS/KMS\",\"AWS/Cassandra\",\"AWS/Kinesis\",\"AWS/KinesisAnalytics\",\"AWS/Firehose\",\"AWS/Lambda\",\"AWS/Lex\",\"AWS/AmazonMQ\",\"AWS/ML\",\"AWS/Kafka\",\"AmazonMWAA\",\"AWS/MemoryDB\",\"AWS/NATGateway\",\"AWS/Neptune\",\"AWS/NetworkFirewall\",\"AWS/NetworkELB\",\"AWS/Network Manager\",\"AWS/NetworkMonitor\",\"AWS/ES\",\"AWS/AOSS\",\"AWS/OpsWorks\",\"AWS/Polly\",\"AWS/PrivateLinkEndpoints\",\"AWS/PrivateLinkServices\",\"AWS/RDS\",\"AWS/RDS/Proxy\",\"AWS/Redshift\",\"AWS/Rekognition\",\"AWS/Route53\",\"AWS/Route53Resolver\",\"AWS/S3\",\"AWS/S3/Storage-Lens\",\"AWS/SageMaker\",\"/aws/sagemaker/Endpoints\",\"AWS/Sagemaker/LabelingJobs\",\"AWS/Sagemaker/ModelBuildingPipeline\",\"/aws/sagemaker/ProcessingJobs\",\"/aws/sagemaker/TrainingJobs\",\"/aws/sagemaker/TransformJobs\",\"AWS/SageMaker/Workteam\",\"AWS/ServiceQuotas\",\"AWS/DDoSProtection\",\"AWS/SES\",\"AWS/SNS\",\"AWS/SQS\",\"AWS/SWF\",\"AWS/States\",\"AWS/StorageGateway\",\"AWS/Textract\",\"AWS/TransitGateway\",\"AWS/Translate\",\"AWS/TrustedAdvisor\",\"AWS/VPN\",\"WAF\",\"AWS/WAFV2\",\"AWS/WorkSpaces\",\"AWS/X-Ray\"]}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d0ec7736-ef6c-d071-3390-4a5c3a301d10" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_API_error_response_response.freeze b/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_API_error_response_response.freeze new file mode 100644 index 00000000000..042faedbb73 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_API_error_response_response.freeze @@ -0,0 +1 @@ +2024-08-21T20:16:52.731Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_API_error_response_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_API_error_response_response.json new file mode 100644 index 00000000000..b163094437c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_API_error_response_response.json @@ -0,0 +1,87 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"$KEY:$VALUE\"],\"auth_config\":{\"role_name\":\"DatadogAWSIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-2\",\"us-west-1\"]},\"logs_config\":{},\"metrics_config\":{\"automute_enabled\":true,\"enabled\":false,\"namespace_filters\":{\"exclude_only\":[\"AWS/AutoScaling\",\"AWS/ElasticMapReduce\",\"AWS/SQS\"]},\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"$KEY:$VALUE\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":true,\"extended_collection\":true},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}},\"id\":\"123456789012\",\"type\":\"account\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"b5333e91-03e0-4a3f-9bd6-07e2d83cb85f\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"$KEY:$VALUE\"],\"auth_config\":{\"role_name\":\"DatadogAWSIntegrationRole\",\"external_id\":\"aa55eef398064c1ab1937f6f008b7184\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-2\",\"us-west-1\"]},\"created_at\":\"2024-08-21T20:16:53.079170523Z\",\"logs_config\":{\"lambda_forwarder\":{}},\"metrics_config\":{\"enabled\":false,\"automute_enabled\":true,\"collect_custom_metrics\":true,\"collect_cloudwatch_alarms\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"$KEY:$VALUE\"]}],\"namespace_filters\":{\"exclude_only\":[\"AWS/AutoScaling\",\"AWS/ElasticMapReduce\",\"AWS/SQS\"]}},\"modified_at\":\"2024-08-21T20:16:53.079176907Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":true,\"extended_collection\":true}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "48bd5fcd-9d25-198b-c2c9-cbbbf80395b7" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[],\"auth_config\":{\"role_name\":\"test\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws-test\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[],\"sources\":[\"s3\"]}},\"metrics_config\":{\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]},\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[]}]},\"resources_config\":{},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}},\"id\":\"123456789012\",\"type\":\"account\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/integration/aws/accounts/123456789012", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"invalid partition: aws-test\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0662a264-24b8-e10c-2dd2-dce946029e48" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/123456789012", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e897b7ca-83cb-687c-d821-7ad147c155cd" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_AWS_Account_object_response.freeze b/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_AWS_Account_object_response.freeze new file mode 100644 index 00000000000..3736f4c8c57 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_AWS_Account_object_response.freeze @@ -0,0 +1 @@ +2024-10-28T14:43:06.952Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_AWS_Account_object_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_AWS_Account_object_response.json new file mode 100644 index 00000000000..d2ad69b5b3e --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_AWS_Account_object_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":false,\"collect_custom_metrics\":false,\"enabled\":true,\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]},\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}},\"id\":\"00000000-abcd-0001-0000-000000000000\",\"type\":\"account\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"28a2004c-84b4-4f07-a2a4-01c9ab6a021e\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"a55061deb44b4bd28f751f150cabf912\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"created_at\":\"2024-10-28T14:43:07.521247459Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"modified_at\":\"2024-10-28T14:43:07.521251841Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "194b15fb-fcae-9b9a-e1a7-0daa19dc9eee" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/integration/aws/accounts/28a2004c-84b4-4f07-a2a4-01c9ab6a021e", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"28a2004c-84b4-4f07-a2a4-01c9ab6a021e\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"a55061deb44b4bd28f751f150cabf912\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"created_at\":\"2024-10-28T14:43:07.521247Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":true,\"collect_cloudwatch_alarms\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"modified_at\":\"2024-10-28T14:43:07.787129993Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "fb2d76fe-77ca-9757-63e5-3f82142eb9c4" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/28a2004c-84b4-4f07-a2a4-01c9ab6a021e", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ab4b9ab3-34f6-0f2c-1957-331962673520" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..e56f6833678 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-10-28T14:43:08.012Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_Bad_Request_response.json new file mode 100644 index 00000000000..77aa5204b9c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_Bad_Request_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":false,\"collect_custom_metrics\":false,\"enabled\":true,\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]},\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}},\"id\":\"00000000-abcd-0001-0000-000000000000\",\"type\":\"account\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"84a5a2e9-80f6-4740-a478-c885ae8d4117\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"8e44f2912a454f59824ddcb767a6f6da\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"created_at\":\"2024-10-28T14:43:08.585257799Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"modified_at\":\"2024-10-28T14:43:08.585261311Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "194b15fb-fcae-9b9a-e1a7-0daa19dc9ee9" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"access_key_id\":\"AKIAIOSFODNN7EXAMPLE\",\"secret_access_key\":\"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/integration/aws/accounts/84a5a2e9-80f6-4740-a478-c885ae8d4117", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"cannot switch between role and key based auth\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "10801992-133a-7f40-382b-539efd3951e0" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/84a5a2e9-80f6-4740-a478-c885ae8d4117", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "8958a38d-7902-c200-4582-26591606ad83" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..861698b9718 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2024-10-28T14:43:08.932Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_Not_Found_response.json new file mode 100644 index 00000000000..cb351a5a3b8 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/integration/aws/accounts/448169a8-251c-4344-abee-1c4edef39f7a", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Account not found\",\"detail\":\"AWS account with provided id is not integrated\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6796bfb2-5496-6f6a-d702-4bc629b25991" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_an_AWS_account_returns_AWS_Account_object_response.freeze b/src/test/resources/cassettes/features/v2/Create_an_AWS_account_returns_AWS_Account_object_response.freeze new file mode 100644 index 00000000000..8da9363a4aa --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_an_AWS_account_returns_AWS_Account_object_response.freeze @@ -0,0 +1 @@ +2024-11-06T18:44:46.341Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_an_AWS_account_returns_AWS_Account_object_response.json b/src/test/resources/cassettes/features/v2/Create_an_AWS_account_returns_AWS_Account_object_response.json new file mode 100644 index 00000000000..dc4c2cf1181 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_an_AWS_account_returns_AWS_Account_object_response.json @@ -0,0 +1,53 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"0696eb1f-06fa-40a6-a623-084a83f61623\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"32cd9dafa1d24205ba26a02d157cd16f\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_all\":true},\"created_at\":\"2024-11-06T18:44:47.20569681Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":true,\"collect_cloudwatch_alarms\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"exclude_only\":[\"AWS/SQS\",\"AWS/ElasticMapReduce\"]}},\"modified_at\":\"2024-11-06T18:44:47.20570138Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c206b9cd-771e-14f0-5d18-42a3a48556cf" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/0696eb1f-06fa-40a6-a623-084a83f61623", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "02a59375-9560-6e5b-24e2-3e75e20e49e6" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_AWS_Account_object_response.freeze b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_AWS_Account_object_response.freeze new file mode 100644 index 00000000000..4adb1638a7a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_AWS_Account_object_response.freeze @@ -0,0 +1 @@ +2024-11-06T18:44:47.513Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_AWS_Account_object_response.json b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_AWS_Account_object_response.json new file mode 100644 index 00000000000..9b050ed9464 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_AWS_Account_object_response.json @@ -0,0 +1,53 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"access_key_id\":\"AKIAIOSFODNN7EXAMPLE\",\"secret_access_key\":\"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"5b07e0e7-013c-427e-977a-7adb94ff4b40\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"access_key_id\":\"AKIAIOSFODNN7EXAMPLE\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_all\":true},\"created_at\":\"2024-11-06T18:44:47.622908005Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":true,\"collect_cloudwatch_alarms\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"exclude_only\":[\"AWS/SQS\",\"AWS/ElasticMapReduce\"]}},\"modified_at\":\"2024-11-06T18:44:47.62291187Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "88af157c-dc0f-2048-e2ff-b672fa2dd882" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/5b07e0e7-013c-427e-977a-7adb94ff4b40", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7dd58fa8-e217-10e6-dfbc-2d306171a505" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..26a03306f6a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-11-06T18:44:47.919Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Bad_Request_response.json new file mode 100644 index 00000000000..6d507bcd8cb --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws-invalid\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"invalid partition: aws-invalid\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f1ca6244-e46c-b3a2-86bf-65d4e9044ba4" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Conflict_response.freeze b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Conflict_response.freeze new file mode 100644 index 00000000000..89901ede4c0 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Conflict_response.freeze @@ -0,0 +1 @@ +2024-11-06T18:44:48.024Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Conflict_response.json b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Conflict_response.json new file mode 100644 index 00000000000..1b25c0185fc --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Conflict_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":false,\"collect_custom_metrics\":false,\"enabled\":true,\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]},\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}},\"type\":\"account\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"7f221537-cb4f-47dc-8666-f77e5ca60750\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"8fce2f5d4975420794b61a5455bf78f2\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"created_at\":\"2024-11-06T18:44:48.579473724Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"modified_at\":\"2024-11-06T18:44:48.579477654Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cd59362c-7df2-d349-9880-5b5536151a0b" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"409\",\"title\":\"Account already exists\",\"detail\":\"AWS account with provided id already exists\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 409, + "reasonPhrase": "Conflict" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c206b9cd-771e-14f0-5d18-42a3a48556d0" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/7f221537-cb4f-47dc-8666-f77e5ca60750", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e7046f32-fabd-748b-ca14-744bcc609385" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..27a329cddf3 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-11-06T18:44:49.460Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_Bad_Request_response.json new file mode 100644 index 00000000000..a42ef29bfae --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_Bad_Request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/not-a-uuid", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Invalid Parameter\",\"detail\":\"invalid parameter \\\"aws_account_config_id\\\" in \\\"path\\\"; expected type \\\"uuid\\\"\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "73fd406e-d686-10bd-50ee-83f2c499e8a8" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_No_Content_response.freeze b/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_No_Content_response.freeze new file mode 100644 index 00000000000..19dc73505b0 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_No_Content_response.freeze @@ -0,0 +1 @@ +2024-11-06T18:44:49.526Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_No_Content_response.json b/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_No_Content_response.json new file mode 100644 index 00000000000..7e5af6d16b6 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_No_Content_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":false,\"collect_custom_metrics\":false,\"enabled\":true,\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]},\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}},\"type\":\"account\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"e733f58b-b8d1-4d0c-b2f5-6438d314ca51\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"33e38eb9a16041fc8688ca9afcf82224\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"created_at\":\"2024-11-06T18:44:50.086633712Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"modified_at\":\"2024-11-06T18:44:50.086637995Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cd59362c-7df2-d349-9880-5b5536151a06" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/e733f58b-b8d1-4d0c-b2f5-6438d314ca51", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "dd52a555-bce1-82a4-be7a-56313e484a66" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/e733f58b-b8d1-4d0c-b2f5-6438d314ca51", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Account not found\",\"detail\":\"AWS account with provided id is not integrated\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "dd52a555-bce1-82a4-be7a-56313e484a67" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..abe0e4a74aa --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2024-11-06T18:44:50.507Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_Not_Found_response.json new file mode 100644 index 00000000000..860cbdc35b9 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_Not_Found_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":false,\"collect_custom_metrics\":false,\"enabled\":true,\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]},\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}},\"type\":\"account\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"22e02b17-0d91-46d7-a228-69f7250a9c67\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"7d448990acf04682b29cb61691bf86bc\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"created_at\":\"2024-11-06T18:44:51.024047931Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"modified_at\":\"2024-11-06T18:44:51.024054618Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cd59362c-7df2-d349-9880-5b5536151a09" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/448169a8-251c-4344-abee-1c4edef39f7a", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Account not found\",\"detail\":\"AWS account with provided id is not integrated\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ab2123e3-6fb5-0f90-fe98-365e086c9c6e" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/22e02b17-0d91-46d7-a228-69f7250a9c67", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "296dbed7-0485-cd34-8857-47ec8c3d181c" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Generate_a_new_external_ID_returns_AWS_External_ID_object_response.freeze b/src/test/resources/cassettes/features/v2/Generate_a_new_external_ID_returns_AWS_External_ID_object_response.freeze new file mode 100644 index 00000000000..6095c780297 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Generate_a_new_external_ID_returns_AWS_External_ID_object_response.freeze @@ -0,0 +1 @@ +2024-11-06T18:44:51.500Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Generate_a_new_external_ID_returns_AWS_External_ID_object_response.json b/src/test/resources/cassettes/features/v2/Generate_a_new_external_ID_returns_AWS_External_ID_object_response.json new file mode 100644 index 00000000000..52d038f19b8 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Generate_a_new_external_ID_returns_AWS_External_ID_object_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/generate_new_external_id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"external_id\",\"type\":\"external_id\",\"attributes\":{\"external_id\":\"96fc79a77c474e4f863a3c227fb91fef\"}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a3ebb722-60eb-fa89-589a-ff3630e3a2cc" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Generate_new_external_ID_returns_AWS_External_ID_object_response.freeze b/src/test/resources/cassettes/features/v2/Generate_new_external_ID_returns_AWS_External_ID_object_response.freeze new file mode 100644 index 00000000000..37cfccb87df --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Generate_new_external_ID_returns_AWS_External_ID_object_response.freeze @@ -0,0 +1 @@ +2024-11-06T18:44:51.871Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Generate_new_external_ID_returns_AWS_External_ID_object_response.json b/src/test/resources/cassettes/features/v2/Generate_new_external_ID_returns_AWS_External_ID_object_response.json new file mode 100644 index 00000000000..47b1947b133 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Generate_new_external_ID_returns_AWS_External_ID_object_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/generate_new_external_id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"78feee6b9c374776888068593fa8c0b9\",\"type\":\"external_id\",\"attributes\":{\"external_id\":\"78feee6b9c374776888068593fa8c0b9\"}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a3ebb722-60eb-fa89-589a-ff3630e3a2cd" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_AWS_Account_object_response.freeze b/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_AWS_Account_object_response.freeze new file mode 100644 index 00000000000..3121171861c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_AWS_Account_object_response.freeze @@ -0,0 +1 @@ +2024-11-06T18:44:52.052Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_AWS_Account_object_response.json b/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_AWS_Account_object_response.json new file mode 100644 index 00000000000..df666810683 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_AWS_Account_object_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":false,\"collect_custom_metrics\":false,\"enabled\":true,\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]},\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}},\"type\":\"account\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"db6c660f-0ee0-4479-b1e6-936e5faa7266\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"f4c8000f33f94d25bcec9afd6609bb11\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"created_at\":\"2024-11-06T18:44:52.646520994Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"modified_at\":\"2024-11-06T18:44:52.646525244Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cd59362c-7df2-d349-9880-5b5536151a07" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/integration/aws/accounts/db6c660f-0ee0-4479-b1e6-936e5faa7266", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"db6c660f-0ee0-4479-b1e6-936e5faa7266\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"f4c8000f33f94d25bcec9afd6609bb11\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"created_at\":\"2024-11-06T18:44:52.646521Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"modified_at\":\"2024-11-06T18:44:52.646525Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0b364aea-ee45-47ee-11aa-685773faa2f4" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/db6c660f-0ee0-4479-b1e6-936e5faa7266", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "2e6296fc-5347-2dac-b47e-904cdd55b6bf" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..8de2f0fbb4c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-11-06T18:44:53.120Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_Bad_Request_response.json new file mode 100644 index 00000000000..87cb96a7640 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_Bad_Request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/integration/aws/accounts/not-a-uuid", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Invalid Parameter\",\"detail\":\"invalid parameter \\\"aws_account_config_id\\\" in \\\"path\\\"; expected type \\\"uuid\\\"\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3d4d0603-9fed-1cc5-8004-086b9b6ef690" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..2abc18523ca --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2024-11-06T18:44:53.215Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_Not_Found_response.json new file mode 100644 index 00000000000..55368f4ae1c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_Not_Found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/integration/aws/accounts/448169a8-251c-4344-abee-1c4edef39f7a", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Account not found\",\"detail\":\"AWS account with provided id is not integrated\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9b33b83c-c8bb-714f-cf71-33ab2f3af9d4" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_list_of_AWS_log_ready_services_returns_AWS_Logs_Services_List_object_response.freeze b/src/test/resources/cassettes/features/v2/Get_list_of_AWS_log_ready_services_returns_AWS_Logs_Services_List_object_response.freeze new file mode 100644 index 00000000000..59066f4dee5 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_list_of_AWS_log_ready_services_returns_AWS_Logs_Services_List_object_response.freeze @@ -0,0 +1 @@ +2024-11-06T15:58:53.184Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_list_of_AWS_log_ready_services_returns_AWS_Logs_Services_List_object_response.json b/src/test/resources/cassettes/features/v2/Get_list_of_AWS_log_ready_services_returns_AWS_Logs_Services_List_object_response.json new file mode 100644 index 00000000000..f469a5cda1f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_list_of_AWS_log_ready_services_returns_AWS_Logs_Services_List_object_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/integration/aws/logs/services", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"logs_services\",\"type\":\"logs_services\",\"attributes\":{\"logs_services\":[\"apigw-access-logs\",\"apigw-execution-logs\",\"cloudfront\",\"elb\",\"elbv2\",\"lambda\",\"redshift\",\"s3\",\"states\",\"waf\"]}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "03c3c0d9-a62f-5ac6-398b-e22a05d14d79" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_all_AWS_integrations_returns_AWS_Accounts_List_object_response.freeze b/src/test/resources/cassettes/features/v2/List_all_AWS_integrations_returns_AWS_Accounts_List_object_response.freeze new file mode 100644 index 00000000000..2932343225b --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_all_AWS_integrations_returns_AWS_Accounts_List_object_response.freeze @@ -0,0 +1 @@ +2024-11-06T18:44:53.338Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_all_AWS_integrations_returns_AWS_Accounts_List_object_response.json b/src/test/resources/cassettes/features/v2/List_all_AWS_integrations_returns_AWS_Accounts_List_object_response.json new file mode 100644 index 00000000000..e1e0b004585 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_all_AWS_integrations_returns_AWS_Accounts_List_object_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"e6daa8c4-58b6-42e1-970e-44e6fa812ce0\",\"type\":\"account\",\"attributes\":{\"account_tags\":[],\"auth_config\":{\"access_key_id\":\"AKIA514950102505\"},\"aws_account_id\":\"514950102505\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_all\":true},\"created_at\":\"2024-09-06T00:18:12.382448Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:1234567890:function:datadog-forwarder-Forwarder\"],\"sources\":[]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[],\"namespace_filters\":{\"exclude_only\":[\"AWS/ElasticMapReduce\",\"AWS/SQS\"]}},\"modified_at\":\"2024-09-06T00:18:17.536561Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}},{\"id\":\"a0c7f96e-a471-488e-84be-c3336e7ab693\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"$KEY:$VALUE\"],\"auth_config\":{\"role_name\":\"DatadogAWSIntegrationRole\",\"external_id\":\"859ffc73702c40f589cc3b74c5967e27\"},\"aws_account_id\":\"172830950700\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-2\",\"us-west-1\",\"eu-west-1\",\"eu-central-1\",\"ap-southeast-1\",\"ap-southeast-2\",\"ap-northeast-1\",\"ap-northeast-2\",\"ap-northeast-3\",\"sa-east-1\",\"ap-south-1\",\"ca-central-1\",\"eu-west-2\",\"eu-west-3\",\"eu-north-1\",\"af-south-1\",\"ap-east-1\",\"ap-south-2\",\"ap-southeast-3\",\"ap-southeast-4\",\"ap-southeast-5\",\"ca-west-1\",\"eu-central-2\",\"eu-south-1\",\"eu-south-2\",\"il-central-1\",\"me-central-1\",\"me-south-1\"]},\"created_at\":\"2024-10-07T13:58:28.577522Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[],\"sources\":[]}},\"metrics_config\":{\"enabled\":false,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"$KEY:$VALUE\"]}],\"namespace_filters\":{\"exclude_only\":[\"AWS/AutoScaling\",\"AWS/ElasticMapReduce\",\"AWS/SQS\"]}},\"modified_at\":\"2024-10-07T13:58:28.577526Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":true,\"extended_collection\":true},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}},{\"id\":\"3a3d5b83-2ad8-41d8-b82e-a3ba972a9783\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"$KEY:$VALUE\"],\"auth_config\":{\"role_name\":\"DatadogAWSIntegrationRole\",\"external_id\":\"be10a93f33a64b0ea872da2f48348979\"},\"aws_account_id\":\"172704974400\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-2\",\"us-west-1\",\"eu-west-1\",\"eu-central-1\",\"ap-southeast-1\",\"ap-southeast-2\",\"ap-northeast-1\",\"ap-northeast-2\",\"ap-northeast-3\",\"sa-east-1\",\"ap-south-1\",\"ca-central-1\",\"eu-west-2\",\"eu-west-3\",\"eu-north-1\",\"af-south-1\",\"ap-east-1\",\"ap-south-2\",\"ap-southeast-3\",\"ap-southeast-4\",\"ap-southeast-5\",\"ca-west-1\",\"eu-central-2\",\"eu-south-1\",\"eu-south-2\",\"il-central-1\",\"me-central-1\",\"me-south-1\"]},\"created_at\":\"2024-09-23T00:02:26.306293Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[],\"sources\":[]}},\"metrics_config\":{\"enabled\":false,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"$KEY:$VALUE\"]}],\"namespace_filters\":{\"exclude_only\":[\"AWS/AutoScaling\",\"AWS/ElasticMapReduce\",\"AWS/SQS\"]}},\"modified_at\":\"2024-09-23T00:02:26.306297Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":true,\"extended_collection\":true},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}},{\"id\":\"89a9dae5-cbe3-4fba-b1b2-aae8775ed319\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"filter:one\",\"filtertwo\"],\"auth_config\":{\"role_name\":\"DatadogAWSIntegrationRole\",\"external_id\":\"e31ada331546486f9099cd5c01eef257\"},\"aws_account_id\":\"001725901256\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-2\",\"us-west-2\",\"eu-west-1\",\"eu-central-1\",\"ap-southeast-1\",\"ap-southeast-2\",\"ap-northeast-1\",\"ap-northeast-2\",\"ap-northeast-3\",\"sa-east-1\",\"ap-south-1\",\"ca-central-1\",\"eu-west-2\",\"eu-west-3\",\"eu-north-1\",\"af-south-1\",\"ap-east-1\",\"ap-south-2\",\"ap-southeast-3\",\"ap-southeast-4\",\"ca-west-1\",\"eu-central-2\",\"eu-south-1\",\"eu-south-2\",\"il-central-1\",\"me-central-1\",\"me-south-1\"]},\"created_at\":\"2024-09-09T17:00:58.823444Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[],\"sources\":[]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"testTag\",\"test:Tag2\"]}],\"namespace_filters\":{\"exclude_only\":[\"AWS/ElasticMapReduce\",\"AWS/SQS\"]}},\"modified_at\":\"2024-10-16T14:55:17.947931Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}},{\"id\":\"7e1d660d-1142-45b1-a795-dc3900b6bd17\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"$KEY:$VALUE\"],\"auth_config\":{\"role_name\":\"DatadogAWSIntegrationRole\",\"external_id\":\"f61b52d768394db6851aed2f887ac6f6\"},\"aws_account_id\":\"172830950701\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"me-south-1\"]},\"created_at\":\"2024-10-17T15:08:40.917209Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[],\"sources\":[]}},\"metrics_config\":{\"enabled\":false,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"$KEY:$VALUE\"]}],\"namespace_filters\":{\"exclude_only\":[\"AWS/AutoScaling\",\"AWS/ElasticMapReduce\",\"AWS/SQS\"]}},\"modified_at\":\"2024-10-18T20:19:53.960435Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":true,\"extended_collection\":true},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}},{\"id\":\"d52e151c-c608-4e14-9f29-dfeff876bb39\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"$KEY:$VALUE\"],\"auth_config\":{\"role_name\":\"DatadogAWSIntegrationRole\",\"external_id\":\"c2909403ca9949db82c36adf6e8cdcfa\"},\"aws_account_id\":\"172772261200\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-2\",\"us-west-1\",\"eu-west-1\",\"eu-central-1\",\"ap-southeast-1\",\"ap-southeast-2\",\"ap-northeast-1\",\"ap-northeast-2\",\"ap-northeast-3\",\"sa-east-1\",\"ap-south-1\",\"ca-central-1\",\"eu-west-2\",\"eu-west-3\",\"eu-north-1\",\"af-south-1\",\"ap-east-1\",\"ap-south-2\",\"ap-southeast-3\",\"ap-southeast-4\",\"ap-southeast-5\",\"ca-west-1\",\"eu-central-2\",\"eu-south-1\",\"eu-south-2\",\"il-central-1\",\"me-central-1\",\"me-south-1\"]},\"created_at\":\"2024-09-30T18:56:55.042771Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[],\"sources\":[]}},\"metrics_config\":{\"enabled\":false,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"$KEY:$VALUE\"]}],\"namespace_filters\":{\"exclude_only\":[\"AWS/AutoScaling\",\"AWS/ElasticMapReduce\",\"AWS/SQS\"]}},\"modified_at\":\"2024-09-30T18:56:55.042775Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":true,\"extended_collection\":true},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}},{\"id\":\"d7d74617-832d-4c4d-a8c3-1e69d509ea52\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"$KEY:$VALUE\"],\"auth_config\":{\"role_name\":\"DatadogAWSIntegrationRole\",\"external_id\":\"2b1dd9fd35b0440ca4bf98ff70ac2e63\"},\"aws_account_id\":\"172772275700\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-2\",\"us-west-1\",\"eu-west-1\",\"eu-central-1\",\"ap-southeast-1\",\"ap-southeast-2\",\"ap-northeast-1\",\"ap-northeast-2\",\"ap-northeast-3\",\"sa-east-1\",\"ap-south-1\",\"ca-central-1\",\"eu-west-2\",\"eu-west-3\",\"eu-north-1\",\"af-south-1\",\"ap-east-1\",\"ap-south-2\",\"ap-southeast-3\",\"ap-southeast-4\",\"ap-southeast-5\",\"ca-west-1\",\"eu-central-2\",\"eu-south-1\",\"eu-south-2\",\"il-central-1\",\"me-central-1\",\"me-south-1\"]},\"created_at\":\"2024-09-30T18:59:18.175722Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[],\"sources\":[]}},\"metrics_config\":{\"enabled\":false,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"$KEY:$VALUE\"]}],\"namespace_filters\":{\"exclude_only\":[\"AWS/AutoScaling\",\"AWS/ElasticMapReduce\",\"AWS/SQS\"]}},\"modified_at\":\"2024-09-30T18:59:18.175727Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":true,\"extended_collection\":true},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}},{\"id\":\"7e5acac6-3ac8-4762-8100-479f03ccffc8\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"$KEY:$VALUE\"],\"auth_config\":{\"role_name\":\"DatadogAWSIntegrationRole\",\"external_id\":\"04548a334583412aa4e6f5548f4e9989\"},\"aws_account_id\":\"172532181900\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-2\",\"us-west-1\",\"eu-west-1\",\"eu-central-1\",\"ap-southeast-1\",\"ap-southeast-2\",\"ap-northeast-1\",\"ap-northeast-2\",\"ap-northeast-3\",\"sa-east-1\",\"ap-south-1\",\"ca-central-1\",\"eu-west-2\",\"eu-west-3\",\"eu-north-1\",\"af-south-1\",\"ap-east-1\",\"ap-south-2\",\"ap-southeast-3\",\"ap-southeast-4\",\"ca-west-1\",\"eu-central-2\",\"eu-south-1\",\"eu-south-2\",\"il-central-1\",\"me-central-1\",\"me-south-1\"]},\"created_at\":\"2024-09-03T00:03:40.248176Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[],\"sources\":[]}},\"metrics_config\":{\"enabled\":false,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"$KEY:$VALUE\"]}],\"namespace_filters\":{\"exclude_only\":[\"AWS/AutoScaling\",\"AWS/ElasticMapReduce\",\"AWS/SQS\"]}},\"modified_at\":\"2024-09-03T00:03:40.24818Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":true,\"extended_collection\":true},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "101a55f5-5a26-d616-5fb4-8d0451d83d10" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_available_namespaces_returns_AWS_Namespaces_List_object_response.freeze b/src/test/resources/cassettes/features/v2/List_available_namespaces_returns_AWS_Namespaces_List_object_response.freeze new file mode 100644 index 00000000000..e1b33d2dbbc --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_available_namespaces_returns_AWS_Namespaces_List_object_response.freeze @@ -0,0 +1 @@ +2024-11-06T18:44:53.502Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_available_namespaces_returns_AWS_Namespaces_List_object_response.json b/src/test/resources/cassettes/features/v2/List_available_namespaces_returns_AWS_Namespaces_List_object_response.json new file mode 100644 index 00000000000..adf7e6ef2ed --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_available_namespaces_returns_AWS_Namespaces_List_object_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/integration/aws/available_namespaces", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"namespaces\",\"type\":\"namespaces\",\"attributes\":{\"namespaces\":[\"AWS/ApiGateway\",\"AWS/AppRunner\",\"AWS/AppStream\",\"AWS/AppSync\",\"AWS/ApplicationELB\",\"AWS/Athena\",\"AWS/AutoScaling\",\"AWS/Backup\",\"AWS/Bedrock\",\"AWS/Billing\",\"AWS/Budgeting\",\"AWS/CertificateManager\",\"AWS/ELB\",\"AWS/CloudFront\",\"AWS/CloudHSM\",\"AWS/CloudSearch\",\"AWS/Logs\",\"AWS/CodeBuild\",\"AWS/CodeWhisperer\",\"AWS/Cognito\",\"AWS/Config\",\"AWS/Connect\",\"AWS/DMS\",\"AWS/DX\",\"AWS/DocDB\",\"AWS/DynamoDB\",\"AWS/DAX\",\"AWS/EC2\",\"AWS/EC2/API\",\"AWS/EC2/InfrastructurePerformance\",\"AWS/EC2Spot\",\"AWS/ElasticMapReduce\",\"AWS/ElastiCache\",\"AWS/ElasticBeanstalk\",\"AWS/EBS\",\"AWS/ECR\",\"AWS/ECS\",\"AWS/EFS\",\"AWS/ElasticInference\",\"AWS/ElasticTranscoder\",\"AWS/MediaConnect\",\"AWS/MediaConvert\",\"AWS/MediaLive\",\"AWS/MediaPackage\",\"AWS/MediaStore\",\"AWS/MediaTailor\",\"AWS/Events\",\"AWS/FSx\",\"AWS/GameLift\",\"AWS/GlobalAccelerator\",\"Glue\",\"AWS/Inspector\",\"AWS/IoT\",\"AWS/KMS\",\"AWS/Cassandra\",\"AWS/Kinesis\",\"AWS/KinesisAnalytics\",\"AWS/Firehose\",\"AWS/Lambda\",\"AWS/Lex\",\"AWS/AmazonMQ\",\"AWS/ML\",\"AWS/Kafka\",\"AmazonMWAA\",\"AWS/MemoryDB\",\"AWS/NATGateway\",\"AWS/Neptune\",\"AWS/NetworkFirewall\",\"AWS/NetworkELB\",\"AWS/Network Manager\",\"AWS/NetworkMonitor\",\"AWS/ES\",\"AWS/AOSS\",\"AWS/OpsWorks\",\"AWS/Polly\",\"AWS/PrivateLinkEndpoints\",\"AWS/PrivateLinkServices\",\"AWS/RDS\",\"AWS/RDS/Proxy\",\"AWS/Redshift\",\"AWS/Rekognition\",\"AWS/Route53\",\"AWS/Route53Resolver\",\"AWS/S3\",\"AWS/S3/Storage-Lens\",\"AWS/SageMaker\",\"/aws/sagemaker/Endpoints\",\"AWS/Sagemaker/LabelingJobs\",\"AWS/Sagemaker/ModelBuildingPipeline\",\"/aws/sagemaker/ProcessingJobs\",\"/aws/sagemaker/TrainingJobs\",\"/aws/sagemaker/TransformJobs\",\"AWS/SageMaker/Workteam\",\"AWS/ServiceQuotas\",\"AWS/DDoSProtection\",\"AWS/SES\",\"AWS/SNS\",\"AWS/SQS\",\"AWS/SWF\",\"AWS/States\",\"AWS/StorageGateway\",\"AWS/Textract\",\"AWS/TransitGateway\",\"AWS/Translate\",\"AWS/TrustedAdvisor\",\"AWS/Usage\",\"AWS/VPN\",\"WAF\",\"AWS/WAFV2\",\"AWS/WorkSpaces\",\"AWS/X-Ray\"]}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d0ec7736-ef6c-d071-3390-4a5c3a301d0e" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_log_services_returns_AWS_Logs_Services_List_object_response.freeze b/src/test/resources/cassettes/features/v2/List_log_services_returns_AWS_Logs_Services_List_object_response.freeze new file mode 100644 index 00000000000..ec96db9bef6 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_log_services_returns_AWS_Logs_Services_List_object_response.freeze @@ -0,0 +1 @@ +2024-11-04T20:55:55.328Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_log_services_returns_AWS_Logs_Services_List_object_response.json b/src/test/resources/cassettes/features/v2/List_log_services_returns_AWS_Logs_Services_List_object_response.json new file mode 100644 index 00000000000..266b281e690 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_log_services_returns_AWS_Logs_Services_List_object_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/integration/aws/logs/services", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"logs_services\",\"type\":\"logs_services\",\"attributes\":{\"logs_services\":[\"apigw-access-logs\",\"apigw-execution-logs\",\"cloudfront\",\"elb\",\"elbv2\",\"lambda\",\"redshift\",\"s3\",\"states\",\"waf\"]}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "03c3c0d9-a62f-5ac6-398b-e22a05d14d7a" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_namespaces_returns_AWS_Namespaces_List_object_response.freeze b/src/test/resources/cassettes/features/v2/List_namespaces_returns_AWS_Namespaces_List_object_response.freeze new file mode 100644 index 00000000000..f663dde1fad --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_namespaces_returns_AWS_Namespaces_List_object_response.freeze @@ -0,0 +1 @@ +2024-11-06T18:44:53.574Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_namespaces_returns_AWS_Namespaces_List_object_response.json b/src/test/resources/cassettes/features/v2/List_namespaces_returns_AWS_Namespaces_List_object_response.json new file mode 100644 index 00000000000..a179615718f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_namespaces_returns_AWS_Namespaces_List_object_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/integration/aws/available_namespaces", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"namespaces\",\"type\":\"namespaces\",\"attributes\":{\"namespaces\":[\"AWS/ApiGateway\",\"AWS/AppRunner\",\"AWS/AppStream\",\"AWS/AppSync\",\"AWS/ApplicationELB\",\"AWS/Athena\",\"AWS/AutoScaling\",\"AWS/Backup\",\"AWS/Bedrock\",\"AWS/Billing\",\"AWS/Budgeting\",\"AWS/CertificateManager\",\"AWS/ELB\",\"AWS/CloudFront\",\"AWS/CloudHSM\",\"AWS/CloudSearch\",\"AWS/Logs\",\"AWS/CodeBuild\",\"AWS/CodeWhisperer\",\"AWS/Cognito\",\"AWS/Config\",\"AWS/Connect\",\"AWS/DMS\",\"AWS/DX\",\"AWS/DocDB\",\"AWS/DynamoDB\",\"AWS/DAX\",\"AWS/EC2\",\"AWS/EC2/API\",\"AWS/EC2/InfrastructurePerformance\",\"AWS/EC2Spot\",\"AWS/ElasticMapReduce\",\"AWS/ElastiCache\",\"AWS/ElasticBeanstalk\",\"AWS/EBS\",\"AWS/ECR\",\"AWS/ECS\",\"AWS/EFS\",\"AWS/ElasticInference\",\"AWS/ElasticTranscoder\",\"AWS/MediaConnect\",\"AWS/MediaConvert\",\"AWS/MediaLive\",\"AWS/MediaPackage\",\"AWS/MediaStore\",\"AWS/MediaTailor\",\"AWS/Events\",\"AWS/FSx\",\"AWS/GameLift\",\"AWS/GlobalAccelerator\",\"Glue\",\"AWS/Inspector\",\"AWS/IoT\",\"AWS/KMS\",\"AWS/Cassandra\",\"AWS/Kinesis\",\"AWS/KinesisAnalytics\",\"AWS/Firehose\",\"AWS/Lambda\",\"AWS/Lex\",\"AWS/AmazonMQ\",\"AWS/ML\",\"AWS/Kafka\",\"AmazonMWAA\",\"AWS/MemoryDB\",\"AWS/NATGateway\",\"AWS/Neptune\",\"AWS/NetworkFirewall\",\"AWS/NetworkELB\",\"AWS/Network Manager\",\"AWS/NetworkMonitor\",\"AWS/ES\",\"AWS/AOSS\",\"AWS/OpsWorks\",\"AWS/Polly\",\"AWS/PrivateLinkEndpoints\",\"AWS/PrivateLinkServices\",\"AWS/RDS\",\"AWS/RDS/Proxy\",\"AWS/Redshift\",\"AWS/Rekognition\",\"AWS/Route53\",\"AWS/Route53Resolver\",\"AWS/S3\",\"AWS/S3/Storage-Lens\",\"AWS/SageMaker\",\"/aws/sagemaker/Endpoints\",\"AWS/Sagemaker/LabelingJobs\",\"AWS/Sagemaker/ModelBuildingPipeline\",\"/aws/sagemaker/ProcessingJobs\",\"/aws/sagemaker/TrainingJobs\",\"/aws/sagemaker/TransformJobs\",\"AWS/SageMaker/Workteam\",\"AWS/ServiceQuotas\",\"AWS/DDoSProtection\",\"AWS/SES\",\"AWS/SNS\",\"AWS/SQS\",\"AWS/SWF\",\"AWS/States\",\"AWS/StorageGateway\",\"AWS/Textract\",\"AWS/TransitGateway\",\"AWS/Translate\",\"AWS/TrustedAdvisor\",\"AWS/Usage\",\"AWS/VPN\",\"WAF\",\"AWS/WAFV2\",\"AWS/WorkSpaces\",\"AWS/X-Ray\"]}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d0ec7736-ef6c-d071-3390-4a5c3a301d11" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_AWS_Account_object_response.freeze b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_AWS_Account_object_response.freeze new file mode 100644 index 00000000000..7d9884c7935 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_AWS_Account_object_response.freeze @@ -0,0 +1 @@ +2024-11-06T18:44:53.669Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_AWS_Account_object_response.json b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_AWS_Account_object_response.json new file mode 100644 index 00000000000..c84781e2410 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_AWS_Account_object_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":false,\"collect_custom_metrics\":false,\"enabled\":true,\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]},\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}},\"type\":\"account\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"06b62294-36d7-4bbe-a8b8-7c93736dc0ee\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"c16e1ceb4ac64293ba91f020191fa781\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"created_at\":\"2024-11-06T18:44:54.297075743Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"modified_at\":\"2024-11-06T18:44:54.297079976Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cd59362c-7df2-d349-9880-5b5536151a0a" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/integration/aws/accounts/06b62294-36d7-4bbe-a8b8-7c93736dc0ee", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"06b62294-36d7-4bbe-a8b8-7c93736dc0ee\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"c16e1ceb4ac64293ba91f020191fa781\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"created_at\":\"2024-11-06T18:44:54.297076Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":true,\"collect_cloudwatch_alarms\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"modified_at\":\"2024-11-06T18:44:54.489623544Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1a822b78-55d5-a1a7-cccb-55e1839ea5dc" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/06b62294-36d7-4bbe-a8b8-7c93736dc0ee", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f1bb647e-d216-d2cc-ee31-7dd2381c304e" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..a20f0bad445 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-11-06T18:44:54.767Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Bad_Request_response.json new file mode 100644 index 00000000000..78e1fd44e41 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Bad_Request_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":false,\"collect_custom_metrics\":false,\"enabled\":true,\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]},\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}},\"type\":\"account\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"6e045c0b-458a-4ec1-8654-6ac491320939\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"00d5e0f623574d388e9717154bcbf7f2\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"created_at\":\"2024-11-06T18:44:55.461251746Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"modified_at\":\"2024-11-06T18:44:55.461256677Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cd59362c-7df2-d349-9880-5b5536151a08" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"access_key_id\":\"AKIAIOSFODNN7EXAMPLE\",\"secret_access_key\":\"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/integration/aws/accounts/6e045c0b-458a-4ec1-8654-6ac491320939", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"cannot switch between role and key based auth\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e3565db5-179a-ec88-d59e-8f68873b0270" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/6e045c0b-458a-4ec1-8654-6ac491320939", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a16d0cec-4d53-a47c-a04d-c45824a56c34" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..7d82ab53f41 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2024-11-06T18:44:55.829Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Not_Found_response.json new file mode 100644 index 00000000000..2cad4645519 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/integration/aws/accounts/448169a8-251c-4344-abee-1c4edef39f7a", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Account not found\",\"detail\":\"AWS account with provided id is not integrated\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6796bfb2-5496-6f6a-d702-4bc629b25992" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v1/api/aws_integration.feature b/src/test/resources/com/datadog/api/client/v1/api/aws_integration.feature index 017326abd32..08c57bbc61e 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/aws_integration.feature +++ b/src/test/resources/com/datadog/api/client/v1/api/aws_integration.feature @@ -9,70 +9,70 @@ Feature: AWS Integration And a valid "appKeyAuth" key in the system And an instance of "AWSIntegration" API - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Create an AWS integration returns "Bad Request" response Given new "CreateAWSAccount" request And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "extended_resource_collection_enabled": true, "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Create an AWS integration returns "Conflict Error" response Given new "CreateAWSAccount" request And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "extended_resource_collection_enabled": true, "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 409 Conflict Error - @team:DataDog/cloud-integrations + @team:DataDog/aws-integrations Scenario: Create an AWS integration returns "OK" response Given new "CreateAWSAccount" request And body with value {"account_id": "{{ timestamp("now") }}00", "account_specific_namespace_rules": {"auto_scaling": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "extended_resource_collection_enabled": true, "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Create an Amazon EventBridge source returns "Bad Request" response Given new "CreateAWSEventBridgeSource" request And body with value {"account_id": "123456789012", "create_event_bus": true, "event_generator_name": "app-alerts", "region": "us-east-1"} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Create an Amazon EventBridge source returns "OK" response Given new "CreateAWSEventBridgeSource" request And body with value {"account_id": "123456789012", "create_event_bus": true, "event_generator_name": "app-alerts", "region": "us-east-1"} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Delete a tag filtering entry returns "Bad Request" response Given new "DeleteAWSTagFilter" request And body with value {"account_id": "FAKEAC0FAKEAC2FAKEAC", "namespace": "elb"} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Delete a tag filtering entry returns "OK" response Given new "DeleteAWSTagFilter" request And body with value {"account_id": "FAKEAC0FAKEAC2FAKEAC", "namespace": "elb"} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Delete an AWS integration returns "Bad Request" response Given new "DeleteAWSAccount" request And body with value {"account_id": "123456789012", "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Delete an AWS integration returns "Conflict Error" response Given new "DeleteAWSAccount" request And body with value {"account_id": "123456789012", "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 409 Conflict Error - @team:DataDog/cloud-integrations + @team:DataDog/aws-integrations Scenario: Delete an AWS integration returns "OK" response Given there is a valid "aws_account" in the system And new "DeleteAWSAccount" request @@ -80,107 +80,107 @@ Feature: AWS Integration When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Delete an Amazon EventBridge source returns "Bad Request" response Given new "DeleteAWSEventBridgeSource" request And body with value {"account_id": "123456789012", "event_generator_name": "app-alerts-zyxw3210", "region": "us-east-1"} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Delete an Amazon EventBridge source returns "OK" response Given new "DeleteAWSEventBridgeSource" request And body with value {"account_id": "123456789012", "event_generator_name": "app-alerts-zyxw3210", "region": "us-east-1"} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Generate a new external ID returns "Bad Request" response Given new "CreateNewAWSExternalID" request And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "extended_resource_collection_enabled": true, "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Generate a new external ID returns "OK" response Given new "CreateNewAWSExternalID" request And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "extended_resource_collection_enabled": true, "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Get all AWS tag filters returns "Bad Request" response Given new "ListAWSTagFilters" request And request contains "account_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Get all AWS tag filters returns "OK" response Given new "ListAWSTagFilters" request And request contains "account_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Get all Amazon EventBridge sources returns "Bad Request" response Given new "ListAWSEventBridgeSources" request When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Get all Amazon EventBridge sources returns "OK" response Given new "ListAWSEventBridgeSources" request When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: List all AWS integrations returns "Bad Request" response Given new "ListAWSAccounts" request When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: List all AWS integrations returns "OK" response Given new "ListAWSAccounts" request When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: List namespace rules returns "OK" response Given new "ListAvailableAWSNamespaces" request When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Set an AWS tag filter returns "Bad Request" response Given new "CreateAWSTagFilter" request And body with value {"account_id": "123456789012", "namespace": "elb", "tag_filter_str": "prod*"} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Set an AWS tag filter returns "OK" response Given new "CreateAWSTagFilter" request And body with value {"account_id": "123456789012", "namespace": "elb", "tag_filter_str": "prod*"} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Update an AWS integration returns "Bad Request" response Given new "UpdateAWSAccount" request And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "extended_resource_collection_enabled": true, "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Update an AWS integration returns "Conflict Error" response Given new "UpdateAWSAccount" request And body with value {"account_id": "123456789012", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "cspm_resource_collection_enabled": true, "excluded_regions": ["us-east-1", "us-west-2"], "extended_resource_collection_enabled": true, "filter_tags": ["$KEY:$VALUE"], "host_tags": ["$KEY:$VALUE"], "metrics_collection_enabled": false, "resource_collection_enabled": true, "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 409 Conflict Error - @team:DataDog/cloud-integrations + @team:DataDog/aws-integrations Scenario: Update an AWS integration returns "OK" response Given there is a valid "aws_account" in the system And new "UpdateAWSAccount" request diff --git a/src/test/resources/com/datadog/api/client/v1/api/aws_logs_integration.feature b/src/test/resources/com/datadog/api/client/v1/api/aws_logs_integration.feature index 5459cbb7947..622d8d7deba 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/aws_logs_integration.feature +++ b/src/test/resources/com/datadog/api/client/v1/api/aws_logs_integration.feature @@ -10,89 +10,89 @@ Feature: AWS Logs Integration And a valid "appKeyAuth" key in the system And an instance of "AWSLogsIntegration" API - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Add AWS Log Lambda ARN returns "Bad Request" response Given new "CreateAWSLambdaARN" request And body with value {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Add AWS Log Lambda ARN returns "OK" response Given new "CreateAWSLambdaARN" request And body with value {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Check permissions for log services returns "Bad Request" response Given new "CheckAWSLogsServicesAsync" request And body with value {"account_id": "1234567", "services": ["s3", "elb", "elbv2", "cloudfront", "redshift", "lambda"]} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Check permissions for log services returns "OK" response Given new "CheckAWSLogsServicesAsync" request And body with value {"account_id": "1234567", "services": ["s3", "elb", "elbv2", "cloudfront", "redshift", "lambda"]} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Check that an AWS Lambda Function exists returns "Bad Request" response Given new "CheckAWSLogsLambdaAsync" request And body with value {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Check that an AWS Lambda Function exists returns "OK" response Given new "CheckAWSLogsLambdaAsync" request And body with value {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Delete an AWS Logs integration returns "Bad Request" response Given new "DeleteAWSLambdaARN" request And body with value {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Delete an AWS Logs integration returns "OK" response Given new "DeleteAWSLambdaARN" request And body with value {"account_id": "1234567", "lambda_arn": "arn:aws:lambda:us-east-1:1234567:function:LogsCollectionAPITest"} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Enable an AWS Logs integration returns "Bad Request" response Given new "EnableAWSLogServices" request And body with value {"account_id": "1234567", "services": ["s3", "elb", "elbv2", "cloudfront", "redshift", "lambda"]} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Enable an AWS Logs integration returns "OK" response Given new "EnableAWSLogServices" request And body with value {"account_id": "1234567", "services": ["s3", "elb", "elbv2", "cloudfront", "redshift", "lambda"]} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: Get list of AWS log ready services returns "OK" response Given new "ListAWSLogsServices" request When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: List all AWS Logs integrations returns "Bad Request" response Given new "ListAWSLogsIntegrations" request When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/cloud-integrations + @generated @skip @team:DataDog/aws-integrations Scenario: List all AWS Logs integrations returns "OK" response Given new "ListAWSLogsIntegrations" request When the request is sent diff --git a/src/test/resources/com/datadog/api/client/v2/api/aws_integration.feature b/src/test/resources/com/datadog/api/client/v2/api/aws_integration.feature new file mode 100644 index 00000000000..3f47d837a7b --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/aws_integration.feature @@ -0,0 +1,158 @@ +@endpoint(aws-integration) @endpoint(aws-integration-v2) +Feature: AWS Integration + Configure your Datadog-AWS integration directly through the Datadog API. + For more information, see the [AWS integration + page](https://docs.datadoghq.com/integrations/amazon_web_services). + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "AWSIntegration" API + + @team:DataDog/aws-integrations + Scenario: Create an AWS account returns "AWS Account object" response + Given operation "CreateAWSAccount" enabled + And new "CreateAWSAccount" request + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws", "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} + When the request is sent + Then the response status is 200 AWS Account object + + @team:DataDog/aws-integrations + Scenario: Create an AWS integration returns "AWS Account object" response + Given operation "CreateAWSAccount" enabled + And new "CreateAWSAccount" request + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"access_key_id": "AKIAIOSFODNN7EXAMPLE", "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}, "aws_account_id": "123456789012", "aws_partition": "aws", "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} + When the request is sent + Then the response status is 200 AWS Account object + + @team:DataDog/aws-integrations + Scenario: Create an AWS integration returns "Bad Request" response + Given operation "CreateAWSAccount" enabled + And new "CreateAWSAccount" request + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws-invalid", "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/aws-integrations + Scenario: Create an AWS integration returns "Conflict" response + Given operation "CreateAWSAccount" enabled + And there is a valid "aws_account_v2" in the system + And new "CreateAWSAccount" request + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws", "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} + When the request is sent + Then the response status is 409 Conflict + + @team:DataDog/aws-integrations + Scenario: Delete an AWS integration returns "Bad Request" response + Given operation "DeleteAWSAccount" enabled + And new "DeleteAWSAccount" request + And request contains "aws_account_config_id" parameter with value "not-a-uuid" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/aws-integrations + Scenario: Delete an AWS integration returns "No Content" response + Given operation "DeleteAWSAccount" enabled + And there is a valid "aws_account_v2" in the system + And new "DeleteAWSAccount" request + And request contains "aws_account_config_id" parameter from "aws_account_v2.data.id" + When the request is sent + Then the response status is 204 No Content + + @team:DataDog/aws-integrations + Scenario: Delete an AWS integration returns "Not Found" response + Given operation "DeleteAWSAccount" enabled + And there is a valid "aws_account_v2" in the system + And new "DeleteAWSAccount" request + And request contains "aws_account_config_id" parameter with value "448169a8-251c-4344-abee-1c4edef39f7a" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/aws-integrations + Scenario: Generate a new external ID returns "AWS External ID object" response + Given operation "CreateNewAWSExternalID" enabled + And new "CreateNewAWSExternalID" request + When the request is sent + Then the response status is 200 AWS External ID object + + @team:DataDog/aws-integrations + Scenario: Generate new external ID returns "AWS External ID object" response + Given operation "CreateNewAWSExternalID" enabled + And new "CreateNewAWSExternalID" request + When the request is sent + Then the response status is 200 AWS External ID object + + @team:DataDog/aws-integrations + Scenario: Get an AWS integration by config ID returns "AWS Account object" response + Given operation "GetAWSAccount" enabled + And there is a valid "aws_account_v2" in the system + And new "GetAWSAccount" request + And request contains "aws_account_config_id" parameter from "aws_account_v2.data.id" + When the request is sent + Then the response status is 200 AWS Account object + + @team:DataDog/aws-integrations + Scenario: Get an AWS integration by config ID returns "Bad Request" response + Given operation "GetAWSAccount" enabled + And new "GetAWSAccount" request + And request contains "aws_account_config_id" parameter with value "not-a-uuid" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/aws-integrations + Scenario: Get an AWS integration by config ID returns "Not Found" response + Given operation "GetAWSAccount" enabled + And new "GetAWSAccount" request + And request contains "aws_account_config_id" parameter with value "448169a8-251c-4344-abee-1c4edef39f7a" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/aws-integrations + Scenario: List all AWS integrations returns "AWS Accounts List object" response + Given operation "ListAWSAccounts" enabled + And new "ListAWSAccounts" request + When the request is sent + Then the response status is 200 AWS Accounts List object + + @team:DataDog/aws-integrations + Scenario: List available namespaces returns "AWS Namespaces List object" response + Given operation "ListAWSNamespaces" enabled + And new "ListAWSNamespaces" request + When the request is sent + Then the response status is 200 AWS Namespaces List object + + @team:DataDog/aws-integrations + Scenario: List namespaces returns "AWS Namespaces List object" response + Given operation "ListAWSNamespaces" enabled + And new "ListAWSNamespaces" request + When the request is sent + Then the response status is 200 AWS Namespaces List object + + @team:DataDog/aws-integrations + Scenario: Update an AWS integration returns "AWS Account object" response + Given operation "UpdateAWSAccount" enabled + And there is a valid "aws_account_v2" in the system + And new "UpdateAWSAccount" request + And request contains "aws_account_config_id" parameter from "aws_account_v2.data.id" + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws", "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} + When the request is sent + Then the response status is 200 AWS Account object + + @team:DataDog/aws-integrations + Scenario: Update an AWS integration returns "Bad Request" response + Given operation "UpdateAWSAccount" enabled + And there is a valid "aws_account_v2" in the system + And new "UpdateAWSAccount" request + And request contains "aws_account_config_id" parameter from "aws_account_v2.data.id" + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"access_key_id": "AKIAIOSFODNN7EXAMPLE", "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}, "aws_account_id": "123456789012", "aws_partition": "aws", "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/aws-integrations + Scenario: Update an AWS integration returns "Not Found" response + Given operation "UpdateAWSAccount" enabled + And new "UpdateAWSAccount" request + And request contains "aws_account_config_id" parameter with value "448169a8-251c-4344-abee-1c4edef39f7a" + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws", "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} + When the request is sent + Then the response status is 404 Not Found diff --git a/src/test/resources/com/datadog/api/client/v2/api/aws_logs_integration.feature b/src/test/resources/com/datadog/api/client/v2/api/aws_logs_integration.feature new file mode 100644 index 00000000000..7dcfb894ae9 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/aws_logs_integration.feature @@ -0,0 +1,16 @@ +@endpoint(aws-logs-integration) @endpoint(aws-logs-integration-v2) +Feature: AWS Logs Integration + Configure your Datadog-AWS-Logs integration directly through Datadog API. + For more information, see the [AWS integration + page](https://docs.datadoghq.com/integrations/amazon_web_services/#log- + collection). + + @team:DataDog/aws-integrations + Scenario: Get list of AWS log ready services returns "AWS Logs Services List object" response + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "AWSLogsIntegration" API + And operation "ListAWSLogsServices" enabled + And new "ListAWSLogsServices" request + When the request is sent + Then the response status is 200 AWS Logs Services List object diff --git a/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index 6271eb23f01..41cd8e0f22a 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/given.json +++ b/src/test/resources/com/datadog/api/client/v2/api/given.json @@ -212,6 +212,18 @@ "tag": "Incidents", "operationId": "CreateIncidentTodo" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"account\",\n \"attributes\": {\n \"account_tags\": [\n \"key:value\"\n ],\n \"auth_config\": {\n \"role_name\": \"DatadogIntegrationRole\"\n },\n \"aws_account_id\": \"123456789012\",\n \"aws_partition\": \"aws\",\n \"aws_regions\": {\n \"include_only\": [\n \"us-east-1\"\n ]\n },\n \"logs_config\": {\n \"lambda_forwarder\": {\n \"lambdas\": [\n \"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"\n ],\n \"sources\": [\n \"s3\"\n ]\n }\n },\n \"metrics_config\": {\n \"enabled\": true,\n \"automute_enabled\": true,\n \"collect_custom_metrics\": false,\n \"collect_cloudwatch_alarms\": false,\n \"tag_filters\": [\n {\n \"namespace\": \"AWS/EC2\",\n \"tags\": [\n \"key:value\"\n ]\n }\n ],\n \"namespace_filters\": {\n \"include_only\": [\n \"AWS/EC2\"\n ]\n }\n },\n \"resources_config\": {\n \"cloud_security_posture_management_collection\": false,\n \"extended_collection\": false\n },\n \"traces_config\": {\n \"xray_services\": {\n \"include_only\": [\n \"AWS/AppSync\"\n ]\n }\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"aws_account_v2\" in the system", + "key": "aws_account_v2", + "tag": "AWS Integration", + "operationId": "CreateAWSAccount" + }, { "parameters": [ { diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 0e2a5942a9d..dcb4deb9a78 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -788,6 +788,61 @@ "type": "idempotent" } }, + "ListAWSAccounts": { + "tag": "AWS Integration", + "undo": { + "type": "safe" + } + }, + "CreateAWSAccount": { + "tag": "AWS Integration", + "undo": { + "operationId": "DeleteAWSAccount", + "parameters": [ + { + "name": "aws_account_config_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteAWSAccount": { + "tag": "AWS Integration", + "undo": { + "type": "idempotent" + } + }, + "GetAWSAccount": { + "tag": "AWS Integration", + "undo": { + "type": "safe" + } + }, + "UpdateAWSAccount": { + "tag": "AWS Integration", + "undo": { + "type": "idempotent" + } + }, + "ListAWSNamespaces": { + "tag": "AWS Integration", + "undo": { + "type": "safe" + } + }, + "CreateNewAWSExternalID": { + "tag": "AWS Integration", + "undo": { + "type": "safe" + } + }, + "ListAWSLogsServices": { + "tag": "AWS Logs Integration", + "undo": { + "type": "safe" + } + }, "ListGCPSTSAccounts": { "tag": "GCP Integration", "undo": {