diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 170293cea7..4857ca25ab 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -929,6 +929,14 @@ components: example: 10 format: int64 type: integer + PersonaMappingID: + description: The ID of the persona mapping + example: c5c758c6-18c2-4484-ae3f-46b84128404a + in: path + name: persona_mapping_id + required: true + schema: + type: string ProductName: description: Name of the product to be deleted, either `logs` or `rum`. in: path @@ -1910,6 +1918,41 @@ components: - account_identifier - account_uuid type: object + AWSCloudAuthPersonaMappingCreateAttributes: + description: Attributes for creating an AWS cloud authentication persona mapping + properties: + account_identifier: + description: Datadog account identifier (email or handle) mapped to the + AWS principal + example: test@test.com + type: string + arn_pattern: + description: AWS IAM ARN pattern to match for authentication + example: arn:aws:iam::123456789012:user/testuser + type: string + required: + - arn_pattern + - account_identifier + type: object + AWSCloudAuthPersonaMappingCreateData: + description: Data for creating an AWS cloud authentication persona mapping + properties: + attributes: + $ref: '#/components/schemas/AWSCloudAuthPersonaMappingCreateAttributes' + type: + $ref: '#/components/schemas/AWSCloudAuthPersonaMappingType' + required: + - type + - attributes + type: object + AWSCloudAuthPersonaMappingCreateRequest: + description: Request used to create an AWS cloud authentication persona mapping + properties: + data: + $ref: '#/components/schemas/AWSCloudAuthPersonaMappingCreateData' + required: + - data + type: object AWSCloudAuthPersonaMappingDataResponse: description: Data for AWS cloud authentication persona mapping response properties: @@ -1926,6 +1969,14 @@ components: - type - attributes type: object + AWSCloudAuthPersonaMappingResponse: + description: Response containing a single AWS cloud authentication persona mapping + properties: + data: + $ref: '#/components/schemas/AWSCloudAuthPersonaMappingDataResponse' + required: + - data + type: object AWSCloudAuthPersonaMappingType: description: Type identifier for AWS cloud authentication persona mapping enum: @@ -77100,6 +77151,114 @@ paths: x-unstable: '**Note**: This endpoint is in public beta and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create an AWS cloud authentication persona mapping. This endpoint + associates an AWS IAM principal with a Datadog user. + operationId: CreateAWSCloudAuthPersonaMapping + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AWSCloudAuthPersonaMappingCreateRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSCloudAuthPersonaMappingResponse' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Conflict + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create an AWS cloud authentication persona mapping + tags: + - Cloud Authentication + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/cloud_auth/aws/persona_mapping/{persona_mapping_id}: + delete: + description: Delete an AWS cloud authentication persona mapping by ID. This + removes the association between an AWS IAM principal and a Datadog user. + operationId: DeleteAWSCloudAuthPersonaMapping + parameters: + - $ref: '#/components/parameters/PersonaMappingID' + responses: + '204': + description: No Content + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete an AWS cloud authentication persona mapping + tags: + - Cloud Authentication + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Get a specific AWS cloud authentication persona mapping by ID. + This endpoint retrieves a single configured persona mapping that associates + an AWS IAM principal with a Datadog user. + operationId: GetAWSCloudAuthPersonaMapping + parameters: + - $ref: '#/components/parameters/PersonaMappingID' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSCloudAuthPersonaMappingResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get an AWS cloud authentication persona mapping + tags: + - Cloud Authentication + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/cloud_security_management/custom_frameworks: post: description: Create a custom framework. diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 67db73c7f0..9f25414941 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -1789,6 +1789,27 @@ datadog\_api\_client.v2.model.aws\_cloud\_auth\_persona\_mapping\_attributes\_re :members: :show-inheritance: +datadog\_api\_client.v2.model.aws\_cloud\_auth\_persona\_mapping\_create\_attributes module +------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_create_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.aws\_cloud\_auth\_persona\_mapping\_create\_data module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_create_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.aws\_cloud\_auth\_persona\_mapping\_create\_request module +---------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_create_request + :members: + :show-inheritance: + datadog\_api\_client.v2.model.aws\_cloud\_auth\_persona\_mapping\_data\_response module --------------------------------------------------------------------------------------- @@ -1796,6 +1817,13 @@ datadog\_api\_client.v2.model.aws\_cloud\_auth\_persona\_mapping\_data\_response :members: :show-inheritance: +datadog\_api\_client.v2.model.aws\_cloud\_auth\_persona\_mapping\_response module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.aws\_cloud\_auth\_persona\_mapping\_type module ----------------------------------------------------------------------------- diff --git a/examples/v2/cloud-authentication/CreateAWSCloudAuthPersonaMapping.py b/examples/v2/cloud-authentication/CreateAWSCloudAuthPersonaMapping.py new file mode 100644 index 0000000000..8433407d89 --- /dev/null +++ b/examples/v2/cloud-authentication/CreateAWSCloudAuthPersonaMapping.py @@ -0,0 +1,32 @@ +""" +Create an AWS cloud authentication persona mapping returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_authentication_api import CloudAuthenticationApi +from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_create_attributes import ( + AWSCloudAuthPersonaMappingCreateAttributes, +) +from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_create_data import AWSCloudAuthPersonaMappingCreateData +from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_create_request import ( + AWSCloudAuthPersonaMappingCreateRequest, +) +from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_type import AWSCloudAuthPersonaMappingType + +body = AWSCloudAuthPersonaMappingCreateRequest( + data=AWSCloudAuthPersonaMappingCreateData( + attributes=AWSCloudAuthPersonaMappingCreateAttributes( + account_identifier="test@test.com", + arn_pattern="arn:aws:iam::123456789012:user/testuser", + ), + type=AWSCloudAuthPersonaMappingType.AWS_CLOUD_AUTH_CONFIG, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_aws_cloud_auth_persona_mapping"] = True +with ApiClient(configuration) as api_client: + api_instance = CloudAuthenticationApi(api_client) + response = api_instance.create_aws_cloud_auth_persona_mapping(body=body) + + print(response) diff --git a/examples/v2/cloud-authentication/DeleteAWSCloudAuthPersonaMapping.py b/examples/v2/cloud-authentication/DeleteAWSCloudAuthPersonaMapping.py new file mode 100644 index 0000000000..77f8a6e7c5 --- /dev/null +++ b/examples/v2/cloud-authentication/DeleteAWSCloudAuthPersonaMapping.py @@ -0,0 +1,14 @@ +""" +Delete an AWS cloud authentication persona mapping returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_authentication_api import CloudAuthenticationApi + +configuration = Configuration() +configuration.unstable_operations["delete_aws_cloud_auth_persona_mapping"] = True +with ApiClient(configuration) as api_client: + api_instance = CloudAuthenticationApi(api_client) + api_instance.delete_aws_cloud_auth_persona_mapping( + persona_mapping_id="persona_mapping_id", + ) diff --git a/examples/v2/cloud-authentication/GetAWSCloudAuthPersonaMapping.py b/examples/v2/cloud-authentication/GetAWSCloudAuthPersonaMapping.py new file mode 100644 index 0000000000..3a7eb7bf5e --- /dev/null +++ b/examples/v2/cloud-authentication/GetAWSCloudAuthPersonaMapping.py @@ -0,0 +1,16 @@ +""" +Get an AWS cloud authentication persona mapping returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_authentication_api import CloudAuthenticationApi + +configuration = Configuration() +configuration.unstable_operations["get_aws_cloud_auth_persona_mapping"] = True +with ApiClient(configuration) as api_client: + api_instance = CloudAuthenticationApi(api_client) + response = api_instance.get_aws_cloud_auth_persona_mapping( + persona_mapping_id="persona_mapping_id", + ) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index d43e56c7f9..8aa9287f21 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -279,6 +279,9 @@ def __init__( "v2.get_change_request": False, "v2.update_change_request": False, "v2.update_change_request_decision": False, + "v2.create_aws_cloud_auth_persona_mapping": False, + "v2.delete_aws_cloud_auth_persona_mapping": False, + "v2.get_aws_cloud_auth_persona_mapping": False, "v2.list_aws_cloud_auth_persona_mappings": False, "v2.activate_content_pack": False, "v2.cancel_threat_hunting_job": False, diff --git a/src/datadog_api_client/v2/api/cloud_authentication_api.py b/src/datadog_api_client/v2/api/cloud_authentication_api.py index 00c130a6ea..4c2729cade 100644 --- a/src/datadog_api_client/v2/api/cloud_authentication_api.py +++ b/src/datadog_api_client/v2/api/cloud_authentication_api.py @@ -8,6 +8,10 @@ from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint from datadog_api_client.configuration import Configuration from datadog_api_client.v2.model.aws_cloud_auth_persona_mappings_response import AWSCloudAuthPersonaMappingsResponse +from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_response import AWSCloudAuthPersonaMappingResponse +from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_create_request import ( + AWSCloudAuthPersonaMappingCreateRequest, +) class CloudAuthenticationApi: @@ -20,6 +24,72 @@ def __init__(self, api_client=None): api_client = ApiClient(Configuration()) self.api_client = api_client + self._create_aws_cloud_auth_persona_mapping_endpoint = _Endpoint( + settings={ + "response_type": (AWSCloudAuthPersonaMappingResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/cloud_auth/aws/persona_mapping", + "operation_id": "create_aws_cloud_auth_persona_mapping", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (AWSCloudAuthPersonaMappingCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._delete_aws_cloud_auth_persona_mapping_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/cloud_auth/aws/persona_mapping/{persona_mapping_id}", + "operation_id": "delete_aws_cloud_auth_persona_mapping", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "persona_mapping_id": { + "required": True, + "openapi_types": (str,), + "attribute": "persona_mapping_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._get_aws_cloud_auth_persona_mapping_endpoint = _Endpoint( + settings={ + "response_type": (AWSCloudAuthPersonaMappingResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/cloud_auth/aws/persona_mapping/{persona_mapping_id}", + "operation_id": "get_aws_cloud_auth_persona_mapping", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "persona_mapping_id": { + "required": True, + "openapi_types": (str,), + "attribute": "persona_mapping_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._list_aws_cloud_auth_persona_mappings_endpoint = _Endpoint( settings={ "response_type": (AWSCloudAuthPersonaMappingsResponse,), @@ -36,6 +106,56 @@ def __init__(self, api_client=None): api_client=api_client, ) + def create_aws_cloud_auth_persona_mapping( + self, + body: AWSCloudAuthPersonaMappingCreateRequest, + ) -> AWSCloudAuthPersonaMappingResponse: + """Create an AWS cloud authentication persona mapping. + + Create an AWS cloud authentication persona mapping. This endpoint associates an AWS IAM principal with a Datadog user. + + :type body: AWSCloudAuthPersonaMappingCreateRequest + :rtype: AWSCloudAuthPersonaMappingResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_aws_cloud_auth_persona_mapping_endpoint.call_with_http_info(**kwargs) + + def delete_aws_cloud_auth_persona_mapping( + self, + persona_mapping_id: str, + ) -> None: + """Delete an AWS cloud authentication persona mapping. + + Delete an AWS cloud authentication persona mapping by ID. This removes the association between an AWS IAM principal and a Datadog user. + + :param persona_mapping_id: The ID of the persona mapping + :type persona_mapping_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["persona_mapping_id"] = persona_mapping_id + + return self._delete_aws_cloud_auth_persona_mapping_endpoint.call_with_http_info(**kwargs) + + def get_aws_cloud_auth_persona_mapping( + self, + persona_mapping_id: str, + ) -> AWSCloudAuthPersonaMappingResponse: + """Get an AWS cloud authentication persona mapping. + + Get a specific AWS cloud authentication persona mapping by ID. This endpoint retrieves a single configured persona mapping that associates an AWS IAM principal with a Datadog user. + + :param persona_mapping_id: The ID of the persona mapping + :type persona_mapping_id: str + :rtype: AWSCloudAuthPersonaMappingResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["persona_mapping_id"] = persona_mapping_id + + return self._get_aws_cloud_auth_persona_mapping_endpoint.call_with_http_info(**kwargs) + def list_aws_cloud_auth_persona_mappings( self, ) -> AWSCloudAuthPersonaMappingsResponse: diff --git a/src/datadog_api_client/v2/model/aws_cloud_auth_persona_mapping_create_attributes.py b/src/datadog_api_client/v2/model/aws_cloud_auth_persona_mapping_create_attributes.py new file mode 100644 index 0000000000..999847dfef --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_cloud_auth_persona_mapping_create_attributes.py @@ -0,0 +1,39 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class AWSCloudAuthPersonaMappingCreateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "account_identifier": (str,), + "arn_pattern": (str,), + } + + attribute_map = { + "account_identifier": "account_identifier", + "arn_pattern": "arn_pattern", + } + + def __init__(self_, account_identifier: str, arn_pattern: str, **kwargs): + """ + Attributes for creating an AWS cloud authentication persona mapping + + :param account_identifier: Datadog account identifier (email or handle) mapped to the AWS principal + :type account_identifier: str + + :param arn_pattern: AWS IAM ARN pattern to match for authentication + :type arn_pattern: str + """ + super().__init__(kwargs) + + self_.account_identifier = account_identifier + self_.arn_pattern = arn_pattern diff --git a/src/datadog_api_client/v2/model/aws_cloud_auth_persona_mapping_create_data.py b/src/datadog_api_client/v2/model/aws_cloud_auth_persona_mapping_create_data.py new file mode 100644 index 0000000000..d6d07e433d --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_cloud_auth_persona_mapping_create_data.py @@ -0,0 +1,54 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_create_attributes import ( + AWSCloudAuthPersonaMappingCreateAttributes, + ) + from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_type import AWSCloudAuthPersonaMappingType + + +class AWSCloudAuthPersonaMappingCreateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_create_attributes import ( + AWSCloudAuthPersonaMappingCreateAttributes, + ) + from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_type import AWSCloudAuthPersonaMappingType + + return { + "attributes": (AWSCloudAuthPersonaMappingCreateAttributes,), + "type": (AWSCloudAuthPersonaMappingType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, attributes: AWSCloudAuthPersonaMappingCreateAttributes, type: AWSCloudAuthPersonaMappingType, **kwargs + ): + """ + Data for creating an AWS cloud authentication persona mapping + + :param attributes: Attributes for creating an AWS cloud authentication persona mapping + :type attributes: AWSCloudAuthPersonaMappingCreateAttributes + + :param type: Type identifier for AWS cloud authentication persona mapping + :type type: AWSCloudAuthPersonaMappingType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/aws_cloud_auth_persona_mapping_create_request.py b/src/datadog_api_client/v2/model/aws_cloud_auth_persona_mapping_create_request.py new file mode 100644 index 0000000000..7cbd1e8885 --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_cloud_auth_persona_mapping_create_request.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_create_data import ( + AWSCloudAuthPersonaMappingCreateData, + ) + + +class AWSCloudAuthPersonaMappingCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_create_data import ( + AWSCloudAuthPersonaMappingCreateData, + ) + + return { + "data": (AWSCloudAuthPersonaMappingCreateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: AWSCloudAuthPersonaMappingCreateData, **kwargs): + """ + Request used to create an AWS cloud authentication persona mapping + + :param data: Data for creating an AWS cloud authentication persona mapping + :type data: AWSCloudAuthPersonaMappingCreateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/aws_cloud_auth_persona_mapping_response.py b/src/datadog_api_client/v2/model/aws_cloud_auth_persona_mapping_response.py new file mode 100644 index 0000000000..b450624fe0 --- /dev/null +++ b/src/datadog_api_client/v2/model/aws_cloud_auth_persona_mapping_response.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_data_response import ( + AWSCloudAuthPersonaMappingDataResponse, + ) + + +class AWSCloudAuthPersonaMappingResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_data_response import ( + AWSCloudAuthPersonaMappingDataResponse, + ) + + return { + "data": (AWSCloudAuthPersonaMappingDataResponse,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: AWSCloudAuthPersonaMappingDataResponse, **kwargs): + """ + Response containing a single AWS cloud authentication persona mapping + + :param data: Data for AWS cloud authentication persona mapping response + :type data: AWSCloudAuthPersonaMappingDataResponse + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index de43f25e1b..7f7db1fff3 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -36,9 +36,17 @@ from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_attributes_response import ( AWSCloudAuthPersonaMappingAttributesResponse, ) +from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_create_attributes import ( + AWSCloudAuthPersonaMappingCreateAttributes, +) +from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_create_data import AWSCloudAuthPersonaMappingCreateData +from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_create_request import ( + AWSCloudAuthPersonaMappingCreateRequest, +) from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_data_response import ( AWSCloudAuthPersonaMappingDataResponse, ) +from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_response import AWSCloudAuthPersonaMappingResponse from datadog_api_client.v2.model.aws_cloud_auth_persona_mapping_type import AWSCloudAuthPersonaMappingType from datadog_api_client.v2.model.aws_cloud_auth_persona_mappings_response import AWSCloudAuthPersonaMappingsResponse from datadog_api_client.v2.model.aws_credentials import AWSCredentials @@ -6259,7 +6267,11 @@ "AWSAuthConfigKeys", "AWSAuthConfigRole", "AWSCloudAuthPersonaMappingAttributesResponse", + "AWSCloudAuthPersonaMappingCreateAttributes", + "AWSCloudAuthPersonaMappingCreateData", + "AWSCloudAuthPersonaMappingCreateRequest", "AWSCloudAuthPersonaMappingDataResponse", + "AWSCloudAuthPersonaMappingResponse", "AWSCloudAuthPersonaMappingType", "AWSCloudAuthPersonaMappingsResponse", "AWSCredentials", diff --git a/tests/v2/features/cloud_authentication.feature b/tests/v2/features/cloud_authentication.feature index fe9eb594a7..c444f1469c 100644 --- a/tests/v2/features/cloud_authentication.feature +++ b/tests/v2/features/cloud_authentication.feature @@ -7,15 +7,73 @@ Feature: Cloud Authentication Given a valid "apiKeyAuth" key in the system And a valid "appKeyAuth" key in the system And an instance of "CloudAuthentication" API - And operation "ListAWSCloudAuthPersonaMappings" enabled - And new "ListAWSCloudAuthPersonaMappings" request + + @generated @skip @team:DataDog/team-aaaauthn + Scenario: Create an AWS cloud authentication persona mapping returns "Bad Request" response + Given operation "CreateAWSCloudAuthPersonaMapping" enabled + And new "CreateAWSCloudAuthPersonaMapping" request + And body with value {"data": {"attributes": {"account_identifier": "test@test.com", "arn_pattern": "arn:aws:iam::123456789012:user/testuser"}, "type": "aws_cloud_auth_config"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/team-aaaauthn + Scenario: Create an AWS cloud authentication persona mapping returns "Conflict" response + Given operation "CreateAWSCloudAuthPersonaMapping" enabled + And new "CreateAWSCloudAuthPersonaMapping" request + And body with value {"data": {"attributes": {"account_identifier": "test@test.com", "arn_pattern": "arn:aws:iam::123456789012:user/testuser"}, "type": "aws_cloud_auth_config"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/team-aaaauthn + Scenario: Create an AWS cloud authentication persona mapping returns "Created" response + Given operation "CreateAWSCloudAuthPersonaMapping" enabled + And new "CreateAWSCloudAuthPersonaMapping" request + And body with value {"data": {"attributes": {"account_identifier": "test@test.com", "arn_pattern": "arn:aws:iam::123456789012:user/testuser"}, "type": "aws_cloud_auth_config"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/team-aaaauthn + Scenario: Delete an AWS cloud authentication persona mapping returns "No Content" response + Given operation "DeleteAWSCloudAuthPersonaMapping" enabled + And new "DeleteAWSCloudAuthPersonaMapping" request + And request contains "persona_mapping_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/team-aaaauthn + Scenario: Delete an AWS cloud authentication persona mapping returns "Not Found" response + Given operation "DeleteAWSCloudAuthPersonaMapping" enabled + And new "DeleteAWSCloudAuthPersonaMapping" request + And request contains "persona_mapping_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/team-aaaauthn + Scenario: Get an AWS cloud authentication persona mapping returns "Not Found" response + Given operation "GetAWSCloudAuthPersonaMapping" enabled + And new "GetAWSCloudAuthPersonaMapping" request + And request contains "persona_mapping_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/team-aaaauthn + Scenario: Get an AWS cloud authentication persona mapping returns "OK" response + Given operation "GetAWSCloudAuthPersonaMapping" enabled + And new "GetAWSCloudAuthPersonaMapping" request + And request contains "persona_mapping_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK @generated @skip @team:DataDog/team-aaaauthn Scenario: List AWS cloud authentication persona mappings returns "Bad Request" response + Given operation "ListAWSCloudAuthPersonaMappings" enabled + And new "ListAWSCloudAuthPersonaMappings" request When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/team-aaaauthn Scenario: List AWS cloud authentication persona mappings returns "OK" response + Given operation "ListAWSCloudAuthPersonaMappings" enabled + And new "ListAWSCloudAuthPersonaMappings" request When the request is sent Then the response status is 200 OK diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 6bcb5be0ae..3b052977c2 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -1060,6 +1060,31 @@ "type": "safe" } }, + "CreateAWSCloudAuthPersonaMapping": { + "tag": "Cloud Authentication", + "undo": { + "operationId": "DeleteAWSCloudAuthPersonaMapping", + "parameters": [ + { + "name": "persona_mapping_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteAWSCloudAuthPersonaMapping": { + "tag": "Cloud Authentication", + "undo": { + "type": "idempotent" + } + }, + "GetAWSCloudAuthPersonaMapping": { + "tag": "Cloud Authentication", + "undo": { + "type": "safe" + } + }, "CreateCustomFramework": { "tag": "Security Monitoring", "undo": {