diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 42ec940d042..9a4d9f05ee8 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -27888,6 +27888,7 @@ paths: - aws_configuration_read /api/v1/integration/aws/event_bridge: delete: + deprecated: true description: Delete an Amazon EventBridge source. operationId: DeleteAWSEventBridgeSource requestBody: @@ -27928,6 +27929,7 @@ paths: permissions: - manage_integrations get: + deprecated: true description: Get all Amazon EventBridge sources. operationId: ListAWSEventBridgeSources parameters: [] @@ -27959,6 +27961,7 @@ paths: operator: OPEN permissions: [] post: + deprecated: true description: Create an Amazon EventBridge source. operationId: CreateAWSEventBridgeSource requestBody: diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c31c76079af..e44adfced6e 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1428,7 +1428,9 @@ components: AWSAccountConfigID: description: 'Unique Datadog ID of the AWS Account Integration Config. - To get the config ID for an account, use the [List all AWS integrations](https://docs.datadoghq.com/api/latest/aws-integration/#list-all-aws-integrations) + To get the config ID for an account, use the + + [List all AWS integrations](https://docs.datadoghq.com/api/latest/aws-integration/#list-all-aws-integrations) endpoint and query by AWS Account ID.' example: 00000000-abcd-0001-0000-000000000000 @@ -1486,6 +1488,7 @@ components: description: 'AWS partition your AWS account is scoped to. Defaults to `aws`. See [Partitions](https://docs.aws.amazon.com/whitepapers/latest/aws-fault-isolation-boundaries/partitions.html) + in the AWS documentation for more information.' enum: - aws @@ -1730,6 +1733,269 @@ components: description: The definition of `AWSCredentialsUpdate` object. oneOf: - $ref: '#/components/schemas/AWSAssumeRoleUpdate' + AWSEventBridgeAccountConfiguration: + description: The EventBridge configuration for one AWS account. + properties: + account_id: + description: Your AWS Account ID without dashes. + example: '123456789012' + type: string + event_hubs: + description: Array of AWS event sources associated with this account. + items: + $ref: '#/components/schemas/AWSEventBridgeSource' + type: array + tags: + description: 'Array of tags (in the form `key:value`) which are added to + all hosts + + and metrics reporting through the main AWS integration.' + example: + - $KEY:$VALUE + items: + description: The list of the host_tags. + type: string + type: array + type: object + AWSEventBridgeCreateRequest: + description: Amazon EventBridge create request body. + properties: + data: + $ref: '#/components/schemas/AWSEventBridgeCreateRequestData' + required: + - data + type: object + AWSEventBridgeCreateRequestAttributes: + description: The EventBridge source to be created. + properties: + account_id: + $ref: '#/components/schemas/AWSAccountID' + create_event_bus: + description: 'Set to true if Datadog should create the event bus in addition + to the event + + source. Requires the `events:CreateEventBus` permission.' + example: true + type: boolean + event_generator_name: + description: 'The given part of the event source name, which is then combined + with an + + assigned suffix to form the full name.' + example: app-alerts + type: string + region: + description: 'The event source''s + + [AWS region](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints).' + example: us-east-1 + type: string + required: + - account_id + - event_generator_name + - region + type: object + AWSEventBridgeCreateRequestData: + description: Amazon EventBridge create request data. + properties: + attributes: + $ref: '#/components/schemas/AWSEventBridgeCreateRequestAttributes' + type: + $ref: '#/components/schemas/AWSEventBridgeType' + required: + - attributes + - type + type: object + AWSEventBridgeCreateResponse: + description: Amazon EventBridge create response body. + properties: + data: + $ref: '#/components/schemas/AWSEventBridgeCreateResponseData' + required: + - data + type: object + AWSEventBridgeCreateResponseAttributes: + description: A created EventBridge source. + properties: + event_source_name: + description: The event source name. + example: app-alerts-zyxw3210 + type: string + has_bus: + description: True if the event bus was created in addition to the source. + example: true + type: boolean + region: + description: 'The event source''s + + [AWS region](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints).' + example: us-east-1 + type: string + status: + $ref: '#/components/schemas/AWSEventBridgeCreateStatus' + type: object + AWSEventBridgeCreateResponseData: + description: Amazon EventBridge create response data. + properties: + attributes: + $ref: '#/components/schemas/AWSEventBridgeCreateResponseAttributes' + id: + default: create_event_bridge + description: The ID of the Amazon EventBridge create response data. + example: create_event_bridge + type: string + type: + $ref: '#/components/schemas/AWSEventBridgeType' + required: + - attributes + - type + type: object + AWSEventBridgeCreateStatus: + description: The event source status "created". + enum: + - created + example: created + type: string + x-enum-varnames: + - CREATED + AWSEventBridgeDeleteRequest: + description: Amazon EventBridge delete request body. + properties: + data: + $ref: '#/components/schemas/AWSEventBridgeDeleteRequestData' + required: + - data + type: object + AWSEventBridgeDeleteRequestAttributes: + description: The EventBridge source to be deleted. + properties: + account_id: + $ref: '#/components/schemas/AWSAccountID' + event_generator_name: + description: The event source name. + example: app-alerts-zyxw3210 + type: string + region: + description: 'The event source''s + + [AWS region](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints).' + example: us-east-1 + type: string + required: + - account_id + - event_generator_name + - region + type: object + AWSEventBridgeDeleteRequestData: + description: Amazon EventBridge delete request data. + properties: + attributes: + $ref: '#/components/schemas/AWSEventBridgeDeleteRequestAttributes' + type: + $ref: '#/components/schemas/AWSEventBridgeType' + required: + - attributes + - type + type: object + AWSEventBridgeDeleteResponse: + description: Amazon EventBridge delete response body. + properties: + data: + $ref: '#/components/schemas/AWSEventBridgeDeleteResponseData' + required: + - data + type: object + AWSEventBridgeDeleteResponseAttributes: + description: The EventBridge source delete response attributes. + properties: + status: + $ref: '#/components/schemas/AWSEventBridgeDeleteStatus' + type: object + AWSEventBridgeDeleteResponseData: + description: Amazon EventBridge delete response data. + properties: + attributes: + $ref: '#/components/schemas/AWSEventBridgeDeleteResponseAttributes' + id: + default: delete_event_bridge + description: The ID of the Amazon EventBridge list response data. + example: delete_event_bridge + type: string + type: + $ref: '#/components/schemas/AWSEventBridgeType' + required: + - attributes + - type + type: object + AWSEventBridgeDeleteStatus: + description: The event source status "empty". + enum: + - empty + example: empty + type: string + x-enum-varnames: + - EMPTY + AWSEventBridgeListResponse: + description: Amazon EventBridge list response body. + properties: + data: + $ref: '#/components/schemas/AWSEventBridgeListResponseData' + required: + - data + type: object + AWSEventBridgeListResponseAttributes: + description: An object describing the EventBridge configuration for multiple + accounts. + properties: + accounts: + description: List of accounts with their event sources. + items: + $ref: '#/components/schemas/AWSEventBridgeAccountConfiguration' + type: array + is_installed: + description: True if the EventBridge integration is enabled for your organization. + type: boolean + type: object + AWSEventBridgeListResponseData: + description: Amazon EventBridge list response data. + properties: + attributes: + $ref: '#/components/schemas/AWSEventBridgeListResponseAttributes' + id: + default: get_event_bridge + description: The ID of the Amazon EventBridge list response data. + example: get_event_bridge + type: string + type: + $ref: '#/components/schemas/AWSEventBridgeType' + required: + - attributes + - id + - type + type: object + AWSEventBridgeSource: + description: An EventBridge source. + properties: + name: + description: The event source name. + example: app-alerts-zyxw3210 + type: string + region: + description: 'The event source''s + + [AWS region](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints).' + example: us-east-1 + type: string + type: object + AWSEventBridgeType: + default: event_bridge + description: Amazon EventBridge resource type. + enum: + - event_bridge + example: event_bridge + type: string + x-enum-varnames: + - EVENT_BRIDGE AWSIntegration: description: The definition of `AWSIntegration` object. properties: @@ -1809,10 +2075,12 @@ components: type: object AWSLambdaForwarderConfig: description: 'Log Autosubscription configuration for Datadog Forwarder Lambda - functions. Automatically set up triggers for existing + functions. - and new logs for some services, ensuring no logs from new resources are missed - and saving time spent on manual configuration.' + Automatically set up triggers for existing and new logs for some services, + + ensuring no logs from new resources are missed and saving time spent on manual + configuration.' properties: lambdas: description: List of Datadog Lambda Log Forwarder ARNs in your AWS account. @@ -1825,9 +2093,11 @@ components: $ref: '#/components/schemas/AWSLambdaForwarderConfigLogSourceConfig' sources: description: 'List of service IDs set to enable automatic log collection. + Discover the list of available services with the [Get list of AWS log ready services](https://docs.datadoghq.com/api/latest/aws-logs-integration/#get-list-of-aws-log-ready-services) + endpoint.' items: example: s3 @@ -1847,14 +2117,20 @@ components: description: 'AWS log source tag filter list. Defaults to `[]`. Array of log source to AWS resource tag mappings. Each mapping contains a - log source and its associated AWS resource tags (in `key:value` format) used - to filter logs submitted to Datadog. + log source and its + + associated AWS resource tags (in `key:value` format) used to filter logs submitted + to Datadog. Tag filters are applied for tags on the AWS resource emitting logs; tags associated - with the log storage entity (such as a CloudWatch Log Group or S3 Bucket) - are not considered. + with the + + log storage entity (such as a CloudWatch Log Group or S3 Bucket) are not considered. + + For more information on resource tag filter syntax, + + [see AWS resource exclusion](https://docs.datadoghq.com/account_management/billing/aws/#aws-resource-exclusion) - For more information on resource tag filter syntax, [see AWS resource exclusion](https://docs.datadoghq.com/account_management/billing/aws/#aws-resource-exclusion) in the AWS integration billing page.' properties: source: @@ -1958,17 +2234,21 @@ components: - $ref: '#/components/schemas/AWSNamespaceFiltersExcludeOnly' - $ref: '#/components/schemas/AWSNamespaceFiltersIncludeOnly' AWSNamespaceFiltersExcludeOnly: - description: 'Exclude only these namespaces from metrics collection. Defaults - to `["AWS/SQS", "AWS/ElasticMapReduce", "AWS/Usage"]`. + description: 'Exclude only these namespaces from metrics collection. + + Defaults to `["AWS/SQS", "AWS/ElasticMapReduce", "AWS/Usage"]`. `AWS/SQS`, `AWS/ElasticMapReduce`, and `AWS/Usage` are excluded by default + to reduce your AWS CloudWatch costs from `GetMetricData` API calls.' properties: exclude_only: - description: 'Exclude only these namespaces from metrics collection. Defaults - to `["AWS/SQS", "AWS/ElasticMapReduce", "AWS/Usage"]`. + description: 'Exclude only these namespaces from metrics collection. + + Defaults to `["AWS/SQS", "AWS/ElasticMapReduce", "AWS/Usage"]`. `AWS/SQS`, `AWS/ElasticMapReduce`, and `AWS/Usage` are excluded by default + to reduce your AWS CloudWatch costs from `GetMetricData` API calls.' example: - AWS/SQS @@ -1999,15 +2279,18 @@ components: description: 'AWS Metrics Collection tag filters list. Defaults to `[]`. The array of custom AWS resource tags (in the form `key:value`) defines a - filter that Datadog uses when collecting metrics from a specified service. + filter that Datadog uses + + when collecting metrics from a specified service. Wildcards, such as `?` (match a single character) and `*` (match multiple - characters), and exclusion using `!` before the tag are supported. + characters), + + and exclusion using `!` before the tag are supported. - For EC2, only hosts that match one of the defined tags will be imported into - Datadog. The rest will be ignored. + For EC2, only hosts that match one of the defined tags are imported into Datadog. - For example, `env:production,instance-type:c?.*,!region:us-east-1`.' + The rest are ignored. For example, `env:production,instance-type:c?.*,!region:us-east-1`.' properties: namespace: description: The AWS service for which the tag filters defined in `tags` @@ -2147,15 +2430,19 @@ components: description: AWS Resources Collection config. properties: cloud_security_posture_management_collection: - description: Enable Cloud Security Management to scan AWS resources for - vulnerabilities, misconfigurations, identity risks, and compliance violations. - Defaults to `false`. Requires `extended_collection` to be set to `true`. + description: 'Enable Cloud Security Management to scan AWS resources for + vulnerabilities, misconfigurations, + + identity risks, and compliance violations. Defaults to `false`. + + Requires `extended_collection` to be set to `true`.' example: false type: boolean extended_collection: - description: Whether Datadog collects additional attributes and configuration - information about the resources in your AWS account. Defaults to `true`. - Required for `cloud_security_posture_management_collection`. + description: 'Whether Datadog collects additional attributes and configuration + information about the resources + + in your AWS account. Defaults to `true`. Required for `cloud_security_posture_management_collection`.' example: true type: boolean type: object @@ -63553,8 +63840,9 @@ paths: description: Get a list of AWS Account Integration Configs. operationId: ListAWSAccounts parameters: - - description: Optional query parameter to filter accounts by AWS Account ID. - If not provided, all accounts are returned. + - description: 'Optional query parameter to filter accounts by AWS Account ID. + + If not provided, all accounts are returned.' example: '123456789012' in: query name: aws_account_id @@ -63719,6 +64007,96 @@ paths: operator: OR permissions: - aws_configuration_read + /api/v2/integration/aws/event_bridge: + delete: + description: Delete an Amazon EventBridge source. + operationId: DeleteAWSEventBridgeSource + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AWSEventBridgeDeleteRequest' + description: Delete the Amazon EventBridge source with the given name, region, + and associated AWS account. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSEventBridgeDeleteResponse' + description: Amazon EventBridge source deleted. + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete an Amazon EventBridge source + tags: + - AWS Integration + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - manage_integrations + get: + description: Get all Amazon EventBridge sources. + operationId: ListAWSEventBridgeSources + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSEventBridgeListResponse' + description: Amazon EventBridge sources list. + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get all Amazon EventBridge sources + tags: + - AWS Integration + x-permission: + operator: OR + permissions: + - integrations_read + post: + description: Create an Amazon EventBridge source. + operationId: CreateAWSEventBridgeSource + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AWSEventBridgeCreateRequest' + description: Create an Amazon EventBridge source for an AWS account with a + given name and region. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSEventBridgeCreateResponse' + description: Amazon EventBridge source created. + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '409': + $ref: '#/components/responses/ConflictResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create an Amazon EventBridge source + tags: + - AWS Integration + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - manage_integrations /api/v2/integration/aws/generate_new_external_id: post: description: Generate a new external ID for AWS role-based authentication. diff --git a/examples/v2/aws-integration/CreateAWSEventBridgeSource.rb b/examples/v2/aws-integration/CreateAWSEventBridgeSource.rb new file mode 100644 index 00000000000..f46e603aa6d --- /dev/null +++ b/examples/v2/aws-integration/CreateAWSEventBridgeSource.rb @@ -0,0 +1,17 @@ +# Create an Amazon EventBridge source returns "Amazon EventBridge source created." response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new + +body = DatadogAPIClient::V2::AWSEventBridgeCreateRequest.new({ + data: DatadogAPIClient::V2::AWSEventBridgeCreateRequestData.new({ + attributes: DatadogAPIClient::V2::AWSEventBridgeCreateRequestAttributes.new({ + account_id: "123456789012", + create_event_bus: true, + event_generator_name: "app-alerts", + region: "us-east-1", + }), + type: DatadogAPIClient::V2::AWSEventBridgeType::EVENT_BRIDGE, + }), +}) +p api_instance.create_aws_event_bridge_source(body) diff --git a/examples/v2/aws-integration/DeleteAWSEventBridgeSource.rb b/examples/v2/aws-integration/DeleteAWSEventBridgeSource.rb new file mode 100644 index 00000000000..14941df7fa5 --- /dev/null +++ b/examples/v2/aws-integration/DeleteAWSEventBridgeSource.rb @@ -0,0 +1,16 @@ +# Delete an Amazon EventBridge source returns "Amazon EventBridge source deleted." response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new + +body = DatadogAPIClient::V2::AWSEventBridgeDeleteRequest.new({ + data: DatadogAPIClient::V2::AWSEventBridgeDeleteRequestData.new({ + attributes: DatadogAPIClient::V2::AWSEventBridgeDeleteRequestAttributes.new({ + account_id: "123456789012", + event_generator_name: "app-alerts-zyxw3210", + region: "us-east-1", + }), + type: DatadogAPIClient::V2::AWSEventBridgeType::EVENT_BRIDGE, + }), +}) +p api_instance.delete_aws_event_bridge_source(body) diff --git a/examples/v2/aws-integration/ListAWSEventBridgeSources.rb b/examples/v2/aws-integration/ListAWSEventBridgeSources.rb new file mode 100644 index 00000000000..745a5311973 --- /dev/null +++ b/examples/v2/aws-integration/ListAWSEventBridgeSources.rb @@ -0,0 +1,5 @@ +# Get all Amazon EventBridge sources returns "Amazon EventBridge sources list." response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new +p api_instance.list_aws_event_bridge_sources() diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 612eaa0f8aa..b0f24e6ccaa 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2087,6 +2087,12 @@ "aws_account_config_id" => "String", "body" => "AWSAccountUpdateRequest", }, + "v2.DeleteAWSEventBridgeSource" => { + "body" => "AWSEventBridgeDeleteRequest", + }, + "v2.CreateAWSEventBridgeSource" => { + "body" => "AWSEventBridgeCreateRequest", + }, "v2.CreateGCPSTSAccount" => { "body" => "GCPSTSServiceAccountCreateRequest", }, diff --git a/features/v2/aws_integration.feature b/features/v2/aws_integration.feature index 16522a97cf5..30ded64d73f 100644 --- a/features/v2/aws_integration.feature +++ b/features/v2/aws_integration.feature @@ -38,6 +38,27 @@ Feature: AWS Integration When the request is sent Then the response status is 409 Conflict + @generated @skip @team:DataDog/aws-integrations + Scenario: Create an Amazon EventBridge source returns "Amazon EventBridge source created." response + Given new "CreateAWSEventBridgeSource" request + And body with value {"data": {"attributes": {"account_id": "123456789012", "create_event_bus": true, "event_generator_name": "app-alerts", "region": "us-east-1"}, "type": "event_bridge"}} + When the request is sent + Then the response status is 200 Amazon EventBridge source created. + + @generated @skip @team:DataDog/aws-integrations + Scenario: Create an Amazon EventBridge source returns "Bad Request" response + Given new "CreateAWSEventBridgeSource" request + And body with value {"data": {"attributes": {"account_id": "123456789012", "create_event_bus": true, "event_generator_name": "app-alerts", "region": "us-east-1"}, "type": "event_bridge"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aws-integrations + Scenario: Create an Amazon EventBridge source returns "Conflict" response + Given new "CreateAWSEventBridgeSource" request + And body with value {"data": {"attributes": {"account_id": "123456789012", "create_event_bus": true, "event_generator_name": "app-alerts", "region": "us-east-1"}, "type": "event_bridge"}} + 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 new "DeleteAWSAccount" request @@ -61,6 +82,20 @@ Feature: AWS Integration When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/aws-integrations + Scenario: Delete an Amazon EventBridge source returns "Amazon EventBridge source deleted." response + Given new "DeleteAWSEventBridgeSource" request + And body with value {"data": {"attributes": {"account_id": "123456789012", "event_generator_name": "app-alerts-zyxw3210", "region": "us-east-1"}, "type": "event_bridge"}} + When the request is sent + Then the response status is 200 Amazon EventBridge source deleted. + + @generated @skip @team:DataDog/aws-integrations + Scenario: Delete an Amazon EventBridge source returns "Bad Request" response + Given new "DeleteAWSEventBridgeSource" request + And body with value {"data": {"attributes": {"account_id": "123456789012", "event_generator_name": "app-alerts-zyxw3210", "region": "us-east-1"}, "type": "event_bridge"}} + When the request is sent + Then the response status is 400 Bad Request + @team:DataDog/aws-integrations Scenario: Generate a new external ID returns "AWS External ID object" response Given new "CreateNewAWSExternalID" request @@ -91,6 +126,18 @@ Feature: AWS Integration When the request is sent Then the response status is 200 AWS integration standard IAM permissions. + @generated @skip @team:DataDog/aws-integrations + Scenario: Get all Amazon EventBridge sources returns "Amazon EventBridge sources list." response + Given new "ListAWSEventBridgeSources" request + When the request is sent + Then the response status is 200 Amazon EventBridge sources list. + + @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 + @team:DataDog/aws-integrations Scenario: Get an AWS integration by config ID returns "AWS Account object" response Given there is a valid "aws_account_v2" in the system diff --git a/features/v2/undo.json b/features/v2/undo.json index eb1380ab6b8..ec7eca2cfdf 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1712,6 +1712,26 @@ "type": "safe" } }, + "DeleteAWSEventBridgeSource": { + "tag": "AWS Integration", + "undo": { + "type": "idempotent" + } + }, + "ListAWSEventBridgeSources": { + "tag": "AWS Integration", + "undo": { + "type": "safe" + } + }, + "CreateAWSEventBridgeSource": { + "tag": "AWS Integration", + "undo": { + "operationId": "DeleteAWSEventBridgeSource", + "parameters": [], + "type": "unsafe" + } + }, "CreateNewAWSExternalID": { "tag": "AWS Integration", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index e43e80707bc..5ff6cd84679 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1200,6 +1200,26 @@ def overrides "v2.aws_cur_config_response_data_type" => "AwsCurConfigResponseDataType", "v2.aws_cur_configs_response" => "AwsCURConfigsResponse", "v2.aws_cur_config_type" => "AwsCURConfigType", + "v2.aws_event_bridge_account_configuration" => "AWSEventBridgeAccountConfiguration", + "v2.aws_event_bridge_create_request" => "AWSEventBridgeCreateRequest", + "v2.aws_event_bridge_create_request_attributes" => "AWSEventBridgeCreateRequestAttributes", + "v2.aws_event_bridge_create_request_data" => "AWSEventBridgeCreateRequestData", + "v2.aws_event_bridge_create_response" => "AWSEventBridgeCreateResponse", + "v2.aws_event_bridge_create_response_attributes" => "AWSEventBridgeCreateResponseAttributes", + "v2.aws_event_bridge_create_response_data" => "AWSEventBridgeCreateResponseData", + "v2.aws_event_bridge_create_status" => "AWSEventBridgeCreateStatus", + "v2.aws_event_bridge_delete_request" => "AWSEventBridgeDeleteRequest", + "v2.aws_event_bridge_delete_request_attributes" => "AWSEventBridgeDeleteRequestAttributes", + "v2.aws_event_bridge_delete_request_data" => "AWSEventBridgeDeleteRequestData", + "v2.aws_event_bridge_delete_response" => "AWSEventBridgeDeleteResponse", + "v2.aws_event_bridge_delete_response_attributes" => "AWSEventBridgeDeleteResponseAttributes", + "v2.aws_event_bridge_delete_response_data" => "AWSEventBridgeDeleteResponseData", + "v2.aws_event_bridge_delete_status" => "AWSEventBridgeDeleteStatus", + "v2.aws_event_bridge_list_response" => "AWSEventBridgeListResponse", + "v2.aws_event_bridge_list_response_attributes" => "AWSEventBridgeListResponseAttributes", + "v2.aws_event_bridge_list_response_data" => "AWSEventBridgeListResponseData", + "v2.aws_event_bridge_source" => "AWSEventBridgeSource", + "v2.aws_event_bridge_type" => "AWSEventBridgeType", "v2.aws_integration" => "AWSIntegration", "v2.aws_integration_iam_permissions_response" => "AWSIntegrationIamPermissionsResponse", "v2.aws_integration_iam_permissions_response_attributes" => "AWSIntegrationIamPermissionsResponseAttributes", diff --git a/lib/datadog_api_client/v1/api/aws_integration_api.rb b/lib/datadog_api_client/v1/api/aws_integration_api.rb index d55c693983d..ace9347d4fa 100644 --- a/lib/datadog_api_client/v1/api/aws_integration_api.rb +++ b/lib/datadog_api_client/v1/api/aws_integration_api.rb @@ -108,10 +108,13 @@ def create_aws_event_bridge_source(body, opts = {}) # # Create an Amazon EventBridge source. # + # @deprecated This API is deprecated. + # # @param body [AWSEventBridgeCreateRequest] Create an Amazon EventBridge source for an AWS account with a given name and region. # @param opts [Hash] the optional parameters # @return [Array<(AWSEventBridgeCreateResponse, Integer, Hash)>] AWSEventBridgeCreateResponse data, response status code and response headers def create_aws_event_bridge_source_with_http_info(body, opts = {}) + warn "[DEPRECATION] `CreateAWSEventBridgeSource` is deprecated." if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AWSIntegrationAPI.create_aws_event_bridge_source ...' @@ -385,10 +388,13 @@ def delete_aws_event_bridge_source(body, opts = {}) # # Delete an Amazon EventBridge source. # + # @deprecated This API is deprecated. + # # @param body [AWSEventBridgeDeleteRequest] Delete the Amazon EventBridge source with the given name, region, and associated AWS account. # @param opts [Hash] the optional parameters # @return [Array<(AWSEventBridgeDeleteResponse, Integer, Hash)>] AWSEventBridgeDeleteResponse data, response status code and response headers def delete_aws_event_bridge_source_with_http_info(body, opts = {}) + warn "[DEPRECATION] `DeleteAWSEventBridgeSource` is deprecated." if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AWSIntegrationAPI.delete_aws_event_bridge_source ...' @@ -654,9 +660,12 @@ def list_aws_event_bridge_sources(opts = {}) # # Get all Amazon EventBridge sources. # + # @deprecated This API is deprecated. + # # @param opts [Hash] the optional parameters # @return [Array<(AWSEventBridgeListResponse, Integer, Hash)>] AWSEventBridgeListResponse data, response status code and response headers def list_aws_event_bridge_sources_with_http_info(opts = {}) + warn "[DEPRECATION] `ListAWSEventBridgeSources` is deprecated." if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AWSIntegrationAPI.list_aws_event_bridge_sources ...' diff --git a/lib/datadog_api_client/v2/api/aws_integration_api.rb b/lib/datadog_api_client/v2/api/aws_integration_api.rb index a5fa19c181c..67ef07d29ea 100644 --- a/lib/datadog_api_client/v2/api/aws_integration_api.rb +++ b/lib/datadog_api_client/v2/api/aws_integration_api.rb @@ -90,6 +90,73 @@ def create_aws_account_with_http_info(body, opts = {}) return data, status_code, headers end + # Create an Amazon EventBridge source. + # + # @see #create_aws_event_bridge_source_with_http_info + def create_aws_event_bridge_source(body, opts = {}) + data, _status_code, _headers = create_aws_event_bridge_source_with_http_info(body, opts) + data + end + + # Create an Amazon EventBridge source. + # + # Create an Amazon EventBridge source. + # + # @param body [AWSEventBridgeCreateRequest] Create an Amazon EventBridge source for an AWS account with a given name and region. + # @param opts [Hash] the optional parameters + # @return [Array<(AWSEventBridgeCreateResponse, Integer, Hash)>] AWSEventBridgeCreateResponse data, response status code and response headers + def create_aws_event_bridge_source_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSIntegrationAPI.create_aws_event_bridge_source ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AWSIntegrationAPI.create_aws_event_bridge_source" + end + # resource path + local_var_path = '/api/v2/integration/aws/event_bridge' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'AWSEventBridgeCreateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_aws_event_bridge_source, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AWSIntegrationAPI#create_aws_event_bridge_source\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Generate a new external ID. # # @see #create_new_aws_external_id_with_http_info @@ -215,6 +282,73 @@ def delete_aws_account_with_http_info(aws_account_config_id, opts = {}) return data, status_code, headers end + # Delete an Amazon EventBridge source. + # + # @see #delete_aws_event_bridge_source_with_http_info + def delete_aws_event_bridge_source(body, opts = {}) + data, _status_code, _headers = delete_aws_event_bridge_source_with_http_info(body, opts) + data + end + + # Delete an Amazon EventBridge source. + # + # Delete an Amazon EventBridge source. + # + # @param body [AWSEventBridgeDeleteRequest] Delete the Amazon EventBridge source with the given name, region, and associated AWS account. + # @param opts [Hash] the optional parameters + # @return [Array<(AWSEventBridgeDeleteResponse, Integer, Hash)>] AWSEventBridgeDeleteResponse data, response status code and response headers + def delete_aws_event_bridge_source_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSIntegrationAPI.delete_aws_event_bridge_source ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AWSIntegrationAPI.delete_aws_event_bridge_source" + end + # resource path + local_var_path = '/api/v2/integration/aws/event_bridge' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'AWSEventBridgeDeleteResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_aws_event_bridge_source, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AWSIntegrationAPI#delete_aws_event_bridge_source\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get an AWS integration by config ID. # # @see #get_aws_account_with_http_info @@ -522,6 +656,66 @@ def list_aws_accounts_with_http_info(opts = {}) return data, status_code, headers end + # Get all Amazon EventBridge sources. + # + # @see #list_aws_event_bridge_sources_with_http_info + def list_aws_event_bridge_sources(opts = {}) + data, _status_code, _headers = list_aws_event_bridge_sources_with_http_info(opts) + data + end + + # Get all Amazon EventBridge sources. + # + # Get all Amazon EventBridge sources. + # + # @param opts [Hash] the optional parameters + # @return [Array<(AWSEventBridgeListResponse, Integer, Hash)>] AWSEventBridgeListResponse data, response status code and response headers + def list_aws_event_bridge_sources_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSIntegrationAPI.list_aws_event_bridge_sources ...' + end + # resource path + local_var_path = '/api/v2/integration/aws/event_bridge' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'AWSEventBridgeListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_aws_event_bridge_sources, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AWSIntegrationAPI#list_aws_event_bridge_sources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List available namespaces. # # @see #list_aws_namespaces_with_http_info diff --git a/lib/datadog_api_client/v2/models/aws_account_create_request_attributes.rb b/lib/datadog_api_client/v2/models/aws_account_create_request_attributes.rb index 55b217b2104..d64c59594ee 100644 --- a/lib/datadog_api_client/v2/models/aws_account_create_request_attributes.rb +++ b/lib/datadog_api_client/v2/models/aws_account_create_request_attributes.rb @@ -31,7 +31,8 @@ class AWSAccountCreateRequestAttributes attr_reader :aws_account_id # AWS partition your AWS account is scoped to. Defaults to `aws`. - # See [Partitions](https://docs.aws.amazon.com/whitepapers/latest/aws-fault-isolation-boundaries/partitions.html) in the AWS documentation for more information. + # See [Partitions](https://docs.aws.amazon.com/whitepapers/latest/aws-fault-isolation-boundaries/partitions.html) + # in the AWS documentation for more information. attr_reader :aws_partition # AWS Regions to collect data from. Defaults to `include_all`. diff --git a/lib/datadog_api_client/v2/models/aws_account_partition.rb b/lib/datadog_api_client/v2/models/aws_account_partition.rb index cdd44187722..0bbd4354c10 100644 --- a/lib/datadog_api_client/v2/models/aws_account_partition.rb +++ b/lib/datadog_api_client/v2/models/aws_account_partition.rb @@ -18,7 +18,8 @@ module DatadogAPIClient::V2 # AWS partition your AWS account is scoped to. Defaults to `aws`. - # See [Partitions](https://docs.aws.amazon.com/whitepapers/latest/aws-fault-isolation-boundaries/partitions.html) in the AWS documentation for more information. + # See [Partitions](https://docs.aws.amazon.com/whitepapers/latest/aws-fault-isolation-boundaries/partitions.html) + # in the AWS documentation for more information. class AWSAccountPartition include BaseEnumModel diff --git a/lib/datadog_api_client/v2/models/aws_account_response_attributes.rb b/lib/datadog_api_client/v2/models/aws_account_response_attributes.rb index 0f17b056f13..9063205acd0 100644 --- a/lib/datadog_api_client/v2/models/aws_account_response_attributes.rb +++ b/lib/datadog_api_client/v2/models/aws_account_response_attributes.rb @@ -31,7 +31,8 @@ class AWSAccountResponseAttributes attr_reader :aws_account_id # AWS partition your AWS account is scoped to. Defaults to `aws`. - # See [Partitions](https://docs.aws.amazon.com/whitepapers/latest/aws-fault-isolation-boundaries/partitions.html) in the AWS documentation for more information. + # See [Partitions](https://docs.aws.amazon.com/whitepapers/latest/aws-fault-isolation-boundaries/partitions.html) + # in the AWS documentation for more information. attr_accessor :aws_partition # AWS Regions to collect data from. Defaults to `include_all`. diff --git a/lib/datadog_api_client/v2/models/aws_account_response_data.rb b/lib/datadog_api_client/v2/models/aws_account_response_data.rb index 3c5afd9c726..17011111006 100644 --- a/lib/datadog_api_client/v2/models/aws_account_response_data.rb +++ b/lib/datadog_api_client/v2/models/aws_account_response_data.rb @@ -25,7 +25,8 @@ class AWSAccountResponseData attr_accessor :attributes # Unique Datadog ID of the AWS Account Integration Config. - # To get the config ID for an account, use the [List all AWS integrations](https://docs.datadoghq.com/api/latest/aws-integration/#list-all-aws-integrations) + # To get the config ID for an account, use the + # [List all AWS integrations](https://docs.datadoghq.com/api/latest/aws-integration/#list-all-aws-integrations) # endpoint and query by AWS Account ID. attr_reader :id diff --git a/lib/datadog_api_client/v2/models/aws_account_update_request_attributes.rb b/lib/datadog_api_client/v2/models/aws_account_update_request_attributes.rb index a65bf3d385f..efbdfdda1f8 100644 --- a/lib/datadog_api_client/v2/models/aws_account_update_request_attributes.rb +++ b/lib/datadog_api_client/v2/models/aws_account_update_request_attributes.rb @@ -31,7 +31,8 @@ class AWSAccountUpdateRequestAttributes attr_reader :aws_account_id # AWS partition your AWS account is scoped to. Defaults to `aws`. - # See [Partitions](https://docs.aws.amazon.com/whitepapers/latest/aws-fault-isolation-boundaries/partitions.html) in the AWS documentation for more information. + # See [Partitions](https://docs.aws.amazon.com/whitepapers/latest/aws-fault-isolation-boundaries/partitions.html) + # in the AWS documentation for more information. attr_accessor :aws_partition # AWS Regions to collect data from. Defaults to `include_all`. diff --git a/lib/datadog_api_client/v2/models/aws_account_update_request_data.rb b/lib/datadog_api_client/v2/models/aws_account_update_request_data.rb index 251fc04e797..091b2a7d682 100644 --- a/lib/datadog_api_client/v2/models/aws_account_update_request_data.rb +++ b/lib/datadog_api_client/v2/models/aws_account_update_request_data.rb @@ -25,7 +25,8 @@ class AWSAccountUpdateRequestData attr_reader :attributes # Unique Datadog ID of the AWS Account Integration Config. - # To get the config ID for an account, use the [List all AWS integrations](https://docs.datadoghq.com/api/latest/aws-integration/#list-all-aws-integrations) + # To get the config ID for an account, use the + # [List all AWS integrations](https://docs.datadoghq.com/api/latest/aws-integration/#list-all-aws-integrations) # endpoint and query by AWS Account ID. attr_accessor :id diff --git a/lib/datadog_api_client/v2/models/aws_event_bridge_account_configuration.rb b/lib/datadog_api_client/v2/models/aws_event_bridge_account_configuration.rb new file mode 100644 index 00000000000..325bf6d0ce4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_event_bridge_account_configuration.rb @@ -0,0 +1,130 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The EventBridge configuration for one AWS account. + class AWSEventBridgeAccountConfiguration + include BaseGenericModel + + # Your AWS Account ID without dashes. + attr_accessor :account_id + + # Array of AWS event sources associated with this account. + attr_accessor :event_hubs + + # Array of tags (in the form `key:value`) which are added to all hosts + # and metrics reporting through the main AWS integration. + attr_accessor :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'account_id' => :'account_id', + :'event_hubs' => :'event_hubs', + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_id' => :'String', + :'event_hubs' => :'Array', + :'tags' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSEventBridgeAccountConfiguration` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'event_hubs') + if (value = attributes[:'event_hubs']).is_a?(Array) + self.event_hubs = value + end + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_id == o.account_id && + event_hubs == o.event_hubs && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_id, event_hubs, tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_event_bridge_create_request.rb b/lib/datadog_api_client/v2/models/aws_event_bridge_create_request.rb new file mode 100644 index 00000000000..2f07eee5d4f --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_event_bridge_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Amazon EventBridge create request body. + class AWSEventBridgeCreateRequest + include BaseGenericModel + + # Amazon EventBridge create request data. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AWSEventBridgeCreateRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSEventBridgeCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_event_bridge_create_request_attributes.rb b/lib/datadog_api_client/v2/models/aws_event_bridge_create_request_attributes.rb new file mode 100644 index 00000000000..70fc204106a --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_event_bridge_create_request_attributes.rb @@ -0,0 +1,178 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The EventBridge source to be created. + class AWSEventBridgeCreateRequestAttributes + include BaseGenericModel + + # AWS Account ID. + attr_reader :account_id + + # Set to true if Datadog should create the event bus in addition to the event + # source. Requires the `events:CreateEventBus` permission. + attr_accessor :create_event_bus + + # The given part of the event source name, which is then combined with an + # assigned suffix to form the full name. + attr_reader :event_generator_name + + # The event source's + # [AWS region](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). + attr_reader :region + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'account_id' => :'account_id', + :'create_event_bus' => :'create_event_bus', + :'event_generator_name' => :'event_generator_name', + :'region' => :'region' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_id' => :'String', + :'create_event_bus' => :'Boolean', + :'event_generator_name' => :'String', + :'region' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSEventBridgeCreateRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'create_event_bus') + self.create_event_bus = attributes[:'create_event_bus'] + end + + if attributes.key?(:'event_generator_name') + self.event_generator_name = attributes[:'event_generator_name'] + end + + if attributes.key?(:'region') + self.region = attributes[:'region'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @account_id.nil? + return false if @event_generator_name.nil? + return false if @region.nil? + true + end + + # Custom attribute writer method with validation + # @param account_id [Object] Object to be assigned + # @!visibility private + def account_id=(account_id) + if account_id.nil? + fail ArgumentError, 'invalid value for "account_id", account_id cannot be nil.' + end + @account_id = account_id + end + + # Custom attribute writer method with validation + # @param event_generator_name [Object] Object to be assigned + # @!visibility private + def event_generator_name=(event_generator_name) + if event_generator_name.nil? + fail ArgumentError, 'invalid value for "event_generator_name", event_generator_name cannot be nil.' + end + @event_generator_name = event_generator_name + end + + # Custom attribute writer method with validation + # @param region [Object] Object to be assigned + # @!visibility private + def region=(region) + if region.nil? + fail ArgumentError, 'invalid value for "region", region cannot be nil.' + end + @region = region + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_id == o.account_id && + create_event_bus == o.create_event_bus && + event_generator_name == o.event_generator_name && + region == o.region && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_id, create_event_bus, event_generator_name, region, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_event_bridge_create_request_data.rb b/lib/datadog_api_client/v2/models/aws_event_bridge_create_request_data.rb new file mode 100644 index 00000000000..1fce06d53a0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_event_bridge_create_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Amazon EventBridge create request data. + class AWSEventBridgeCreateRequestData + include BaseGenericModel + + # The EventBridge source to be created. + attr_reader :attributes + + # Amazon EventBridge resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AWSEventBridgeCreateRequestAttributes', + :'type' => :'AWSEventBridgeType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSEventBridgeCreateRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_event_bridge_create_response.rb b/lib/datadog_api_client/v2/models/aws_event_bridge_create_response.rb new file mode 100644 index 00000000000..940dd0b2bd7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_event_bridge_create_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Amazon EventBridge create response body. + class AWSEventBridgeCreateResponse + include BaseGenericModel + + # Amazon EventBridge create response data. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AWSEventBridgeCreateResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSEventBridgeCreateResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_event_bridge_create_response_attributes.rb b/lib/datadog_api_client/v2/models/aws_event_bridge_create_response_attributes.rb new file mode 100644 index 00000000000..8dd5991f024 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_event_bridge_create_response_attributes.rb @@ -0,0 +1,136 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A created EventBridge source. + class AWSEventBridgeCreateResponseAttributes + include BaseGenericModel + + # The event source name. + attr_accessor :event_source_name + + # True if the event bus was created in addition to the source. + attr_accessor :has_bus + + # The event source's + # [AWS region](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). + attr_accessor :region + + # The event source status "created". + attr_accessor :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'event_source_name' => :'event_source_name', + :'has_bus' => :'has_bus', + :'region' => :'region', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'event_source_name' => :'String', + :'has_bus' => :'Boolean', + :'region' => :'String', + :'status' => :'AWSEventBridgeCreateStatus' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSEventBridgeCreateResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'event_source_name') + self.event_source_name = attributes[:'event_source_name'] + end + + if attributes.key?(:'has_bus') + self.has_bus = attributes[:'has_bus'] + end + + if attributes.key?(:'region') + self.region = attributes[:'region'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + event_source_name == o.event_source_name && + has_bus == o.has_bus && + region == o.region && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [event_source_name, has_bus, region, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_event_bridge_create_response_data.rb b/lib/datadog_api_client/v2/models/aws_event_bridge_create_response_data.rb new file mode 100644 index 00000000000..3d899a5f6a7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_event_bridge_create_response_data.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Amazon EventBridge create response data. + class AWSEventBridgeCreateResponseData + include BaseGenericModel + + # A created EventBridge source. + attr_reader :attributes + + # The ID of the Amazon EventBridge create response data. + attr_accessor :id + + # Amazon EventBridge resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AWSEventBridgeCreateResponseAttributes', + :'id' => :'String', + :'type' => :'AWSEventBridgeType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSEventBridgeCreateResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_event_bridge_create_status.rb b/lib/datadog_api_client/v2/models/aws_event_bridge_create_status.rb new file mode 100644 index 00000000000..7f32b94691c --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_event_bridge_create_status.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The event source status "created". + class AWSEventBridgeCreateStatus + include BaseEnumModel + + CREATED = "created".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/aws_event_bridge_delete_request.rb b/lib/datadog_api_client/v2/models/aws_event_bridge_delete_request.rb new file mode 100644 index 00000000000..0ae5af48ea8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_event_bridge_delete_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Amazon EventBridge delete request body. + class AWSEventBridgeDeleteRequest + include BaseGenericModel + + # Amazon EventBridge delete request data. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AWSEventBridgeDeleteRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSEventBridgeDeleteRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_event_bridge_delete_request_attributes.rb b/lib/datadog_api_client/v2/models/aws_event_bridge_delete_request_attributes.rb new file mode 100644 index 00000000000..7ca1edce5a7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_event_bridge_delete_request_attributes.rb @@ -0,0 +1,166 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The EventBridge source to be deleted. + class AWSEventBridgeDeleteRequestAttributes + include BaseGenericModel + + # AWS Account ID. + attr_reader :account_id + + # The event source name. + attr_reader :event_generator_name + + # The event source's + # [AWS region](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). + attr_reader :region + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'account_id' => :'account_id', + :'event_generator_name' => :'event_generator_name', + :'region' => :'region' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_id' => :'String', + :'event_generator_name' => :'String', + :'region' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSEventBridgeDeleteRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'event_generator_name') + self.event_generator_name = attributes[:'event_generator_name'] + end + + if attributes.key?(:'region') + self.region = attributes[:'region'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @account_id.nil? + return false if @event_generator_name.nil? + return false if @region.nil? + true + end + + # Custom attribute writer method with validation + # @param account_id [Object] Object to be assigned + # @!visibility private + def account_id=(account_id) + if account_id.nil? + fail ArgumentError, 'invalid value for "account_id", account_id cannot be nil.' + end + @account_id = account_id + end + + # Custom attribute writer method with validation + # @param event_generator_name [Object] Object to be assigned + # @!visibility private + def event_generator_name=(event_generator_name) + if event_generator_name.nil? + fail ArgumentError, 'invalid value for "event_generator_name", event_generator_name cannot be nil.' + end + @event_generator_name = event_generator_name + end + + # Custom attribute writer method with validation + # @param region [Object] Object to be assigned + # @!visibility private + def region=(region) + if region.nil? + fail ArgumentError, 'invalid value for "region", region cannot be nil.' + end + @region = region + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_id == o.account_id && + event_generator_name == o.event_generator_name && + region == o.region && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_id, event_generator_name, region, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_event_bridge_delete_request_data.rb b/lib/datadog_api_client/v2/models/aws_event_bridge_delete_request_data.rb new file mode 100644 index 00000000000..04f015f39e6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_event_bridge_delete_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Amazon EventBridge delete request data. + class AWSEventBridgeDeleteRequestData + include BaseGenericModel + + # The EventBridge source to be deleted. + attr_reader :attributes + + # Amazon EventBridge resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AWSEventBridgeDeleteRequestAttributes', + :'type' => :'AWSEventBridgeType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSEventBridgeDeleteRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_event_bridge_delete_response.rb b/lib/datadog_api_client/v2/models/aws_event_bridge_delete_response.rb new file mode 100644 index 00000000000..ce94435cf4c --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_event_bridge_delete_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Amazon EventBridge delete response body. + class AWSEventBridgeDeleteResponse + include BaseGenericModel + + # Amazon EventBridge delete response data. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AWSEventBridgeDeleteResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSEventBridgeDeleteResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_event_bridge_delete_response_attributes.rb b/lib/datadog_api_client/v2/models/aws_event_bridge_delete_response_attributes.rb new file mode 100644 index 00000000000..1ae723c6b10 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_event_bridge_delete_response_attributes.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The EventBridge source delete response attributes. + class AWSEventBridgeDeleteResponseAttributes + include BaseGenericModel + + # The event source status "empty". + attr_accessor :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'status' => :'AWSEventBridgeDeleteStatus' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSEventBridgeDeleteResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_event_bridge_delete_response_data.rb b/lib/datadog_api_client/v2/models/aws_event_bridge_delete_response_data.rb new file mode 100644 index 00000000000..47126658e6e --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_event_bridge_delete_response_data.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Amazon EventBridge delete response data. + class AWSEventBridgeDeleteResponseData + include BaseGenericModel + + # The EventBridge source delete response attributes. + attr_reader :attributes + + # The ID of the Amazon EventBridge list response data. + attr_accessor :id + + # Amazon EventBridge resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AWSEventBridgeDeleteResponseAttributes', + :'id' => :'String', + :'type' => :'AWSEventBridgeType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSEventBridgeDeleteResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_event_bridge_delete_status.rb b/lib/datadog_api_client/v2/models/aws_event_bridge_delete_status.rb new file mode 100644 index 00000000000..8becd1c2d65 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_event_bridge_delete_status.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The event source status "empty". + class AWSEventBridgeDeleteStatus + include BaseEnumModel + + EMPTY = "empty".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/aws_event_bridge_list_response.rb b/lib/datadog_api_client/v2/models/aws_event_bridge_list_response.rb new file mode 100644 index 00000000000..87fb9ed2b01 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_event_bridge_list_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Amazon EventBridge list response body. + class AWSEventBridgeListResponse + include BaseGenericModel + + # Amazon EventBridge list response data. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AWSEventBridgeListResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSEventBridgeListResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_event_bridge_list_response_attributes.rb b/lib/datadog_api_client/v2/models/aws_event_bridge_list_response_attributes.rb new file mode 100644 index 00000000000..fae748f15f3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_event_bridge_list_response_attributes.rb @@ -0,0 +1,117 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An object describing the EventBridge configuration for multiple accounts. + class AWSEventBridgeListResponseAttributes + include BaseGenericModel + + # List of accounts with their event sources. + attr_accessor :accounts + + # True if the EventBridge integration is enabled for your organization. + attr_accessor :is_installed + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'accounts' => :'accounts', + :'is_installed' => :'is_installed' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'accounts' => :'Array', + :'is_installed' => :'Boolean' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSEventBridgeListResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'accounts') + if (value = attributes[:'accounts']).is_a?(Array) + self.accounts = value + end + end + + if attributes.key?(:'is_installed') + self.is_installed = attributes[:'is_installed'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + accounts == o.accounts && + is_installed == o.is_installed && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [accounts, is_installed, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_event_bridge_list_response_data.rb b/lib/datadog_api_client/v2/models/aws_event_bridge_list_response_data.rb new file mode 100644 index 00000000000..359765996ca --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_event_bridge_list_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Amazon EventBridge list response data. + class AWSEventBridgeListResponseData + include BaseGenericModel + + # An object describing the EventBridge configuration for multiple accounts. + attr_reader :attributes + + # The ID of the Amazon EventBridge list response data. + attr_reader :id + + # Amazon EventBridge resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AWSEventBridgeListResponseAttributes', + :'id' => :'String', + :'type' => :'AWSEventBridgeType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSEventBridgeListResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_event_bridge_source.rb b/lib/datadog_api_client/v2/models/aws_event_bridge_source.rb new file mode 100644 index 00000000000..a03b52aa6a1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_event_bridge_source.rb @@ -0,0 +1,116 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An EventBridge source. + class AWSEventBridgeSource + include BaseGenericModel + + # The event source name. + attr_accessor :name + + # The event source's + # [AWS region](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). + attr_accessor :region + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'region' => :'region' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'region' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AWSEventBridgeSource` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'region') + self.region = attributes[:'region'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + region == o.region && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, region, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_event_bridge_type.rb b/lib/datadog_api_client/v2/models/aws_event_bridge_type.rb new file mode 100644 index 00000000000..15aa0cd0756 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_event_bridge_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Amazon EventBridge resource type. + class AWSEventBridgeType + include BaseEnumModel + + EVENT_BRIDGE = "event_bridge".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/aws_lambda_forwarder_config.rb b/lib/datadog_api_client/v2/models/aws_lambda_forwarder_config.rb index 1cdbc3e6fdf..e99ea0eaacf 100644 --- a/lib/datadog_api_client/v2/models/aws_lambda_forwarder_config.rb +++ b/lib/datadog_api_client/v2/models/aws_lambda_forwarder_config.rb @@ -17,8 +17,9 @@ require 'time' module DatadogAPIClient::V2 - # Log Autosubscription configuration for Datadog Forwarder Lambda functions. Automatically set up triggers for existing - # and new logs for some services, ensuring no logs from new resources are missed and saving time spent on manual configuration. + # Log Autosubscription configuration for Datadog Forwarder Lambda functions. + # Automatically set up triggers for existing and new logs for some services, + # ensuring no logs from new resources are missed and saving time spent on manual configuration. class AWSLambdaForwarderConfig include BaseGenericModel @@ -28,8 +29,10 @@ class AWSLambdaForwarderConfig # Log source configuration. attr_accessor :log_source_config - # List of service IDs set to enable automatic log collection. Discover the list of available services with the - # [Get list of AWS log ready services](https://docs.datadoghq.com/api/latest/aws-logs-integration/#get-list-of-aws-log-ready-services) endpoint. + # List of service IDs set to enable automatic log collection. + # Discover the list of available services with the + # [Get list of AWS log ready services](https://docs.datadoghq.com/api/latest/aws-logs-integration/#get-list-of-aws-log-ready-services) + # endpoint. attr_accessor :sources attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/aws_log_source_tag_filter.rb b/lib/datadog_api_client/v2/models/aws_log_source_tag_filter.rb index cd10a70d264..92f07a64d70 100644 --- a/lib/datadog_api_client/v2/models/aws_log_source_tag_filter.rb +++ b/lib/datadog_api_client/v2/models/aws_log_source_tag_filter.rb @@ -18,9 +18,13 @@ module DatadogAPIClient::V2 # AWS log source tag filter list. Defaults to `[]`. - # Array of log source to AWS resource tag mappings. Each mapping contains a log source and its associated AWS resource tags (in `key:value` format) used to filter logs submitted to Datadog. - # Tag filters are applied for tags on the AWS resource emitting logs; tags associated with the log storage entity (such as a CloudWatch Log Group or S3 Bucket) are not considered. - # For more information on resource tag filter syntax, [see AWS resource exclusion](https://docs.datadoghq.com/account_management/billing/aws/#aws-resource-exclusion) in the AWS integration billing page. + # Array of log source to AWS resource tag mappings. Each mapping contains a log source and its + # associated AWS resource tags (in `key:value` format) used to filter logs submitted to Datadog. + # Tag filters are applied for tags on the AWS resource emitting logs; tags associated with the + # log storage entity (such as a CloudWatch Log Group or S3 Bucket) are not considered. + # For more information on resource tag filter syntax, + # [see AWS resource exclusion](https://docs.datadoghq.com/account_management/billing/aws/#aws-resource-exclusion) + # in the AWS integration billing page. class AWSLogSourceTagFilter include BaseGenericModel diff --git a/lib/datadog_api_client/v2/models/aws_logs_config.rb b/lib/datadog_api_client/v2/models/aws_logs_config.rb index 3e3efc1c227..d05ae62d336 100644 --- a/lib/datadog_api_client/v2/models/aws_logs_config.rb +++ b/lib/datadog_api_client/v2/models/aws_logs_config.rb @@ -21,8 +21,9 @@ module DatadogAPIClient::V2 class AWSLogsConfig include BaseGenericModel - # Log Autosubscription configuration for Datadog Forwarder Lambda functions. Automatically set up triggers for existing - # and new logs for some services, ensuring no logs from new resources are missed and saving time spent on manual configuration. + # Log Autosubscription configuration for Datadog Forwarder Lambda functions. + # Automatically set up triggers for existing and new logs for some services, + # ensuring no logs from new resources are missed and saving time spent on manual configuration. attr_accessor :lambda_forwarder attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/aws_namespace_filters_exclude_only.rb b/lib/datadog_api_client/v2/models/aws_namespace_filters_exclude_only.rb index cb31e20fbd2..1c589914dea 100644 --- a/lib/datadog_api_client/v2/models/aws_namespace_filters_exclude_only.rb +++ b/lib/datadog_api_client/v2/models/aws_namespace_filters_exclude_only.rb @@ -17,13 +17,17 @@ require 'time' module DatadogAPIClient::V2 - # Exclude only these namespaces from metrics collection. Defaults to `["AWS/SQS", "AWS/ElasticMapReduce", "AWS/Usage"]`. - # `AWS/SQS`, `AWS/ElasticMapReduce`, and `AWS/Usage` are excluded by default to reduce your AWS CloudWatch costs from `GetMetricData` API calls. + # Exclude only these namespaces from metrics collection. + # Defaults to `["AWS/SQS", "AWS/ElasticMapReduce", "AWS/Usage"]`. + # `AWS/SQS`, `AWS/ElasticMapReduce`, and `AWS/Usage` are excluded by default + # to reduce your AWS CloudWatch costs from `GetMetricData` API calls. class AWSNamespaceFiltersExcludeOnly include BaseGenericModel - # Exclude only these namespaces from metrics collection. Defaults to `["AWS/SQS", "AWS/ElasticMapReduce", "AWS/Usage"]`. - # `AWS/SQS`, `AWS/ElasticMapReduce`, and `AWS/Usage` are excluded by default to reduce your AWS CloudWatch costs from `GetMetricData` API calls. + # Exclude only these namespaces from metrics collection. + # Defaults to `["AWS/SQS", "AWS/ElasticMapReduce", "AWS/Usage"]`. + # `AWS/SQS`, `AWS/ElasticMapReduce`, and `AWS/Usage` are excluded by default + # to reduce your AWS CloudWatch costs from `GetMetricData` API calls. attr_reader :exclude_only attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/aws_namespace_tag_filter.rb b/lib/datadog_api_client/v2/models/aws_namespace_tag_filter.rb index 0ae0e3c7d38..7f7fabbc61b 100644 --- a/lib/datadog_api_client/v2/models/aws_namespace_tag_filter.rb +++ b/lib/datadog_api_client/v2/models/aws_namespace_tag_filter.rb @@ -18,10 +18,12 @@ module DatadogAPIClient::V2 # AWS Metrics Collection tag filters list. Defaults to `[]`. - # The array of custom AWS resource tags (in the form `key:value`) defines a filter that Datadog uses when collecting metrics from a specified service. - # Wildcards, such as `?` (match a single character) and `*` (match multiple characters), and exclusion using `!` before the tag are supported. - # For EC2, only hosts that match one of the defined tags will be imported into Datadog. The rest will be ignored. - # For example, `env:production,instance-type:c?.*,!region:us-east-1`. + # The array of custom AWS resource tags (in the form `key:value`) defines a filter that Datadog uses + # when collecting metrics from a specified service. + # Wildcards, such as `?` (match a single character) and `*` (match multiple characters), + # and exclusion using `!` before the tag are supported. + # For EC2, only hosts that match one of the defined tags are imported into Datadog. + # The rest are ignored. For example, `env:production,instance-type:c?.*,!region:us-east-1`. class AWSNamespaceTagFilter include BaseGenericModel diff --git a/lib/datadog_api_client/v2/models/aws_resources_config.rb b/lib/datadog_api_client/v2/models/aws_resources_config.rb index 8ff6bb8e01e..89b4026bff0 100644 --- a/lib/datadog_api_client/v2/models/aws_resources_config.rb +++ b/lib/datadog_api_client/v2/models/aws_resources_config.rb @@ -21,10 +21,13 @@ module DatadogAPIClient::V2 class AWSResourcesConfig include BaseGenericModel - # Enable Cloud Security Management to scan AWS resources for vulnerabilities, misconfigurations, identity risks, and compliance violations. Defaults to `false`. Requires `extended_collection` to be set to `true`. + # Enable Cloud Security Management to scan AWS resources for vulnerabilities, misconfigurations, + # identity risks, and compliance violations. Defaults to `false`. + # Requires `extended_collection` to be set to `true`. attr_accessor :cloud_security_posture_management_collection - # Whether Datadog collects additional attributes and configuration information about the resources in your AWS account. Defaults to `true`. Required for `cloud_security_posture_management_collection`. + # Whether Datadog collects additional attributes and configuration information about the resources + # in your AWS account. Defaults to `true`. Required for `cloud_security_posture_management_collection`. attr_accessor :extended_collection attr_accessor :additional_properties