From 6ff3ec7087ec44f11e2d5adbe5c9785ece2afe1f Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 1 May 2026 14:07:53 +0000 Subject: [PATCH] Regenerate client from commit cde65b5 of spec repo --- .generator/schemas/v2/openapi.yaml | 303 ++++++++++++++++++ docs/datadog_api_client.v2.api.rst | 7 + docs/datadog_api_client.v2.model.rst | 84 +++++ .../UpsertSyncConfig.py | 63 ++++ src/datadog_api_client/configuration.py | 1 + .../api/cloud_inventory_sync_configs_api.py | 59 ++++ src/datadog_api_client/v2/apis/__init__.py | 2 + .../cloud_inventory_cloud_provider_id.py | 41 +++ ...d_inventory_cloud_provider_request_type.py | 35 ++ .../cloud_inventory_sync_config_attributes.py | 140 ++++++++ ...tory_sync_config_aws_request_attributes.py | 62 ++++ ...ry_sync_config_azure_request_attributes.py | 72 +++++ ...tory_sync_config_gcp_request_attributes.py | 58 ++++ ...oud_inventory_sync_config_resource_type.py | 35 ++ .../cloud_inventory_sync_config_response.py | 44 +++ ...oud_inventory_sync_config_response_data.py | 66 ++++ ...ert_cloud_inventory_sync_config_request.py | 44 +++ ...nventory_sync_config_request_attributes.py | 78 +++++ ...loud_inventory_sync_config_request_data.py | 70 ++++ src/datadog_api_client/v2/models/__init__.py | 36 +++ .../cloud_inventory_sync_configs.feature | 22 ++ tests/v2/features/undo.json | 6 + 22 files changed, 1328 insertions(+) create mode 100644 examples/v2/cloud-inventory-sync-configs/UpsertSyncConfig.py create mode 100644 src/datadog_api_client/v2/api/cloud_inventory_sync_configs_api.py create mode 100644 src/datadog_api_client/v2/model/cloud_inventory_cloud_provider_id.py create mode 100644 src/datadog_api_client/v2/model/cloud_inventory_cloud_provider_request_type.py create mode 100644 src/datadog_api_client/v2/model/cloud_inventory_sync_config_attributes.py create mode 100644 src/datadog_api_client/v2/model/cloud_inventory_sync_config_aws_request_attributes.py create mode 100644 src/datadog_api_client/v2/model/cloud_inventory_sync_config_azure_request_attributes.py create mode 100644 src/datadog_api_client/v2/model/cloud_inventory_sync_config_gcp_request_attributes.py create mode 100644 src/datadog_api_client/v2/model/cloud_inventory_sync_config_resource_type.py create mode 100644 src/datadog_api_client/v2/model/cloud_inventory_sync_config_response.py create mode 100644 src/datadog_api_client/v2/model/cloud_inventory_sync_config_response_data.py create mode 100644 src/datadog_api_client/v2/model/upsert_cloud_inventory_sync_config_request.py create mode 100644 src/datadog_api_client/v2/model/upsert_cloud_inventory_sync_config_request_attributes.py create mode 100644 src/datadog_api_client/v2/model/upsert_cloud_inventory_sync_config_request_data.py create mode 100644 tests/v2/features/cloud_inventory_sync_configs.feature diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 382c9233aa..93b41388a7 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -12652,6 +12652,219 @@ components: type: string x-enum-varnames: - CLOUD_CONFIGURATION + CloudInventoryCloudProviderId: + description: |- + Cloud provider for this sync configuration (`aws`, `gcp`, or `azure`). For requests, must match the provider block supplied under `attributes`. + enum: + - aws + - gcp + - azure + example: aws + type: string + x-enum-varnames: + - AWS + - GCP + - AZURE + CloudInventoryCloudProviderRequestType: + description: JSON:API type for upsert sync configuration requests. + enum: + - cloud_provider + example: cloud_provider + type: string + x-enum-varnames: + - CLOUD_PROVIDER + CloudInventorySyncConfigAWSRequestAttributes: + description: AWS settings for the customer bucket that stores inventory reports. + properties: + aws_account_id: + description: AWS account ID that owns the inventory bucket. + example: "123456789012" + type: string + destination_bucket_name: + description: Name of the S3 bucket containing inventory files. + example: my-inventory-bucket + type: string + destination_bucket_region: + description: AWS Region of the inventory bucket. + example: us-east-1 + type: string + destination_prefix: + description: Optional object key prefix for inventory files. Use `/` or omit for the entire bucket. + example: logs/ + type: string + required: + - aws_account_id + - destination_bucket_name + - destination_bucket_region + type: object + CloudInventorySyncConfigAttributes: + description: Attributes for a cloud inventory sync configuration. Values beyond `id` may be omitted immediately after upsert. + properties: + aws_account_id: + description: AWS account ID for the inventory bucket. + example: "123456789012" + type: string + aws_bucket_name: + description: AWS S3 bucket name for inventory files. + example: my-inventory-bucket + type: string + aws_region: + description: AWS Region for the inventory bucket. + example: us-east-1 + type: string + azure_client_id: + description: Azure AD application (client) ID. + example: 11111111-1111-1111-1111-111111111111 + type: string + azure_container_name: + description: Azure blob container name. + example: inventory-container + type: string + azure_storage_account_name: + description: Azure storage account name. + example: mystorageaccount + type: string + azure_tenant_id: + description: Azure AD tenant ID. + example: 22222222-2222-2222-2222-222222222222 + type: string + cloud_provider: + $ref: "#/components/schemas/CloudInventoryCloudProviderId" + error: + description: Human-readable error detail when sync is unhealthy. + example: "" + readOnly: true + type: string + error_code: + description: Machine-readable error code when sync is unhealthy. + example: "" + readOnly: true + type: string + gcp_bucket_name: + description: GCS bucket name for inventory files Datadog reads. + example: my-inventory-reports + type: string + gcp_project_id: + description: GCP project ID. + example: my-gcp-project + type: string + gcp_service_account_email: + description: Service account email for bucket access. + example: reader@my-gcp-project.iam.gserviceaccount.com + type: string + prefix: + description: Object key prefix or `/` when the entire bucket is synced. + example: logs/ + readOnly: true + type: string + required: + - aws_bucket_name + - aws_account_id + - aws_region + - azure_storage_account_name + - azure_container_name + - azure_client_id + - azure_tenant_id + - gcp_bucket_name + - gcp_project_id + - gcp_service_account_email + - cloud_provider + - prefix + - error + - error_code + type: object + CloudInventorySyncConfigAzureRequestAttributes: + description: Azure settings for the storage account and container with inventory data. + properties: + client_id: + description: Azure AD application (client) ID used for access. + example: 11111111-1111-1111-1111-111111111111 + type: string + container: + description: Blob container name. + example: inventory-container + type: string + resource_group: + description: Resource group containing the storage account. + example: my-resource-group + type: string + storage_account: + description: Storage account name. + example: mystorageaccount + type: string + subscription_id: + description: Azure subscription ID. + example: 33333333-3333-3333-3333-333333333333 + type: string + tenant_id: + description: Azure AD tenant ID. + example: 22222222-2222-2222-2222-222222222222 + type: string + required: + - client_id + - tenant_id + - subscription_id + - resource_group + - storage_account + - container + type: object + CloudInventorySyncConfigGCPRequestAttributes: + description: GCP settings for buckets involved in inventory reporting. + properties: + destination_bucket_name: + description: GCS bucket name where Datadog reads inventory reports. + example: my-inventory-reports + type: string + project_id: + description: GCP project ID for the inventory destination bucket. + example: my-gcp-project + type: string + service_account_email: + description: Service account email used to read the destination bucket. + example: reader@my-gcp-project.iam.gserviceaccount.com + type: string + source_bucket_name: + description: GCS bucket name that inventory reports are generated for. + example: my-monitored-bucket + type: string + required: + - project_id + - destination_bucket_name + - source_bucket_name + - service_account_email + type: object + CloudInventorySyncConfigResourceType: + description: JSON:API type for sync configuration resources. + enum: + - sync_configs + example: sync_configs + type: string + x-enum-varnames: + - SYNC_CONFIGS + CloudInventorySyncConfigResponse: + description: Response containing the upserted sync configuration. Additional read-only fields appear on list and get. + properties: + data: + $ref: "#/components/schemas/CloudInventorySyncConfigResponseData" + required: + - data + type: object + CloudInventorySyncConfigResponseData: + description: JSON:API data object for a sync configuration. + properties: + attributes: + $ref: "#/components/schemas/CloudInventorySyncConfigAttributes" + id: + description: Unique identifier for the recurring sync configuration. + example: abc123 + type: string + type: + $ref: "#/components/schemas/CloudInventorySyncConfigResourceType" + required: + - id + - type + - attributes + type: object CloudWorkloadSecurityAgentPoliciesListResponse: description: "Response object that includes a list of Agent policies" properties: @@ -80681,6 +80894,39 @@ components: meta: $ref: "#/components/schemas/KindResponseMeta" type: object + UpsertCloudInventorySyncConfigRequest: + description: Request body for creating or updating a cloud inventory sync configuration. + properties: + data: + $ref: "#/components/schemas/UpsertCloudInventorySyncConfigRequestData" + required: + - data + type: object + UpsertCloudInventorySyncConfigRequestAttributes: + description: |- + Provider-specific configuration. Include the object that matches `data.id` (`aws`, `gcp`, or `azure`). + properties: + aws: + $ref: "#/components/schemas/CloudInventorySyncConfigAWSRequestAttributes" + azure: + $ref: "#/components/schemas/CloudInventorySyncConfigAzureRequestAttributes" + gcp: + $ref: "#/components/schemas/CloudInventorySyncConfigGCPRequestAttributes" + type: object + UpsertCloudInventorySyncConfigRequestData: + description: JSON:API data envelope for an upsert sync configuration request. + properties: + attributes: + $ref: "#/components/schemas/UpsertCloudInventorySyncConfigRequestAttributes" + id: + $ref: "#/components/schemas/CloudInventoryCloudProviderId" + type: + $ref: "#/components/schemas/CloudInventoryCloudProviderRequestType" + required: + - type + - id + - attributes + type: object Urgency: description: Specifies the level of urgency for a routing rule (low, high, or dynamic). enum: @@ -82895,6 +83141,7 @@ components: apm_service_catalog_read: View service catalog and service definitions. apm_service_catalog_write: Add, modify, and delete service catalog definitions when those definitions are maintained by Datadog. appsec_vm_read: View infrastructure, application code, and library vulnerability findings. + aws_configurations_manage: Manage AWS integration account configurations and related integration settings. billing_read: View your organization's billing information. bits_investigations_read: View Bits AI investigations. bits_investigations_write: Create and manage Bits AI investigations. @@ -91595,6 +91842,59 @@ paths: operator: OR permissions: - security_monitoring_filters_write + /api/v2/cloudinventoryservice/syncconfigs: + put: + description: |- + Create or update a cloud inventory sync configuration. Specify the cloud provider in `data.id` + and provider-specific settings under `data.attributes`. This endpoint uses an upsert model. + operationId: UpsertSyncConfig + requestBody: + content: + application/json: + examples: + default: + summary: AWS inventory bucket + value: + data: + attributes: + aws: + aws_account_id: "123456789012" + destination_bucket_name: my-inventory-bucket + destination_bucket_region: us-east-1 + destination_prefix: logs/ + id: aws + type: cloud_provider + schema: + $ref: "#/components/schemas/UpsertCloudInventorySyncConfigRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/CloudInventorySyncConfigResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create or update a sync configuration + tags: + - Cloud Inventory Sync Configs + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - aws_configurations_manage + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/code-coverage/branch/summary: post: description: |- @@ -134830,6 +135130,9 @@ tags: - description: |- The Cloud Cost Management API allows you to set up, edit, and delete Cloud Cost Management accounts for AWS, Azure, and Google Cloud. You can query your cost data by using the [Metrics endpoint](https://docs.datadoghq.com/api/latest/metrics/#query-timeseries-data-across-multiple-products) and the `cloud_cost` data source. For more information, see the [Cloud Cost Management documentation](https://docs.datadoghq.com/cloud_cost_management/). name: Cloud Cost Management + - description: |- + Configure cloud inventory file synchronization from your cloud storage to Datadog. + name: Cloud Inventory Sync Configs - description: |- The Cloud Network Monitoring API allows you to fetch aggregated connections and DNS traffic with their attributes. See the [Cloud Network Monitoring page](https://docs.datadoghq.com/network_monitoring/cloud_network_monitoring/) and [DNS Monitoring page](https://docs.datadoghq.com/network_monitoring/dns/) for more information. name: Cloud Network Monitoring diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index cbf7b505b3..79ecbd0439 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -151,6 +151,13 @@ datadog\_api\_client.v2.api.cloud\_cost\_management\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.cloud\_inventory\_sync\_configs\_api module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.cloud_inventory_sync_configs_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.cloud\_network\_monitoring\_api module ------------------------------------------------------------------ diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index bb0817ad6d..a796374b93 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -4981,6 +4981,69 @@ datadog\_api\_client.v2.model.cloud\_configuration\_rule\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.cloud\_inventory\_cloud\_provider\_id module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.cloud_inventory_cloud_provider_id + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.cloud\_inventory\_cloud\_provider\_request\_type module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.cloud_inventory_cloud_provider_request_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.cloud\_inventory\_sync\_config\_attributes module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.cloud_inventory_sync_config_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.cloud\_inventory\_sync\_config\_aws\_request\_attributes module +--------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.cloud_inventory_sync_config_aws_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.cloud\_inventory\_sync\_config\_azure\_request\_attributes module +----------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.cloud_inventory_sync_config_azure_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.cloud\_inventory\_sync\_config\_gcp\_request\_attributes module +--------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.cloud_inventory_sync_config_gcp_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.cloud\_inventory\_sync\_config\_resource\_type module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.cloud_inventory_sync_config_resource_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.cloud\_inventory\_sync\_config\_response module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.cloud_inventory_sync_config_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.cloud\_inventory\_sync\_config\_response\_data module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.cloud_inventory_sync_config_response_data + :members: + :show-inheritance: + datadog\_api\_client.v2.model.cloud\_workload\_security\_agent\_policies\_list\_response module ----------------------------------------------------------------------------------------------- @@ -35718,6 +35781,27 @@ datadog\_api\_client.v2.model.upsert\_catalog\_kind\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.upsert\_cloud\_inventory\_sync\_config\_request module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.upsert_cloud_inventory_sync_config_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.upsert\_cloud\_inventory\_sync\_config\_request\_attributes module +------------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.upsert_cloud_inventory_sync_config_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.upsert\_cloud\_inventory\_sync\_config\_request\_data module +------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.upsert_cloud_inventory_sync_config_request_data + :members: + :show-inheritance: + datadog\_api\_client.v2.model.urgency module -------------------------------------------- diff --git a/examples/v2/cloud-inventory-sync-configs/UpsertSyncConfig.py b/examples/v2/cloud-inventory-sync-configs/UpsertSyncConfig.py new file mode 100644 index 0000000000..5a9968038d --- /dev/null +++ b/examples/v2/cloud-inventory-sync-configs/UpsertSyncConfig.py @@ -0,0 +1,63 @@ +""" +Create or update a sync configuration returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.cloud_inventory_sync_configs_api import CloudInventorySyncConfigsApi +from datadog_api_client.v2.model.cloud_inventory_cloud_provider_id import CloudInventoryCloudProviderId +from datadog_api_client.v2.model.cloud_inventory_cloud_provider_request_type import ( + CloudInventoryCloudProviderRequestType, +) +from datadog_api_client.v2.model.cloud_inventory_sync_config_aws_request_attributes import ( + CloudInventorySyncConfigAWSRequestAttributes, +) +from datadog_api_client.v2.model.cloud_inventory_sync_config_azure_request_attributes import ( + CloudInventorySyncConfigAzureRequestAttributes, +) +from datadog_api_client.v2.model.cloud_inventory_sync_config_gcp_request_attributes import ( + CloudInventorySyncConfigGCPRequestAttributes, +) +from datadog_api_client.v2.model.upsert_cloud_inventory_sync_config_request import UpsertCloudInventorySyncConfigRequest +from datadog_api_client.v2.model.upsert_cloud_inventory_sync_config_request_attributes import ( + UpsertCloudInventorySyncConfigRequestAttributes, +) +from datadog_api_client.v2.model.upsert_cloud_inventory_sync_config_request_data import ( + UpsertCloudInventorySyncConfigRequestData, +) + +body = UpsertCloudInventorySyncConfigRequest( + data=UpsertCloudInventorySyncConfigRequestData( + attributes=UpsertCloudInventorySyncConfigRequestAttributes( + aws=CloudInventorySyncConfigAWSRequestAttributes( + aws_account_id="123456789012", + destination_bucket_name="my-inventory-bucket", + destination_bucket_region="us-east-1", + destination_prefix="logs/", + ), + azure=CloudInventorySyncConfigAzureRequestAttributes( + client_id="11111111-1111-1111-1111-111111111111", + container="inventory-container", + resource_group="my-resource-group", + storage_account="mystorageaccount", + subscription_id="33333333-3333-3333-3333-333333333333", + tenant_id="22222222-2222-2222-2222-222222222222", + ), + gcp=CloudInventorySyncConfigGCPRequestAttributes( + destination_bucket_name="my-inventory-reports", + project_id="my-gcp-project", + service_account_email="reader@my-gcp-project.iam.gserviceaccount.com", + source_bucket_name="my-monitored-bucket", + ), + ), + id=CloudInventoryCloudProviderId.AWS, + type=CloudInventoryCloudProviderRequestType.CLOUD_PROVIDER, + ), +) + +configuration = Configuration() +configuration.unstable_operations["upsert_sync_config"] = True +with ApiClient(configuration) as api_client: + api_instance = CloudInventorySyncConfigsApi(api_client) + response = api_instance.upsert_sync_config(body=body) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 9692f7e42c..6e38061ac6 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -348,6 +348,7 @@ def __init__( "v2.mute_security_findings": False, "v2.run_historical_job": False, "v2.search_security_monitoring_histsignals": False, + "v2.upsert_sync_config": False, "v2.get_code_coverage_branch_summary": False, "v2.get_code_coverage_commit_summary": False, "v2.create_dashboard_secure_embed": False, diff --git a/src/datadog_api_client/v2/api/cloud_inventory_sync_configs_api.py b/src/datadog_api_client/v2/api/cloud_inventory_sync_configs_api.py new file mode 100644 index 0000000000..af49b9cc2d --- /dev/null +++ b/src/datadog_api_client/v2/api/cloud_inventory_sync_configs_api.py @@ -0,0 +1,59 @@ +# 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 Any, Dict + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.v2.model.cloud_inventory_sync_config_response import CloudInventorySyncConfigResponse +from datadog_api_client.v2.model.upsert_cloud_inventory_sync_config_request import UpsertCloudInventorySyncConfigRequest + + +class CloudInventorySyncConfigsApi: + """ + Configure cloud inventory file synchronization from your cloud storage to Datadog. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._upsert_sync_config_endpoint = _Endpoint( + settings={ + "response_type": (CloudInventorySyncConfigResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/cloudinventoryservice/syncconfigs", + "operation_id": "upsert_sync_config", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (UpsertCloudInventorySyncConfigRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def upsert_sync_config( + self, + body: UpsertCloudInventorySyncConfigRequest, + ) -> CloudInventorySyncConfigResponse: + """Create or update a sync configuration. + + Create or update a cloud inventory sync configuration. Specify the cloud provider in ``data.id`` + and provider-specific settings under ``data.attributes``. This endpoint uses an upsert model. + + :type body: UpsertCloudInventorySyncConfigRequest + :rtype: CloudInventorySyncConfigResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._upsert_sync_config_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index 1cdb0b2c63..3d8270c1b1 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -22,6 +22,7 @@ from datadog_api_client.v2.api.change_management_api import ChangeManagementApi from datadog_api_client.v2.api.cloud_authentication_api import CloudAuthenticationApi from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi +from datadog_api_client.v2.api.cloud_inventory_sync_configs_api import CloudInventorySyncConfigsApi from datadog_api_client.v2.api.cloud_network_monitoring_api import CloudNetworkMonitoringApi from datadog_api_client.v2.api.cloudflare_integration_api import CloudflareIntegrationApi from datadog_api_client.v2.api.code_coverage_api import CodeCoverageApi @@ -133,6 +134,7 @@ "ChangeManagementApi", "CloudAuthenticationApi", "CloudCostManagementApi", + "CloudInventorySyncConfigsApi", "CloudNetworkMonitoringApi", "CloudflareIntegrationApi", "CodeCoverageApi", diff --git a/src/datadog_api_client/v2/model/cloud_inventory_cloud_provider_id.py b/src/datadog_api_client/v2/model/cloud_inventory_cloud_provider_id.py new file mode 100644 index 0000000000..75512aad21 --- /dev/null +++ b/src/datadog_api_client/v2/model/cloud_inventory_cloud_provider_id.py @@ -0,0 +1,41 @@ +# 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 ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class CloudInventoryCloudProviderId(ModelSimple): + """ + Cloud provider for this sync configuration (`aws`, `gcp`, or `azure`). For requests, must match the provider block supplied under `attributes`. + + :param value: Must be one of ["aws", "gcp", "azure"]. + :type value: str + """ + + allowed_values = { + "aws", + "gcp", + "azure", + } + AWS: ClassVar["CloudInventoryCloudProviderId"] + GCP: ClassVar["CloudInventoryCloudProviderId"] + AZURE: ClassVar["CloudInventoryCloudProviderId"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CloudInventoryCloudProviderId.AWS = CloudInventoryCloudProviderId("aws") +CloudInventoryCloudProviderId.GCP = CloudInventoryCloudProviderId("gcp") +CloudInventoryCloudProviderId.AZURE = CloudInventoryCloudProviderId("azure") diff --git a/src/datadog_api_client/v2/model/cloud_inventory_cloud_provider_request_type.py b/src/datadog_api_client/v2/model/cloud_inventory_cloud_provider_request_type.py new file mode 100644 index 0000000000..f38b1c2fec --- /dev/null +++ b/src/datadog_api_client/v2/model/cloud_inventory_cloud_provider_request_type.py @@ -0,0 +1,35 @@ +# 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 ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class CloudInventoryCloudProviderRequestType(ModelSimple): + """ + JSON:API type for upsert sync configuration requests. + + :param value: If omitted defaults to "cloud_provider". Must be one of ["cloud_provider"]. + :type value: str + """ + + allowed_values = { + "cloud_provider", + } + CLOUD_PROVIDER: ClassVar["CloudInventoryCloudProviderRequestType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CloudInventoryCloudProviderRequestType.CLOUD_PROVIDER = CloudInventoryCloudProviderRequestType("cloud_provider") diff --git a/src/datadog_api_client/v2/model/cloud_inventory_sync_config_attributes.py b/src/datadog_api_client/v2/model/cloud_inventory_sync_config_attributes.py new file mode 100644 index 0000000000..f4c1b5b224 --- /dev/null +++ b/src/datadog_api_client/v2/model/cloud_inventory_sync_config_attributes.py @@ -0,0 +1,140 @@ +# 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.cloud_inventory_cloud_provider_id import CloudInventoryCloudProviderId + + +class CloudInventorySyncConfigAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.cloud_inventory_cloud_provider_id import CloudInventoryCloudProviderId + + return { + "aws_account_id": (str,), + "aws_bucket_name": (str,), + "aws_region": (str,), + "azure_client_id": (str,), + "azure_container_name": (str,), + "azure_storage_account_name": (str,), + "azure_tenant_id": (str,), + "cloud_provider": (CloudInventoryCloudProviderId,), + "error": (str,), + "error_code": (str,), + "gcp_bucket_name": (str,), + "gcp_project_id": (str,), + "gcp_service_account_email": (str,), + "prefix": (str,), + } + + attribute_map = { + "aws_account_id": "aws_account_id", + "aws_bucket_name": "aws_bucket_name", + "aws_region": "aws_region", + "azure_client_id": "azure_client_id", + "azure_container_name": "azure_container_name", + "azure_storage_account_name": "azure_storage_account_name", + "azure_tenant_id": "azure_tenant_id", + "cloud_provider": "cloud_provider", + "error": "error", + "error_code": "error_code", + "gcp_bucket_name": "gcp_bucket_name", + "gcp_project_id": "gcp_project_id", + "gcp_service_account_email": "gcp_service_account_email", + "prefix": "prefix", + } + read_only_vars = { + "error", + "error_code", + "prefix", + } + + def __init__( + self_, + aws_account_id: str, + aws_bucket_name: str, + aws_region: str, + azure_client_id: str, + azure_container_name: str, + azure_storage_account_name: str, + azure_tenant_id: str, + cloud_provider: CloudInventoryCloudProviderId, + error: str, + error_code: str, + gcp_bucket_name: str, + gcp_project_id: str, + gcp_service_account_email: str, + prefix: str, + **kwargs, + ): + """ + Attributes for a cloud inventory sync configuration. Values beyond ``id`` may be omitted immediately after upsert. + + :param aws_account_id: AWS account ID for the inventory bucket. + :type aws_account_id: str + + :param aws_bucket_name: AWS S3 bucket name for inventory files. + :type aws_bucket_name: str + + :param aws_region: AWS Region for the inventory bucket. + :type aws_region: str + + :param azure_client_id: Azure AD application (client) ID. + :type azure_client_id: str + + :param azure_container_name: Azure blob container name. + :type azure_container_name: str + + :param azure_storage_account_name: Azure storage account name. + :type azure_storage_account_name: str + + :param azure_tenant_id: Azure AD tenant ID. + :type azure_tenant_id: str + + :param cloud_provider: Cloud provider for this sync configuration ( ``aws`` , ``gcp`` , or ``azure`` ). For requests, must match the provider block supplied under ``attributes``. + :type cloud_provider: CloudInventoryCloudProviderId + + :param error: Human-readable error detail when sync is unhealthy. + :type error: str + + :param error_code: Machine-readable error code when sync is unhealthy. + :type error_code: str + + :param gcp_bucket_name: GCS bucket name for inventory files Datadog reads. + :type gcp_bucket_name: str + + :param gcp_project_id: GCP project ID. + :type gcp_project_id: str + + :param gcp_service_account_email: Service account email for bucket access. + :type gcp_service_account_email: str + + :param prefix: Object key prefix or ``/`` when the entire bucket is synced. + :type prefix: str + """ + super().__init__(kwargs) + + self_.aws_account_id = aws_account_id + self_.aws_bucket_name = aws_bucket_name + self_.aws_region = aws_region + self_.azure_client_id = azure_client_id + self_.azure_container_name = azure_container_name + self_.azure_storage_account_name = azure_storage_account_name + self_.azure_tenant_id = azure_tenant_id + self_.cloud_provider = cloud_provider + self_.error = error + self_.error_code = error_code + self_.gcp_bucket_name = gcp_bucket_name + self_.gcp_project_id = gcp_project_id + self_.gcp_service_account_email = gcp_service_account_email + self_.prefix = prefix diff --git a/src/datadog_api_client/v2/model/cloud_inventory_sync_config_aws_request_attributes.py b/src/datadog_api_client/v2/model/cloud_inventory_sync_config_aws_request_attributes.py new file mode 100644 index 0000000000..70bdf34f8b --- /dev/null +++ b/src/datadog_api_client/v2/model/cloud_inventory_sync_config_aws_request_attributes.py @@ -0,0 +1,62 @@ +# 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 Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class CloudInventorySyncConfigAWSRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "aws_account_id": (str,), + "destination_bucket_name": (str,), + "destination_bucket_region": (str,), + "destination_prefix": (str,), + } + + attribute_map = { + "aws_account_id": "aws_account_id", + "destination_bucket_name": "destination_bucket_name", + "destination_bucket_region": "destination_bucket_region", + "destination_prefix": "destination_prefix", + } + + def __init__( + self_, + aws_account_id: str, + destination_bucket_name: str, + destination_bucket_region: str, + destination_prefix: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + AWS settings for the customer bucket that stores inventory reports. + + :param aws_account_id: AWS account ID that owns the inventory bucket. + :type aws_account_id: str + + :param destination_bucket_name: Name of the S3 bucket containing inventory files. + :type destination_bucket_name: str + + :param destination_bucket_region: AWS Region of the inventory bucket. + :type destination_bucket_region: str + + :param destination_prefix: Optional object key prefix for inventory files. Use ``/`` or omit for the entire bucket. + :type destination_prefix: str, optional + """ + if destination_prefix is not unset: + kwargs["destination_prefix"] = destination_prefix + super().__init__(kwargs) + + self_.aws_account_id = aws_account_id + self_.destination_bucket_name = destination_bucket_name + self_.destination_bucket_region = destination_bucket_region diff --git a/src/datadog_api_client/v2/model/cloud_inventory_sync_config_azure_request_attributes.py b/src/datadog_api_client/v2/model/cloud_inventory_sync_config_azure_request_attributes.py new file mode 100644 index 0000000000..6cdea7ce0f --- /dev/null +++ b/src/datadog_api_client/v2/model/cloud_inventory_sync_config_azure_request_attributes.py @@ -0,0 +1,72 @@ +# 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 CloudInventorySyncConfigAzureRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "client_id": (str,), + "container": (str,), + "resource_group": (str,), + "storage_account": (str,), + "subscription_id": (str,), + "tenant_id": (str,), + } + + attribute_map = { + "client_id": "client_id", + "container": "container", + "resource_group": "resource_group", + "storage_account": "storage_account", + "subscription_id": "subscription_id", + "tenant_id": "tenant_id", + } + + def __init__( + self_, + client_id: str, + container: str, + resource_group: str, + storage_account: str, + subscription_id: str, + tenant_id: str, + **kwargs, + ): + """ + Azure settings for the storage account and container with inventory data. + + :param client_id: Azure AD application (client) ID used for access. + :type client_id: str + + :param container: Blob container name. + :type container: str + + :param resource_group: Resource group containing the storage account. + :type resource_group: str + + :param storage_account: Storage account name. + :type storage_account: str + + :param subscription_id: Azure subscription ID. + :type subscription_id: str + + :param tenant_id: Azure AD tenant ID. + :type tenant_id: str + """ + super().__init__(kwargs) + + self_.client_id = client_id + self_.container = container + self_.resource_group = resource_group + self_.storage_account = storage_account + self_.subscription_id = subscription_id + self_.tenant_id = tenant_id diff --git a/src/datadog_api_client/v2/model/cloud_inventory_sync_config_gcp_request_attributes.py b/src/datadog_api_client/v2/model/cloud_inventory_sync_config_gcp_request_attributes.py new file mode 100644 index 0000000000..9b237adb36 --- /dev/null +++ b/src/datadog_api_client/v2/model/cloud_inventory_sync_config_gcp_request_attributes.py @@ -0,0 +1,58 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class CloudInventorySyncConfigGCPRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "destination_bucket_name": (str,), + "project_id": (str,), + "service_account_email": (str,), + "source_bucket_name": (str,), + } + + attribute_map = { + "destination_bucket_name": "destination_bucket_name", + "project_id": "project_id", + "service_account_email": "service_account_email", + "source_bucket_name": "source_bucket_name", + } + + def __init__( + self_, + destination_bucket_name: str, + project_id: str, + service_account_email: str, + source_bucket_name: str, + **kwargs, + ): + """ + GCP settings for buckets involved in inventory reporting. + + :param destination_bucket_name: GCS bucket name where Datadog reads inventory reports. + :type destination_bucket_name: str + + :param project_id: GCP project ID for the inventory destination bucket. + :type project_id: str + + :param service_account_email: Service account email used to read the destination bucket. + :type service_account_email: str + + :param source_bucket_name: GCS bucket name that inventory reports are generated for. + :type source_bucket_name: str + """ + super().__init__(kwargs) + + self_.destination_bucket_name = destination_bucket_name + self_.project_id = project_id + self_.service_account_email = service_account_email + self_.source_bucket_name = source_bucket_name diff --git a/src/datadog_api_client/v2/model/cloud_inventory_sync_config_resource_type.py b/src/datadog_api_client/v2/model/cloud_inventory_sync_config_resource_type.py new file mode 100644 index 0000000000..73d3d8eed1 --- /dev/null +++ b/src/datadog_api_client/v2/model/cloud_inventory_sync_config_resource_type.py @@ -0,0 +1,35 @@ +# 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 ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class CloudInventorySyncConfigResourceType(ModelSimple): + """ + JSON:API type for sync configuration resources. + + :param value: If omitted defaults to "sync_configs". Must be one of ["sync_configs"]. + :type value: str + """ + + allowed_values = { + "sync_configs", + } + SYNC_CONFIGS: ClassVar["CloudInventorySyncConfigResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +CloudInventorySyncConfigResourceType.SYNC_CONFIGS = CloudInventorySyncConfigResourceType("sync_configs") diff --git a/src/datadog_api_client/v2/model/cloud_inventory_sync_config_response.py b/src/datadog_api_client/v2/model/cloud_inventory_sync_config_response.py new file mode 100644 index 0000000000..14b0f7848e --- /dev/null +++ b/src/datadog_api_client/v2/model/cloud_inventory_sync_config_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.cloud_inventory_sync_config_response_data import ( + CloudInventorySyncConfigResponseData, + ) + + +class CloudInventorySyncConfigResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.cloud_inventory_sync_config_response_data import ( + CloudInventorySyncConfigResponseData, + ) + + return { + "data": (CloudInventorySyncConfigResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: CloudInventorySyncConfigResponseData, **kwargs): + """ + Response containing the upserted sync configuration. Additional read-only fields appear on list and get. + + :param data: JSON:API data object for a sync configuration. + :type data: CloudInventorySyncConfigResponseData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/cloud_inventory_sync_config_response_data.py b/src/datadog_api_client/v2/model/cloud_inventory_sync_config_response_data.py new file mode 100644 index 0000000000..58f9644441 --- /dev/null +++ b/src/datadog_api_client/v2/model/cloud_inventory_sync_config_response_data.py @@ -0,0 +1,66 @@ +# 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.cloud_inventory_sync_config_attributes import CloudInventorySyncConfigAttributes + from datadog_api_client.v2.model.cloud_inventory_sync_config_resource_type import ( + CloudInventorySyncConfigResourceType, + ) + + +class CloudInventorySyncConfigResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.cloud_inventory_sync_config_attributes import ( + CloudInventorySyncConfigAttributes, + ) + from datadog_api_client.v2.model.cloud_inventory_sync_config_resource_type import ( + CloudInventorySyncConfigResourceType, + ) + + return { + "attributes": (CloudInventorySyncConfigAttributes,), + "id": (str,), + "type": (CloudInventorySyncConfigResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: CloudInventorySyncConfigAttributes, + id: str, + type: CloudInventorySyncConfigResourceType, + **kwargs, + ): + """ + JSON:API data object for a sync configuration. + + :param attributes: Attributes for a cloud inventory sync configuration. Values beyond ``id`` may be omitted immediately after upsert. + :type attributes: CloudInventorySyncConfigAttributes + + :param id: Unique identifier for the recurring sync configuration. + :type id: str + + :param type: JSON:API type for sync configuration resources. + :type type: CloudInventorySyncConfigResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/upsert_cloud_inventory_sync_config_request.py b/src/datadog_api_client/v2/model/upsert_cloud_inventory_sync_config_request.py new file mode 100644 index 0000000000..86f3f114c4 --- /dev/null +++ b/src/datadog_api_client/v2/model/upsert_cloud_inventory_sync_config_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.upsert_cloud_inventory_sync_config_request_data import ( + UpsertCloudInventorySyncConfigRequestData, + ) + + +class UpsertCloudInventorySyncConfigRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.upsert_cloud_inventory_sync_config_request_data import ( + UpsertCloudInventorySyncConfigRequestData, + ) + + return { + "data": (UpsertCloudInventorySyncConfigRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: UpsertCloudInventorySyncConfigRequestData, **kwargs): + """ + Request body for creating or updating a cloud inventory sync configuration. + + :param data: JSON:API data envelope for an upsert sync configuration request. + :type data: UpsertCloudInventorySyncConfigRequestData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/upsert_cloud_inventory_sync_config_request_attributes.py b/src/datadog_api_client/v2/model/upsert_cloud_inventory_sync_config_request_attributes.py new file mode 100644 index 0000000000..107527ac59 --- /dev/null +++ b/src/datadog_api_client/v2/model/upsert_cloud_inventory_sync_config_request_attributes.py @@ -0,0 +1,78 @@ +# 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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.cloud_inventory_sync_config_aws_request_attributes import ( + CloudInventorySyncConfigAWSRequestAttributes, + ) + from datadog_api_client.v2.model.cloud_inventory_sync_config_azure_request_attributes import ( + CloudInventorySyncConfigAzureRequestAttributes, + ) + from datadog_api_client.v2.model.cloud_inventory_sync_config_gcp_request_attributes import ( + CloudInventorySyncConfigGCPRequestAttributes, + ) + + +class UpsertCloudInventorySyncConfigRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.cloud_inventory_sync_config_aws_request_attributes import ( + CloudInventorySyncConfigAWSRequestAttributes, + ) + from datadog_api_client.v2.model.cloud_inventory_sync_config_azure_request_attributes import ( + CloudInventorySyncConfigAzureRequestAttributes, + ) + from datadog_api_client.v2.model.cloud_inventory_sync_config_gcp_request_attributes import ( + CloudInventorySyncConfigGCPRequestAttributes, + ) + + return { + "aws": (CloudInventorySyncConfigAWSRequestAttributes,), + "azure": (CloudInventorySyncConfigAzureRequestAttributes,), + "gcp": (CloudInventorySyncConfigGCPRequestAttributes,), + } + + attribute_map = { + "aws": "aws", + "azure": "azure", + "gcp": "gcp", + } + + def __init__( + self_, + aws: Union[CloudInventorySyncConfigAWSRequestAttributes, UnsetType] = unset, + azure: Union[CloudInventorySyncConfigAzureRequestAttributes, UnsetType] = unset, + gcp: Union[CloudInventorySyncConfigGCPRequestAttributes, UnsetType] = unset, + **kwargs, + ): + """ + Provider-specific configuration. Include the object that matches ``data.id`` ( ``aws`` , ``gcp`` , or ``azure`` ). + + :param aws: AWS settings for the customer bucket that stores inventory reports. + :type aws: CloudInventorySyncConfigAWSRequestAttributes, optional + + :param azure: Azure settings for the storage account and container with inventory data. + :type azure: CloudInventorySyncConfigAzureRequestAttributes, optional + + :param gcp: GCP settings for buckets involved in inventory reporting. + :type gcp: CloudInventorySyncConfigGCPRequestAttributes, optional + """ + if aws is not unset: + kwargs["aws"] = aws + if azure is not unset: + kwargs["azure"] = azure + if gcp is not unset: + kwargs["gcp"] = gcp + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/upsert_cloud_inventory_sync_config_request_data.py b/src/datadog_api_client/v2/model/upsert_cloud_inventory_sync_config_request_data.py new file mode 100644 index 0000000000..87e41c0723 --- /dev/null +++ b/src/datadog_api_client/v2/model/upsert_cloud_inventory_sync_config_request_data.py @@ -0,0 +1,70 @@ +# 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.upsert_cloud_inventory_sync_config_request_attributes import ( + UpsertCloudInventorySyncConfigRequestAttributes, + ) + from datadog_api_client.v2.model.cloud_inventory_cloud_provider_id import CloudInventoryCloudProviderId + from datadog_api_client.v2.model.cloud_inventory_cloud_provider_request_type import ( + CloudInventoryCloudProviderRequestType, + ) + + +class UpsertCloudInventorySyncConfigRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.upsert_cloud_inventory_sync_config_request_attributes import ( + UpsertCloudInventorySyncConfigRequestAttributes, + ) + from datadog_api_client.v2.model.cloud_inventory_cloud_provider_id import CloudInventoryCloudProviderId + from datadog_api_client.v2.model.cloud_inventory_cloud_provider_request_type import ( + CloudInventoryCloudProviderRequestType, + ) + + return { + "attributes": (UpsertCloudInventorySyncConfigRequestAttributes,), + "id": (CloudInventoryCloudProviderId,), + "type": (CloudInventoryCloudProviderRequestType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: UpsertCloudInventorySyncConfigRequestAttributes, + id: CloudInventoryCloudProviderId, + type: CloudInventoryCloudProviderRequestType, + **kwargs, + ): + """ + JSON:API data envelope for an upsert sync configuration request. + + :param attributes: Provider-specific configuration. Include the object that matches ``data.id`` ( ``aws`` , ``gcp`` , or ``azure`` ). + :type attributes: UpsertCloudInventorySyncConfigRequestAttributes + + :param id: Cloud provider for this sync configuration ( ``aws`` , ``gcp`` , or ``azure`` ). For requests, must match the provider block supplied under ``attributes``. + :type id: CloudInventoryCloudProviderId + + :param type: JSON:API type for upsert sync configuration requests. + :type type: CloudInventoryCloudProviderRequestType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index e120b39440..75f28c1ac9 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -917,6 +917,23 @@ from datadog_api_client.v2.model.cloud_configuration_rule_options import CloudConfigurationRuleOptions from datadog_api_client.v2.model.cloud_configuration_rule_payload import CloudConfigurationRulePayload from datadog_api_client.v2.model.cloud_configuration_rule_type import CloudConfigurationRuleType +from datadog_api_client.v2.model.cloud_inventory_cloud_provider_id import CloudInventoryCloudProviderId +from datadog_api_client.v2.model.cloud_inventory_cloud_provider_request_type import ( + CloudInventoryCloudProviderRequestType, +) +from datadog_api_client.v2.model.cloud_inventory_sync_config_aws_request_attributes import ( + CloudInventorySyncConfigAWSRequestAttributes, +) +from datadog_api_client.v2.model.cloud_inventory_sync_config_attributes import CloudInventorySyncConfigAttributes +from datadog_api_client.v2.model.cloud_inventory_sync_config_azure_request_attributes import ( + CloudInventorySyncConfigAzureRequestAttributes, +) +from datadog_api_client.v2.model.cloud_inventory_sync_config_gcp_request_attributes import ( + CloudInventorySyncConfigGCPRequestAttributes, +) +from datadog_api_client.v2.model.cloud_inventory_sync_config_resource_type import CloudInventorySyncConfigResourceType +from datadog_api_client.v2.model.cloud_inventory_sync_config_response import CloudInventorySyncConfigResponse +from datadog_api_client.v2.model.cloud_inventory_sync_config_response_data import CloudInventorySyncConfigResponseData from datadog_api_client.v2.model.cloud_workload_security_agent_policies_list_response import ( CloudWorkloadSecurityAgentPoliciesListResponse, ) @@ -7295,6 +7312,13 @@ ) from datadog_api_client.v2.model.upsert_catalog_kind_request import UpsertCatalogKindRequest from datadog_api_client.v2.model.upsert_catalog_kind_response import UpsertCatalogKindResponse +from datadog_api_client.v2.model.upsert_cloud_inventory_sync_config_request import UpsertCloudInventorySyncConfigRequest +from datadog_api_client.v2.model.upsert_cloud_inventory_sync_config_request_attributes import ( + UpsertCloudInventorySyncConfigRequestAttributes, +) +from datadog_api_client.v2.model.upsert_cloud_inventory_sync_config_request_data import ( + UpsertCloudInventorySyncConfigRequestData, +) from datadog_api_client.v2.model.urgency import Urgency from datadog_api_client.v2.model.url_param import UrlParam from datadog_api_client.v2.model.url_param_update import UrlParamUpdate @@ -8168,6 +8192,15 @@ "CloudConfigurationRuleOptions", "CloudConfigurationRulePayload", "CloudConfigurationRuleType", + "CloudInventoryCloudProviderId", + "CloudInventoryCloudProviderRequestType", + "CloudInventorySyncConfigAWSRequestAttributes", + "CloudInventorySyncConfigAttributes", + "CloudInventorySyncConfigAzureRequestAttributes", + "CloudInventorySyncConfigGCPRequestAttributes", + "CloudInventorySyncConfigResourceType", + "CloudInventorySyncConfigResponse", + "CloudInventorySyncConfigResponseData", "CloudWorkloadSecurityAgentPoliciesListResponse", "CloudWorkloadSecurityAgentPolicyAttributes", "CloudWorkloadSecurityAgentPolicyCreateAttributes", @@ -12566,6 +12599,9 @@ "UpsertCatalogEntityResponseIncludedItem", "UpsertCatalogKindRequest", "UpsertCatalogKindResponse", + "UpsertCloudInventorySyncConfigRequest", + "UpsertCloudInventorySyncConfigRequestAttributes", + "UpsertCloudInventorySyncConfigRequestData", "Urgency", "UrlParam", "UrlParamUpdate", diff --git a/tests/v2/features/cloud_inventory_sync_configs.feature b/tests/v2/features/cloud_inventory_sync_configs.feature new file mode 100644 index 0000000000..32a7d292ef --- /dev/null +++ b/tests/v2/features/cloud_inventory_sync_configs.feature @@ -0,0 +1,22 @@ +@endpoint(cloud-inventory-sync-configs) @endpoint(cloud-inventory-sync-configs-v2) +Feature: Cloud Inventory Sync Configs + Configure cloud inventory file synchronization from your cloud storage to + Datadog. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "CloudInventorySyncConfigs" API + And operation "UpsertSyncConfig" enabled + And new "UpsertSyncConfig" request + And body with value {"data": {"attributes": {"aws": {"aws_account_id": "123456789012", "destination_bucket_name": "my-inventory-bucket", "destination_bucket_region": "us-east-1", "destination_prefix": "logs/"}, "azure": {"client_id": "11111111-1111-1111-1111-111111111111", "container": "inventory-container", "resource_group": "my-resource-group", "storage_account": "mystorageaccount", "subscription_id": "33333333-3333-3333-3333-333333333333", "tenant_id": "22222222-2222-2222-2222-222222222222"}, "gcp": {"destination_bucket_name": "my-inventory-reports", "project_id": "my-gcp-project", "service_account_email": "reader@my-gcp-project.iam.gserviceaccount.com", "source_bucket_name": "my-monitored-bucket"}}, "id": "aws", "type": "cloud_provider"}} + + @generated @skip @team:DataDog/storage-management + Scenario: Create or update a sync configuration returns "Bad Request" response + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/storage-management + Scenario: Create or update a sync configuration returns "OK" response + 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 f606e4a865..4d694af5be 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -1235,6 +1235,12 @@ "type": "idempotent" } }, + "UpsertSyncConfig": { + "tag": "Cloud Inventory Sync Configs", + "undo": { + "type": "idempotent" + } + }, "GetCodeCoverageBranchSummary": { "tag": "Code Coverage", "undo": {