diff --git a/.apigentools-info b/.apigentools-info index 5e4a98b575..77571fdc77 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.4.1.dev11", - "regenerated": "2021-07-13 15:54:40.523054", - "spec_repo_commit": "c2e2dda" + "regenerated": "2021-07-14 09:06:55.275340", + "spec_repo_commit": "f0a4221" }, "v2": { "apigentools_version": "1.4.1.dev11", - "regenerated": "2021-07-13 15:55:03.366670", - "spec_repo_commit": "c2e2dda" + "regenerated": "2021-07-14 09:07:22.355067", + "spec_repo_commit": "f0a4221" } } } \ No newline at end of file diff --git a/docs/v1/AWSAccountDeleteRequest.md b/docs/v1/AWSAccountDeleteRequest.md new file mode 100644 index 0000000000..f4adc0892b --- /dev/null +++ b/docs/v1/AWSAccountDeleteRequest.md @@ -0,0 +1,14 @@ +# AWSAccountDeleteRequest + +List of AWS accounts to delete. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**access_key_id** | **str** | Your AWS access key ID. Only required if your AWS account is a GovCloud or China account. | [optional] +**account_id** | **str** | Your AWS Account ID without dashes. | [optional] +**role_name** | **str** | Your Datadog role delegation name. | [optional] + +[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) + + diff --git a/docs/v1/AWSIntegrationApi.md b/docs/v1/AWSIntegrationApi.md index 6a2a243c12..aa5762a000 100644 --- a/docs/v1/AWSIntegrationApi.md +++ b/docs/v1/AWSIntegrationApi.md @@ -260,18 +260,11 @@ configuration = Configuration() with ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = aws_integration_api.AWSIntegrationApi(api_client) - body = AWSAccount( + body = AWSAccountDeleteRequest( access_key_id="access_key_id_example", account_id="1234567", - account_specific_namespace_rules={ - "key": True, - }, - excluded_regions=["us-east-1","us-west-2"], - filter_tags=[":"], - host_tags=[":"], role_name="DatadogAWSIntegrationRole", - secret_access_key="secret_access_key_example", - ) # AWSAccount | AWS request object + ) # AWSAccountDeleteRequest | AWS request object # example passing only required values which don't have defaults set try: @@ -287,7 +280,7 @@ with ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**AWSAccount**](AWSAccount.md)| AWS request object | + **body** | [**AWSAccountDeleteRequest**](AWSAccountDeleteRequest.md)| AWS request object | ### Return type diff --git a/docs/v1/README.md b/docs/v1/README.md index ed5ae54097..891ac42a59 100644 --- a/docs/v1/README.md +++ b/docs/v1/README.md @@ -54,6 +54,7 @@ from datadog_api_client.v1.api import aws_integration_api from datadog_api_client.v1.model.api_error_response import APIErrorResponse from datadog_api_client.v1.model.aws_account import AWSAccount from datadog_api_client.v1.model.aws_account_create_response import AWSAccountCreateResponse +from datadog_api_client.v1.model.aws_account_delete_request import AWSAccountDeleteRequest from datadog_api_client.v1.model.aws_account_list_response import AWSAccountListResponse from datadog_api_client.v1.model.aws_tag_filter_create_request import AWSTagFilterCreateRequest from datadog_api_client.v1.model.aws_tag_filter_delete_request import AWSTagFilterDeleteRequest @@ -292,6 +293,7 @@ Class | Method | HTTP request | Description - [AWSAccount](AWSAccount.md) - [AWSAccountAndLambdaRequest](AWSAccountAndLambdaRequest.md) - [AWSAccountCreateResponse](AWSAccountCreateResponse.md) + - [AWSAccountDeleteRequest](AWSAccountDeleteRequest.md) - [AWSAccountListResponse](AWSAccountListResponse.md) - [AWSLogsAsyncError](AWSLogsAsyncError.md) - [AWSLogsAsyncResponse](AWSLogsAsyncResponse.md) diff --git a/src/datadog_api_client/v1/api/aws_integration_api.py b/src/datadog_api_client/v1/api/aws_integration_api.py index b37ad49e61..b12ee6cbb9 100644 --- a/src/datadog_api_client/v1/api/aws_integration_api.py +++ b/src/datadog_api_client/v1/api/aws_integration_api.py @@ -19,6 +19,7 @@ from datadog_api_client.v1.model.api_error_response import APIErrorResponse from datadog_api_client.v1.model.aws_account import AWSAccount from datadog_api_client.v1.model.aws_account_create_response import AWSAccountCreateResponse +from datadog_api_client.v1.model.aws_account_delete_request import AWSAccountDeleteRequest from datadog_api_client.v1.model.aws_account_list_response import AWSAccountListResponse from datadog_api_client.v1.model.aws_tag_filter_create_request import AWSTagFilterCreateRequest from datadog_api_client.v1.model.aws_tag_filter_delete_request import AWSTagFilterDeleteRequest @@ -169,7 +170,7 @@ def __init__(self, api_client=None): "validations": {}, "allowed_values": {}, "openapi_types": { - "body": (AWSAccount,), + "body": (AWSAccountDeleteRequest,), }, "attribute_map": {}, "location_map": { @@ -519,7 +520,7 @@ def delete_aws_account(self, body, **kwargs): >>> result = thread.get() Args: - body (AWSAccount): AWS request object + body (AWSAccountDeleteRequest): AWS request object Keyword Args: _return_http_data_only (bool): response data without head status diff --git a/src/datadog_api_client/v1/model/aws_account_delete_request.py b/src/datadog_api_client/v1/model/aws_account_delete_request.py new file mode 100644 index 0000000000..19c4ba9728 --- /dev/null +++ b/src/datadog_api_client/v1/model/aws_account_delete_request.py @@ -0,0 +1,169 @@ +# 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. + + +import re # noqa: F401 +import sys # noqa: F401 + +from datadog_api_client.v1.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class AWSAccountDeleteRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = {} + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "access_key_id": (str,), # noqa: E501 + "account_id": (str,), # noqa: E501 + "role_name": (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "access_key_id": "access_key_id", # noqa: E501 + "account_id": "account_id", # noqa: E501 + "role_name": "role_name", # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """AWSAccountDeleteRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + access_key_id (str): Your AWS access key ID. Only required if your AWS account is a GovCloud or China account.. [optional] # noqa: E501 + account_id (str): Your AWS Account ID without dashes.. [optional] # noqa: E501 + role_name (str): Your Datadog role delegation name.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/src/datadog_api_client/v1/models/__init__.py b/src/datadog_api_client/v1/models/__init__.py index c995054bc2..86073f799d 100644 --- a/src/datadog_api_client/v1/models/__init__.py +++ b/src/datadog_api_client/v1/models/__init__.py @@ -13,6 +13,7 @@ from datadog_api_client.v1.model.aws_account import AWSAccount from datadog_api_client.v1.model.aws_account_and_lambda_request import AWSAccountAndLambdaRequest from datadog_api_client.v1.model.aws_account_create_response import AWSAccountCreateResponse +from datadog_api_client.v1.model.aws_account_delete_request import AWSAccountDeleteRequest from datadog_api_client.v1.model.aws_account_list_response import AWSAccountListResponse from datadog_api_client.v1.model.aws_logs_async_error import AWSLogsAsyncError from datadog_api_client.v1.model.aws_logs_async_response import AWSLogsAsyncResponse diff --git a/src/datadog_api_client/v1/openapi.yaml b/src/datadog_api_client/v1/openapi.yaml index d838292311..cc2c2d4e19 100644 --- a/src/datadog_api_client/v1/openapi.yaml +++ b/src/datadog_api_client/v1/openapi.yaml @@ -131,6 +131,22 @@ components: description: AWS external_id. type: string type: object + AWSAccountDeleteRequest: + description: List of AWS accounts to delete. + properties: + access_key_id: + description: Your AWS access key ID. Only required if your AWS account is + a GovCloud or China account. + type: string + account_id: + description: Your AWS Account ID without dashes. + example: '1234567' + type: string + role_name: + description: Your Datadog role delegation name. + example: DatadogAWSIntegrationRole + type: string + type: object AWSAccountListResponse: description: List of enabled AWS accounts. properties: @@ -15153,7 +15169,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/AWSAccount' + $ref: '#/components/schemas/AWSAccountDeleteRequest' description: AWS request object required: true responses: diff --git a/tests/v1/features/aws_integration.feature b/tests/v1/features/aws_integration.feature index 99b7fefd40..16acddbef1 100644 --- a/tests/v1/features/aws_integration.feature +++ b/tests/v1/features/aws_integration.feature @@ -47,21 +47,21 @@ Feature: AWS Integration @generated @skip Scenario: Delete an AWS integration returns "Bad Request" response Given new "DeleteAWSAccount" request - And body with value {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": [":"], "host_tags": [":"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null} + And body with value {"access_key_id": null, "account_id": "1234567", "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 400 Bad Request @generated @skip Scenario: Delete an AWS integration returns "Conflict Error" response Given new "DeleteAWSAccount" request - And body with value {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": [":"], "host_tags": [":"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null} + And body with value {"access_key_id": null, "account_id": "1234567", "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 409 Conflict Error @generated @skip Scenario: Delete an AWS integration returns "OK" response Given new "DeleteAWSAccount" request - And body with value {"access_key_id": null, "account_id": "1234567", "account_specific_namespace_rules": {"auto_scaling": false, "opswork": false}, "excluded_regions": ["us-east-1", "us-west-2"], "filter_tags": [":"], "host_tags": [":"], "role_name": "DatadogAWSIntegrationRole", "secret_access_key": null} + And body with value {"access_key_id": null, "account_id": "1234567", "role_name": "DatadogAWSIntegrationRole"} When the request is sent Then the response status is 200 OK