diff --git a/.apigentools-info b/.apigentools-info
index 9a1b9e2de2..8e2b787cc4 100644
--- a/.apigentools-info
+++ b/.apigentools-info
@@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
- "regenerated": "2024-11-20 21:48:33.802103",
- "spec_repo_commit": "34905ccb"
+ "regenerated": "2024-11-21 20:23:40.544960",
+ "spec_repo_commit": "ad36259c"
},
"v2": {
"apigentools_version": "1.6.6",
- "regenerated": "2024-11-20 21:48:33.819731",
- "spec_repo_commit": "34905ccb"
+ "regenerated": "2024-11-21 20:23:40.562982",
+ "spec_repo_commit": "ad36259c"
}
}
}
\ No newline at end of file
diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml
index 91a7d81a16..33e7c854dd 100644
--- a/.generator/schemas/v2/openapi.yaml
+++ b/.generator/schemas/v2/openapi.yaml
@@ -4556,6 +4556,127 @@ components:
format: int64
type: integer
type: object
+ ChangeEventCustomAttributes:
+ description: Object representing custom change event attributes.
+ properties:
+ author:
+ $ref: '#/components/schemas/ChangeEventCustomAttributesAuthor'
+ change_metadata:
+ additionalProperties: {}
+ description: Free form object with information related to the `change` event.
+ Can be arbitrarily nested and contain any valid JSON.
+ example:
+ dd:
+ team: datadog_team
+ user_email: datadog@datadog.com
+ user_id: datadog_user_id
+ user_name: datadog_username
+ resource_link: datadog.com/feature/fallback_payments_test
+ type: object
+ changed_resource:
+ $ref: '#/components/schemas/ChangeEventCustomAttributesChangedResource'
+ impacted_resources:
+ description: 'A list of resources impacted by this change. It is recommended
+ to provide an impacted resource to display
+
+ the change event at the right location. Only resources of type `service`
+ are supported.'
+ example:
+ - name: payments_api
+ type: service
+ items:
+ $ref: '#/components/schemas/ChangeEventCustomAttributesImpactedResourcesItems'
+ type: array
+ new_value:
+ additionalProperties: {}
+ description: Free form object to track new value of the changed resource.
+ example:
+ enabled: true
+ percentage: 50%
+ rule:
+ datacenter: devcycle.us1.prod
+ type: object
+ prev_value:
+ additionalProperties: {}
+ description: Free form object to track previous value of the changed resource.
+ example:
+ enabled: true
+ percentage: 10%
+ rule:
+ datacenter: devcycle.us1.prod
+ type: object
+ required:
+ - changed_resource
+ type: object
+ ChangeEventCustomAttributesAuthor:
+ description: Object representing the entity which made the change. Optional
+ field but if provided should include `type` and `name`.
+ properties:
+ name:
+ description: Author's name. Limited to 128 characters.
+ example: datadog@datadog.com
+ maxLength: 128
+ type: string
+ type:
+ $ref: '#/components/schemas/ChangeEventCustomAttributesAuthorType'
+ required:
+ - name
+ - type
+ type: object
+ ChangeEventCustomAttributesAuthorType:
+ description: Author's type.
+ enum:
+ - user
+ - system
+ example: user
+ type: string
+ x-enum-varnames:
+ - USER
+ - SYSTEM
+ ChangeEventCustomAttributesChangedResource:
+ description: Object representing a uniquely identified resource. Only the resource
+ type `feature_flag` is supported.
+ properties:
+ name:
+ description: Resource's name.
+ example: fallback_payments_test
+ type: string
+ type:
+ $ref: '#/components/schemas/ChangeEventCustomAttributesChangedResourceType'
+ required:
+ - type
+ - name
+ type: object
+ ChangeEventCustomAttributesChangedResourceType:
+ description: Resource's type.
+ enum:
+ - feature_flag
+ example: feature_flag
+ type: string
+ x-enum-varnames:
+ - FEATURE_FLAG
+ ChangeEventCustomAttributesImpactedResourcesItems:
+ description: Object representing a uniquely identified resource. Only the resource
+ type `service` is supported.
+ properties:
+ name:
+ description: Resource's name.
+ example: payments_api
+ type: string
+ type:
+ $ref: '#/components/schemas/ChangeEventCustomAttributesImpactedResourcesItemsType'
+ required:
+ - type
+ - name
+ type: object
+ ChangeEventCustomAttributesImpactedResourcesItemsType:
+ description: Resource's type.
+ enum:
+ - service
+ example: service
+ type: string
+ x-enum-varnames:
+ - SERVICE
ChargebackBreakdown:
description: Charges breakdown.
properties:
@@ -9335,6 +9456,125 @@ components:
example: Oh boy!
type: string
type: object
+ EventCategory:
+ description: Event category to identify the type of event. Only the value `change`
+ is supported. Support for other categories are coming. please reach out to
+ datadog support if you're interested.
+ enum:
+ - change
+ example: change
+ type: string
+ x-enum-varnames:
+ - CHANGE
+ EventCreateRequest:
+ description: Object representing an event creation request.
+ properties:
+ attributes:
+ $ref: '#/components/schemas/EventPayload'
+ type:
+ $ref: '#/components/schemas/EventCreateRequestType'
+ type: object
+ EventCreateRequestPayload:
+ description: Payload for creating an event.
+ properties:
+ data:
+ $ref: '#/components/schemas/EventCreateRequest'
+ type: object
+ EventCreateRequestType:
+ description: Entity type.
+ enum:
+ - event
+ example: event
+ type: string
+ x-enum-varnames:
+ - EVENT
+ EventCreateResponse:
+ description: Object containing an event response.
+ properties:
+ attributes:
+ $ref: '#/components/schemas/EventCreateResponseAttributes'
+ type:
+ description: Event type
+ example: event
+ type: string
+ type: object
+ EventCreateResponseAttributes:
+ description: JSON object containing all events attributes and their associated
+ values.
+ properties:
+ attributes:
+ $ref: '#/components/schemas/EventCreateResponseAttributesAttributes'
+ type: object
+ EventCreateResponseAttributesAttributes:
+ description: JSON object of attributes from your events.
+ properties:
+ evt:
+ $ref: '#/components/schemas/EventCreateResponseAttributesAttributesEvt'
+ type: object
+ EventCreateResponseAttributesAttributesEvt:
+ description: JSON object of event system attributes.
+ properties:
+ id:
+ description: Event id
+ type: string
+ type: object
+ EventCreateResponsePayload:
+ description: Response containing information about created event.
+ properties:
+ data:
+ $ref: '#/components/schemas/EventCreateResponse'
+ type: object
+ EventPayload:
+ description: Event attributes.
+ properties:
+ aggregation_key:
+ description: An arbitrary string to use for aggregation when correlating
+ events. Limited to 100 characters.
+ maxLength: 100
+ type: string
+ attributes:
+ $ref: '#/components/schemas/EventPayloadAttributes'
+ category:
+ $ref: '#/components/schemas/EventCategory'
+ message:
+ description: The body of the event. Limited to 4000 characters.
+ example: payment_processed feature flag has been enabled
+ maxLength: 4000
+ type: string
+ tags:
+ description: 'A list of tags to apply to the event.
+
+ Refer to [Tags docs](https://docs.datadoghq.com/getting_started/tagging/).'
+ example:
+ - environment:test
+ items:
+ description: A tag.
+ type: string
+ type: array
+ timestamp:
+ description: 'Timestamp when the event occurred. Must follow [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)
+ format.
+
+ For example `"2017-01-15T01:30:15.010000Z"`.
+
+ Defaults to the timestamp of receipt. Limited to values no older than
+ 18 hours.'
+ type: string
+ title:
+ description: The event title. Limited to 500 characters.
+ example: payment_processed feature flag updated
+ maxLength: 500
+ type: string
+ required:
+ - title
+ - category
+ - attributes
+ type: object
+ EventPayloadAttributes:
+ description: JSON object for custom attributes. Schema are different per each
+ event category.
+ oneOf:
+ - $ref: '#/components/schemas/ChangeEventCustomAttributes'
EventPriority:
description: The priority of the event's monitor. For example, `normal` or `low`.
enum:
@@ -31196,6 +31436,82 @@ paths:
operator: OR
permissions:
- events_read
+ post:
+ description: This endpoint allows you to post events. Only events with `change`
+ category are under General Availability.
+ operationId: CreateEvent
+ requestBody:
+ content:
+ application/json:
+ examples:
+ json-request-body:
+ value:
+ data:
+ attributes:
+ attributes:
+ author:
+ name: datadog@datadog.com
+ type: user
+ change_metadata:
+ dd:
+ team: datadog_team
+ user_email: datadog@datadog.com
+ user_id: datadog_user_id
+ user_name: datadog_username
+ resource_link: datadog.com/feature/fallback_payments_test
+ changed_resource:
+ name: fallback_payments_test
+ type: feature_flag
+ impacted_resources:
+ - name: payments_api
+ type: service
+ new_value:
+ enabled: true
+ percentage: 50%
+ rule:
+ datacenter: devcycle.us1.prod
+ prev_value:
+ enabled: true
+ percentage: 10%
+ rule:
+ datacenter: devcycle.us1.prod
+ category: change
+ message: payment_processed feature flag has been enabled
+ tags:
+ - environment:test
+ title: payment_processed feature flag updated
+ type: event
+ schema:
+ $ref: '#/components/schemas/EventCreateRequestPayload'
+ description: Event request object
+ required: true
+ responses:
+ '200':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/EventCreateResponsePayload'
+ description: OK
+ '400':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Bad request
+ '403':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: Forbidden
+ '429':
+ $ref: '#/components/responses/TooManyRequestsResponse'
+ security:
+ - apiKeyAuth: []
+ summary: Post an event
+ tags:
+ - Events
+ x-codegen-request-body-name: body
/api/v2/events/search:
post:
description: 'List endpoint returns events that match an events search query.
diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst
index 7c0eb4f23a..a0db60b751 100644
--- a/docs/datadog_api_client.v2.model.rst
+++ b/docs/datadog_api_client.v2.model.rst
@@ -1257,6 +1257,55 @@ datadog\_api\_client.v2.model.cases\_response\_meta\_pagination module
:members:
:show-inheritance:
+datadog\_api\_client.v2.model.change\_event\_custom\_attributes module
+----------------------------------------------------------------------
+
+.. automodule:: datadog_api_client.v2.model.change_event_custom_attributes
+ :members:
+ :show-inheritance:
+
+datadog\_api\_client.v2.model.change\_event\_custom\_attributes\_author module
+------------------------------------------------------------------------------
+
+.. automodule:: datadog_api_client.v2.model.change_event_custom_attributes_author
+ :members:
+ :show-inheritance:
+
+datadog\_api\_client.v2.model.change\_event\_custom\_attributes\_author\_type module
+------------------------------------------------------------------------------------
+
+.. automodule:: datadog_api_client.v2.model.change_event_custom_attributes_author_type
+ :members:
+ :show-inheritance:
+
+datadog\_api\_client.v2.model.change\_event\_custom\_attributes\_changed\_resource module
+-----------------------------------------------------------------------------------------
+
+.. automodule:: datadog_api_client.v2.model.change_event_custom_attributes_changed_resource
+ :members:
+ :show-inheritance:
+
+datadog\_api\_client.v2.model.change\_event\_custom\_attributes\_changed\_resource\_type module
+-----------------------------------------------------------------------------------------------
+
+.. automodule:: datadog_api_client.v2.model.change_event_custom_attributes_changed_resource_type
+ :members:
+ :show-inheritance:
+
+datadog\_api\_client.v2.model.change\_event\_custom\_attributes\_impacted\_resources\_items module
+--------------------------------------------------------------------------------------------------
+
+.. automodule:: datadog_api_client.v2.model.change_event_custom_attributes_impacted_resources_items
+ :members:
+ :show-inheritance:
+
+datadog\_api\_client.v2.model.change\_event\_custom\_attributes\_impacted\_resources\_items\_type module
+--------------------------------------------------------------------------------------------------------
+
+.. automodule:: datadog_api_client.v2.model.change_event_custom_attributes_impacted_resources_items_type
+ :members:
+ :show-inheritance:
+
datadog\_api\_client.v2.model.chargeback\_breakdown module
----------------------------------------------------------
@@ -3791,6 +3840,83 @@ datadog\_api\_client.v2.model.event\_attributes module
:members:
:show-inheritance:
+datadog\_api\_client.v2.model.event\_category module
+----------------------------------------------------
+
+.. automodule:: datadog_api_client.v2.model.event_category
+ :members:
+ :show-inheritance:
+
+datadog\_api\_client.v2.model.event\_create\_request module
+-----------------------------------------------------------
+
+.. automodule:: datadog_api_client.v2.model.event_create_request
+ :members:
+ :show-inheritance:
+
+datadog\_api\_client.v2.model.event\_create\_request\_payload module
+--------------------------------------------------------------------
+
+.. automodule:: datadog_api_client.v2.model.event_create_request_payload
+ :members:
+ :show-inheritance:
+
+datadog\_api\_client.v2.model.event\_create\_request\_type module
+-----------------------------------------------------------------
+
+.. automodule:: datadog_api_client.v2.model.event_create_request_type
+ :members:
+ :show-inheritance:
+
+datadog\_api\_client.v2.model.event\_create\_response module
+------------------------------------------------------------
+
+.. automodule:: datadog_api_client.v2.model.event_create_response
+ :members:
+ :show-inheritance:
+
+datadog\_api\_client.v2.model.event\_create\_response\_attributes module
+------------------------------------------------------------------------
+
+.. automodule:: datadog_api_client.v2.model.event_create_response_attributes
+ :members:
+ :show-inheritance:
+
+datadog\_api\_client.v2.model.event\_create\_response\_attributes\_attributes module
+------------------------------------------------------------------------------------
+
+.. automodule:: datadog_api_client.v2.model.event_create_response_attributes_attributes
+ :members:
+ :show-inheritance:
+
+datadog\_api\_client.v2.model.event\_create\_response\_attributes\_attributes\_evt module
+-----------------------------------------------------------------------------------------
+
+.. automodule:: datadog_api_client.v2.model.event_create_response_attributes_attributes_evt
+ :members:
+ :show-inheritance:
+
+datadog\_api\_client.v2.model.event\_create\_response\_payload module
+---------------------------------------------------------------------
+
+.. automodule:: datadog_api_client.v2.model.event_create_response_payload
+ :members:
+ :show-inheritance:
+
+datadog\_api\_client.v2.model.event\_payload module
+---------------------------------------------------
+
+.. automodule:: datadog_api_client.v2.model.event_payload
+ :members:
+ :show-inheritance:
+
+datadog\_api\_client.v2.model.event\_payload\_attributes module
+---------------------------------------------------------------
+
+.. automodule:: datadog_api_client.v2.model.event_payload_attributes
+ :members:
+ :show-inheritance:
+
datadog\_api\_client.v2.model.event\_priority module
----------------------------------------------------
diff --git a/examples/v2/events/CreateEvent.py b/examples/v2/events/CreateEvent.py
new file mode 100644
index 0000000000..c063063998
--- /dev/null
+++ b/examples/v2/events/CreateEvent.py
@@ -0,0 +1,78 @@
+"""
+Post an event returns "OK" response
+"""
+
+from datadog_api_client import ApiClient, Configuration
+from datadog_api_client.v2.api.events_api import EventsApi
+from datadog_api_client.v2.model.change_event_custom_attributes import ChangeEventCustomAttributes
+from datadog_api_client.v2.model.change_event_custom_attributes_author import ChangeEventCustomAttributesAuthor
+from datadog_api_client.v2.model.change_event_custom_attributes_author_type import ChangeEventCustomAttributesAuthorType
+from datadog_api_client.v2.model.change_event_custom_attributes_changed_resource import (
+ ChangeEventCustomAttributesChangedResource,
+)
+from datadog_api_client.v2.model.change_event_custom_attributes_changed_resource_type import (
+ ChangeEventCustomAttributesChangedResourceType,
+)
+from datadog_api_client.v2.model.change_event_custom_attributes_impacted_resources_items import (
+ ChangeEventCustomAttributesImpactedResourcesItems,
+)
+from datadog_api_client.v2.model.change_event_custom_attributes_impacted_resources_items_type import (
+ ChangeEventCustomAttributesImpactedResourcesItemsType,
+)
+from datadog_api_client.v2.model.event_category import EventCategory
+from datadog_api_client.v2.model.event_create_request import EventCreateRequest
+from datadog_api_client.v2.model.event_create_request_payload import EventCreateRequestPayload
+from datadog_api_client.v2.model.event_create_request_type import EventCreateRequestType
+from datadog_api_client.v2.model.event_payload import EventPayload
+
+body = EventCreateRequestPayload(
+ data=EventCreateRequest(
+ attributes=EventPayload(
+ attributes=ChangeEventCustomAttributes(
+ author=ChangeEventCustomAttributesAuthor(
+ name="datadog@datadog.com",
+ type=ChangeEventCustomAttributesAuthorType.USER,
+ ),
+ change_metadata=dict(
+ [
+ (
+ "dd",
+ "{'team': 'datadog_team', 'user_email': 'datadog@datadog.com', 'user_id': 'datadog_user_id', 'user_name': 'datadog_username'}",
+ ),
+ ("resource_link", "datadog.com/feature/fallback_payments_test"),
+ ]
+ ),
+ changed_resource=ChangeEventCustomAttributesChangedResource(
+ name="fallback_payments_test",
+ type=ChangeEventCustomAttributesChangedResourceType.FEATURE_FLAG,
+ ),
+ impacted_resources=[
+ ChangeEventCustomAttributesImpactedResourcesItems(
+ name="payments_api",
+ type=ChangeEventCustomAttributesImpactedResourcesItemsType.SERVICE,
+ ),
+ ],
+ new_value=dict(
+ [("enabled", "True"), ("percentage", "50%"), ("rule", "{'datacenter': 'devcycle.us1.prod'}")]
+ ),
+ prev_value=dict(
+ [("enabled", "True"), ("percentage", "10%"), ("rule", "{'datacenter': 'devcycle.us1.prod'}")]
+ ),
+ ),
+ category=EventCategory.CHANGE,
+ message="payment_processed feature flag has been enabled",
+ tags=[
+ "environment:test",
+ ],
+ title="payment_processed feature flag updated",
+ ),
+ type=EventCreateRequestType.EVENT,
+ ),
+)
+
+configuration = Configuration()
+with ApiClient(configuration) as api_client:
+ api_instance = EventsApi(api_client)
+ response = api_instance.create_event(body=body)
+
+ print(response)
diff --git a/src/datadog_api_client/v2/api/events_api.py b/src/datadog_api_client/v2/api/events_api.py
index b1c77507b8..28077594dd 100644
--- a/src/datadog_api_client/v2/api/events_api.py
+++ b/src/datadog_api_client/v2/api/events_api.py
@@ -17,6 +17,8 @@
from datadog_api_client.v2.model.events_list_response import EventsListResponse
from datadog_api_client.v2.model.events_sort import EventsSort
from datadog_api_client.v2.model.event_response import EventResponse
+from datadog_api_client.v2.model.event_create_response_payload import EventCreateResponsePayload
+from datadog_api_client.v2.model.event_create_request_payload import EventCreateRequestPayload
from datadog_api_client.v2.model.events_list_request import EventsListRequest
@@ -31,6 +33,26 @@ def __init__(self, api_client=None):
api_client = ApiClient(Configuration())
self.api_client = api_client
+ self._create_event_endpoint = _Endpoint(
+ settings={
+ "response_type": (EventCreateResponsePayload,),
+ "auth": ["apiKeyAuth"],
+ "endpoint_path": "/api/v2/events",
+ "operation_id": "create_event",
+ "http_method": "POST",
+ "version": "v2",
+ },
+ params_map={
+ "body": {
+ "required": True,
+ "openapi_types": (EventCreateRequestPayload,),
+ "location": "body",
+ },
+ },
+ headers_map={"accept": ["application/json"], "content_type": ["application/json"]},
+ api_client=api_client,
+ )
+
self._list_events_endpoint = _Endpoint(
settings={
"response_type": (EventsListResponse,),
@@ -100,6 +122,23 @@ def __init__(self, api_client=None):
api_client=api_client,
)
+ def create_event(
+ self,
+ body: EventCreateRequestPayload,
+ ) -> EventCreateResponsePayload:
+ """Post an event.
+
+ This endpoint allows you to post events. Only events with ``change`` category are under General Availability.
+
+ :param body: Event request object
+ :type body: EventCreateRequestPayload
+ :rtype: EventCreateResponsePayload
+ """
+ kwargs: Dict[str, Any] = {}
+ kwargs["body"] = body
+
+ return self._create_event_endpoint.call_with_http_info(**kwargs)
+
def list_events(
self,
*,
diff --git a/src/datadog_api_client/v2/model/change_event_custom_attributes.py b/src/datadog_api_client/v2/model/change_event_custom_attributes.py
new file mode 100644
index 0000000000..44b113a49b
--- /dev/null
+++ b/src/datadog_api_client/v2/model/change_event_custom_attributes.py
@@ -0,0 +1,148 @@
+# 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, List, Union, TYPE_CHECKING
+
+from datadog_api_client.model_utils import (
+ ModelNormal,
+ cached_property,
+ date,
+ datetime,
+ none_type,
+ unset,
+ UnsetType,
+ UUID,
+)
+
+
+if TYPE_CHECKING:
+ from datadog_api_client.v2.model.change_event_custom_attributes_author import ChangeEventCustomAttributesAuthor
+ from datadog_api_client.v2.model.change_event_custom_attributes_changed_resource import (
+ ChangeEventCustomAttributesChangedResource,
+ )
+ from datadog_api_client.v2.model.change_event_custom_attributes_impacted_resources_items import (
+ ChangeEventCustomAttributesImpactedResourcesItems,
+ )
+
+
+class ChangeEventCustomAttributes(ModelNormal):
+ @cached_property
+ def openapi_types(_):
+ from datadog_api_client.v2.model.change_event_custom_attributes_author import ChangeEventCustomAttributesAuthor
+ from datadog_api_client.v2.model.change_event_custom_attributes_changed_resource import (
+ ChangeEventCustomAttributesChangedResource,
+ )
+ from datadog_api_client.v2.model.change_event_custom_attributes_impacted_resources_items import (
+ ChangeEventCustomAttributesImpactedResourcesItems,
+ )
+
+ return {
+ "author": (ChangeEventCustomAttributesAuthor,),
+ "change_metadata": (
+ {
+ str: (
+ bool,
+ date,
+ datetime,
+ dict,
+ float,
+ int,
+ list,
+ str,
+ UUID,
+ none_type,
+ )
+ },
+ ),
+ "changed_resource": (ChangeEventCustomAttributesChangedResource,),
+ "impacted_resources": ([ChangeEventCustomAttributesImpactedResourcesItems],),
+ "new_value": (
+ {
+ str: (
+ bool,
+ date,
+ datetime,
+ dict,
+ float,
+ int,
+ list,
+ str,
+ UUID,
+ none_type,
+ )
+ },
+ ),
+ "prev_value": (
+ {
+ str: (
+ bool,
+ date,
+ datetime,
+ dict,
+ float,
+ int,
+ list,
+ str,
+ UUID,
+ none_type,
+ )
+ },
+ ),
+ }
+
+ attribute_map = {
+ "author": "author",
+ "change_metadata": "change_metadata",
+ "changed_resource": "changed_resource",
+ "impacted_resources": "impacted_resources",
+ "new_value": "new_value",
+ "prev_value": "prev_value",
+ }
+
+ def __init__(
+ self_,
+ changed_resource: ChangeEventCustomAttributesChangedResource,
+ author: Union[ChangeEventCustomAttributesAuthor, UnsetType] = unset,
+ change_metadata: Union[Dict[str, Any], UnsetType] = unset,
+ impacted_resources: Union[List[ChangeEventCustomAttributesImpactedResourcesItems], UnsetType] = unset,
+ new_value: Union[Dict[str, Any], UnsetType] = unset,
+ prev_value: Union[Dict[str, Any], UnsetType] = unset,
+ **kwargs,
+ ):
+ """
+ Object representing custom change event attributes.
+
+ :param author: Object representing the entity which made the change. Optional field but if provided should include ``type`` and ``name``.
+ :type author: ChangeEventCustomAttributesAuthor, optional
+
+ :param change_metadata: Free form object with information related to the ``change`` event. Can be arbitrarily nested and contain any valid JSON.
+ :type change_metadata: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, optional
+
+ :param changed_resource: Object representing a uniquely identified resource. Only the resource type ``feature_flag`` is supported.
+ :type changed_resource: ChangeEventCustomAttributesChangedResource
+
+ :param impacted_resources: A list of resources impacted by this change. It is recommended to provide an impacted resource to display
+ the change event at the right location. Only resources of type ``service`` are supported.
+ :type impacted_resources: [ChangeEventCustomAttributesImpactedResourcesItems], optional
+
+ :param new_value: Free form object to track new value of the changed resource.
+ :type new_value: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, optional
+
+ :param prev_value: Free form object to track previous value of the changed resource.
+ :type prev_value: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, optional
+ """
+ if author is not unset:
+ kwargs["author"] = author
+ if change_metadata is not unset:
+ kwargs["change_metadata"] = change_metadata
+ if impacted_resources is not unset:
+ kwargs["impacted_resources"] = impacted_resources
+ if new_value is not unset:
+ kwargs["new_value"] = new_value
+ if prev_value is not unset:
+ kwargs["prev_value"] = prev_value
+ super().__init__(kwargs)
+
+ self_.changed_resource = changed_resource
diff --git a/src/datadog_api_client/v2/model/change_event_custom_attributes_author.py b/src/datadog_api_client/v2/model/change_event_custom_attributes_author.py
new file mode 100644
index 0000000000..5bb1f4e8bc
--- /dev/null
+++ b/src/datadog_api_client/v2/model/change_event_custom_attributes_author.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 TYPE_CHECKING
+
+from datadog_api_client.model_utils import (
+ ModelNormal,
+ cached_property,
+)
+
+
+if TYPE_CHECKING:
+ from datadog_api_client.v2.model.change_event_custom_attributes_author_type import (
+ ChangeEventCustomAttributesAuthorType,
+ )
+
+
+class ChangeEventCustomAttributesAuthor(ModelNormal):
+ validations = {
+ "name": {
+ "max_length": 128,
+ },
+ }
+
+ @cached_property
+ def openapi_types(_):
+ from datadog_api_client.v2.model.change_event_custom_attributes_author_type import (
+ ChangeEventCustomAttributesAuthorType,
+ )
+
+ return {
+ "name": (str,),
+ "type": (ChangeEventCustomAttributesAuthorType,),
+ }
+
+ attribute_map = {
+ "name": "name",
+ "type": "type",
+ }
+
+ def __init__(self_, name: str, type: ChangeEventCustomAttributesAuthorType, **kwargs):
+ """
+ Object representing the entity which made the change. Optional field but if provided should include ``type`` and ``name``.
+
+ :param name: Author's name. Limited to 128 characters.
+ :type name: str
+
+ :param type: Author's type.
+ :type type: ChangeEventCustomAttributesAuthorType
+ """
+ super().__init__(kwargs)
+
+ self_.name = name
+ self_.type = type
diff --git a/src/datadog_api_client/v2/model/change_event_custom_attributes_author_type.py b/src/datadog_api_client/v2/model/change_event_custom_attributes_author_type.py
new file mode 100644
index 0000000000..290e179e6e
--- /dev/null
+++ b/src/datadog_api_client/v2/model/change_event_custom_attributes_author_type.py
@@ -0,0 +1,38 @@
+# 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 ChangeEventCustomAttributesAuthorType(ModelSimple):
+ """
+ Author's type.
+
+ :param value: Must be one of ["user", "system"].
+ :type value: str
+ """
+
+ allowed_values = {
+ "user",
+ "system",
+ }
+ USER: ClassVar["ChangeEventCustomAttributesAuthorType"]
+ SYSTEM: ClassVar["ChangeEventCustomAttributesAuthorType"]
+
+ @cached_property
+ def openapi_types(_):
+ return {
+ "value": (str,),
+ }
+
+
+ChangeEventCustomAttributesAuthorType.USER = ChangeEventCustomAttributesAuthorType("user")
+ChangeEventCustomAttributesAuthorType.SYSTEM = ChangeEventCustomAttributesAuthorType("system")
diff --git a/src/datadog_api_client/v2/model/change_event_custom_attributes_changed_resource.py b/src/datadog_api_client/v2/model/change_event_custom_attributes_changed_resource.py
new file mode 100644
index 0000000000..4137566eef
--- /dev/null
+++ b/src/datadog_api_client/v2/model/change_event_custom_attributes_changed_resource.py
@@ -0,0 +1,50 @@
+# 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.change_event_custom_attributes_changed_resource_type import (
+ ChangeEventCustomAttributesChangedResourceType,
+ )
+
+
+class ChangeEventCustomAttributesChangedResource(ModelNormal):
+ @cached_property
+ def openapi_types(_):
+ from datadog_api_client.v2.model.change_event_custom_attributes_changed_resource_type import (
+ ChangeEventCustomAttributesChangedResourceType,
+ )
+
+ return {
+ "name": (str,),
+ "type": (ChangeEventCustomAttributesChangedResourceType,),
+ }
+
+ attribute_map = {
+ "name": "name",
+ "type": "type",
+ }
+
+ def __init__(self_, name: str, type: ChangeEventCustomAttributesChangedResourceType, **kwargs):
+ """
+ Object representing a uniquely identified resource. Only the resource type ``feature_flag`` is supported.
+
+ :param name: Resource's name.
+ :type name: str
+
+ :param type: Resource's type.
+ :type type: ChangeEventCustomAttributesChangedResourceType
+ """
+ super().__init__(kwargs)
+
+ self_.name = name
+ self_.type = type
diff --git a/src/datadog_api_client/v2/model/change_event_custom_attributes_changed_resource_type.py b/src/datadog_api_client/v2/model/change_event_custom_attributes_changed_resource_type.py
new file mode 100644
index 0000000000..1d0d4aa6bc
--- /dev/null
+++ b/src/datadog_api_client/v2/model/change_event_custom_attributes_changed_resource_type.py
@@ -0,0 +1,37 @@
+# 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 ChangeEventCustomAttributesChangedResourceType(ModelSimple):
+ """
+ Resource's type.
+
+ :param value: If omitted defaults to "feature_flag". Must be one of ["feature_flag"].
+ :type value: str
+ """
+
+ allowed_values = {
+ "feature_flag",
+ }
+ FEATURE_FLAG: ClassVar["ChangeEventCustomAttributesChangedResourceType"]
+
+ @cached_property
+ def openapi_types(_):
+ return {
+ "value": (str,),
+ }
+
+
+ChangeEventCustomAttributesChangedResourceType.FEATURE_FLAG = ChangeEventCustomAttributesChangedResourceType(
+ "feature_flag"
+)
diff --git a/src/datadog_api_client/v2/model/change_event_custom_attributes_impacted_resources_items.py b/src/datadog_api_client/v2/model/change_event_custom_attributes_impacted_resources_items.py
new file mode 100644
index 0000000000..129b7c01a9
--- /dev/null
+++ b/src/datadog_api_client/v2/model/change_event_custom_attributes_impacted_resources_items.py
@@ -0,0 +1,50 @@
+# 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.change_event_custom_attributes_impacted_resources_items_type import (
+ ChangeEventCustomAttributesImpactedResourcesItemsType,
+ )
+
+
+class ChangeEventCustomAttributesImpactedResourcesItems(ModelNormal):
+ @cached_property
+ def openapi_types(_):
+ from datadog_api_client.v2.model.change_event_custom_attributes_impacted_resources_items_type import (
+ ChangeEventCustomAttributesImpactedResourcesItemsType,
+ )
+
+ return {
+ "name": (str,),
+ "type": (ChangeEventCustomAttributesImpactedResourcesItemsType,),
+ }
+
+ attribute_map = {
+ "name": "name",
+ "type": "type",
+ }
+
+ def __init__(self_, name: str, type: ChangeEventCustomAttributesImpactedResourcesItemsType, **kwargs):
+ """
+ Object representing a uniquely identified resource. Only the resource type ``service`` is supported.
+
+ :param name: Resource's name.
+ :type name: str
+
+ :param type: Resource's type.
+ :type type: ChangeEventCustomAttributesImpactedResourcesItemsType
+ """
+ super().__init__(kwargs)
+
+ self_.name = name
+ self_.type = type
diff --git a/src/datadog_api_client/v2/model/change_event_custom_attributes_impacted_resources_items_type.py b/src/datadog_api_client/v2/model/change_event_custom_attributes_impacted_resources_items_type.py
new file mode 100644
index 0000000000..b020054bcb
--- /dev/null
+++ b/src/datadog_api_client/v2/model/change_event_custom_attributes_impacted_resources_items_type.py
@@ -0,0 +1,37 @@
+# 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 ChangeEventCustomAttributesImpactedResourcesItemsType(ModelSimple):
+ """
+ Resource's type.
+
+ :param value: If omitted defaults to "service". Must be one of ["service"].
+ :type value: str
+ """
+
+ allowed_values = {
+ "service",
+ }
+ SERVICE: ClassVar["ChangeEventCustomAttributesImpactedResourcesItemsType"]
+
+ @cached_property
+ def openapi_types(_):
+ return {
+ "value": (str,),
+ }
+
+
+ChangeEventCustomAttributesImpactedResourcesItemsType.SERVICE = ChangeEventCustomAttributesImpactedResourcesItemsType(
+ "service"
+)
diff --git a/src/datadog_api_client/v2/model/event_category.py b/src/datadog_api_client/v2/model/event_category.py
new file mode 100644
index 0000000000..9dc88b7cbd
--- /dev/null
+++ b/src/datadog_api_client/v2/model/event_category.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 EventCategory(ModelSimple):
+ """
+ Event category to identify the type of event. Only the value `change` is supported. Support for other categories are coming. please reach out to datadog support if you're interested.
+
+ :param value: If omitted defaults to "change". Must be one of ["change"].
+ :type value: str
+ """
+
+ allowed_values = {
+ "change",
+ }
+ CHANGE: ClassVar["EventCategory"]
+
+ @cached_property
+ def openapi_types(_):
+ return {
+ "value": (str,),
+ }
+
+
+EventCategory.CHANGE = EventCategory("change")
diff --git a/src/datadog_api_client/v2/model/event_create_request.py b/src/datadog_api_client/v2/model/event_create_request.py
new file mode 100644
index 0000000000..0c47ed1304
--- /dev/null
+++ b/src/datadog_api_client/v2/model/event_create_request.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, TYPE_CHECKING
+
+from datadog_api_client.model_utils import (
+ ModelNormal,
+ cached_property,
+ unset,
+ UnsetType,
+)
+
+
+if TYPE_CHECKING:
+ from datadog_api_client.v2.model.event_payload import EventPayload
+ from datadog_api_client.v2.model.event_create_request_type import EventCreateRequestType
+
+
+class EventCreateRequest(ModelNormal):
+ @cached_property
+ def openapi_types(_):
+ from datadog_api_client.v2.model.event_payload import EventPayload
+ from datadog_api_client.v2.model.event_create_request_type import EventCreateRequestType
+
+ return {
+ "attributes": (EventPayload,),
+ "type": (EventCreateRequestType,),
+ }
+
+ attribute_map = {
+ "attributes": "attributes",
+ "type": "type",
+ }
+
+ def __init__(
+ self_,
+ attributes: Union[EventPayload, UnsetType] = unset,
+ type: Union[EventCreateRequestType, UnsetType] = unset,
+ **kwargs,
+ ):
+ """
+ Object representing an event creation request.
+
+ :param attributes: Event attributes.
+ :type attributes: EventPayload, optional
+
+ :param type: Entity type.
+ :type type: EventCreateRequestType, optional
+ """
+ if attributes is not unset:
+ kwargs["attributes"] = attributes
+ if type is not unset:
+ kwargs["type"] = type
+ super().__init__(kwargs)
diff --git a/src/datadog_api_client/v2/model/event_create_request_payload.py b/src/datadog_api_client/v2/model/event_create_request_payload.py
new file mode 100644
index 0000000000..14b78c6a81
--- /dev/null
+++ b/src/datadog_api_client/v2/model/event_create_request_payload.py
@@ -0,0 +1,42 @@
+# 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.event_create_request import EventCreateRequest
+
+
+class EventCreateRequestPayload(ModelNormal):
+ @cached_property
+ def openapi_types(_):
+ from datadog_api_client.v2.model.event_create_request import EventCreateRequest
+
+ return {
+ "data": (EventCreateRequest,),
+ }
+
+ attribute_map = {
+ "data": "data",
+ }
+
+ def __init__(self_, data: Union[EventCreateRequest, UnsetType] = unset, **kwargs):
+ """
+ Payload for creating an event.
+
+ :param data: Object representing an event creation request.
+ :type data: EventCreateRequest, optional
+ """
+ if data is not unset:
+ kwargs["data"] = data
+ super().__init__(kwargs)
diff --git a/src/datadog_api_client/v2/model/event_create_request_type.py b/src/datadog_api_client/v2/model/event_create_request_type.py
new file mode 100644
index 0000000000..c892de246b
--- /dev/null
+++ b/src/datadog_api_client/v2/model/event_create_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 EventCreateRequestType(ModelSimple):
+ """
+ Entity type.
+
+ :param value: If omitted defaults to "event". Must be one of ["event"].
+ :type value: str
+ """
+
+ allowed_values = {
+ "event",
+ }
+ EVENT: ClassVar["EventCreateRequestType"]
+
+ @cached_property
+ def openapi_types(_):
+ return {
+ "value": (str,),
+ }
+
+
+EventCreateRequestType.EVENT = EventCreateRequestType("event")
diff --git a/src/datadog_api_client/v2/model/event_create_response.py b/src/datadog_api_client/v2/model/event_create_response.py
new file mode 100644
index 0000000000..08443fcaf2
--- /dev/null
+++ b/src/datadog_api_client/v2/model/event_create_response.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 Union, TYPE_CHECKING
+
+from datadog_api_client.model_utils import (
+ ModelNormal,
+ cached_property,
+ unset,
+ UnsetType,
+)
+
+
+if TYPE_CHECKING:
+ from datadog_api_client.v2.model.event_create_response_attributes import EventCreateResponseAttributes
+
+
+class EventCreateResponse(ModelNormal):
+ @cached_property
+ def openapi_types(_):
+ from datadog_api_client.v2.model.event_create_response_attributes import EventCreateResponseAttributes
+
+ return {
+ "attributes": (EventCreateResponseAttributes,),
+ "type": (str,),
+ }
+
+ attribute_map = {
+ "attributes": "attributes",
+ "type": "type",
+ }
+
+ def __init__(
+ self_,
+ attributes: Union[EventCreateResponseAttributes, UnsetType] = unset,
+ type: Union[str, UnsetType] = unset,
+ **kwargs,
+ ):
+ """
+ Object containing an event response.
+
+ :param attributes: JSON object containing all events attributes and their associated values.
+ :type attributes: EventCreateResponseAttributes, optional
+
+ :param type: Event type
+ :type type: str, optional
+ """
+ if attributes is not unset:
+ kwargs["attributes"] = attributes
+ if type is not unset:
+ kwargs["type"] = type
+ super().__init__(kwargs)
diff --git a/src/datadog_api_client/v2/model/event_create_response_attributes.py b/src/datadog_api_client/v2/model/event_create_response_attributes.py
new file mode 100644
index 0000000000..ec3a68a9fe
--- /dev/null
+++ b/src/datadog_api_client/v2/model/event_create_response_attributes.py
@@ -0,0 +1,46 @@
+# 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.event_create_response_attributes_attributes import (
+ EventCreateResponseAttributesAttributes,
+ )
+
+
+class EventCreateResponseAttributes(ModelNormal):
+ @cached_property
+ def openapi_types(_):
+ from datadog_api_client.v2.model.event_create_response_attributes_attributes import (
+ EventCreateResponseAttributesAttributes,
+ )
+
+ return {
+ "attributes": (EventCreateResponseAttributesAttributes,),
+ }
+
+ attribute_map = {
+ "attributes": "attributes",
+ }
+
+ def __init__(self_, attributes: Union[EventCreateResponseAttributesAttributes, UnsetType] = unset, **kwargs):
+ """
+ JSON object containing all events attributes and their associated values.
+
+ :param attributes: JSON object of attributes from your events.
+ :type attributes: EventCreateResponseAttributesAttributes, optional
+ """
+ if attributes is not unset:
+ kwargs["attributes"] = attributes
+ super().__init__(kwargs)
diff --git a/src/datadog_api_client/v2/model/event_create_response_attributes_attributes.py b/src/datadog_api_client/v2/model/event_create_response_attributes_attributes.py
new file mode 100644
index 0000000000..84adda5368
--- /dev/null
+++ b/src/datadog_api_client/v2/model/event_create_response_attributes_attributes.py
@@ -0,0 +1,46 @@
+# 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.event_create_response_attributes_attributes_evt import (
+ EventCreateResponseAttributesAttributesEvt,
+ )
+
+
+class EventCreateResponseAttributesAttributes(ModelNormal):
+ @cached_property
+ def openapi_types(_):
+ from datadog_api_client.v2.model.event_create_response_attributes_attributes_evt import (
+ EventCreateResponseAttributesAttributesEvt,
+ )
+
+ return {
+ "evt": (EventCreateResponseAttributesAttributesEvt,),
+ }
+
+ attribute_map = {
+ "evt": "evt",
+ }
+
+ def __init__(self_, evt: Union[EventCreateResponseAttributesAttributesEvt, UnsetType] = unset, **kwargs):
+ """
+ JSON object of attributes from your events.
+
+ :param evt: JSON object of event system attributes.
+ :type evt: EventCreateResponseAttributesAttributesEvt, optional
+ """
+ if evt is not unset:
+ kwargs["evt"] = evt
+ super().__init__(kwargs)
diff --git a/src/datadog_api_client/v2/model/event_create_response_attributes_attributes_evt.py b/src/datadog_api_client/v2/model/event_create_response_attributes_attributes_evt.py
new file mode 100644
index 0000000000..e61e67ddc0
--- /dev/null
+++ b/src/datadog_api_client/v2/model/event_create_response_attributes_attributes_evt.py
@@ -0,0 +1,36 @@
+# 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 EventCreateResponseAttributesAttributesEvt(ModelNormal):
+ @cached_property
+ def openapi_types(_):
+ return {
+ "id": (str,),
+ }
+
+ attribute_map = {
+ "id": "id",
+ }
+
+ def __init__(self_, id: Union[str, UnsetType] = unset, **kwargs):
+ """
+ JSON object of event system attributes.
+
+ :param id: Event id
+ :type id: str, optional
+ """
+ if id is not unset:
+ kwargs["id"] = id
+ super().__init__(kwargs)
diff --git a/src/datadog_api_client/v2/model/event_create_response_payload.py b/src/datadog_api_client/v2/model/event_create_response_payload.py
new file mode 100644
index 0000000000..e79410032a
--- /dev/null
+++ b/src/datadog_api_client/v2/model/event_create_response_payload.py
@@ -0,0 +1,42 @@
+# 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.event_create_response import EventCreateResponse
+
+
+class EventCreateResponsePayload(ModelNormal):
+ @cached_property
+ def openapi_types(_):
+ from datadog_api_client.v2.model.event_create_response import EventCreateResponse
+
+ return {
+ "data": (EventCreateResponse,),
+ }
+
+ attribute_map = {
+ "data": "data",
+ }
+
+ def __init__(self_, data: Union[EventCreateResponse, UnsetType] = unset, **kwargs):
+ """
+ Response containing information about created event.
+
+ :param data: Object containing an event response.
+ :type data: EventCreateResponse, optional
+ """
+ if data is not unset:
+ kwargs["data"] = data
+ super().__init__(kwargs)
diff --git a/src/datadog_api_client/v2/model/event_payload.py b/src/datadog_api_client/v2/model/event_payload.py
new file mode 100644
index 0000000000..39c97b1e1a
--- /dev/null
+++ b/src/datadog_api_client/v2/model/event_payload.py
@@ -0,0 +1,110 @@
+# 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.event_payload_attributes import EventPayloadAttributes
+ from datadog_api_client.v2.model.event_category import EventCategory
+ from datadog_api_client.v2.model.change_event_custom_attributes import ChangeEventCustomAttributes
+
+
+class EventPayload(ModelNormal):
+ validations = {
+ "aggregation_key": {
+ "max_length": 100,
+ },
+ "message": {
+ "max_length": 4000,
+ },
+ "title": {
+ "max_length": 500,
+ },
+ }
+
+ @cached_property
+ def openapi_types(_):
+ from datadog_api_client.v2.model.event_payload_attributes import EventPayloadAttributes
+ from datadog_api_client.v2.model.event_category import EventCategory
+
+ return {
+ "aggregation_key": (str,),
+ "attributes": (EventPayloadAttributes,),
+ "category": (EventCategory,),
+ "message": (str,),
+ "tags": ([str],),
+ "timestamp": (str,),
+ "title": (str,),
+ }
+
+ attribute_map = {
+ "aggregation_key": "aggregation_key",
+ "attributes": "attributes",
+ "category": "category",
+ "message": "message",
+ "tags": "tags",
+ "timestamp": "timestamp",
+ "title": "title",
+ }
+
+ def __init__(
+ self_,
+ attributes: Union[EventPayloadAttributes, ChangeEventCustomAttributes],
+ category: EventCategory,
+ title: str,
+ aggregation_key: Union[str, UnsetType] = unset,
+ message: Union[str, UnsetType] = unset,
+ tags: Union[List[str], UnsetType] = unset,
+ timestamp: Union[str, UnsetType] = unset,
+ **kwargs,
+ ):
+ """
+ Event attributes.
+
+ :param aggregation_key: An arbitrary string to use for aggregation when correlating events. Limited to 100 characters.
+ :type aggregation_key: str, optional
+
+ :param attributes: JSON object for custom attributes. Schema are different per each event category.
+ :type attributes: EventPayloadAttributes
+
+ :param category: Event category to identify the type of event. Only the value ``change`` is supported. Support for other categories are coming. please reach out to datadog support if you're interested.
+ :type category: EventCategory
+
+ :param message: The body of the event. Limited to 4000 characters.
+ :type message: str, optional
+
+ :param tags: A list of tags to apply to the event.
+ Refer to `Tags docs `_.
+ :type tags: [str], optional
+
+ :param timestamp: Timestamp when the event occurred. Must follow `ISO 8601 `_ format.
+ For example ``"2017-01-15T01:30:15.010000Z"``.
+ Defaults to the timestamp of receipt. Limited to values no older than 18 hours.
+ :type timestamp: str, optional
+
+ :param title: The event title. Limited to 500 characters.
+ :type title: str
+ """
+ if aggregation_key is not unset:
+ kwargs["aggregation_key"] = aggregation_key
+ if message is not unset:
+ kwargs["message"] = message
+ if tags is not unset:
+ kwargs["tags"] = tags
+ if timestamp is not unset:
+ kwargs["timestamp"] = timestamp
+ super().__init__(kwargs)
+
+ self_.attributes = attributes
+ self_.category = category
+ self_.title = title
diff --git a/src/datadog_api_client/v2/model/event_payload_attributes.py b/src/datadog_api_client/v2/model/event_payload_attributes.py
new file mode 100644
index 0000000000..9286a05618
--- /dev/null
+++ b/src/datadog_api_client/v2/model/event_payload_attributes.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 datadog_api_client.model_utils import (
+ ModelComposed,
+ cached_property,
+)
+
+
+class EventPayloadAttributes(ModelComposed):
+ def __init__(self, **kwargs):
+ """
+ JSON object for custom attributes. Schema are different per each event category.
+
+ :param author: Object representing the entity which made the change. Optional field but if provided should include `type` and `name`.
+ :type author: ChangeEventCustomAttributesAuthor, optional
+
+ :param change_metadata: Free form object with information related to the `change` event. Can be arbitrarily nested and contain any valid JSON.
+ :type change_metadata: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, optional
+
+ :param changed_resource: Object representing a uniquely identified resource. Only the resource type `feature_flag` is supported.
+ :type changed_resource: ChangeEventCustomAttributesChangedResource
+
+ :param impacted_resources: A list of resources impacted by this change. It is recommended to provide an impacted resource to display
+ the change event at the right location. Only resources of type `service` are supported.
+ :type impacted_resources: [ChangeEventCustomAttributesImpactedResourcesItems], optional
+
+ :param new_value: Free form object to track new value of the changed resource.
+ :type new_value: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, optional
+
+ :param prev_value: Free form object to track previous value of the changed resource.
+ :type prev_value: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, optional
+ """
+ super().__init__(kwargs)
+
+ @cached_property
+ def _composed_schemas(_):
+ # we need this here to make our import statements work
+ # we must store _composed_schemas in here so the code is only run
+ # when we invoke this method. If we kept this at the class
+ # level we would get an error because the class level
+ # code would be run when this module is imported, and these composed
+ # classes don't exist yet because their module has not finished
+ # loading
+ from datadog_api_client.v2.model.change_event_custom_attributes import ChangeEventCustomAttributes
+
+ return {
+ "oneOf": [
+ ChangeEventCustomAttributes,
+ ],
+ }
diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py
index 49f6934803..d3cadff35d 100644
--- a/src/datadog_api_client/v2/models/__init__.py
+++ b/src/datadog_api_client/v2/models/__init__.py
@@ -265,6 +265,21 @@
from datadog_api_client.v2.model.cases_response import CasesResponse
from datadog_api_client.v2.model.cases_response_meta import CasesResponseMeta
from datadog_api_client.v2.model.cases_response_meta_pagination import CasesResponseMetaPagination
+from datadog_api_client.v2.model.change_event_custom_attributes import ChangeEventCustomAttributes
+from datadog_api_client.v2.model.change_event_custom_attributes_author import ChangeEventCustomAttributesAuthor
+from datadog_api_client.v2.model.change_event_custom_attributes_author_type import ChangeEventCustomAttributesAuthorType
+from datadog_api_client.v2.model.change_event_custom_attributes_changed_resource import (
+ ChangeEventCustomAttributesChangedResource,
+)
+from datadog_api_client.v2.model.change_event_custom_attributes_changed_resource_type import (
+ ChangeEventCustomAttributesChangedResourceType,
+)
+from datadog_api_client.v2.model.change_event_custom_attributes_impacted_resources_items import (
+ ChangeEventCustomAttributesImpactedResourcesItems,
+)
+from datadog_api_client.v2.model.change_event_custom_attributes_impacted_resources_items_type import (
+ ChangeEventCustomAttributesImpactedResourcesItemsType,
+)
from datadog_api_client.v2.model.chargeback_breakdown import ChargebackBreakdown
from datadog_api_client.v2.model.cloud_configuration_compliance_rule_options import (
CloudConfigurationComplianceRuleOptions,
@@ -678,6 +693,21 @@
from datadog_api_client.v2.model.entity_v3_system_spec import EntityV3SystemSpec
from datadog_api_client.v2.model.event import Event
from datadog_api_client.v2.model.event_attributes import EventAttributes
+from datadog_api_client.v2.model.event_category import EventCategory
+from datadog_api_client.v2.model.event_create_request import EventCreateRequest
+from datadog_api_client.v2.model.event_create_request_payload import EventCreateRequestPayload
+from datadog_api_client.v2.model.event_create_request_type import EventCreateRequestType
+from datadog_api_client.v2.model.event_create_response import EventCreateResponse
+from datadog_api_client.v2.model.event_create_response_attributes import EventCreateResponseAttributes
+from datadog_api_client.v2.model.event_create_response_attributes_attributes import (
+ EventCreateResponseAttributesAttributes,
+)
+from datadog_api_client.v2.model.event_create_response_attributes_attributes_evt import (
+ EventCreateResponseAttributesAttributesEvt,
+)
+from datadog_api_client.v2.model.event_create_response_payload import EventCreateResponsePayload
+from datadog_api_client.v2.model.event_payload import EventPayload
+from datadog_api_client.v2.model.event_payload_attributes import EventPayloadAttributes
from datadog_api_client.v2.model.event_priority import EventPriority
from datadog_api_client.v2.model.event_response import EventResponse
from datadog_api_client.v2.model.event_response_attributes import EventResponseAttributes
@@ -2370,6 +2400,13 @@
"CasesResponse",
"CasesResponseMeta",
"CasesResponseMetaPagination",
+ "ChangeEventCustomAttributes",
+ "ChangeEventCustomAttributesAuthor",
+ "ChangeEventCustomAttributesAuthorType",
+ "ChangeEventCustomAttributesChangedResource",
+ "ChangeEventCustomAttributesChangedResourceType",
+ "ChangeEventCustomAttributesImpactedResourcesItems",
+ "ChangeEventCustomAttributesImpactedResourcesItemsType",
"ChargebackBreakdown",
"CloudConfigurationComplianceRuleOptions",
"CloudConfigurationRegoRule",
@@ -2663,6 +2700,17 @@
"EntityV3SystemSpec",
"Event",
"EventAttributes",
+ "EventCategory",
+ "EventCreateRequest",
+ "EventCreateRequestPayload",
+ "EventCreateRequestType",
+ "EventCreateResponse",
+ "EventCreateResponseAttributes",
+ "EventCreateResponseAttributesAttributes",
+ "EventCreateResponseAttributesAttributesEvt",
+ "EventCreateResponsePayload",
+ "EventPayload",
+ "EventPayloadAttributes",
"EventPriority",
"EventResponse",
"EventResponseAttributes",
diff --git a/tests/v2/features/events.feature b/tests/v2/features/events.feature
index 9a1c79072d..2013c242f6 100644
--- a/tests/v2/features/events.feature
+++ b/tests/v2/features/events.feature
@@ -7,24 +7,26 @@ Feature: Events
Background:
Given a valid "apiKeyAuth" key in the system
- And a valid "appKeyAuth" key in the system
And an instance of "Events" API
@generated @skip @team:DataDog/event-management
Scenario: Get a list of events returns "Bad Request" response
- Given new "ListEvents" request
+ Given a valid "appKeyAuth" key in the system
+ And new "ListEvents" request
When the request is sent
Then the response status is 400 Bad Request
@skip-validation @team:DataDog/event-management
Scenario: Get a list of events returns "OK" response
- Given new "ListEvents" request
+ Given a valid "appKeyAuth" key in the system
+ And new "ListEvents" request
When the request is sent
Then the response status is 200 OK
@replay-only @skip-validation @team:DataDog/event-management @with-pagination
Scenario: Get a list of events returns "OK" response with pagination
- Given new "ListEvents" request
+ Given a valid "appKeyAuth" key in the system
+ And new "ListEvents" request
And request contains "filter[from]" parameter with value "now-15m"
And request contains "filter[to]" parameter with value "now"
And request contains "page[limit]" parameter with value 2
@@ -34,7 +36,8 @@ Feature: Events
@team:DataDog/event-management
Scenario: Get a quick list of events returns "OK" response
- Given new "ListEvents" request
+ Given a valid "appKeyAuth" key in the system
+ And new "ListEvents" request
And request contains "filter[query]" parameter with value "datadog-agent"
And request contains "filter[from]" parameter with value "2020-09-17T11:48:36+01:00"
And request contains "filter[to]" parameter with value "2020-09-17T12:48:36+01:00"
@@ -43,16 +46,32 @@ Feature: Events
Then the response status is 200 OK
And the response "data" has length 0
+ @generated @skip @team:DataDog/event-management
+ Scenario: Post an event returns "Bad request" response
+ Given new "CreateEvent" request
+ And body with value {"data": {"attributes": {"attributes": {"author": {"name": "datadog@datadog.com", "type": "user"}, "change_metadata": {"dd": {"team": "datadog_team", "user_email": "datadog@datadog.com", "user_id": "datadog_user_id", "user_name": "datadog_username"}, "resource_link": "datadog.com/feature/fallback_payments_test"}, "changed_resource": {"name": "fallback_payments_test", "type": "feature_flag"}, "impacted_resources": [{"name": "payments_api", "type": "service"}], "new_value": {"enabled": true, "percentage": "50%", "rule": {"datacenter": "devcycle.us1.prod"}}, "prev_value": {"enabled": true, "percentage": "10%", "rule": {"datacenter": "devcycle.us1.prod"}}}, "category": "change", "message": "payment_processed feature flag has been enabled", "tags": ["environment:test"], "title": "payment_processed feature flag updated"}, "type": "event"}}
+ When the request is sent
+ Then the response status is 400 Bad request
+
+ @generated @skip @team:DataDog/event-management
+ Scenario: Post an event returns "OK" response
+ Given new "CreateEvent" request
+ And body with value {"data": {"attributes": {"attributes": {"author": {"name": "datadog@datadog.com", "type": "user"}, "change_metadata": {"dd": {"team": "datadog_team", "user_email": "datadog@datadog.com", "user_id": "datadog_user_id", "user_name": "datadog_username"}, "resource_link": "datadog.com/feature/fallback_payments_test"}, "changed_resource": {"name": "fallback_payments_test", "type": "feature_flag"}, "impacted_resources": [{"name": "payments_api", "type": "service"}], "new_value": {"enabled": true, "percentage": "50%", "rule": {"datacenter": "devcycle.us1.prod"}}, "prev_value": {"enabled": true, "percentage": "10%", "rule": {"datacenter": "devcycle.us1.prod"}}}, "category": "change", "message": "payment_processed feature flag has been enabled", "tags": ["environment:test"], "title": "payment_processed feature flag updated"}, "type": "event"}}
+ When the request is sent
+ Then the response status is 200 OK
+
@team:DataDog/event-management
Scenario: Search events returns "Bad Request" response
- Given new "SearchEvents" request
+ Given a valid "appKeyAuth" key in the system
+ And new "SearchEvents" request
And body with value {"filter": {"from": "now-15m", "query": "service:web* AND @http.status_code:[200 TO 299]", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"}
When the request is sent
Then the response status is 400 Bad Request
@team:DataDog/event-management
Scenario: Search events returns "OK" response
- Given new "SearchEvents" request
+ Given a valid "appKeyAuth" key in the system
+ And new "SearchEvents" request
And body with value {"filter": {"query": "datadog-agent", "from": "2020-09-17T11:48:36+01:00", "to": "2020-09-17T12:48:36+01:00"}, "sort": "timestamp", "page": {"limit": 5}}
When the request is sent
Then the response status is 200 OK
@@ -60,7 +79,8 @@ Feature: Events
@replay-only @skip-validation @team:DataDog/event-management @with-pagination
Scenario: Search events returns "OK" response with pagination
- Given new "SearchEvents" request
+ Given a valid "appKeyAuth" key in the system
+ And new "SearchEvents" request
And body with value {"filter": {"from": "now-15m", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"limit": 2}, "sort": "timestamp"}
When the request with pagination is sent
Then the response status is 200 OK
diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json
index dcb4deb9a7..91f554953b 100644
--- a/tests/v2/features/undo.json
+++ b/tests/v2/features/undo.json
@@ -608,6 +608,12 @@
"type": "safe"
}
},
+ "CreateEvent": {
+ "tag": "Events",
+ "undo": {
+ "type": "unsafe"
+ }
+ },
"SearchEvents": {
"tag": "Events",
"undo": {