diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 7a9926c3d3..cf0b7463a1 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -126140,6 +126140,41 @@ components: - type - attributes type: object + SecurityMonitoringBatchMigrationPublishError: + description: The reason why the resource could not be published. + properties: + code: + description: The error code returned on rule creation. + example: InvalidArgument + type: string + details: + description: The rule validation errors returned on rule creation. + items: + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationPublishErrorDetail" + type: array + message: + description: The error message. + example: Invalid rule configuration + type: string + required: + - message + type: object + SecurityMonitoringBatchMigrationPublishErrorDetail: + description: A rule validation error. + properties: + code: + description: The error code. + example: AlreadyExists + type: string + message: + description: The error message. + example: Rule name must be unique + type: string + target: + description: The rule field the error applies to. + example: name + type: string + type: object SecurityMonitoringBatchMigrationPublishRequest: description: Request to publish the resources of a batch migration. properties: @@ -126183,9 +126218,7 @@ components: description: Attributes of the publication outcome of a batch migration resource. properties: error: - description: The reason why the resource could not be published. - example: failed to create rule - type: string + $ref: "#/components/schemas/SecurityMonitoringBatchMigrationPublishError" ruleId: description: The ID of the created Cloud SIEM detection rule. example: abc-def-ghi @@ -249749,6 +249782,17 @@ paths: status: published id: c968cf83-56c2-4d54-a993-6c86dfb83527 type: batchMigrationPublishedResource + - attributes: + error: + code: InvalidArgument + details: + - code: AlreadyExists + message: Rule name must be unique + target: name + message: Invalid rule configuration + status: failed + id: 0b9d3f3e-2a4c-4e8b-9f1a-6d2c7e5b8a41 + type: batchMigrationPublishedResource schema: $ref: "#/components/schemas/SecurityMonitoringBatchMigrationPublishResponse" description: OK diff --git a/src/datadog_api_client/v2/model/security_monitoring_batch_migration_publish_error.py b/src/datadog_api_client/v2/model/security_monitoring_batch_migration_publish_error.py new file mode 100644 index 0000000000..219bfb7591 --- /dev/null +++ b/src/datadog_api_client/v2/model/security_monitoring_batch_migration_publish_error.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 List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.security_monitoring_batch_migration_publish_error_detail import ( + SecurityMonitoringBatchMigrationPublishErrorDetail, + ) + + +class SecurityMonitoringBatchMigrationPublishError(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.security_monitoring_batch_migration_publish_error_detail import ( + SecurityMonitoringBatchMigrationPublishErrorDetail, + ) + + return { + "code": (str,), + "details": ([SecurityMonitoringBatchMigrationPublishErrorDetail],), + "message": (str,), + } + + attribute_map = { + "code": "code", + "details": "details", + "message": "message", + } + + def __init__( + self_, + message: str, + code: Union[str, UnsetType] = unset, + details: Union[List[SecurityMonitoringBatchMigrationPublishErrorDetail], UnsetType] = unset, + **kwargs, + ): + """ + The reason why the resource could not be published. + + :param code: The error code returned on rule creation. + :type code: str, optional + + :param details: The rule validation errors returned on rule creation. + :type details: [SecurityMonitoringBatchMigrationPublishErrorDetail], optional + + :param message: The error message. + :type message: str + """ + if code is not unset: + kwargs["code"] = code + if details is not unset: + kwargs["details"] = details + super().__init__(kwargs) + + self_.message = message diff --git a/src/datadog_api_client/v2/model/security_monitoring_batch_migration_publish_error_detail.py b/src/datadog_api_client/v2/model/security_monitoring_batch_migration_publish_error_detail.py new file mode 100644 index 0000000000..68ecb96d40 --- /dev/null +++ b/src/datadog_api_client/v2/model/security_monitoring_batch_migration_publish_error_detail.py @@ -0,0 +1,56 @@ +# 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 SecurityMonitoringBatchMigrationPublishErrorDetail(ModelNormal): + @cached_property + def openapi_types(_): + return { + "code": (str,), + "message": (str,), + "target": (str,), + } + + attribute_map = { + "code": "code", + "message": "message", + "target": "target", + } + + def __init__( + self_, + code: Union[str, UnsetType] = unset, + message: Union[str, UnsetType] = unset, + target: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + A rule validation error. + + :param code: The error code. + :type code: str, optional + + :param message: The error message. + :type message: str, optional + + :param target: The rule field the error applies to. + :type target: str, optional + """ + if code is not unset: + kwargs["code"] = code + if message is not unset: + kwargs["message"] = message + if target is not unset: + kwargs["target"] = target + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/security_monitoring_batch_migration_published_resource_attributes.py b/src/datadog_api_client/v2/model/security_monitoring_batch_migration_published_resource_attributes.py index f028892764..3bd52beca0 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_batch_migration_published_resource_attributes.py +++ b/src/datadog_api_client/v2/model/security_monitoring_batch_migration_published_resource_attributes.py @@ -14,6 +14,9 @@ if TYPE_CHECKING: + from datadog_api_client.v2.model.security_monitoring_batch_migration_publish_error import ( + SecurityMonitoringBatchMigrationPublishError, + ) from datadog_api_client.v2.model.security_monitoring_batch_migration_published_resource_status import ( SecurityMonitoringBatchMigrationPublishedResourceStatus, ) @@ -22,12 +25,15 @@ class SecurityMonitoringBatchMigrationPublishedResourceAttributes(ModelNormal): @cached_property def openapi_types(_): + from datadog_api_client.v2.model.security_monitoring_batch_migration_publish_error import ( + SecurityMonitoringBatchMigrationPublishError, + ) from datadog_api_client.v2.model.security_monitoring_batch_migration_published_resource_status import ( SecurityMonitoringBatchMigrationPublishedResourceStatus, ) return { - "error": (str,), + "error": (SecurityMonitoringBatchMigrationPublishError,), "rule_id": (str,), "status": (SecurityMonitoringBatchMigrationPublishedResourceStatus,), } @@ -41,7 +47,7 @@ def openapi_types(_): def __init__( self_, status: SecurityMonitoringBatchMigrationPublishedResourceStatus, - error: Union[str, UnsetType] = unset, + error: Union[SecurityMonitoringBatchMigrationPublishError, UnsetType] = unset, rule_id: Union[str, UnsetType] = unset, **kwargs, ): @@ -49,7 +55,7 @@ def __init__( Attributes of the publication outcome of a batch migration resource. :param error: The reason why the resource could not be published. - :type error: str, optional + :type error: SecurityMonitoringBatchMigrationPublishError, optional :param rule_id: The ID of the created Cloud SIEM detection rule. :type rule_id: str, optional diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 24dc39251c..e2f9b0c848 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -10828,6 +10828,12 @@ from datadog_api_client.v2.model.security_monitoring_batch_migration_publish_data import ( SecurityMonitoringBatchMigrationPublishData, ) +from datadog_api_client.v2.model.security_monitoring_batch_migration_publish_error import ( + SecurityMonitoringBatchMigrationPublishError, +) +from datadog_api_client.v2.model.security_monitoring_batch_migration_publish_error_detail import ( + SecurityMonitoringBatchMigrationPublishErrorDetail, +) from datadog_api_client.v2.model.security_monitoring_batch_migration_publish_request import ( SecurityMonitoringBatchMigrationPublishRequest, ) @@ -21385,6 +21391,8 @@ "SecurityMonitoringBatchMigrationListMeta", "SecurityMonitoringBatchMigrationPublishAttributes", "SecurityMonitoringBatchMigrationPublishData", + "SecurityMonitoringBatchMigrationPublishError", + "SecurityMonitoringBatchMigrationPublishErrorDetail", "SecurityMonitoringBatchMigrationPublishRequest", "SecurityMonitoringBatchMigrationPublishResponse", "SecurityMonitoringBatchMigrationPublishType",