diff --git a/.apigentools-info b/.apigentools-info index 7ae0665076cb..969b948f0bfc 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-07-02 12:38:43.717493", - "spec_repo_commit": "4fd1c189" + "regenerated": "2025-07-02 16:34:52.201607", + "spec_repo_commit": "de2517ad" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-07-02 12:38:43.733432", - "spec_repo_commit": "4fd1c189" + "regenerated": "2025-07-02 16:34:52.217566", + "spec_repo_commit": "de2517ad" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index da27cb1f6e87..20932a38c85e 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1536,6 +1536,54 @@ components: - type - credentials type: object + AWSIntegrationIamPermissionsResponse: + description: AWS Integration IAM Permissions response body. + properties: + data: + $ref: '#/components/schemas/AWSIntegrationIamPermissionsResponseData' + required: + - data + type: object + AWSIntegrationIamPermissionsResponseAttributes: + description: AWS Integration IAM Permissions response attributes. + properties: + permissions: + description: List of AWS IAM permissions required for the integration. + example: + - account:GetContactInformation + - amplify:ListApps + - amplify:ListArtifacts + - amplify:ListBackendEnvironments + - amplify:ListBranches + items: + example: account:GetContactInformation + type: string + type: array + required: + - permissions + type: object + AWSIntegrationIamPermissionsResponseData: + description: AWS Integration IAM Permissions response data. + properties: + attributes: + $ref: '#/components/schemas/AWSIntegrationIamPermissionsResponseAttributes' + id: + default: permissions + description: The `AWSIntegrationIamPermissionsResponseData` `id`. + example: permissions + type: string + type: + $ref: '#/components/schemas/AWSIntegrationIamPermissionsResponseDataType' + type: object + AWSIntegrationIamPermissionsResponseDataType: + default: permissions + description: The `AWSIntegrationIamPermissionsResponseData` `type`. + enum: + - permissions + example: permissions + type: string + x-enum-varnames: + - PERMISSIONS AWSIntegrationType: description: The definition of `AWSIntegrationType` object. enum: @@ -49519,6 +49567,22 @@ paths: x-unstable: '**Note: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).**' + /api/v2/integration/aws/iam_permissions: + get: + description: Get all AWS IAM permissions required for the AWS integration. + operationId: GetAWSIntegrationIAMPermissions + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSIntegrationIamPermissionsResponse' + description: AWS IAM Permissions object + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get AWS integration IAM permissions + tags: + - AWS Integration /api/v2/integration/aws/logs/services: get: description: Get a list of AWS services that can send logs to Datadog. diff --git a/examples/v2/aws-integration/GetAWSIntegrationIAMPermissions.rb b/examples/v2/aws-integration/GetAWSIntegrationIAMPermissions.rb new file mode 100644 index 000000000000..7d793b61699c --- /dev/null +++ b/examples/v2/aws-integration/GetAWSIntegrationIAMPermissions.rb @@ -0,0 +1,5 @@ +# Get AWS integration IAM permissions returns "AWS IAM Permissions object" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new +p api_instance.get_aws_integration_iam_permissions() diff --git a/features/v2/aws_integration.feature b/features/v2/aws_integration.feature index 3f47d837a7b1..1b501698e9f6 100644 --- a/features/v2/aws_integration.feature +++ b/features/v2/aws_integration.feature @@ -82,6 +82,12 @@ Feature: AWS Integration When the request is sent Then the response status is 200 AWS External ID object + @generated @skip @team:DataDog/aws-integrations + Scenario: Get AWS integration IAM permissions returns "AWS IAM Permissions object" response + Given new "GetAWSIntegrationIAMPermissions" request + When the request is sent + Then the response status is 200 AWS IAM Permissions object + @team:DataDog/aws-integrations Scenario: Get an AWS integration by config ID returns "AWS Account object" response Given operation "GetAWSAccount" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index a67059cda875..b93f6b777af9 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1214,6 +1214,12 @@ "type": "safe" } }, + "GetAWSIntegrationIAMPermissions": { + "tag": "AWS Integration", + "undo": { + "type": "safe" + } + }, "ListAWSLogsServices": { "tag": "AWS Logs Integration", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 5d0c7fa1e380..7323b8685859 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1125,6 +1125,10 @@ def overrides "v2.aws_cur_configs_response" => "AwsCURConfigsResponse", "v2.aws_cur_config_type" => "AwsCURConfigType", "v2.aws_integration" => "AWSIntegration", + "v2.aws_integration_iam_permissions_response" => "AWSIntegrationIamPermissionsResponse", + "v2.aws_integration_iam_permissions_response_attributes" => "AWSIntegrationIamPermissionsResponseAttributes", + "v2.aws_integration_iam_permissions_response_data" => "AWSIntegrationIamPermissionsResponseData", + "v2.aws_integration_iam_permissions_response_data_type" => "AWSIntegrationIamPermissionsResponseDataType", "v2.aws_integration_type" => "AWSIntegrationType", "v2.aws_integration_update" => "AWSIntegrationUpdate", "v2.aws_lambda_forwarder_config" => "AWSLambdaForwarderConfig", 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 1956ddee131f..7c6fdaa9fa5e 100644 --- a/lib/datadog_api_client/v2/api/aws_integration_api.rb +++ b/lib/datadog_api_client/v2/api/aws_integration_api.rb @@ -304,6 +304,66 @@ def get_aws_account_with_http_info(aws_account_config_id, opts = {}) return data, status_code, headers end + # Get AWS integration IAM permissions. + # + # @see #get_aws_integration_iam_permissions_with_http_info + def get_aws_integration_iam_permissions(opts = {}) + data, _status_code, _headers = get_aws_integration_iam_permissions_with_http_info(opts) + data + end + + # Get AWS integration IAM permissions. + # + # Get all AWS IAM permissions required for the AWS integration. + # + # @param opts [Hash] the optional parameters + # @return [Array<(AWSIntegrationIamPermissionsResponse, Integer, Hash)>] AWSIntegrationIamPermissionsResponse data, response status code and response headers + def get_aws_integration_iam_permissions_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSIntegrationAPI.get_aws_integration_iam_permissions ...' + end + # resource path + local_var_path = '/api/v2/integration/aws/iam_permissions' + + # 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] || 'AWSIntegrationIamPermissionsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_aws_integration_iam_permissions, + :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#get_aws_integration_iam_permissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List all AWS integrations. # # @see #list_aws_accounts_with_http_info diff --git a/lib/datadog_api_client/v2/models/aws_integration_iam_permissions_response.rb b/lib/datadog_api_client/v2/models/aws_integration_iam_permissions_response.rb new file mode 100644 index 000000000000..cc3c0fa57af9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_integration_iam_permissions_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 + # AWS Integration IAM Permissions response body. + class AWSIntegrationIamPermissionsResponse + include BaseGenericModel + + # AWS Integration IAM Permissions 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' => :'AWSIntegrationIamPermissionsResponseData' + } + 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::AWSIntegrationIamPermissionsResponse` 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_integration_iam_permissions_response_attributes.rb b/lib/datadog_api_client/v2/models/aws_integration_iam_permissions_response_attributes.rb new file mode 100644 index 000000000000..d12416106c40 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_integration_iam_permissions_response_attributes.rb @@ -0,0 +1,125 @@ +=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 + # AWS Integration IAM Permissions response attributes. + class AWSIntegrationIamPermissionsResponseAttributes + include BaseGenericModel + + # List of AWS IAM permissions required for the integration. + attr_reader :permissions + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'permissions' => :'permissions' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'permissions' => :'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::AWSIntegrationIamPermissionsResponseAttributes` 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?(:'permissions') + if (value = attributes[:'permissions']).is_a?(Array) + self.permissions = value + end + 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 @permissions.nil? + true + end + + # Custom attribute writer method with validation + # @param permissions [Object] Object to be assigned + # @!visibility private + def permissions=(permissions) + if permissions.nil? + fail ArgumentError, 'invalid value for "permissions", permissions cannot be nil.' + end + @permissions = permissions + 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 && + permissions == o.permissions && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [permissions, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_integration_iam_permissions_response_data.rb b/lib/datadog_api_client/v2/models/aws_integration_iam_permissions_response_data.rb new file mode 100644 index 000000000000..fc3ba402f97a --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_integration_iam_permissions_response_data.rb @@ -0,0 +1,125 @@ +=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 + # AWS Integration IAM Permissions response data. + class AWSIntegrationIamPermissionsResponseData + include BaseGenericModel + + # AWS Integration IAM Permissions response attributes. + attr_accessor :attributes + + # The `AWSIntegrationIamPermissionsResponseData` `id`. + attr_accessor :id + + # The `AWSIntegrationIamPermissionsResponseData` `type`. + attr_accessor :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' => :'AWSIntegrationIamPermissionsResponseAttributes', + :'id' => :'String', + :'type' => :'AWSIntegrationIamPermissionsResponseDataType' + } + 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::AWSIntegrationIamPermissionsResponseData` 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 + + # 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_integration_iam_permissions_response_data_type.rb b/lib/datadog_api_client/v2/models/aws_integration_iam_permissions_response_data_type.rb new file mode 100644 index 000000000000..44ad82a32b90 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_integration_iam_permissions_response_data_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 + # The `AWSIntegrationIamPermissionsResponseData` `type`. + class AWSIntegrationIamPermissionsResponseDataType + include BaseEnumModel + + PERMISSIONS = "permissions".freeze + end +end