From d0cfb9ca5bec1bb44706e7aec7c5aca71671027f Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 23 Jun 2025 19:20:28 +0000 Subject: [PATCH] Regenerate client from commit 779f1def of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 575 ++---------------- api/datadog/configuration.go | 52 -- api/datadogV2/api_action_connection.go | 319 +--------- api/datadogV2/api_app_builder.go | 16 +- api/datadogV2/api_events.go | 10 +- api/datadogV2/api_workflow_automation.go | 16 +- api/datadogV2/doc.go | 4 - .../model_alert_event_custom_attributes.go | 209 ------- ...ert_event_custom_attributes_links_items.go | 163 ----- ..._custom_attributes_links_items_category.go | 68 --- ..._alert_event_custom_attributes_priority.go | 72 --- ...el_alert_event_custom_attributes_status.go | 68 --- .../model_app_key_registration_data.go | 148 ----- .../model_app_key_registration_data_type.go | 64 -- .../model_change_event_custom_attributes.go | 31 +- ...l_change_event_custom_attributes_author.go | 21 +- ...vent_custom_attributes_changed_resource.go | 23 +- ...custom_attributes_changed_resource_type.go | 2 +- ...tom_attributes_impacted_resources_items.go | 23 +- ...ttributes_impacted_resources_items_type.go | 2 +- api/datadogV2/model_event_category.go | 4 +- api/datadogV2/model_event_create_request.go | 80 +-- .../model_event_create_request_payload.go | 43 +- api/datadogV2/model_event_create_response.go | 6 +- .../model_event_create_response_attributes.go | 4 +- ...t_create_response_attributes_attributes.go | 2 +- ...eate_response_attributes_attributes_evt.go | 45 +- .../model_event_create_response_payload.go | 46 +- ...del_event_create_response_payload_links.go | 102 ---- api/datadogV2/model_event_payload.go | 82 +-- .../model_event_payload_attributes.go | 34 +- .../model_event_payload_integration_id.go | 64 -- ...model_get_app_key_registration_response.go | 111 ---- ...del_list_app_key_registrations_response.go | 146 ----- ...ist_app_key_registrations_response_meta.go | 137 ----- .../model_register_app_key_response.go | 111 ---- .../GetAppKeyRegistration.go | 29 - .../ListAppKeyRegistrations.go | 29 - .../v2/action-connection/RegisterAppKey.go | 29 - .../v2/action-connection/UnregisterAppKey.go | 25 - examples/v2/events/CreateEvent.go | 16 +- ...ration_returns_Bad_request_response.freeze | 1 - ...stration_returns_Bad_request_response.yaml | 20 - ...stration_returns_Not_found_response.freeze | 1 - ...gistration_returns_Not_found_response.yaml | 19 - ...ey_Registration_returns_OK_response.freeze | 1 - ..._Key_Registration_returns_OK_response.yaml | 19 - ...y_Registrations_returns_OK_response.freeze | 1 - ...Key_Registrations_returns_OK_response.yaml | 19 - ...pp_Key_returns_Bad_request_response.freeze | 1 - ..._App_Key_returns_Bad_request_response.yaml | 20 - ...ew_App_Key_returns_Created_response.freeze | 1 - ..._new_App_Key_returns_Created_response.yaml | 19 - ...pp_Key_returns_Bad_request_response.freeze | 1 - ..._App_Key_returns_Bad_request_response.yaml | 20 - ..._App_Key_returns_Not_found_response.freeze | 1 - ...an_App_Key_returns_Not_found_response.yaml | 19 - ..._event_returns_Bad_request_response.freeze | 1 - ...an_event_returns_Bad_request_response.yaml | 23 - ...o_Post_an_event_returns_OK_response.freeze | 1 - ...rio_Post_an_event_returns_OK_response.yaml | 22 - .../features/v2/action_connection.feature | 68 --- tests/scenarios/features/v2/events.feature | 12 +- tests/scenarios/features/v2/undo.json | 26 +- 65 files changed, 296 insertions(+), 3059 deletions(-) delete mode 100644 api/datadogV2/model_alert_event_custom_attributes.go delete mode 100644 api/datadogV2/model_alert_event_custom_attributes_links_items.go delete mode 100644 api/datadogV2/model_alert_event_custom_attributes_links_items_category.go delete mode 100644 api/datadogV2/model_alert_event_custom_attributes_priority.go delete mode 100644 api/datadogV2/model_alert_event_custom_attributes_status.go delete mode 100644 api/datadogV2/model_app_key_registration_data.go delete mode 100644 api/datadogV2/model_app_key_registration_data_type.go delete mode 100644 api/datadogV2/model_event_create_response_payload_links.go delete mode 100644 api/datadogV2/model_event_payload_integration_id.go delete mode 100644 api/datadogV2/model_get_app_key_registration_response.go delete mode 100644 api/datadogV2/model_list_app_key_registrations_response.go delete mode 100644 api/datadogV2/model_list_app_key_registrations_response_meta.go delete mode 100644 api/datadogV2/model_register_app_key_response.go delete mode 100644 examples/v2/action-connection/GetAppKeyRegistration.go delete mode 100644 examples/v2/action-connection/ListAppKeyRegistrations.go delete mode 100644 examples/v2/action-connection/RegisterAppKey.go delete mode 100644 examples/v2/action-connection/UnregisterAppKey.go delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_Bad_request_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_Bad_request_response.yaml delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_Not_found_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_Not_found_response.yaml delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_OK_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_OK_response.yaml delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_List_App_Key_Registrations_returns_OK_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_List_App_Key_Registrations_returns_OK_response.yaml delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Register_a_new_App_Key_returns_Bad_request_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Register_a_new_App_Key_returns_Bad_request_response.yaml delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Register_a_new_App_Key_returns_Created_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Register_a_new_App_Key_returns_Created_response.yaml delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Unregister_an_App_Key_returns_Bad_request_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Unregister_an_App_Key_returns_Bad_request_response.yaml delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Unregister_an_App_Key_returns_Not_found_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Unregister_an_App_Key_returns_Not_found_response.yaml delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Events/Scenario_Post_an_event_returns_Bad_request_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Events/Scenario_Post_an_event_returns_Bad_request_response.yaml delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Events/Scenario_Post_an_event_returns_OK_response.freeze delete mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Events/Scenario_Post_an_event_returns_OK_response.yaml diff --git a/.apigentools-info b/.apigentools-info index d58db5c1875..1b6f36d5941 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-23 17:09:16.092993", - "spec_repo_commit": "75caa2e0" + "regenerated": "2025-06-23 19:18:45.955890", + "spec_repo_commit": "779f1def" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-23 17:09:16.109217", - "spec_repo_commit": "75caa2e0" + "regenerated": "2025-06-23 19:18:45.971799", + "spec_repo_commit": "779f1def" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index fdbd7a7f5db..40efcb6b55c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -127,13 +127,6 @@ components: required: true schema: type: string - ApplicationKeyId: - description: The ID of the app key - in: path - name: app_key_id - required: true - schema: - type: string ApplicationKeyIncludeParameter: description: Resource path for related resources to include in the response. Only `owned_by` is supported. @@ -2234,97 +2227,6 @@ components: - id - base_severity type: object - AlertEventCustomAttributes: - additionalProperties: false - description: Alert event attributes. - properties: - custom: - $ref: '#/components/schemas/AlertEventCustomAttributesCustom' - links: - $ref: '#/components/schemas/AlertEventCustomAttributesLinks' - priority: - $ref: '#/components/schemas/AlertEventCustomAttributesPriority' - status: - $ref: '#/components/schemas/AlertEventCustomAttributesStatus' - required: - - status - type: object - AlertEventCustomAttributesCustom: - additionalProperties: {} - description: Free form JSON object for arbitrary data. Supports up to 100 properties - per object and a maximum nesting depth of 10 levels. - example: {} - type: object - AlertEventCustomAttributesLinks: - description: The links related to the event. Maximum of 20 links allowed. - items: - $ref: '#/components/schemas/AlertEventCustomAttributesLinksItems' - maxItems: 20 - minItems: 1 - type: array - AlertEventCustomAttributesLinksItems: - additionalProperties: false - description: A link. - properties: - category: - $ref: '#/components/schemas/AlertEventCustomAttributesLinksItemsCategory' - title: - description: The display text of the link. Limited to 300 characters. - example: Runbook Link - maxLength: 300 - minLength: 1 - type: string - url: - description: The URL of the link. Limited to 2048 characters. - example: https://app.datadoghq.com/runbook - maxLength: 2048 - minLength: 1 - type: string - required: - - url - - category - type: object - AlertEventCustomAttributesLinksItemsCategory: - description: The category of the link. - enum: - - runbook - - documentation - - dashboard - example: runbook - type: string - x-enum-varnames: - - RUNBOOK - - DOCUMENTATION - - DASHBOARD - AlertEventCustomAttributesPriority: - default: '5' - description: The priority of the alert. - enum: - - '1' - - '2' - - '3' - - '4' - - '5' - example: '5' - type: string - x-enum-varnames: - - PRIORITY_ONE - - PRIORITY_TWO - - PRIORITY_THREE - - PRIORITY_FOUR - - PRIORITY_FIVE - AlertEventCustomAttributesStatus: - description: The status of the alert. - enum: - - warn - - error - - ok - example: warn - type: string - x-enum-varnames: - - WARN - - ERROR - - OK Annotation: description: A list of annotations used in the workflow. These are like sticky notes for your workflow! @@ -2465,27 +2367,6 @@ components: type: string x-enum-varnames: - DEPLOYMENT - AppKeyRegistrationData: - description: Data related to the app key registration. - properties: - id: - description: The app key registration identifier - format: uuid - readOnly: true - type: string - type: - $ref: '#/components/schemas/AppKeyRegistrationDataType' - required: - - type - type: object - AppKeyRegistrationDataType: - description: The definition of `AppKeyRegistrationDataType` object. - enum: - - app_key_registration - example: app_key_registration - type: string - x-enum-varnames: - - APP_KEY_REGISTRATION AppMeta: description: Metadata of an app. properties: @@ -7038,16 +6919,14 @@ components: type: integer type: object ChangeEventCustomAttributes: - additionalProperties: false - description: Change event attributes. + description: Object representing custom change event attributes. properties: author: $ref: '#/components/schemas/ChangeEventCustomAttributesAuthor' change_metadata: additionalProperties: {} - description: Free form JSON object with information related to the `change` - event. Supports up to 100 properties per object and a maximum nesting - depth of 10 levels. + 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 @@ -7062,19 +6941,17 @@ components: description: 'A list of resources impacted by this change. It is recommended to provide an impacted resource to display - the change event at the correct location. Only resources of type `service` - are supported. Maximum of 100 impacted resources allowed.' + 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' - maxItems: 100 type: array new_value: additionalProperties: {} - description: Free form JSON object representing the new state of the changed - resource. + description: Free form object to track new value of the changed resource. example: enabled: true percentage: 50% @@ -7083,8 +6960,7 @@ components: type: object prev_value: additionalProperties: {} - description: Free form JSON object representing the previous state of the - changed resource. + description: Free form object to track previous value of the changed resource. example: enabled: true percentage: 10% @@ -7095,16 +6971,13 @@ components: - changed_resource type: object ChangeEventCustomAttributesAuthor: - additionalProperties: false - description: The entity that made the change. Optional, if provided it must - include `type` and `name`. + description: Object representing the entity which made the change. Optional + field but if provided should include `type` and `name`. properties: name: - description: The name of the user or system that made the change. Limited - to 128 characters. - example: example@datadog.com + description: Author's name. Limited to 128 characters. + example: datadog@datadog.com maxLength: 128 - minLength: 1 type: string type: $ref: '#/components/schemas/ChangeEventCustomAttributesAuthorType' @@ -7127,14 +7000,11 @@ components: - API - AUTOMATION ChangeEventCustomAttributesChangedResource: - additionalProperties: false - description: A uniquely identified resource. + description: Object representing a uniquely identified resource. properties: name: - description: The name of the resource that was changed. Limited to 128 characters. + description: Resource's name. example: fallback_payments_test - maxLength: 128 - minLength: 1 type: string type: $ref: '#/components/schemas/ChangeEventCustomAttributesChangedResourceType' @@ -7143,7 +7013,7 @@ components: - name type: object ChangeEventCustomAttributesChangedResourceType: - description: The type of the resource that was changed. + description: Resource's type. enum: - feature_flag - configuration @@ -7153,14 +7023,12 @@ components: - FEATURE_FLAG - CONFIGURATION ChangeEventCustomAttributesImpactedResourcesItems: - additionalProperties: false - description: Object representing a uniquely identified resource. + description: Object representing a uniquely identified resource. Only the resource + type `service` is supported. properties: name: - description: The name of the impacted resource. Limited to 128 characters. + description: Resource's name. example: payments_api - maxLength: 128 - minLength: 1 type: string type: $ref: '#/components/schemas/ChangeEventCustomAttributesImpactedResourcesItemsType' @@ -7169,7 +7037,7 @@ components: - name type: object ChangeEventCustomAttributesImpactedResourcesItemsType: - description: The type of the impacted resource. + description: Resource's type. enum: - service example: service @@ -14811,33 +14679,28 @@ components: type: string type: object EventCategory: - description: Event category identifying the type of event. + 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 - - alert example: change type: string x-enum-varnames: - CHANGE - - ALERT EventCreateRequest: - description: An event object. + description: Object representing an event creation request. properties: attributes: $ref: '#/components/schemas/EventPayload' type: $ref: '#/components/schemas/EventCreateRequestType' - required: - - type - - attributes type: object EventCreateRequestPayload: description: Payload for creating an event. properties: data: $ref: '#/components/schemas/EventCreateRequest' - required: - - data type: object EventCreateRequestType: description: Entity type. @@ -14848,23 +14711,24 @@ components: x-enum-varnames: - EVENT EventCreateResponse: - description: Event object. + description: Object containing an event response. properties: attributes: $ref: '#/components/schemas/EventCreateResponseAttributes' type: - description: Entity type. + description: Event type example: event type: string type: object EventCreateResponseAttributes: - description: Event attributes. + description: JSON object containing all events attributes and their associated + values. properties: attributes: $ref: '#/components/schemas/EventCreateResponseAttributesAttributes' type: object EventCreateResponseAttributesAttributes: - description: JSON object for category-specific attributes. + description: JSON object of attributes from your events. properties: evt: $ref: '#/components/schemas/EventCreateResponseAttributesAttributesEvt' @@ -14873,71 +14737,41 @@ components: description: JSON object of event system attributes. properties: id: - deprecated: true - description: Event identifier. This field is deprecated and will be removed - in a future version. Use the `uid` field instead. - type: string - uid: - description: A unique identifier for the event. You can use this identifier - to query or reference the event. + description: Event id type: string type: object EventCreateResponsePayload: - description: Event creation response. + description: Response containing information about created event. properties: data: $ref: '#/components/schemas/EventCreateResponse' - links: - $ref: '#/components/schemas/EventCreateResponsePayloadLinks' - type: object - EventCreateResponsePayloadLinks: - description: Links to the event. - properties: - self: - description: The URL of the event. This link is only functional when using - the default subdomain. - type: string type: object EventPayload: - additionalProperties: false description: Event attributes. properties: aggregation_key: - description: A string used for aggregation when [correlating](https://docs.datadoghq.com/service_management/events/correlation/) - events. If you specify a key, events are deduplicated to alerts based - on this key. Limited to 100 characters. - example: aggregation_key_123 + description: An arbitrary string to use for aggregation when correlating + events. Limited to 100 characters. maxLength: 100 - minLength: 1 type: string attributes: $ref: '#/components/schemas/EventPayloadAttributes' category: $ref: '#/components/schemas/EventCategory' - integration_id: - $ref: '#/components/schemas/EventPayloadIntegrationId' message: - description: Free formed text associated with the event. It's suggested - to use `data.attributes.attributes.custom` for well-structured attributes. - Limited to 4000 characters. + description: The body of the event. Limited to 4000 characters. example: payment_processed feature flag has been enabled maxLength: 4000 - minLength: 1 type: string tags: - description: 'A list of tags associated with the event. Maximum of 100 tags - allowed. + description: 'A list of tags to apply to the event. Refer to [Tags docs](https://docs.datadoghq.com/getting_started/tagging/).' example: - - env:api_client_test + - env:test items: description: A tag. - maxLength: 200 - minLength: 1 type: string - maxItems: 100 - minItems: 1 type: array timestamp: description: 'Timestamp when the event occurred. Must follow [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) @@ -14949,10 +14783,9 @@ components: 18 hours.' type: string title: - description: The title of the event. Limited to 500 characters. + description: The event title. Limited to 500 characters. example: payment_processed feature flag updated maxLength: 500 - minLength: 1 type: string required: - title @@ -14960,19 +14793,10 @@ components: - attributes type: object EventPayloadAttributes: - description: JSON object for category-specific attributes. Schema is different - per event category. + description: JSON object for custom attributes. Schema are different per each + event category. oneOf: - $ref: '#/components/schemas/ChangeEventCustomAttributes' - - $ref: '#/components/schemas/AlertEventCustomAttributes' - EventPayloadIntegrationId: - description: Integration ID sourced from integration manifests. - enum: - - custom-events - example: custom-events - type: string - x-enum-varnames: - - CUSTOM_EVENTS EventPriority: description: The priority of the event's monitor. For example, `normal` or `low`. enum: @@ -16168,12 +15992,6 @@ components: data: $ref: '#/components/schemas/ActionConnectionData' type: object - GetAppKeyRegistrationResponse: - description: The response object after getting an app key registration. - properties: - data: - $ref: '#/components/schemas/AppKeyRegistrationData' - type: object GetAppResponse: description: The full app definition response object. properties: @@ -19952,32 +19770,6 @@ components: format: int64 type: integer type: object - ListAppKeyRegistrationsResponse: - description: A paginated list of app key registrations. - properties: - data: - description: An array of app key registrations. - items: - $ref: '#/components/schemas/AppKeyRegistrationData' - type: array - meta: - $ref: '#/components/schemas/ListAppKeyRegistrationsResponseMeta' - type: object - ListAppKeyRegistrationsResponseMeta: - description: The definition of `ListAppKeyRegistrationsResponseMeta` object. - properties: - total: - description: The total number of app key registrations. - example: 1 - format: int64 - type: integer - total_filtered: - description: The total number of app key registrations that match the specified - filters. - example: 1 - format: int64 - type: integer - type: object ListApplicationKeysResponse: description: Response for a list of application keys. properties: @@ -29615,12 +29407,6 @@ components: x-enum-varnames: - ANY - ALL - RegisterAppKeyResponse: - description: The response object after creating an app key registration. - properties: - data: - $ref: '#/components/schemas/AppKeyRegistrationData' - type: object RelationAttributes: description: Relation attributes. properties: @@ -41654,185 +41440,9 @@ info: version: '1.0' openapi: 3.0.0 paths: - /api/v2/actions/app_key_registrations: - get: - description: List App Key Registrations - operationId: ListAppKeyRegistrations - parameters: - - description: The number of App Key Registrations to return per page. - in: query - name: page[size] - required: false - schema: - format: int64 - type: integer - - description: The page number to return. - in: query - name: page[number] - required: false - schema: - format: int64 - type: integer - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ListAppKeyRegistrationsResponse' - 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': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Too many requests - summary: List App Key Registrations - tags: - - Action Connection - x-permission: - operator: OR - permissions: - - org_app_keys_read - /api/v2/actions/app_key_registrations/{app_key_id}: - delete: - description: Unregister an App Key - operationId: UnregisterAppKey - parameters: - - $ref: '#/components/parameters/ApplicationKeyId' - responses: - '204': - description: No Content - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Bad request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Not found - '429': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Too many requests - summary: Unregister an App Key - tags: - - Action Connection - x-permission: - operator: OR - permissions: - - user_access_manage - - user_app_keys - - service_account_write - get: - description: Get an existing App Key Registration - operationId: GetAppKeyRegistration - parameters: - - $ref: '#/components/parameters/ApplicationKeyId' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/GetAppKeyRegistrationResponse' - 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 - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Not found - '429': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Too many requests - summary: Get an existing App Key Registration - tags: - - Action Connection - x-permission: - operator: OR - permissions: - - org_app_keys_read - put: - description: Register a new App Key - operationId: RegisterAppKey - parameters: - - $ref: '#/components/parameters/ApplicationKeyId' - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterAppKeyResponse' - description: Created - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Bad request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Forbidden - '429': - content: - application/json: - schema: - $ref: '#/components/schemas/JSONAPIErrorResponse' - description: Too many requests - summary: Register a new App Key - tags: - - Action Connection - x-permission: - operator: OR - permissions: - - user_access_manage - - user_app_keys - - service_account_write /api/v2/actions/connections: post: - description: Create a new Action Connection. This API requires a [registered - application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). + description: Create a new Action Connection operationId: CreateActionConnection requestBody: content: @@ -41870,8 +41480,7 @@ paths: - Action Connection /api/v2/actions/connections/{connection_id}: delete: - description: Delete an existing Action Connection. This API requires a [registered - application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). + description: Delete an existing Action Connection operationId: DeleteActionConnection parameters: - $ref: '#/components/parameters/ConnectionId' @@ -41904,8 +41513,7 @@ paths: permissions: - connection_write get: - description: Get an existing Action Connection. This API requires a [registered - application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). + description: Get an existing Action Connection operationId: GetActionConnection parameters: - $ref: '#/components/parameters/ConnectionId' @@ -41944,8 +41552,7 @@ paths: tags: - Action Connection patch: - description: Update an existing Action Connection. This API requires a [registered - application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). + description: Update an existing Action Connection operationId: UpdateActionConnection parameters: - $ref: '#/components/parameters/ConnectionId' @@ -42975,7 +42582,6 @@ paths: /api/v2/app-builder/apps: delete: description: Delete multiple apps in a single request from a list of app IDs. - This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: DeleteApps requestBody: content: @@ -43020,8 +42626,7 @@ paths: get: description: List all apps, with optional filters and sorting. This endpoint is paginated. Only basic app information such as the app ID, name, and description - is returned by this endpoint. This API requires a [registered application - key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). + is returned by this endpoint. operationId: ListApps parameters: - description: The number of apps to return per page. @@ -43127,8 +42732,7 @@ paths: permissions: - apps_run post: - description: Create a new app, returning the app ID. This API requires a [registered - application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). + description: Create a new app, returning the app ID. operationId: CreateApp requestBody: content: @@ -43168,8 +42772,7 @@ paths: - workflows_run /api/v2/app-builder/apps/{app_id}: delete: - description: Delete a single app. This API requires a [registered application - key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). + description: Delete a single app. operationId: DeleteApp parameters: - description: The ID of the app to delete. @@ -43221,8 +42824,7 @@ paths: permissions: - apps_write get: - description: Get the full definition of an app. This API requires a [registered - application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). + description: Get the full definition of an app. operationId: GetApp parameters: - description: The ID of the app to retrieve. @@ -43285,7 +42887,6 @@ paths: - connections_read patch: description: Update an existing app. This creates a new version of the app. - This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: UpdateApp parameters: - description: The ID of the app to update. @@ -43337,8 +42938,7 @@ paths: description: Unpublish an app, removing the live version of the app. Unpublishing creates a new instance of a `deployment` object on the app, with a nil `app_version_id` (`00000000-0000-0000-0000-000000000000`). The app can still be updated and - published again in the future. This API requires a [registered application - key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). + published again in the future. operationId: UnpublishApp parameters: - description: The ID of the app to unpublish. @@ -43386,8 +42986,7 @@ paths: post: description: Publish an app for use by other users. To ensure the app is accessible to the correct users, you also need to set a [Restriction Policy](https://docs.datadoghq.com/api/latest/restriction-policies/) - on the app if a policy does not yet exist. This API requires a [registered - application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). + on the app if a policy does not yet exist. operationId: PublishApp parameters: - description: The ID of the app to publish. @@ -47560,15 +47159,10 @@ paths: permissions: - events_read post: - description: "This endpoint allows you to publish events.\n\n\u2705 **Only events - with the `change` or `alert` category** are in General Availability. For change - events, see [Change Tracking](https://docs.datadoghq.com/change_tracking) + description: "This endpoint allows you to post events.\n\n\u2705 **Only events + with the `change` category** are in General Availability. See [Change Tracking](https://docs.datadoghq.com/change_tracking) for more details.\n\n\u274C For use cases involving other event categories, - use the V1 endpoint or reach out to [support](https://www.datadoghq.com/support/).\n\n\u274C - Notifications are not yet supported for events sent to this endpoint. Use - the V1 endpoint for notification functionality.\n\n\u274C This endpoint is - not available for the Government (US1-FED) site. Contact your account representative - for more information." + please use the V1 endpoint." operationId: CreateEvent requestBody: content: @@ -47578,10 +47172,9 @@ paths: value: data: attributes: - aggregation_key: aggregation_key_123 attributes: author: - name: example@datadog.com + name: datadog@datadog.com type: user change_metadata: dd: @@ -47607,19 +47200,17 @@ paths: rule: datacenter: devcycle.us1.prod category: change - integration_id: custom-events message: payment_processed feature flag has been enabled tags: - - env:api_client_test - timestamp: '2020-01-01T01:30:15.010000Z' + - env:test title: payment_processed feature flag updated type: event schema: $ref: '#/components/schemas/EventCreateRequestPayload' - description: Event creation request payload. + description: Event request object required: true responses: - '202': + '200': content: application/json: schema: @@ -47642,38 +47233,6 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - servers: - - url: https://{subdomain}.{site} - variables: - site: - default: datadoghq.com - description: The regional site for customers. - enum: - - datadoghq.com - - us3.datadoghq.com - - us5.datadoghq.com - - ap1.datadoghq.com - - datadoghq.eu - - ddog-gov.com - subdomain: - default: event-management-intake - description: The subdomain where the API is deployed. - - url: '{protocol}://{name}' - variables: - name: - default: event-management-intake.datadoghq.com - description: Full site DNS name. - protocol: - default: https - description: The protocol for accessing the API. - - url: https://{subdomain}.{site} - variables: - site: - default: datadoghq.com - description: Any Datadog deployment. - subdomain: - default: event-management-intake - description: The subdomain where the API is deployed. summary: Post an event tags: - Events @@ -63313,7 +62872,7 @@ paths: /api/v2/workflows: post: description: Create a new workflow, returning the workflow ID. This API requires - a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). + an application key scoped with the `workflows_write` permission. operationId: CreateWorkflow requestBody: content: @@ -63355,8 +62914,8 @@ paths: - workflows_write /api/v2/workflows/{workflow_id}: delete: - description: Delete a workflow by ID. This API requires a [registered application - key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). + description: Delete a workflow by ID. This API requires an application key scoped + with the `workflows_write` permission. operationId: DeleteWorkflow parameters: - $ref: '#/components/parameters/WorkflowId' @@ -63389,8 +62948,8 @@ paths: permissions: - workflows_write get: - description: Get a workflow by ID. This API requires a [registered application - key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). + description: Get a workflow by ID. This API requires an application key scoped + with the `workflows_read` permission. operationId: GetWorkflow parameters: - $ref: '#/components/parameters/WorkflowId' @@ -63433,8 +62992,8 @@ paths: permissions: - workflows_read patch: - description: Update a workflow by ID. This API requires a [registered application - key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). + description: Update a workflow by ID. This API requires an application key scoped + with the `workflows_write` permission. operationId: UpdateWorkflow parameters: - $ref: '#/components/parameters/WorkflowId' @@ -63484,8 +63043,8 @@ paths: - workflows_write /api/v2/workflows/{workflow_id}/instances: get: - description: List all instances of a given workflow. This API requires a [registered - application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). + description: List all instances of a given workflow. This API requires an application + key scoped with the workflows_read permission. operationId: ListWorkflowInstances parameters: - $ref: '#/components/parameters/WorkflowId' @@ -63517,8 +63076,8 @@ paths: permissions: - workflows_read post: - description: Execute the given workflow. This API requires a [registered application - key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). + description: Execute the given workflow. This API requires an application key + scoped with the workflows_run permission. operationId: CreateWorkflowInstance parameters: - $ref: '#/components/parameters/WorkflowId' @@ -63557,7 +63116,7 @@ paths: /api/v2/workflows/{workflow_id}/instances/{instance_id}: get: description: Get a specific execution of a given workflow. This API requires - a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). + an application key scoped with the workflows_read permission. operationId: GetWorkflowInstance parameters: - $ref: '#/components/parameters/WorkflowId' @@ -63592,7 +63151,7 @@ paths: /api/v2/workflows/{workflow_id}/instances/{instance_id}/cancel: put: description: Cancels a specific execution of a given workflow. This API requires - a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). + an application key scoped with the workflows_run permission. operationId: CancelWorkflowInstance parameters: - $ref: '#/components/parameters/WorkflowId' diff --git a/api/datadog/configuration.go b/api/datadog/configuration.go index d4d2c4256fe..82c1ff88bbd 100644 --- a/api/datadog/configuration.go +++ b/api/datadog/configuration.go @@ -269,58 +269,6 @@ func NewConfiguration() *Configuration { }, }, }, - "v2.EventsApi.CreateEvent": { - { - URL: "https://{subdomain}.{site}", - Description: "No description provided", - Variables: map[string]ServerVariable{ - "site": { - Description: "The regional site for customers.", - DefaultValue: "datadoghq.com", - EnumValues: []string{ - "datadoghq.com", - "us3.datadoghq.com", - "us5.datadoghq.com", - "ap1.datadoghq.com", - "datadoghq.eu", - "ddog-gov.com", - }, - }, - "subdomain": { - Description: "The subdomain where the API is deployed.", - DefaultValue: "event-management-intake", - }, - }, - }, - { - URL: "{protocol}://{name}", - Description: "No description provided", - Variables: map[string]ServerVariable{ - "name": { - Description: "Full site DNS name.", - DefaultValue: "event-management-intake.datadoghq.com", - }, - "protocol": { - Description: "The protocol for accessing the API.", - DefaultValue: "https", - }, - }, - }, - { - URL: "https://{subdomain}.{site}", - Description: "No description provided", - Variables: map[string]ServerVariable{ - "site": { - Description: "Any Datadog deployment.", - DefaultValue: "datadoghq.com", - }, - "subdomain": { - Description: "The subdomain where the API is deployed.", - DefaultValue: "event-management-intake", - }, - }, - }, - }, "v2.LogsApi.SubmitLog": { { URL: "https://{subdomain}.{site}", diff --git a/api/datadogV2/api_action_connection.go b/api/datadogV2/api_action_connection.go index dc303f3dc3d..5687927823d 100644 --- a/api/datadogV2/api_action_connection.go +++ b/api/datadogV2/api_action_connection.go @@ -16,7 +16,7 @@ import ( type ActionConnectionApi datadog.Service // CreateActionConnection Create a new Action Connection. -// Create a new Action Connection. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). +// Create a new Action Connection func (a *ActionConnectionApi) CreateActionConnection(ctx _context.Context, body CreateActionConnectionRequest) (CreateActionConnectionResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost @@ -89,7 +89,7 @@ func (a *ActionConnectionApi) CreateActionConnection(ctx _context.Context, body } // DeleteActionConnection Delete an existing Action Connection. -// Delete an existing Action Connection. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). +// Delete an existing Action Connection func (a *ActionConnectionApi) DeleteActionConnection(ctx _context.Context, connectionId string) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete @@ -150,7 +150,7 @@ func (a *ActionConnectionApi) DeleteActionConnection(ctx _context.Context, conne } // GetActionConnection Get an existing Action Connection. -// Get an existing Action Connection. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). +// Get an existing Action Connection func (a *ActionConnectionApi) GetActionConnection(ctx _context.Context, connectionId string) (GetActionConnectionResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet @@ -220,319 +220,8 @@ func (a *ActionConnectionApi) GetActionConnection(ctx _context.Context, connecti return localVarReturnValue, localVarHTTPResponse, nil } -// GetAppKeyRegistration Get an existing App Key Registration. -// Get an existing App Key Registration -func (a *ActionConnectionApi) GetAppKeyRegistration(ctx _context.Context, appKeyId string) (GetAppKeyRegistrationResponse, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue GetAppKeyRegistrationResponse - ) - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ActionConnectionApi.GetAppKeyRegistration") - if err != nil { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/api/v2/actions/app_key_registrations/{app_key_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_key_id}", _neturl.PathEscape(datadog.ParameterToString(appKeyId, ""))) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "application/json" - - datadog.SetAuthKeys( - ctx, - &localVarHeaderParams, - [2]string{"apiKeyAuth", "DD-API-KEY"}, - [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, - ) - req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.Client.CallAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := datadog.ReadBody(localVarHTTPResponse) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := datadog.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { - var v JSONAPIErrorResponse - err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := datadog.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -// ListAppKeyRegistrationsOptionalParameters holds optional parameters for ListAppKeyRegistrations. -type ListAppKeyRegistrationsOptionalParameters struct { - PageSize *int64 - PageNumber *int64 -} - -// NewListAppKeyRegistrationsOptionalParameters creates an empty struct for parameters. -func NewListAppKeyRegistrationsOptionalParameters() *ListAppKeyRegistrationsOptionalParameters { - this := ListAppKeyRegistrationsOptionalParameters{} - return &this -} - -// WithPageSize sets the corresponding parameter name and returns the struct. -func (r *ListAppKeyRegistrationsOptionalParameters) WithPageSize(pageSize int64) *ListAppKeyRegistrationsOptionalParameters { - r.PageSize = &pageSize - return r -} - -// WithPageNumber sets the corresponding parameter name and returns the struct. -func (r *ListAppKeyRegistrationsOptionalParameters) WithPageNumber(pageNumber int64) *ListAppKeyRegistrationsOptionalParameters { - r.PageNumber = &pageNumber - return r -} - -// ListAppKeyRegistrations List App Key Registrations. -// List App Key Registrations -func (a *ActionConnectionApi) ListAppKeyRegistrations(ctx _context.Context, o ...ListAppKeyRegistrationsOptionalParameters) (ListAppKeyRegistrationsResponse, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarReturnValue ListAppKeyRegistrationsResponse - optionalParams ListAppKeyRegistrationsOptionalParameters - ) - - if len(o) > 1 { - return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListAppKeyRegistrationsOptionalParameters is allowed") - } - if len(o) == 1 { - optionalParams = o[0] - } - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ActionConnectionApi.ListAppKeyRegistrations") - if err != nil { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/api/v2/actions/app_key_registrations" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if optionalParams.PageSize != nil { - localVarQueryParams.Add("page[size]", datadog.ParameterToString(*optionalParams.PageSize, "")) - } - if optionalParams.PageNumber != nil { - localVarQueryParams.Add("page[number]", datadog.ParameterToString(*optionalParams.PageNumber, "")) - } - localVarHeaderParams["Accept"] = "application/json" - - datadog.SetAuthKeys( - ctx, - &localVarHeaderParams, - [2]string{"apiKeyAuth", "DD-API-KEY"}, - [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, - ) - req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.Client.CallAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := datadog.ReadBody(localVarHTTPResponse) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := datadog.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { - var v JSONAPIErrorResponse - err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := datadog.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -// RegisterAppKey Register a new App Key. -// Register a new App Key -func (a *ActionConnectionApi) RegisterAppKey(ctx _context.Context, appKeyId string) (RegisterAppKeyResponse, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPut - localVarPostBody interface{} - localVarReturnValue RegisterAppKeyResponse - ) - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ActionConnectionApi.RegisterAppKey") - if err != nil { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/api/v2/actions/app_key_registrations/{app_key_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_key_id}", _neturl.PathEscape(datadog.ParameterToString(appKeyId, ""))) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "application/json" - - datadog.SetAuthKeys( - ctx, - &localVarHeaderParams, - [2]string{"apiKeyAuth", "DD-API-KEY"}, - [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, - ) - req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.Client.CallAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := datadog.ReadBody(localVarHTTPResponse) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := datadog.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { - var v JSONAPIErrorResponse - err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := datadog.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -// UnregisterAppKey Unregister an App Key. -// Unregister an App Key -func (a *ActionConnectionApi) UnregisterAppKey(ctx _context.Context, appKeyId string) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodDelete - localVarPostBody interface{} - ) - - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ActionConnectionApi.UnregisterAppKey") - if err != nil { - return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/api/v2/actions/app_key_registrations/{app_key_id}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{app_key_id}", _neturl.PathEscape(datadog.ParameterToString(appKeyId, ""))) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - localVarHeaderParams["Accept"] = "*/*" - - datadog.SetAuthKeys( - ctx, - &localVarHeaderParams, - [2]string{"apiKeyAuth", "DD-API-KEY"}, - [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, - ) - req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.Client.CallAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := datadog.ReadBody(localVarHTTPResponse) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := datadog.GenericOpenAPIError{ - ErrorBody: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { - var v JSONAPIErrorResponse - err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - return localVarHTTPResponse, newErr - } - newErr.ErrorModel = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - // UpdateActionConnection Update an existing Action Connection. -// Update an existing Action Connection. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). +// Update an existing Action Connection func (a *ActionConnectionApi) UpdateActionConnection(ctx _context.Context, connectionId string, body UpdateActionConnectionRequest) (UpdateActionConnectionResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch diff --git a/api/datadogV2/api_app_builder.go b/api/datadogV2/api_app_builder.go index 662fdd0c76b..dacb5bc3bfa 100644 --- a/api/datadogV2/api_app_builder.go +++ b/api/datadogV2/api_app_builder.go @@ -17,7 +17,7 @@ import ( type AppBuilderApi datadog.Service // CreateApp Create App. -// Create a new app, returning the app ID. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). +// Create a new app, returning the app ID. func (a *AppBuilderApi) CreateApp(ctx _context.Context, body CreateAppRequest) (CreateAppResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost @@ -99,7 +99,7 @@ func (a *AppBuilderApi) CreateApp(ctx _context.Context, body CreateAppRequest) ( } // DeleteApp Delete App. -// Delete a single app. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). +// Delete a single app. func (a *AppBuilderApi) DeleteApp(ctx _context.Context, appId uuid.UUID) (DeleteAppResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete @@ -179,7 +179,7 @@ func (a *AppBuilderApi) DeleteApp(ctx _context.Context, appId uuid.UUID) (Delete } // DeleteApps Delete Multiple Apps. -// Delete multiple apps in a single request from a list of app IDs. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). +// Delete multiple apps in a single request from a list of app IDs. func (a *AppBuilderApi) DeleteApps(ctx _context.Context, body DeleteAppsRequest) (DeleteAppsResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete @@ -278,7 +278,7 @@ func (r *GetAppOptionalParameters) WithVersion(version string) *GetAppOptionalPa } // GetApp Get App. -// Get the full definition of an app. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). +// Get the full definition of an app. func (a *AppBuilderApi) GetApp(ctx _context.Context, appId uuid.UUID, o ...GetAppOptionalParameters) (GetAppResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet @@ -456,7 +456,7 @@ func (r *ListAppsOptionalParameters) WithSort(sort []AppsSortField) *ListAppsOpt } // ListApps List Apps. -// List all apps, with optional filters and sorting. This endpoint is paginated. Only basic app information such as the app ID, name, and description is returned by this endpoint. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). +// List all apps, with optional filters and sorting. This endpoint is paginated. Only basic app information such as the app ID, name, and description is returned by this endpoint. func (a *AppBuilderApi) ListApps(ctx _context.Context, o ...ListAppsOptionalParameters) (ListAppsResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet @@ -576,7 +576,7 @@ func (a *AppBuilderApi) ListApps(ctx _context.Context, o ...ListAppsOptionalPara } // PublishApp Publish App. -// Publish an app for use by other users. To ensure the app is accessible to the correct users, you also need to set a [Restriction Policy](https://docs.datadoghq.com/api/latest/restriction-policies/) on the app if a policy does not yet exist. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). +// Publish an app for use by other users. To ensure the app is accessible to the correct users, you also need to set a [Restriction Policy](https://docs.datadoghq.com/api/latest/restriction-policies/) on the app if a policy does not yet exist. func (a *AppBuilderApi) PublishApp(ctx _context.Context, appId uuid.UUID) (PublishAppResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost @@ -656,7 +656,7 @@ func (a *AppBuilderApi) PublishApp(ctx _context.Context, appId uuid.UUID) (Publi } // UnpublishApp Unpublish App. -// Unpublish an app, removing the live version of the app. Unpublishing creates a new instance of a `deployment` object on the app, with a nil `app_version_id` (`00000000-0000-0000-0000-000000000000`). The app can still be updated and published again in the future. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). +// Unpublish an app, removing the live version of the app. Unpublishing creates a new instance of a `deployment` object on the app, with a nil `app_version_id` (`00000000-0000-0000-0000-000000000000`). The app can still be updated and published again in the future. func (a *AppBuilderApi) UnpublishApp(ctx _context.Context, appId uuid.UUID) (UnpublishAppResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete @@ -736,7 +736,7 @@ func (a *AppBuilderApi) UnpublishApp(ctx _context.Context, appId uuid.UUID) (Unp } // UpdateApp Update App. -// Update an existing app. This creates a new version of the app. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). +// Update an existing app. This creates a new version of the app. func (a *AppBuilderApi) UpdateApp(ctx _context.Context, appId uuid.UUID, body UpdateAppRequest) (UpdateAppResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch diff --git a/api/datadogV2/api_events.go b/api/datadogV2/api_events.go index 2b10c68ef7d..c1ea8823326 100644 --- a/api/datadogV2/api_events.go +++ b/api/datadogV2/api_events.go @@ -16,15 +16,11 @@ import ( type EventsApi datadog.Service // CreateEvent Post an event. -// This endpoint allows you to publish events. +// This endpoint allows you to post events. // -// ✅ **Only events with the `change` or `alert` category** are in General Availability. For change events, see [Change Tracking](https://docs.datadoghq.com/change_tracking) for more details. +// ✅ **Only events with the `change` category** are in General Availability. See [Change Tracking](https://docs.datadoghq.com/change_tracking) for more details. // -// ❌ For use cases involving other event categories, use the V1 endpoint or reach out to [support](https://www.datadoghq.com/support/). -// -// ❌ Notifications are not yet supported for events sent to this endpoint. Use the V1 endpoint for notification functionality. -// -// ❌ This endpoint is not available for the Government (US1-FED) site. Contact your account representative for more information. +// ❌ For use cases involving other event categories, please use the V1 endpoint. func (a *EventsApi) CreateEvent(ctx _context.Context, body EventCreateRequestPayload) (EventCreateResponsePayload, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost diff --git a/api/datadogV2/api_workflow_automation.go b/api/datadogV2/api_workflow_automation.go index ff5e1790407..fa3783c3dd7 100644 --- a/api/datadogV2/api_workflow_automation.go +++ b/api/datadogV2/api_workflow_automation.go @@ -16,7 +16,7 @@ import ( type WorkflowAutomationApi datadog.Service // CancelWorkflowInstance Cancel a workflow instance. -// Cancels a specific execution of a given workflow. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). +// Cancels a specific execution of a given workflow. This API requires an application key scoped with the workflows_run permission. func (a *WorkflowAutomationApi) CancelWorkflowInstance(ctx _context.Context, workflowId string, instanceId string) (WorklflowCancelInstanceResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPut @@ -88,7 +88,7 @@ func (a *WorkflowAutomationApi) CancelWorkflowInstance(ctx _context.Context, wor } // CreateWorkflow Create a Workflow. -// Create a new workflow, returning the workflow ID. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). +// Create a new workflow, returning the workflow ID. This API requires an application key scoped with the `workflows_write` permission. func (a *WorkflowAutomationApi) CreateWorkflow(ctx _context.Context, body CreateWorkflowRequest) (CreateWorkflowResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost @@ -161,7 +161,7 @@ func (a *WorkflowAutomationApi) CreateWorkflow(ctx _context.Context, body Create } // CreateWorkflowInstance Execute a workflow. -// Execute the given workflow. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). +// Execute the given workflow. This API requires an application key scoped with the workflows_run permission. func (a *WorkflowAutomationApi) CreateWorkflowInstance(ctx _context.Context, workflowId string, body WorkflowInstanceCreateRequest) (WorkflowInstanceCreateResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPost @@ -235,7 +235,7 @@ func (a *WorkflowAutomationApi) CreateWorkflowInstance(ctx _context.Context, wor } // DeleteWorkflow Delete an existing Workflow. -// Delete a workflow by ID. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). +// Delete a workflow by ID. This API requires an application key scoped with the `workflows_write` permission. func (a *WorkflowAutomationApi) DeleteWorkflow(ctx _context.Context, workflowId string) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete @@ -296,7 +296,7 @@ func (a *WorkflowAutomationApi) DeleteWorkflow(ctx _context.Context, workflowId } // GetWorkflow Get an existing Workflow. -// Get a workflow by ID. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). +// Get a workflow by ID. This API requires an application key scoped with the `workflows_read` permission. func (a *WorkflowAutomationApi) GetWorkflow(ctx _context.Context, workflowId string) (GetWorkflowResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet @@ -367,7 +367,7 @@ func (a *WorkflowAutomationApi) GetWorkflow(ctx _context.Context, workflowId str } // GetWorkflowInstance Get a workflow instance. -// Get a specific execution of a given workflow. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). +// Get a specific execution of a given workflow. This API requires an application key scoped with the workflows_read permission. func (a *WorkflowAutomationApi) GetWorkflowInstance(ctx _context.Context, workflowId string, instanceId string) (WorklflowGetInstanceResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet @@ -463,7 +463,7 @@ func (r *ListWorkflowInstancesOptionalParameters) WithPageNumber(pageNumber int6 } // ListWorkflowInstances List workflow instances. -// List all instances of a given workflow. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). +// List all instances of a given workflow. This API requires an application key scoped with the workflows_read permission. func (a *WorkflowAutomationApi) ListWorkflowInstances(ctx _context.Context, workflowId string, o ...ListWorkflowInstancesOptionalParameters) (WorkflowListInstancesResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet @@ -548,7 +548,7 @@ func (a *WorkflowAutomationApi) ListWorkflowInstances(ctx _context.Context, work } // UpdateWorkflow Update an existing Workflow. -// Update a workflow by ID. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). +// Update a workflow by ID. This API requires an application key scoped with the `workflows_write` permission. func (a *WorkflowAutomationApi) UpdateWorkflow(ctx _context.Context, workflowId string, body UpdateWorkflowRequest) (UpdateWorkflowResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch diff --git a/api/datadogV2/doc.go b/api/datadogV2/doc.go index 1c703b9e8ab..ee496e49482 100644 --- a/api/datadogV2/doc.go +++ b/api/datadogV2/doc.go @@ -25,10 +25,6 @@ // - [ActionConnectionApi.CreateActionConnection] // - [ActionConnectionApi.DeleteActionConnection] // - [ActionConnectionApi.GetActionConnection] -// - [ActionConnectionApi.GetAppKeyRegistration] -// - [ActionConnectionApi.ListAppKeyRegistrations] -// - [ActionConnectionApi.RegisterAppKey] -// - [ActionConnectionApi.UnregisterAppKey] // - [ActionConnectionApi.UpdateActionConnection] // - [AgentlessScanningApi.CreateAwsOnDemandTask] // - [AgentlessScanningApi.CreateAwsScanOptions] diff --git a/api/datadogV2/model_alert_event_custom_attributes.go b/api/datadogV2/model_alert_event_custom_attributes.go deleted file mode 100644 index 7f5a07124c5..00000000000 --- a/api/datadogV2/model_alert_event_custom_attributes.go +++ /dev/null @@ -1,209 +0,0 @@ -// 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. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// AlertEventCustomAttributes Alert event attributes. -type AlertEventCustomAttributes struct { - // Free form JSON object for arbitrary data. Supports up to 100 properties per object and a maximum nesting depth of 10 levels. - Custom map[string]interface{} `json:"custom,omitempty"` - // The links related to the event. Maximum of 20 links allowed. - Links []AlertEventCustomAttributesLinksItems `json:"links,omitempty"` - // The priority of the alert. - Priority *AlertEventCustomAttributesPriority `json:"priority,omitempty"` - // The status of the alert. - Status AlertEventCustomAttributesStatus `json:"status"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` -} - -// NewAlertEventCustomAttributes instantiates a new AlertEventCustomAttributes object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewAlertEventCustomAttributes(status AlertEventCustomAttributesStatus) *AlertEventCustomAttributes { - this := AlertEventCustomAttributes{} - var priority AlertEventCustomAttributesPriority = ALERTEVENTCUSTOMATTRIBUTESPRIORITY_PRIORITY_FIVE - this.Priority = &priority - this.Status = status - return &this -} - -// NewAlertEventCustomAttributesWithDefaults instantiates a new AlertEventCustomAttributes object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewAlertEventCustomAttributesWithDefaults() *AlertEventCustomAttributes { - this := AlertEventCustomAttributes{} - var priority AlertEventCustomAttributesPriority = ALERTEVENTCUSTOMATTRIBUTESPRIORITY_PRIORITY_FIVE - this.Priority = &priority - return &this -} - -// GetCustom returns the Custom field value if set, zero value otherwise. -func (o *AlertEventCustomAttributes) GetCustom() map[string]interface{} { - if o == nil || o.Custom == nil { - var ret map[string]interface{} - return ret - } - return o.Custom -} - -// GetCustomOk returns a tuple with the Custom field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AlertEventCustomAttributes) GetCustomOk() (*map[string]interface{}, bool) { - if o == nil || o.Custom == nil { - return nil, false - } - return &o.Custom, true -} - -// HasCustom returns a boolean if a field has been set. -func (o *AlertEventCustomAttributes) HasCustom() bool { - return o != nil && o.Custom != nil -} - -// SetCustom gets a reference to the given map[string]interface{} and assigns it to the Custom field. -func (o *AlertEventCustomAttributes) SetCustom(v map[string]interface{}) { - o.Custom = v -} - -// GetLinks returns the Links field value if set, zero value otherwise. -func (o *AlertEventCustomAttributes) GetLinks() []AlertEventCustomAttributesLinksItems { - if o == nil || o.Links == nil { - var ret []AlertEventCustomAttributesLinksItems - return ret - } - return o.Links -} - -// GetLinksOk returns a tuple with the Links field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AlertEventCustomAttributes) GetLinksOk() (*[]AlertEventCustomAttributesLinksItems, bool) { - if o == nil || o.Links == nil { - return nil, false - } - return &o.Links, true -} - -// HasLinks returns a boolean if a field has been set. -func (o *AlertEventCustomAttributes) HasLinks() bool { - return o != nil && o.Links != nil -} - -// SetLinks gets a reference to the given []AlertEventCustomAttributesLinksItems and assigns it to the Links field. -func (o *AlertEventCustomAttributes) SetLinks(v []AlertEventCustomAttributesLinksItems) { - o.Links = v -} - -// GetPriority returns the Priority field value if set, zero value otherwise. -func (o *AlertEventCustomAttributes) GetPriority() AlertEventCustomAttributesPriority { - if o == nil || o.Priority == nil { - var ret AlertEventCustomAttributesPriority - return ret - } - return *o.Priority -} - -// GetPriorityOk returns a tuple with the Priority field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AlertEventCustomAttributes) GetPriorityOk() (*AlertEventCustomAttributesPriority, bool) { - if o == nil || o.Priority == nil { - return nil, false - } - return o.Priority, true -} - -// HasPriority returns a boolean if a field has been set. -func (o *AlertEventCustomAttributes) HasPriority() bool { - return o != nil && o.Priority != nil -} - -// SetPriority gets a reference to the given AlertEventCustomAttributesPriority and assigns it to the Priority field. -func (o *AlertEventCustomAttributes) SetPriority(v AlertEventCustomAttributesPriority) { - o.Priority = &v -} - -// GetStatus returns the Status field value. -func (o *AlertEventCustomAttributes) GetStatus() AlertEventCustomAttributesStatus { - if o == nil { - var ret AlertEventCustomAttributesStatus - return ret - } - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *AlertEventCustomAttributes) GetStatusOk() (*AlertEventCustomAttributesStatus, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value. -func (o *AlertEventCustomAttributes) SetStatus(v AlertEventCustomAttributesStatus) { - o.Status = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o AlertEventCustomAttributes) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Custom != nil { - toSerialize["custom"] = o.Custom - } - if o.Links != nil { - toSerialize["links"] = o.Links - } - if o.Priority != nil { - toSerialize["priority"] = o.Priority - } - toSerialize["status"] = o.Status - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *AlertEventCustomAttributes) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Custom map[string]interface{} `json:"custom,omitempty"` - Links []AlertEventCustomAttributesLinksItems `json:"links,omitempty"` - Priority *AlertEventCustomAttributesPriority `json:"priority,omitempty"` - Status *AlertEventCustomAttributesStatus `json:"status"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.Status == nil { - return fmt.Errorf("required field status missing") - } - - hasInvalidField := false - o.Custom = all.Custom - o.Links = all.Links - if all.Priority != nil && !all.Priority.IsValid() { - hasInvalidField = true - } else { - o.Priority = all.Priority - } - if !all.Status.IsValid() { - hasInvalidField = true - } else { - o.Status = *all.Status - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_alert_event_custom_attributes_links_items.go b/api/datadogV2/model_alert_event_custom_attributes_links_items.go deleted file mode 100644 index a3168981aff..00000000000 --- a/api/datadogV2/model_alert_event_custom_attributes_links_items.go +++ /dev/null @@ -1,163 +0,0 @@ -// 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. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// AlertEventCustomAttributesLinksItems A link. -type AlertEventCustomAttributesLinksItems struct { - // The category of the link. - Category AlertEventCustomAttributesLinksItemsCategory `json:"category"` - // The display text of the link. Limited to 300 characters. - Title *string `json:"title,omitempty"` - // The URL of the link. Limited to 2048 characters. - Url string `json:"url"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` -} - -// NewAlertEventCustomAttributesLinksItems instantiates a new AlertEventCustomAttributesLinksItems object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewAlertEventCustomAttributesLinksItems(category AlertEventCustomAttributesLinksItemsCategory, url string) *AlertEventCustomAttributesLinksItems { - this := AlertEventCustomAttributesLinksItems{} - this.Category = category - this.Url = url - return &this -} - -// NewAlertEventCustomAttributesLinksItemsWithDefaults instantiates a new AlertEventCustomAttributesLinksItems object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewAlertEventCustomAttributesLinksItemsWithDefaults() *AlertEventCustomAttributesLinksItems { - this := AlertEventCustomAttributesLinksItems{} - return &this -} - -// GetCategory returns the Category field value. -func (o *AlertEventCustomAttributesLinksItems) GetCategory() AlertEventCustomAttributesLinksItemsCategory { - if o == nil { - var ret AlertEventCustomAttributesLinksItemsCategory - return ret - } - return o.Category -} - -// GetCategoryOk returns a tuple with the Category field value -// and a boolean to check if the value has been set. -func (o *AlertEventCustomAttributesLinksItems) GetCategoryOk() (*AlertEventCustomAttributesLinksItemsCategory, bool) { - if o == nil { - return nil, false - } - return &o.Category, true -} - -// SetCategory sets field value. -func (o *AlertEventCustomAttributesLinksItems) SetCategory(v AlertEventCustomAttributesLinksItemsCategory) { - o.Category = v -} - -// GetTitle returns the Title field value if set, zero value otherwise. -func (o *AlertEventCustomAttributesLinksItems) GetTitle() string { - if o == nil || o.Title == nil { - var ret string - return ret - } - return *o.Title -} - -// GetTitleOk returns a tuple with the Title field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AlertEventCustomAttributesLinksItems) GetTitleOk() (*string, bool) { - if o == nil || o.Title == nil { - return nil, false - } - return o.Title, true -} - -// HasTitle returns a boolean if a field has been set. -func (o *AlertEventCustomAttributesLinksItems) HasTitle() bool { - return o != nil && o.Title != nil -} - -// SetTitle gets a reference to the given string and assigns it to the Title field. -func (o *AlertEventCustomAttributesLinksItems) SetTitle(v string) { - o.Title = &v -} - -// GetUrl returns the Url field value. -func (o *AlertEventCustomAttributesLinksItems) GetUrl() string { - if o == nil { - var ret string - return ret - } - return o.Url -} - -// GetUrlOk returns a tuple with the Url field value -// and a boolean to check if the value has been set. -func (o *AlertEventCustomAttributesLinksItems) GetUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Url, true -} - -// SetUrl sets field value. -func (o *AlertEventCustomAttributesLinksItems) SetUrl(v string) { - o.Url = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o AlertEventCustomAttributesLinksItems) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - toSerialize["category"] = o.Category - if o.Title != nil { - toSerialize["title"] = o.Title - } - toSerialize["url"] = o.Url - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *AlertEventCustomAttributesLinksItems) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Category *AlertEventCustomAttributesLinksItemsCategory `json:"category"` - Title *string `json:"title,omitempty"` - Url *string `json:"url"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.Category == nil { - return fmt.Errorf("required field category missing") - } - if all.Url == nil { - return fmt.Errorf("required field url missing") - } - - hasInvalidField := false - if !all.Category.IsValid() { - hasInvalidField = true - } else { - o.Category = *all.Category - } - o.Title = all.Title - o.Url = *all.Url - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_alert_event_custom_attributes_links_items_category.go b/api/datadogV2/model_alert_event_custom_attributes_links_items_category.go deleted file mode 100644 index 7d7198fe5ac..00000000000 --- a/api/datadogV2/model_alert_event_custom_attributes_links_items_category.go +++ /dev/null @@ -1,68 +0,0 @@ -// 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. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// AlertEventCustomAttributesLinksItemsCategory The category of the link. -type AlertEventCustomAttributesLinksItemsCategory string - -// List of AlertEventCustomAttributesLinksItemsCategory. -const ( - ALERTEVENTCUSTOMATTRIBUTESLINKSITEMSCATEGORY_RUNBOOK AlertEventCustomAttributesLinksItemsCategory = "runbook" - ALERTEVENTCUSTOMATTRIBUTESLINKSITEMSCATEGORY_DOCUMENTATION AlertEventCustomAttributesLinksItemsCategory = "documentation" - ALERTEVENTCUSTOMATTRIBUTESLINKSITEMSCATEGORY_DASHBOARD AlertEventCustomAttributesLinksItemsCategory = "dashboard" -) - -var allowedAlertEventCustomAttributesLinksItemsCategoryEnumValues = []AlertEventCustomAttributesLinksItemsCategory{ - ALERTEVENTCUSTOMATTRIBUTESLINKSITEMSCATEGORY_RUNBOOK, - ALERTEVENTCUSTOMATTRIBUTESLINKSITEMSCATEGORY_DOCUMENTATION, - ALERTEVENTCUSTOMATTRIBUTESLINKSITEMSCATEGORY_DASHBOARD, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *AlertEventCustomAttributesLinksItemsCategory) GetAllowedValues() []AlertEventCustomAttributesLinksItemsCategory { - return allowedAlertEventCustomAttributesLinksItemsCategoryEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *AlertEventCustomAttributesLinksItemsCategory) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = AlertEventCustomAttributesLinksItemsCategory(value) - return nil -} - -// NewAlertEventCustomAttributesLinksItemsCategoryFromValue returns a pointer to a valid AlertEventCustomAttributesLinksItemsCategory -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewAlertEventCustomAttributesLinksItemsCategoryFromValue(v string) (*AlertEventCustomAttributesLinksItemsCategory, error) { - ev := AlertEventCustomAttributesLinksItemsCategory(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for AlertEventCustomAttributesLinksItemsCategory: valid values are %v", v, allowedAlertEventCustomAttributesLinksItemsCategoryEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v AlertEventCustomAttributesLinksItemsCategory) IsValid() bool { - for _, existing := range allowedAlertEventCustomAttributesLinksItemsCategoryEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to AlertEventCustomAttributesLinksItemsCategory value. -func (v AlertEventCustomAttributesLinksItemsCategory) Ptr() *AlertEventCustomAttributesLinksItemsCategory { - return &v -} diff --git a/api/datadogV2/model_alert_event_custom_attributes_priority.go b/api/datadogV2/model_alert_event_custom_attributes_priority.go deleted file mode 100644 index d6fae1aa0cb..00000000000 --- a/api/datadogV2/model_alert_event_custom_attributes_priority.go +++ /dev/null @@ -1,72 +0,0 @@ -// 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. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// AlertEventCustomAttributesPriority The priority of the alert. -type AlertEventCustomAttributesPriority string - -// List of AlertEventCustomAttributesPriority. -const ( - ALERTEVENTCUSTOMATTRIBUTESPRIORITY_PRIORITY_ONE AlertEventCustomAttributesPriority = "1" - ALERTEVENTCUSTOMATTRIBUTESPRIORITY_PRIORITY_TWO AlertEventCustomAttributesPriority = "2" - ALERTEVENTCUSTOMATTRIBUTESPRIORITY_PRIORITY_THREE AlertEventCustomAttributesPriority = "3" - ALERTEVENTCUSTOMATTRIBUTESPRIORITY_PRIORITY_FOUR AlertEventCustomAttributesPriority = "4" - ALERTEVENTCUSTOMATTRIBUTESPRIORITY_PRIORITY_FIVE AlertEventCustomAttributesPriority = "5" -) - -var allowedAlertEventCustomAttributesPriorityEnumValues = []AlertEventCustomAttributesPriority{ - ALERTEVENTCUSTOMATTRIBUTESPRIORITY_PRIORITY_ONE, - ALERTEVENTCUSTOMATTRIBUTESPRIORITY_PRIORITY_TWO, - ALERTEVENTCUSTOMATTRIBUTESPRIORITY_PRIORITY_THREE, - ALERTEVENTCUSTOMATTRIBUTESPRIORITY_PRIORITY_FOUR, - ALERTEVENTCUSTOMATTRIBUTESPRIORITY_PRIORITY_FIVE, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *AlertEventCustomAttributesPriority) GetAllowedValues() []AlertEventCustomAttributesPriority { - return allowedAlertEventCustomAttributesPriorityEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *AlertEventCustomAttributesPriority) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = AlertEventCustomAttributesPriority(value) - return nil -} - -// NewAlertEventCustomAttributesPriorityFromValue returns a pointer to a valid AlertEventCustomAttributesPriority -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewAlertEventCustomAttributesPriorityFromValue(v string) (*AlertEventCustomAttributesPriority, error) { - ev := AlertEventCustomAttributesPriority(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for AlertEventCustomAttributesPriority: valid values are %v", v, allowedAlertEventCustomAttributesPriorityEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v AlertEventCustomAttributesPriority) IsValid() bool { - for _, existing := range allowedAlertEventCustomAttributesPriorityEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to AlertEventCustomAttributesPriority value. -func (v AlertEventCustomAttributesPriority) Ptr() *AlertEventCustomAttributesPriority { - return &v -} diff --git a/api/datadogV2/model_alert_event_custom_attributes_status.go b/api/datadogV2/model_alert_event_custom_attributes_status.go deleted file mode 100644 index c391a48677f..00000000000 --- a/api/datadogV2/model_alert_event_custom_attributes_status.go +++ /dev/null @@ -1,68 +0,0 @@ -// 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. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// AlertEventCustomAttributesStatus The status of the alert. -type AlertEventCustomAttributesStatus string - -// List of AlertEventCustomAttributesStatus. -const ( - ALERTEVENTCUSTOMATTRIBUTESSTATUS_WARN AlertEventCustomAttributesStatus = "warn" - ALERTEVENTCUSTOMATTRIBUTESSTATUS_ERROR AlertEventCustomAttributesStatus = "error" - ALERTEVENTCUSTOMATTRIBUTESSTATUS_OK AlertEventCustomAttributesStatus = "ok" -) - -var allowedAlertEventCustomAttributesStatusEnumValues = []AlertEventCustomAttributesStatus{ - ALERTEVENTCUSTOMATTRIBUTESSTATUS_WARN, - ALERTEVENTCUSTOMATTRIBUTESSTATUS_ERROR, - ALERTEVENTCUSTOMATTRIBUTESSTATUS_OK, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *AlertEventCustomAttributesStatus) GetAllowedValues() []AlertEventCustomAttributesStatus { - return allowedAlertEventCustomAttributesStatusEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *AlertEventCustomAttributesStatus) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = AlertEventCustomAttributesStatus(value) - return nil -} - -// NewAlertEventCustomAttributesStatusFromValue returns a pointer to a valid AlertEventCustomAttributesStatus -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewAlertEventCustomAttributesStatusFromValue(v string) (*AlertEventCustomAttributesStatus, error) { - ev := AlertEventCustomAttributesStatus(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for AlertEventCustomAttributesStatus: valid values are %v", v, allowedAlertEventCustomAttributesStatusEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v AlertEventCustomAttributesStatus) IsValid() bool { - for _, existing := range allowedAlertEventCustomAttributesStatusEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to AlertEventCustomAttributesStatus value. -func (v AlertEventCustomAttributesStatus) Ptr() *AlertEventCustomAttributesStatus { - return &v -} diff --git a/api/datadogV2/model_app_key_registration_data.go b/api/datadogV2/model_app_key_registration_data.go deleted file mode 100644 index 0d08e43e54b..00000000000 --- a/api/datadogV2/model_app_key_registration_data.go +++ /dev/null @@ -1,148 +0,0 @@ -// 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. - -package datadogV2 - -import ( - "fmt" - - "github.com/google/uuid" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// AppKeyRegistrationData Data related to the app key registration. -type AppKeyRegistrationData struct { - // The app key registration identifier - Id *uuid.UUID `json:"id,omitempty"` - // The definition of `AppKeyRegistrationDataType` object. - Type AppKeyRegistrationDataType `json:"type"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewAppKeyRegistrationData instantiates a new AppKeyRegistrationData object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewAppKeyRegistrationData(typeVar AppKeyRegistrationDataType) *AppKeyRegistrationData { - this := AppKeyRegistrationData{} - this.Type = typeVar - return &this -} - -// NewAppKeyRegistrationDataWithDefaults instantiates a new AppKeyRegistrationData object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewAppKeyRegistrationDataWithDefaults() *AppKeyRegistrationData { - this := AppKeyRegistrationData{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *AppKeyRegistrationData) GetId() uuid.UUID { - if o == nil || o.Id == nil { - var ret uuid.UUID - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AppKeyRegistrationData) GetIdOk() (*uuid.UUID, bool) { - if o == nil || o.Id == nil { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *AppKeyRegistrationData) HasId() bool { - return o != nil && o.Id != nil -} - -// SetId gets a reference to the given uuid.UUID and assigns it to the Id field. -func (o *AppKeyRegistrationData) SetId(v uuid.UUID) { - o.Id = &v -} - -// GetType returns the Type field value. -func (o *AppKeyRegistrationData) GetType() AppKeyRegistrationDataType { - if o == nil { - var ret AppKeyRegistrationDataType - return ret - } - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *AppKeyRegistrationData) GetTypeOk() (*AppKeyRegistrationDataType, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value. -func (o *AppKeyRegistrationData) SetType(v AppKeyRegistrationDataType) { - o.Type = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o AppKeyRegistrationData) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Id != nil { - toSerialize["id"] = o.Id - } - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *AppKeyRegistrationData) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Id *uuid.UUID `json:"id,omitempty"` - Type *AppKeyRegistrationDataType `json:"type"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.Type == nil { - return fmt.Errorf("required field type missing") - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"id", "type"}) - } else { - return err - } - - hasInvalidField := false - o.Id = all.Id - if !all.Type.IsValid() { - hasInvalidField = true - } else { - o.Type = *all.Type - } - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_app_key_registration_data_type.go b/api/datadogV2/model_app_key_registration_data_type.go deleted file mode 100644 index ed64ec91e9c..00000000000 --- a/api/datadogV2/model_app_key_registration_data_type.go +++ /dev/null @@ -1,64 +0,0 @@ -// 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. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// AppKeyRegistrationDataType The definition of `AppKeyRegistrationDataType` object. -type AppKeyRegistrationDataType string - -// List of AppKeyRegistrationDataType. -const ( - APPKEYREGISTRATIONDATATYPE_APP_KEY_REGISTRATION AppKeyRegistrationDataType = "app_key_registration" -) - -var allowedAppKeyRegistrationDataTypeEnumValues = []AppKeyRegistrationDataType{ - APPKEYREGISTRATIONDATATYPE_APP_KEY_REGISTRATION, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *AppKeyRegistrationDataType) GetAllowedValues() []AppKeyRegistrationDataType { - return allowedAppKeyRegistrationDataTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *AppKeyRegistrationDataType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = AppKeyRegistrationDataType(value) - return nil -} - -// NewAppKeyRegistrationDataTypeFromValue returns a pointer to a valid AppKeyRegistrationDataType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewAppKeyRegistrationDataTypeFromValue(v string) (*AppKeyRegistrationDataType, error) { - ev := AppKeyRegistrationDataType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for AppKeyRegistrationDataType: valid values are %v", v, allowedAppKeyRegistrationDataTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v AppKeyRegistrationDataType) IsValid() bool { - for _, existing := range allowedAppKeyRegistrationDataTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to AppKeyRegistrationDataType value. -func (v AppKeyRegistrationDataType) Ptr() *AppKeyRegistrationDataType { - return &v -} diff --git a/api/datadogV2/model_change_event_custom_attributes.go b/api/datadogV2/model_change_event_custom_attributes.go index 4ccd149bb43..8b79e9668cf 100644 --- a/api/datadogV2/model_change_event_custom_attributes.go +++ b/api/datadogV2/model_change_event_custom_attributes.go @@ -10,23 +10,24 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// ChangeEventCustomAttributes Change event attributes. +// ChangeEventCustomAttributes Object representing custom change event attributes. type ChangeEventCustomAttributes struct { - // The entity that made the change. Optional, if provided it must include `type` and `name`. + // Object representing the entity which made the change. Optional field but if provided should include `type` and `name`. Author *ChangeEventCustomAttributesAuthor `json:"author,omitempty"` - // Free form JSON object with information related to the `change` event. Supports up to 100 properties per object and a maximum nesting depth of 10 levels. + // Free form object with information related to the `change` event. Can be arbitrarily nested and contain any valid JSON. ChangeMetadata map[string]interface{} `json:"change_metadata,omitempty"` - // A uniquely identified resource. + // Object representing a uniquely identified resource. ChangedResource ChangeEventCustomAttributesChangedResource `json:"changed_resource"` // A list of resources impacted by this change. It is recommended to provide an impacted resource to display - // the change event at the correct location. Only resources of type `service` are supported. Maximum of 100 impacted resources allowed. + // the change event at the right location. Only resources of type `service` are supported. ImpactedResources []ChangeEventCustomAttributesImpactedResourcesItems `json:"impacted_resources,omitempty"` - // Free form JSON object representing the new state of the changed resource. + // Free form object to track new value of the changed resource. NewValue map[string]interface{} `json:"new_value,omitempty"` - // Free form JSON object representing the previous state of the changed resource. + // Free form object to track previous value of the changed resource. PrevValue map[string]interface{} `json:"prev_value,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` } // NewChangeEventCustomAttributes instantiates a new ChangeEventCustomAttributes object. @@ -232,6 +233,10 @@ func (o ChangeEventCustomAttributes) MarshalJSON() ([]byte, error) { if o.PrevValue != nil { toSerialize["prev_value"] = o.PrevValue } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } return datadog.Marshal(toSerialize) } @@ -251,6 +256,12 @@ func (o *ChangeEventCustomAttributes) UnmarshalJSON(bytes []byte) (err error) { if all.ChangedResource == nil { return fmt.Errorf("required field changed_resource missing") } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"author", "change_metadata", "changed_resource", "impacted_resources", "new_value", "prev_value"}) + } else { + return err + } hasInvalidField := false if all.Author != nil && all.Author.UnparsedObject != nil && o.UnparsedObject == nil { @@ -266,6 +277,10 @@ func (o *ChangeEventCustomAttributes) UnmarshalJSON(bytes []byte) (err error) { o.NewValue = all.NewValue o.PrevValue = all.PrevValue + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + if hasInvalidField { return datadog.Unmarshal(bytes, &o.UnparsedObject) } diff --git a/api/datadogV2/model_change_event_custom_attributes_author.go b/api/datadogV2/model_change_event_custom_attributes_author.go index c78b4cf5586..d9d235e8b4b 100644 --- a/api/datadogV2/model_change_event_custom_attributes_author.go +++ b/api/datadogV2/model_change_event_custom_attributes_author.go @@ -10,14 +10,15 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// ChangeEventCustomAttributesAuthor The entity that made the change. Optional, if provided it must include `type` and `name`. +// ChangeEventCustomAttributesAuthor Object representing the entity which made the change. Optional field but if provided should include `type` and `name`. type ChangeEventCustomAttributesAuthor struct { - // The name of the user or system that made the change. Limited to 128 characters. + // Author's name. Limited to 128 characters. Name string `json:"name"` // Author's type. Type ChangeEventCustomAttributesAuthorType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` } // NewChangeEventCustomAttributesAuthor instantiates a new ChangeEventCustomAttributesAuthor object. @@ -93,6 +94,10 @@ func (o ChangeEventCustomAttributesAuthor) MarshalJSON() ([]byte, error) { } toSerialize["name"] = o.Name toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } return datadog.Marshal(toSerialize) } @@ -111,6 +116,12 @@ func (o *ChangeEventCustomAttributesAuthor) UnmarshalJSON(bytes []byte) (err err if all.Type == nil { return fmt.Errorf("required field type missing") } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"name", "type"}) + } else { + return err + } hasInvalidField := false o.Name = *all.Name @@ -120,6 +131,10 @@ func (o *ChangeEventCustomAttributesAuthor) UnmarshalJSON(bytes []byte) (err err o.Type = *all.Type } + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + if hasInvalidField { return datadog.Unmarshal(bytes, &o.UnparsedObject) } diff --git a/api/datadogV2/model_change_event_custom_attributes_changed_resource.go b/api/datadogV2/model_change_event_custom_attributes_changed_resource.go index a9333a3b498..ac6873bd2ec 100644 --- a/api/datadogV2/model_change_event_custom_attributes_changed_resource.go +++ b/api/datadogV2/model_change_event_custom_attributes_changed_resource.go @@ -10,14 +10,15 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// ChangeEventCustomAttributesChangedResource A uniquely identified resource. +// ChangeEventCustomAttributesChangedResource Object representing a uniquely identified resource. type ChangeEventCustomAttributesChangedResource struct { - // The name of the resource that was changed. Limited to 128 characters. + // Resource's name. Name string `json:"name"` - // The type of the resource that was changed. + // Resource's type. Type ChangeEventCustomAttributesChangedResourceType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` } // NewChangeEventCustomAttributesChangedResource instantiates a new ChangeEventCustomAttributesChangedResource object. @@ -93,6 +94,10 @@ func (o ChangeEventCustomAttributesChangedResource) MarshalJSON() ([]byte, error } toSerialize["name"] = o.Name toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } return datadog.Marshal(toSerialize) } @@ -111,6 +116,12 @@ func (o *ChangeEventCustomAttributesChangedResource) UnmarshalJSON(bytes []byte) if all.Type == nil { return fmt.Errorf("required field type missing") } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"name", "type"}) + } else { + return err + } hasInvalidField := false o.Name = *all.Name @@ -120,6 +131,10 @@ func (o *ChangeEventCustomAttributesChangedResource) UnmarshalJSON(bytes []byte) o.Type = *all.Type } + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + if hasInvalidField { return datadog.Unmarshal(bytes, &o.UnparsedObject) } diff --git a/api/datadogV2/model_change_event_custom_attributes_changed_resource_type.go b/api/datadogV2/model_change_event_custom_attributes_changed_resource_type.go index 6ab9fa3bf0c..899c1fee4c4 100644 --- a/api/datadogV2/model_change_event_custom_attributes_changed_resource_type.go +++ b/api/datadogV2/model_change_event_custom_attributes_changed_resource_type.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// ChangeEventCustomAttributesChangedResourceType The type of the resource that was changed. +// ChangeEventCustomAttributesChangedResourceType Resource's type. type ChangeEventCustomAttributesChangedResourceType string // List of ChangeEventCustomAttributesChangedResourceType. diff --git a/api/datadogV2/model_change_event_custom_attributes_impacted_resources_items.go b/api/datadogV2/model_change_event_custom_attributes_impacted_resources_items.go index fdbffd6f9f1..6ce74a25468 100644 --- a/api/datadogV2/model_change_event_custom_attributes_impacted_resources_items.go +++ b/api/datadogV2/model_change_event_custom_attributes_impacted_resources_items.go @@ -10,14 +10,15 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// ChangeEventCustomAttributesImpactedResourcesItems Object representing a uniquely identified resource. +// ChangeEventCustomAttributesImpactedResourcesItems Object representing a uniquely identified resource. Only the resource type `service` is supported. type ChangeEventCustomAttributesImpactedResourcesItems struct { - // The name of the impacted resource. Limited to 128 characters. + // Resource's name. Name string `json:"name"` - // The type of the impacted resource. + // Resource's type. Type ChangeEventCustomAttributesImpactedResourcesItemsType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` } // NewChangeEventCustomAttributesImpactedResourcesItems instantiates a new ChangeEventCustomAttributesImpactedResourcesItems object. @@ -93,6 +94,10 @@ func (o ChangeEventCustomAttributesImpactedResourcesItems) MarshalJSON() ([]byte } toSerialize["name"] = o.Name toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } return datadog.Marshal(toSerialize) } @@ -111,6 +116,12 @@ func (o *ChangeEventCustomAttributesImpactedResourcesItems) UnmarshalJSON(bytes if all.Type == nil { return fmt.Errorf("required field type missing") } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"name", "type"}) + } else { + return err + } hasInvalidField := false o.Name = *all.Name @@ -120,6 +131,10 @@ func (o *ChangeEventCustomAttributesImpactedResourcesItems) UnmarshalJSON(bytes o.Type = *all.Type } + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + if hasInvalidField { return datadog.Unmarshal(bytes, &o.UnparsedObject) } diff --git a/api/datadogV2/model_change_event_custom_attributes_impacted_resources_items_type.go b/api/datadogV2/model_change_event_custom_attributes_impacted_resources_items_type.go index 87cf7ea1e78..69dfc09930c 100644 --- a/api/datadogV2/model_change_event_custom_attributes_impacted_resources_items_type.go +++ b/api/datadogV2/model_change_event_custom_attributes_impacted_resources_items_type.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// ChangeEventCustomAttributesImpactedResourcesItemsType The type of the impacted resource. +// ChangeEventCustomAttributesImpactedResourcesItemsType Resource's type. type ChangeEventCustomAttributesImpactedResourcesItemsType string // List of ChangeEventCustomAttributesImpactedResourcesItemsType. diff --git a/api/datadogV2/model_event_category.go b/api/datadogV2/model_event_category.go index ca7cf81fdde..abc1ca9adb5 100644 --- a/api/datadogV2/model_event_category.go +++ b/api/datadogV2/model_event_category.go @@ -10,18 +10,16 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// EventCategory Event category identifying the type of event. +// EventCategory 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 EventCategory string // List of EventCategory. const ( EVENTCATEGORY_CHANGE EventCategory = "change" - EVENTCATEGORY_ALERT EventCategory = "alert" ) var allowedEventCategoryEnumValues = []EventCategory{ EVENTCATEGORY_CHANGE, - EVENTCATEGORY_ALERT, } // GetAllowedValues reeturns the list of possible values. diff --git a/api/datadogV2/model_event_create_request.go b/api/datadogV2/model_event_create_request.go index 49e014c8fbd..9504cec7985 100644 --- a/api/datadogV2/model_event_create_request.go +++ b/api/datadogV2/model_event_create_request.go @@ -5,17 +5,15 @@ package datadogV2 import ( - "fmt" - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// EventCreateRequest An event object. +// EventCreateRequest Object representing an event creation request. type EventCreateRequest struct { // Event attributes. - Attributes EventPayload `json:"attributes"` + Attributes *EventPayload `json:"attributes,omitempty"` // Entity type. - Type EventCreateRequestType `json:"type"` + Type *EventCreateRequestType `json:"type,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -25,10 +23,8 @@ type EventCreateRequest struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewEventCreateRequest(attributes EventPayload, typeVar EventCreateRequestType) *EventCreateRequest { +func NewEventCreateRequest() *EventCreateRequest { this := EventCreateRequest{} - this.Attributes = attributes - this.Type = typeVar return &this } @@ -40,50 +36,60 @@ func NewEventCreateRequestWithDefaults() *EventCreateRequest { return &this } -// GetAttributes returns the Attributes field value. +// GetAttributes returns the Attributes field value if set, zero value otherwise. func (o *EventCreateRequest) GetAttributes() EventPayload { - if o == nil { + if o == nil || o.Attributes == nil { var ret EventPayload return ret } - return o.Attributes + return *o.Attributes } -// GetAttributesOk returns a tuple with the Attributes field value +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EventCreateRequest) GetAttributesOk() (*EventPayload, bool) { - if o == nil { + if o == nil || o.Attributes == nil { return nil, false } - return &o.Attributes, true + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *EventCreateRequest) HasAttributes() bool { + return o != nil && o.Attributes != nil } -// SetAttributes sets field value. +// SetAttributes gets a reference to the given EventPayload and assigns it to the Attributes field. func (o *EventCreateRequest) SetAttributes(v EventPayload) { - o.Attributes = v + o.Attributes = &v } -// GetType returns the Type field value. +// GetType returns the Type field value if set, zero value otherwise. func (o *EventCreateRequest) GetType() EventCreateRequestType { - if o == nil { + if o == nil || o.Type == nil { var ret EventCreateRequestType return ret } - return o.Type + return *o.Type } -// GetTypeOk returns a tuple with the Type field value +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EventCreateRequest) GetTypeOk() (*EventCreateRequestType, bool) { - if o == nil { + if o == nil || o.Type == nil { return nil, false } - return &o.Type, true + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *EventCreateRequest) HasType() bool { + return o != nil && o.Type != nil } -// SetType sets field value. +// SetType gets a reference to the given EventCreateRequestType and assigns it to the Type field. func (o *EventCreateRequest) SetType(v EventCreateRequestType) { - o.Type = v + o.Type = &v } // MarshalJSON serializes the struct using spec logic. @@ -92,8 +98,12 @@ func (o EventCreateRequest) MarshalJSON() ([]byte, error) { if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } - toSerialize["attributes"] = o.Attributes - toSerialize["type"] = o.Type + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Type != nil { + toSerialize["type"] = o.Type + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -104,18 +114,12 @@ func (o EventCreateRequest) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EventCreateRequest) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Attributes *EventPayload `json:"attributes"` - Type *EventCreateRequestType `json:"type"` + Attributes *EventPayload `json:"attributes,omitempty"` + Type *EventCreateRequestType `json:"type,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) } - if all.Attributes == nil { - return fmt.Errorf("required field attributes missing") - } - if all.Type == nil { - return fmt.Errorf("required field type missing") - } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) @@ -124,14 +128,14 @@ func (o *EventCreateRequest) UnmarshalJSON(bytes []byte) (err error) { } hasInvalidField := false - if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } - o.Attributes = *all.Attributes - if !all.Type.IsValid() { + o.Attributes = all.Attributes + if all.Type != nil && !all.Type.IsValid() { hasInvalidField = true } else { - o.Type = *all.Type + o.Type = all.Type } if len(additionalProperties) > 0 { diff --git a/api/datadogV2/model_event_create_request_payload.go b/api/datadogV2/model_event_create_request_payload.go index 11d5c45ae6a..b1616503c5b 100644 --- a/api/datadogV2/model_event_create_request_payload.go +++ b/api/datadogV2/model_event_create_request_payload.go @@ -5,15 +5,13 @@ package datadogV2 import ( - "fmt" - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) // EventCreateRequestPayload Payload for creating an event. type EventCreateRequestPayload struct { - // An event object. - Data EventCreateRequest `json:"data"` + // Object representing an event creation request. + Data *EventCreateRequest `json:"data,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -23,9 +21,8 @@ type EventCreateRequestPayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewEventCreateRequestPayload(data EventCreateRequest) *EventCreateRequestPayload { +func NewEventCreateRequestPayload() *EventCreateRequestPayload { this := EventCreateRequestPayload{} - this.Data = data return &this } @@ -37,27 +34,32 @@ func NewEventCreateRequestPayloadWithDefaults() *EventCreateRequestPayload { return &this } -// GetData returns the Data field value. +// GetData returns the Data field value if set, zero value otherwise. func (o *EventCreateRequestPayload) GetData() EventCreateRequest { - if o == nil { + if o == nil || o.Data == nil { var ret EventCreateRequest return ret } - return o.Data + return *o.Data } -// GetDataOk returns a tuple with the Data field value +// GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EventCreateRequestPayload) GetDataOk() (*EventCreateRequest, bool) { - if o == nil { + if o == nil || o.Data == nil { return nil, false } - return &o.Data, true + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *EventCreateRequestPayload) HasData() bool { + return o != nil && o.Data != nil } -// SetData sets field value. +// SetData gets a reference to the given EventCreateRequest and assigns it to the Data field. func (o *EventCreateRequestPayload) SetData(v EventCreateRequest) { - o.Data = v + o.Data = &v } // MarshalJSON serializes the struct using spec logic. @@ -66,7 +68,9 @@ func (o EventCreateRequestPayload) MarshalJSON() ([]byte, error) { if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } - toSerialize["data"] = o.Data + if o.Data != nil { + toSerialize["data"] = o.Data + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -77,14 +81,11 @@ func (o EventCreateRequestPayload) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EventCreateRequestPayload) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Data *EventCreateRequest `json:"data"` + Data *EventCreateRequest `json:"data,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) } - if all.Data == nil { - return fmt.Errorf("required field data missing") - } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { datadog.DeleteKeys(additionalProperties, &[]string{"data"}) @@ -93,10 +94,10 @@ func (o *EventCreateRequestPayload) UnmarshalJSON(bytes []byte) (err error) { } hasInvalidField := false - if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } - o.Data = *all.Data + o.Data = all.Data if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/datadogV2/model_event_create_response.go b/api/datadogV2/model_event_create_response.go index d9717567cac..52b979dd7ee 100644 --- a/api/datadogV2/model_event_create_response.go +++ b/api/datadogV2/model_event_create_response.go @@ -8,11 +8,11 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// EventCreateResponse Event object. +// EventCreateResponse Object containing an event response. type EventCreateResponse struct { - // Event attributes. + // JSON object containing all events attributes and their associated values. Attributes *EventCreateResponseAttributes `json:"attributes,omitempty"` - // Entity type. + // Event type Type *string `json:"type,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_event_create_response_attributes.go b/api/datadogV2/model_event_create_response_attributes.go index 7c67627632a..aff9c573dd7 100644 --- a/api/datadogV2/model_event_create_response_attributes.go +++ b/api/datadogV2/model_event_create_response_attributes.go @@ -8,9 +8,9 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// EventCreateResponseAttributes Event attributes. +// EventCreateResponseAttributes JSON object containing all events attributes and their associated values. type EventCreateResponseAttributes struct { - // JSON object for category-specific attributes. + // JSON object of attributes from your events. Attributes *EventCreateResponseAttributesAttributes `json:"attributes,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_event_create_response_attributes_attributes.go b/api/datadogV2/model_event_create_response_attributes_attributes.go index 8be21a6a066..9665fa59b23 100644 --- a/api/datadogV2/model_event_create_response_attributes_attributes.go +++ b/api/datadogV2/model_event_create_response_attributes_attributes.go @@ -8,7 +8,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// EventCreateResponseAttributesAttributes JSON object for category-specific attributes. +// EventCreateResponseAttributesAttributes JSON object of attributes from your events. type EventCreateResponseAttributesAttributes struct { // JSON object of event system attributes. Evt *EventCreateResponseAttributesAttributesEvt `json:"evt,omitempty"` diff --git a/api/datadogV2/model_event_create_response_attributes_attributes_evt.go b/api/datadogV2/model_event_create_response_attributes_attributes_evt.go index b35d3201d63..45ecd78c4cb 100644 --- a/api/datadogV2/model_event_create_response_attributes_attributes_evt.go +++ b/api/datadogV2/model_event_create_response_attributes_attributes_evt.go @@ -10,11 +10,8 @@ import ( // EventCreateResponseAttributesAttributesEvt JSON object of event system attributes. type EventCreateResponseAttributesAttributesEvt struct { - // Event identifier. This field is deprecated and will be removed in a future version. Use the `uid` field instead. - // Deprecated + // Event id Id *string `json:"id,omitempty"` - // A unique identifier for the event. You can use this identifier to query or reference the event. - Uid *string `json:"uid,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -38,7 +35,6 @@ func NewEventCreateResponseAttributesAttributesEvtWithDefaults() *EventCreateRes } // GetId returns the Id field value if set, zero value otherwise. -// Deprecated func (o *EventCreateResponseAttributesAttributesEvt) GetId() string { if o == nil || o.Id == nil { var ret string @@ -49,7 +45,6 @@ func (o *EventCreateResponseAttributesAttributesEvt) GetId() string { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -// Deprecated func (o *EventCreateResponseAttributesAttributesEvt) GetIdOk() (*string, bool) { if o == nil || o.Id == nil { return nil, false @@ -63,39 +58,10 @@ func (o *EventCreateResponseAttributesAttributesEvt) HasId() bool { } // SetId gets a reference to the given string and assigns it to the Id field. -// Deprecated func (o *EventCreateResponseAttributesAttributesEvt) SetId(v string) { o.Id = &v } -// GetUid returns the Uid field value if set, zero value otherwise. -func (o *EventCreateResponseAttributesAttributesEvt) GetUid() string { - if o == nil || o.Uid == nil { - var ret string - return ret - } - return *o.Uid -} - -// GetUidOk returns a tuple with the Uid field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EventCreateResponseAttributesAttributesEvt) GetUidOk() (*string, bool) { - if o == nil || o.Uid == nil { - return nil, false - } - return o.Uid, true -} - -// HasUid returns a boolean if a field has been set. -func (o *EventCreateResponseAttributesAttributesEvt) HasUid() bool { - return o != nil && o.Uid != nil -} - -// SetUid gets a reference to the given string and assigns it to the Uid field. -func (o *EventCreateResponseAttributesAttributesEvt) SetUid(v string) { - o.Uid = &v -} - // MarshalJSON serializes the struct using spec logic. func (o EventCreateResponseAttributesAttributesEvt) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -105,9 +71,6 @@ func (o EventCreateResponseAttributesAttributesEvt) MarshalJSON() ([]byte, error if o.Id != nil { toSerialize["id"] = o.Id } - if o.Uid != nil { - toSerialize["uid"] = o.Uid - } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -118,20 +81,18 @@ func (o EventCreateResponseAttributesAttributesEvt) MarshalJSON() ([]byte, error // UnmarshalJSON deserializes the given payload. func (o *EventCreateResponseAttributesAttributesEvt) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - Uid *string `json:"uid,omitempty"` + Id *string `json:"id,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"id", "uid"}) + datadog.DeleteKeys(additionalProperties, &[]string{"id"}) } else { return err } o.Id = all.Id - o.Uid = all.Uid if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/datadogV2/model_event_create_response_payload.go b/api/datadogV2/model_event_create_response_payload.go index 18dd63e0ca8..6f41f2c199a 100644 --- a/api/datadogV2/model_event_create_response_payload.go +++ b/api/datadogV2/model_event_create_response_payload.go @@ -8,12 +8,10 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// EventCreateResponsePayload Event creation response. +// EventCreateResponsePayload Response containing information about created event. type EventCreateResponsePayload struct { - // Event object. + // Object containing an event response. Data *EventCreateResponse `json:"data,omitempty"` - // Links to the event. - Links *EventCreateResponsePayloadLinks `json:"links,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -64,34 +62,6 @@ func (o *EventCreateResponsePayload) SetData(v EventCreateResponse) { o.Data = &v } -// GetLinks returns the Links field value if set, zero value otherwise. -func (o *EventCreateResponsePayload) GetLinks() EventCreateResponsePayloadLinks { - if o == nil || o.Links == nil { - var ret EventCreateResponsePayloadLinks - return ret - } - return *o.Links -} - -// GetLinksOk returns a tuple with the Links field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EventCreateResponsePayload) GetLinksOk() (*EventCreateResponsePayloadLinks, bool) { - if o == nil || o.Links == nil { - return nil, false - } - return o.Links, true -} - -// HasLinks returns a boolean if a field has been set. -func (o *EventCreateResponsePayload) HasLinks() bool { - return o != nil && o.Links != nil -} - -// SetLinks gets a reference to the given EventCreateResponsePayloadLinks and assigns it to the Links field. -func (o *EventCreateResponsePayload) SetLinks(v EventCreateResponsePayloadLinks) { - o.Links = &v -} - // MarshalJSON serializes the struct using spec logic. func (o EventCreateResponsePayload) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -101,9 +71,6 @@ func (o EventCreateResponsePayload) MarshalJSON() ([]byte, error) { if o.Data != nil { toSerialize["data"] = o.Data } - if o.Links != nil { - toSerialize["links"] = o.Links - } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -114,15 +81,14 @@ func (o EventCreateResponsePayload) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *EventCreateResponsePayload) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Data *EventCreateResponse `json:"data,omitempty"` - Links *EventCreateResponsePayloadLinks `json:"links,omitempty"` + Data *EventCreateResponse `json:"data,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"data", "links"}) + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) } else { return err } @@ -132,10 +98,6 @@ func (o *EventCreateResponsePayload) UnmarshalJSON(bytes []byte) (err error) { hasInvalidField = true } o.Data = all.Data - if all.Links != nil && all.Links.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Links = all.Links if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/datadogV2/model_event_create_response_payload_links.go b/api/datadogV2/model_event_create_response_payload_links.go deleted file mode 100644 index ac0a8e4709b..00000000000 --- a/api/datadogV2/model_event_create_response_payload_links.go +++ /dev/null @@ -1,102 +0,0 @@ -// 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. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// EventCreateResponsePayloadLinks Links to the event. -type EventCreateResponsePayloadLinks struct { - // The URL of the event. This link is only functional when using the default subdomain. - Self *string `json:"self,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewEventCreateResponsePayloadLinks instantiates a new EventCreateResponsePayloadLinks object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewEventCreateResponsePayloadLinks() *EventCreateResponsePayloadLinks { - this := EventCreateResponsePayloadLinks{} - return &this -} - -// NewEventCreateResponsePayloadLinksWithDefaults instantiates a new EventCreateResponsePayloadLinks object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewEventCreateResponsePayloadLinksWithDefaults() *EventCreateResponsePayloadLinks { - this := EventCreateResponsePayloadLinks{} - return &this -} - -// GetSelf returns the Self field value if set, zero value otherwise. -func (o *EventCreateResponsePayloadLinks) GetSelf() string { - if o == nil || o.Self == nil { - var ret string - return ret - } - return *o.Self -} - -// GetSelfOk returns a tuple with the Self field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EventCreateResponsePayloadLinks) GetSelfOk() (*string, bool) { - if o == nil || o.Self == nil { - return nil, false - } - return o.Self, true -} - -// HasSelf returns a boolean if a field has been set. -func (o *EventCreateResponsePayloadLinks) HasSelf() bool { - return o != nil && o.Self != nil -} - -// SetSelf gets a reference to the given string and assigns it to the Self field. -func (o *EventCreateResponsePayloadLinks) SetSelf(v string) { - o.Self = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o EventCreateResponsePayloadLinks) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Self != nil { - toSerialize["self"] = o.Self - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *EventCreateResponsePayloadLinks) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Self *string `json:"self,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"self"}) - } else { - return err - } - o.Self = all.Self - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_event_payload.go b/api/datadogV2/model_event_payload.go index d6634a8c6b3..8d10d414110 100644 --- a/api/datadogV2/model_event_payload.go +++ b/api/datadogV2/model_event_payload.go @@ -12,27 +12,26 @@ import ( // EventPayload Event attributes. type EventPayload struct { - // A string used for aggregation when [correlating](https://docs.datadoghq.com/service_management/events/correlation/) events. If you specify a key, events are deduplicated to alerts based on this key. Limited to 100 characters. + // An arbitrary string to use for aggregation when correlating events. Limited to 100 characters. AggregationKey *string `json:"aggregation_key,omitempty"` - // JSON object for category-specific attributes. Schema is different per event category. + // JSON object for custom attributes. Schema are different per each event category. Attributes EventPayloadAttributes `json:"attributes"` - // Event category identifying the type of event. + // 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. Category EventCategory `json:"category"` - // Integration ID sourced from integration manifests. - IntegrationId *EventPayloadIntegrationId `json:"integration_id,omitempty"` - // Free formed text associated with the event. It's suggested to use `data.attributes.attributes.custom` for well-structured attributes. Limited to 4000 characters. + // The body of the event. Limited to 4000 characters. Message *string `json:"message,omitempty"` - // A list of tags associated with the event. Maximum of 100 tags allowed. + // A list of tags to apply to the event. // Refer to [Tags docs](https://docs.datadoghq.com/getting_started/tagging/). Tags []string `json:"tags,omitempty"` // 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. Timestamp *string `json:"timestamp,omitempty"` - // The title of the event. Limited to 500 characters. + // The event title. Limited to 500 characters. Title string `json:"title"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` } // NewEventPayload instantiates a new EventPayload object. @@ -129,34 +128,6 @@ func (o *EventPayload) SetCategory(v EventCategory) { o.Category = v } -// GetIntegrationId returns the IntegrationId field value if set, zero value otherwise. -func (o *EventPayload) GetIntegrationId() EventPayloadIntegrationId { - if o == nil || o.IntegrationId == nil { - var ret EventPayloadIntegrationId - return ret - } - return *o.IntegrationId -} - -// GetIntegrationIdOk returns a tuple with the IntegrationId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *EventPayload) GetIntegrationIdOk() (*EventPayloadIntegrationId, bool) { - if o == nil || o.IntegrationId == nil { - return nil, false - } - return o.IntegrationId, true -} - -// HasIntegrationId returns a boolean if a field has been set. -func (o *EventPayload) HasIntegrationId() bool { - return o != nil && o.IntegrationId != nil -} - -// SetIntegrationId gets a reference to the given EventPayloadIntegrationId and assigns it to the IntegrationId field. -func (o *EventPayload) SetIntegrationId(v EventPayloadIntegrationId) { - o.IntegrationId = &v -} - // GetMessage returns the Message field value if set, zero value otherwise. func (o *EventPayload) GetMessage() string { if o == nil || o.Message == nil { @@ -275,9 +246,6 @@ func (o EventPayload) MarshalJSON() ([]byte, error) { } toSerialize["attributes"] = o.Attributes toSerialize["category"] = o.Category - if o.IntegrationId != nil { - toSerialize["integration_id"] = o.IntegrationId - } if o.Message != nil { toSerialize["message"] = o.Message } @@ -288,20 +256,23 @@ func (o EventPayload) MarshalJSON() ([]byte, error) { toSerialize["timestamp"] = o.Timestamp } toSerialize["title"] = o.Title + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } return datadog.Marshal(toSerialize) } // UnmarshalJSON deserializes the given payload. func (o *EventPayload) UnmarshalJSON(bytes []byte) (err error) { all := struct { - AggregationKey *string `json:"aggregation_key,omitempty"` - Attributes *EventPayloadAttributes `json:"attributes"` - Category *EventCategory `json:"category"` - IntegrationId *EventPayloadIntegrationId `json:"integration_id,omitempty"` - Message *string `json:"message,omitempty"` - Tags []string `json:"tags,omitempty"` - Timestamp *string `json:"timestamp,omitempty"` - Title *string `json:"title"` + AggregationKey *string `json:"aggregation_key,omitempty"` + Attributes *EventPayloadAttributes `json:"attributes"` + Category *EventCategory `json:"category"` + Message *string `json:"message,omitempty"` + Tags []string `json:"tags,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` + Title *string `json:"title"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) @@ -315,6 +286,12 @@ func (o *EventPayload) UnmarshalJSON(bytes []byte) (err error) { if all.Title == nil { return fmt.Errorf("required field title missing") } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"aggregation_key", "attributes", "category", "message", "tags", "timestamp", "title"}) + } else { + return err + } hasInvalidField := false o.AggregationKey = all.AggregationKey @@ -324,16 +301,15 @@ func (o *EventPayload) UnmarshalJSON(bytes []byte) (err error) { } else { o.Category = *all.Category } - if all.IntegrationId != nil && !all.IntegrationId.IsValid() { - hasInvalidField = true - } else { - o.IntegrationId = all.IntegrationId - } o.Message = all.Message o.Tags = all.Tags o.Timestamp = all.Timestamp o.Title = *all.Title + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + if hasInvalidField { return datadog.Unmarshal(bytes, &o.UnparsedObject) } diff --git a/api/datadogV2/model_event_payload_attributes.go b/api/datadogV2/model_event_payload_attributes.go index 203f87eafac..e6b8b0a28e8 100644 --- a/api/datadogV2/model_event_payload_attributes.go +++ b/api/datadogV2/model_event_payload_attributes.go @@ -8,10 +8,9 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// EventPayloadAttributes - JSON object for category-specific attributes. Schema is different per event category. +// EventPayloadAttributes - JSON object for custom attributes. Schema are different per each event category. type EventPayloadAttributes struct { ChangeEventCustomAttributes *ChangeEventCustomAttributes - AlertEventCustomAttributes *AlertEventCustomAttributes // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject interface{} @@ -22,11 +21,6 @@ func ChangeEventCustomAttributesAsEventPayloadAttributes(v *ChangeEventCustomAtt return EventPayloadAttributes{ChangeEventCustomAttributes: v} } -// AlertEventCustomAttributesAsEventPayloadAttributes is a convenience function that returns AlertEventCustomAttributes wrapped in EventPayloadAttributes. -func AlertEventCustomAttributesAsEventPayloadAttributes(v *AlertEventCustomAttributes) EventPayloadAttributes { - return EventPayloadAttributes{AlertEventCustomAttributes: v} -} - // UnmarshalJSON turns data into one of the pointers in the struct. func (obj *EventPayloadAttributes) UnmarshalJSON(data []byte) error { var err error @@ -48,27 +42,9 @@ func (obj *EventPayloadAttributes) UnmarshalJSON(data []byte) error { obj.ChangeEventCustomAttributes = nil } - // try to unmarshal data into AlertEventCustomAttributes - err = datadog.Unmarshal(data, &obj.AlertEventCustomAttributes) - if err == nil { - if obj.AlertEventCustomAttributes != nil && obj.AlertEventCustomAttributes.UnparsedObject == nil { - jsonAlertEventCustomAttributes, _ := datadog.Marshal(obj.AlertEventCustomAttributes) - if string(jsonAlertEventCustomAttributes) == "{}" { // empty struct - obj.AlertEventCustomAttributes = nil - } else { - match++ - } - } else { - obj.AlertEventCustomAttributes = nil - } - } else { - obj.AlertEventCustomAttributes = nil - } - if match != 1 { // more than 1 match // reset to nil obj.ChangeEventCustomAttributes = nil - obj.AlertEventCustomAttributes = nil return datadog.Unmarshal(data, &obj.UnparsedObject) } return nil // exactly one match @@ -80,10 +56,6 @@ func (obj EventPayloadAttributes) MarshalJSON() ([]byte, error) { return datadog.Marshal(&obj.ChangeEventCustomAttributes) } - if obj.AlertEventCustomAttributes != nil { - return datadog.Marshal(&obj.AlertEventCustomAttributes) - } - if obj.UnparsedObject != nil { return datadog.Marshal(obj.UnparsedObject) } @@ -96,10 +68,6 @@ func (obj *EventPayloadAttributes) GetActualInstance() interface{} { return obj.ChangeEventCustomAttributes } - if obj.AlertEventCustomAttributes != nil { - return obj.AlertEventCustomAttributes - } - // all schemas are nil return nil } diff --git a/api/datadogV2/model_event_payload_integration_id.go b/api/datadogV2/model_event_payload_integration_id.go deleted file mode 100644 index 6479028984b..00000000000 --- a/api/datadogV2/model_event_payload_integration_id.go +++ /dev/null @@ -1,64 +0,0 @@ -// 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. - -package datadogV2 - -import ( - "fmt" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// EventPayloadIntegrationId Integration ID sourced from integration manifests. -type EventPayloadIntegrationId string - -// List of EventPayloadIntegrationId. -const ( - EVENTPAYLOADINTEGRATIONID_CUSTOM_EVENTS EventPayloadIntegrationId = "custom-events" -) - -var allowedEventPayloadIntegrationIdEnumValues = []EventPayloadIntegrationId{ - EVENTPAYLOADINTEGRATIONID_CUSTOM_EVENTS, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *EventPayloadIntegrationId) GetAllowedValues() []EventPayloadIntegrationId { - return allowedEventPayloadIntegrationIdEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *EventPayloadIntegrationId) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = EventPayloadIntegrationId(value) - return nil -} - -// NewEventPayloadIntegrationIdFromValue returns a pointer to a valid EventPayloadIntegrationId -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewEventPayloadIntegrationIdFromValue(v string) (*EventPayloadIntegrationId, error) { - ev := EventPayloadIntegrationId(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for EventPayloadIntegrationId: valid values are %v", v, allowedEventPayloadIntegrationIdEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v EventPayloadIntegrationId) IsValid() bool { - for _, existing := range allowedEventPayloadIntegrationIdEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to EventPayloadIntegrationId value. -func (v EventPayloadIntegrationId) Ptr() *EventPayloadIntegrationId { - return &v -} diff --git a/api/datadogV2/model_get_app_key_registration_response.go b/api/datadogV2/model_get_app_key_registration_response.go deleted file mode 100644 index 3e634ba87a3..00000000000 --- a/api/datadogV2/model_get_app_key_registration_response.go +++ /dev/null @@ -1,111 +0,0 @@ -// 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. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// GetAppKeyRegistrationResponse The response object after getting an app key registration. -type GetAppKeyRegistrationResponse struct { - // Data related to the app key registration. - Data *AppKeyRegistrationData `json:"data,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewGetAppKeyRegistrationResponse instantiates a new GetAppKeyRegistrationResponse object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewGetAppKeyRegistrationResponse() *GetAppKeyRegistrationResponse { - this := GetAppKeyRegistrationResponse{} - return &this -} - -// NewGetAppKeyRegistrationResponseWithDefaults instantiates a new GetAppKeyRegistrationResponse object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewGetAppKeyRegistrationResponseWithDefaults() *GetAppKeyRegistrationResponse { - this := GetAppKeyRegistrationResponse{} - return &this -} - -// GetData returns the Data field value if set, zero value otherwise. -func (o *GetAppKeyRegistrationResponse) GetData() AppKeyRegistrationData { - if o == nil || o.Data == nil { - var ret AppKeyRegistrationData - return ret - } - return *o.Data -} - -// GetDataOk returns a tuple with the Data field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetAppKeyRegistrationResponse) GetDataOk() (*AppKeyRegistrationData, bool) { - if o == nil || o.Data == nil { - return nil, false - } - return o.Data, true -} - -// HasData returns a boolean if a field has been set. -func (o *GetAppKeyRegistrationResponse) HasData() bool { - return o != nil && o.Data != nil -} - -// SetData gets a reference to the given AppKeyRegistrationData and assigns it to the Data field. -func (o *GetAppKeyRegistrationResponse) SetData(v AppKeyRegistrationData) { - o.Data = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o GetAppKeyRegistrationResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Data != nil { - toSerialize["data"] = o.Data - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *GetAppKeyRegistrationResponse) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Data *AppKeyRegistrationData `json:"data,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"data"}) - } else { - return err - } - - hasInvalidField := false - if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Data = all.Data - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_list_app_key_registrations_response.go b/api/datadogV2/model_list_app_key_registrations_response.go deleted file mode 100644 index 6fba4050722..00000000000 --- a/api/datadogV2/model_list_app_key_registrations_response.go +++ /dev/null @@ -1,146 +0,0 @@ -// 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. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// ListAppKeyRegistrationsResponse A paginated list of app key registrations. -type ListAppKeyRegistrationsResponse struct { - // An array of app key registrations. - Data []AppKeyRegistrationData `json:"data,omitempty"` - // The definition of `ListAppKeyRegistrationsResponseMeta` object. - Meta *ListAppKeyRegistrationsResponseMeta `json:"meta,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewListAppKeyRegistrationsResponse instantiates a new ListAppKeyRegistrationsResponse object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewListAppKeyRegistrationsResponse() *ListAppKeyRegistrationsResponse { - this := ListAppKeyRegistrationsResponse{} - return &this -} - -// NewListAppKeyRegistrationsResponseWithDefaults instantiates a new ListAppKeyRegistrationsResponse object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewListAppKeyRegistrationsResponseWithDefaults() *ListAppKeyRegistrationsResponse { - this := ListAppKeyRegistrationsResponse{} - return &this -} - -// GetData returns the Data field value if set, zero value otherwise. -func (o *ListAppKeyRegistrationsResponse) GetData() []AppKeyRegistrationData { - if o == nil || o.Data == nil { - var ret []AppKeyRegistrationData - return ret - } - return o.Data -} - -// GetDataOk returns a tuple with the Data field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListAppKeyRegistrationsResponse) GetDataOk() (*[]AppKeyRegistrationData, bool) { - if o == nil || o.Data == nil { - return nil, false - } - return &o.Data, true -} - -// HasData returns a boolean if a field has been set. -func (o *ListAppKeyRegistrationsResponse) HasData() bool { - return o != nil && o.Data != nil -} - -// SetData gets a reference to the given []AppKeyRegistrationData and assigns it to the Data field. -func (o *ListAppKeyRegistrationsResponse) SetData(v []AppKeyRegistrationData) { - o.Data = v -} - -// GetMeta returns the Meta field value if set, zero value otherwise. -func (o *ListAppKeyRegistrationsResponse) GetMeta() ListAppKeyRegistrationsResponseMeta { - if o == nil || o.Meta == nil { - var ret ListAppKeyRegistrationsResponseMeta - return ret - } - return *o.Meta -} - -// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListAppKeyRegistrationsResponse) GetMetaOk() (*ListAppKeyRegistrationsResponseMeta, bool) { - if o == nil || o.Meta == nil { - return nil, false - } - return o.Meta, true -} - -// HasMeta returns a boolean if a field has been set. -func (o *ListAppKeyRegistrationsResponse) HasMeta() bool { - return o != nil && o.Meta != nil -} - -// SetMeta gets a reference to the given ListAppKeyRegistrationsResponseMeta and assigns it to the Meta field. -func (o *ListAppKeyRegistrationsResponse) SetMeta(v ListAppKeyRegistrationsResponseMeta) { - o.Meta = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o ListAppKeyRegistrationsResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Data != nil { - toSerialize["data"] = o.Data - } - if o.Meta != nil { - toSerialize["meta"] = o.Meta - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *ListAppKeyRegistrationsResponse) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Data []AppKeyRegistrationData `json:"data,omitempty"` - Meta *ListAppKeyRegistrationsResponseMeta `json:"meta,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"data", "meta"}) - } else { - return err - } - - hasInvalidField := false - o.Data = all.Data - if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Meta = all.Meta - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/api/datadogV2/model_list_app_key_registrations_response_meta.go b/api/datadogV2/model_list_app_key_registrations_response_meta.go deleted file mode 100644 index f2ce99261a5..00000000000 --- a/api/datadogV2/model_list_app_key_registrations_response_meta.go +++ /dev/null @@ -1,137 +0,0 @@ -// 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. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// ListAppKeyRegistrationsResponseMeta The definition of `ListAppKeyRegistrationsResponseMeta` object. -type ListAppKeyRegistrationsResponseMeta struct { - // The total number of app key registrations. - Total *int64 `json:"total,omitempty"` - // The total number of app key registrations that match the specified filters. - TotalFiltered *int64 `json:"total_filtered,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewListAppKeyRegistrationsResponseMeta instantiates a new ListAppKeyRegistrationsResponseMeta object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewListAppKeyRegistrationsResponseMeta() *ListAppKeyRegistrationsResponseMeta { - this := ListAppKeyRegistrationsResponseMeta{} - return &this -} - -// NewListAppKeyRegistrationsResponseMetaWithDefaults instantiates a new ListAppKeyRegistrationsResponseMeta object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewListAppKeyRegistrationsResponseMetaWithDefaults() *ListAppKeyRegistrationsResponseMeta { - this := ListAppKeyRegistrationsResponseMeta{} - return &this -} - -// GetTotal returns the Total field value if set, zero value otherwise. -func (o *ListAppKeyRegistrationsResponseMeta) GetTotal() int64 { - if o == nil || o.Total == nil { - var ret int64 - return ret - } - return *o.Total -} - -// GetTotalOk returns a tuple with the Total field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListAppKeyRegistrationsResponseMeta) GetTotalOk() (*int64, bool) { - if o == nil || o.Total == nil { - return nil, false - } - return o.Total, true -} - -// HasTotal returns a boolean if a field has been set. -func (o *ListAppKeyRegistrationsResponseMeta) HasTotal() bool { - return o != nil && o.Total != nil -} - -// SetTotal gets a reference to the given int64 and assigns it to the Total field. -func (o *ListAppKeyRegistrationsResponseMeta) SetTotal(v int64) { - o.Total = &v -} - -// GetTotalFiltered returns the TotalFiltered field value if set, zero value otherwise. -func (o *ListAppKeyRegistrationsResponseMeta) GetTotalFiltered() int64 { - if o == nil || o.TotalFiltered == nil { - var ret int64 - return ret - } - return *o.TotalFiltered -} - -// GetTotalFilteredOk returns a tuple with the TotalFiltered field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListAppKeyRegistrationsResponseMeta) GetTotalFilteredOk() (*int64, bool) { - if o == nil || o.TotalFiltered == nil { - return nil, false - } - return o.TotalFiltered, true -} - -// HasTotalFiltered returns a boolean if a field has been set. -func (o *ListAppKeyRegistrationsResponseMeta) HasTotalFiltered() bool { - return o != nil && o.TotalFiltered != nil -} - -// SetTotalFiltered gets a reference to the given int64 and assigns it to the TotalFiltered field. -func (o *ListAppKeyRegistrationsResponseMeta) SetTotalFiltered(v int64) { - o.TotalFiltered = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o ListAppKeyRegistrationsResponseMeta) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Total != nil { - toSerialize["total"] = o.Total - } - if o.TotalFiltered != nil { - toSerialize["total_filtered"] = o.TotalFiltered - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *ListAppKeyRegistrationsResponseMeta) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Total *int64 `json:"total,omitempty"` - TotalFiltered *int64 `json:"total_filtered,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"total", "total_filtered"}) - } else { - return err - } - o.Total = all.Total - o.TotalFiltered = all.TotalFiltered - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_register_app_key_response.go b/api/datadogV2/model_register_app_key_response.go deleted file mode 100644 index 31714324534..00000000000 --- a/api/datadogV2/model_register_app_key_response.go +++ /dev/null @@ -1,111 +0,0 @@ -// 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. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// RegisterAppKeyResponse The response object after creating an app key registration. -type RegisterAppKeyResponse struct { - // Data related to the app key registration. - Data *AppKeyRegistrationData `json:"data,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewRegisterAppKeyResponse instantiates a new RegisterAppKeyResponse object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewRegisterAppKeyResponse() *RegisterAppKeyResponse { - this := RegisterAppKeyResponse{} - return &this -} - -// NewRegisterAppKeyResponseWithDefaults instantiates a new RegisterAppKeyResponse object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewRegisterAppKeyResponseWithDefaults() *RegisterAppKeyResponse { - this := RegisterAppKeyResponse{} - return &this -} - -// GetData returns the Data field value if set, zero value otherwise. -func (o *RegisterAppKeyResponse) GetData() AppKeyRegistrationData { - if o == nil || o.Data == nil { - var ret AppKeyRegistrationData - return ret - } - return *o.Data -} - -// GetDataOk returns a tuple with the Data field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RegisterAppKeyResponse) GetDataOk() (*AppKeyRegistrationData, bool) { - if o == nil || o.Data == nil { - return nil, false - } - return o.Data, true -} - -// HasData returns a boolean if a field has been set. -func (o *RegisterAppKeyResponse) HasData() bool { - return o != nil && o.Data != nil -} - -// SetData gets a reference to the given AppKeyRegistrationData and assigns it to the Data field. -func (o *RegisterAppKeyResponse) SetData(v AppKeyRegistrationData) { - o.Data = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o RegisterAppKeyResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Data != nil { - toSerialize["data"] = o.Data - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *RegisterAppKeyResponse) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Data *AppKeyRegistrationData `json:"data,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"data"}) - } else { - return err - } - - hasInvalidField := false - if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Data = all.Data - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - - return nil -} diff --git a/examples/v2/action-connection/GetAppKeyRegistration.go b/examples/v2/action-connection/GetAppKeyRegistration.go deleted file mode 100644 index 0237c069ec4..00000000000 --- a/examples/v2/action-connection/GetAppKeyRegistration.go +++ /dev/null @@ -1,29 +0,0 @@ -// Get an existing App Key Registration returns "OK" response - -package main - -import ( - "context" - "encoding/json" - "fmt" - "os" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" - "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" -) - -func main() { - ctx := datadog.NewDefaultContext(context.Background()) - configuration := datadog.NewConfiguration() - apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewActionConnectionApi(apiClient) - resp, r, err := api.GetAppKeyRegistration(ctx, "b7feea52-994e-4714-a100-1bd9eff5aee1") - - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActionConnectionApi.GetAppKeyRegistration`: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - - responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `ActionConnectionApi.GetAppKeyRegistration`:\n%s\n", responseContent) -} diff --git a/examples/v2/action-connection/ListAppKeyRegistrations.go b/examples/v2/action-connection/ListAppKeyRegistrations.go deleted file mode 100644 index ba21f05bfd8..00000000000 --- a/examples/v2/action-connection/ListAppKeyRegistrations.go +++ /dev/null @@ -1,29 +0,0 @@ -// List App Key Registrations returns "OK" response - -package main - -import ( - "context" - "encoding/json" - "fmt" - "os" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" - "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" -) - -func main() { - ctx := datadog.NewDefaultContext(context.Background()) - configuration := datadog.NewConfiguration() - apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewActionConnectionApi(apiClient) - resp, r, err := api.ListAppKeyRegistrations(ctx, *datadogV2.NewListAppKeyRegistrationsOptionalParameters()) - - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActionConnectionApi.ListAppKeyRegistrations`: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - - responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `ActionConnectionApi.ListAppKeyRegistrations`:\n%s\n", responseContent) -} diff --git a/examples/v2/action-connection/RegisterAppKey.go b/examples/v2/action-connection/RegisterAppKey.go deleted file mode 100644 index cc9c93671b6..00000000000 --- a/examples/v2/action-connection/RegisterAppKey.go +++ /dev/null @@ -1,29 +0,0 @@ -// Register a new App Key returns "Created" response - -package main - -import ( - "context" - "encoding/json" - "fmt" - "os" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" - "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" -) - -func main() { - ctx := datadog.NewDefaultContext(context.Background()) - configuration := datadog.NewConfiguration() - apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewActionConnectionApi(apiClient) - resp, r, err := api.RegisterAppKey(ctx, "b7feea52-994e-4714-a100-1bd9eff5aee1") - - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActionConnectionApi.RegisterAppKey`: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - - responseContent, _ := json.MarshalIndent(resp, "", " ") - fmt.Fprintf(os.Stdout, "Response from `ActionConnectionApi.RegisterAppKey`:\n%s\n", responseContent) -} diff --git a/examples/v2/action-connection/UnregisterAppKey.go b/examples/v2/action-connection/UnregisterAppKey.go deleted file mode 100644 index 1ba3bca04d2..00000000000 --- a/examples/v2/action-connection/UnregisterAppKey.go +++ /dev/null @@ -1,25 +0,0 @@ -// Unregister an App Key returns "No Content" response - -package main - -import ( - "context" - "fmt" - "os" - - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" - "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" -) - -func main() { - ctx := datadog.NewDefaultContext(context.Background()) - configuration := datadog.NewConfiguration() - apiClient := datadog.NewAPIClient(configuration) - api := datadogV2.NewActionConnectionApi(apiClient) - r, err := api.UnregisterAppKey(ctx, "57cc69ae-9214-4ecc-8df8-43ecc1d92d99") - - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ActionConnectionApi.UnregisterAppKey`: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} diff --git a/examples/v2/events/CreateEvent.go b/examples/v2/events/CreateEvent.go index 769225715da..75785df172c 100644 --- a/examples/v2/events/CreateEvent.go +++ b/examples/v2/events/CreateEvent.go @@ -14,13 +14,12 @@ import ( func main() { body := datadogV2.EventCreateRequestPayload{ - Data: datadogV2.EventCreateRequest{ - Attributes: datadogV2.EventPayload{ - AggregationKey: datadog.PtrString("aggregation_key_123"), + Data: &datadogV2.EventCreateRequest{ + Attributes: &datadogV2.EventPayload{ Attributes: datadogV2.EventPayloadAttributes{ ChangeEventCustomAttributes: &datadogV2.ChangeEventCustomAttributes{ Author: &datadogV2.ChangeEventCustomAttributesAuthor{ - Name: "example@datadog.com", + Name: "datadog@datadog.com", Type: datadogV2.CHANGEEVENTCUSTOMATTRIBUTESAUTHORTYPE_USER, }, ChangeMetadata: map[string]interface{}{ @@ -48,15 +47,14 @@ func main() { "rule": "{'datacenter': 'devcycle.us1.prod'}", }, }}, - Category: datadogV2.EVENTCATEGORY_CHANGE, - IntegrationId: datadogV2.EVENTPAYLOADINTEGRATIONID_CUSTOM_EVENTS.Ptr(), - Message: datadog.PtrString("payment_processed feature flag has been enabled"), + Category: datadogV2.EVENTCATEGORY_CHANGE, + Message: datadog.PtrString("payment_processed feature flag has been enabled"), Tags: []string{ - "env:api_client_test", + "env:test", }, Title: "payment_processed feature flag updated", }, - Type: datadogV2.EVENTCREATEREQUESTTYPE_EVENT, + Type: datadogV2.EVENTCREATEREQUESTTYPE_EVENT.Ptr(), }, } ctx := datadog.NewDefaultContext(context.Background()) diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_Bad_request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_Bad_request_response.freeze deleted file mode 100644 index bf4ba6bc770..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_Bad_request_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2025-06-13T17:54:59.658Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_Bad_request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_Bad_request_response.yaml deleted file mode 100644 index 2f00e260b55..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_Bad_request_response.yaml +++ /dev/null @@ -1,20 +0,0 @@ -interactions: -- request: - body: '' - form: {} - headers: - Accept: - - application/json - id: 0 - method: GET - url: https://api.datadoghq.com/api/v2/actions/app_key_registrations/not_valid_app_key_id - response: - body: '{"errors":[{"status":"400","title":"Invalid Parameter","detail":"invalid - parameter \"appKeyId\" in \"path\"; expected type \"uuid\""}]}' - code: 400 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 400 Bad Request -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_Not_found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_Not_found_response.freeze deleted file mode 100644 index f50611d250b..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_Not_found_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2025-06-13T18:04:07.176Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_Not_found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_Not_found_response.yaml deleted file mode 100644 index 1c0530c51c8..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_Not_found_response.yaml +++ /dev/null @@ -1,19 +0,0 @@ -interactions: -- request: - body: '' - form: {} - headers: - Accept: - - application/json - id: 0 - method: GET - url: https://api.datadoghq.com/api/v2/actions/app_key_registrations/aaa11111-aa11-aa11-aaaa-aaaaaa111111 - response: - body: '{"errors":[{"detail":"app key not found"}]}' - code: 404 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 404 Not Found -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_OK_response.freeze deleted file mode 100644 index 6a5bad178a6..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2025-06-13T18:04:07.258Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_OK_response.yaml deleted file mode 100644 index 60070a2fd88..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Get_an_existing_App_Key_Registration_returns_OK_response.yaml +++ /dev/null @@ -1,19 +0,0 @@ -interactions: -- request: - body: '' - form: {} - headers: - Accept: - - application/json - id: 0 - method: GET - url: https://api.datadoghq.com/api/v2/actions/app_key_registrations/b7feea52-994e-4714-a100-1bd9eff5aee1 - response: - body: '{"data":{"id":"b7feea52-994e-4714-a100-1bd9eff5aee1","type":"app_key_registration"}}' - code: 200 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 200 OK -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_List_App_Key_Registrations_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_List_App_Key_Registrations_returns_OK_response.freeze deleted file mode 100644 index 1ecc5c9b090..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_List_App_Key_Registrations_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2025-06-13T18:04:07.439Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_List_App_Key_Registrations_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_List_App_Key_Registrations_returns_OK_response.yaml deleted file mode 100644 index 964e707d3bb..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_List_App_Key_Registrations_returns_OK_response.yaml +++ /dev/null @@ -1,19 +0,0 @@ -interactions: -- request: - body: '' - form: {} - headers: - Accept: - - application/json - id: 0 - method: GET - url: https://api.datadoghq.com/api/v2/actions/app_key_registrations - response: - body: '{"data":[{"id":"b7feea52-994e-4714-a100-1bd9eff5aee1","type":"app_key_registration"}],"meta":{"total":1,"total_filtered":1}}' - code: 200 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 200 OK -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Register_a_new_App_Key_returns_Bad_request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Register_a_new_App_Key_returns_Bad_request_response.freeze deleted file mode 100644 index aaa15730d79..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Register_a_new_App_Key_returns_Bad_request_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2025-06-13T17:55:00.012Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Register_a_new_App_Key_returns_Bad_request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Register_a_new_App_Key_returns_Bad_request_response.yaml deleted file mode 100644 index 09b3e59adf9..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Register_a_new_App_Key_returns_Bad_request_response.yaml +++ /dev/null @@ -1,20 +0,0 @@ -interactions: -- request: - body: '' - form: {} - headers: - Accept: - - application/json - id: 0 - method: PUT - url: https://api.datadoghq.com/api/v2/actions/app_key_registrations/not_valid_app_key_id - response: - body: '{"errors":[{"status":"400","title":"Invalid Parameter","detail":"invalid - parameter \"appKeyId\" in \"path\"; expected type \"uuid\""}]}' - code: 400 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 400 Bad Request -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Register_a_new_App_Key_returns_Created_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Register_a_new_App_Key_returns_Created_response.freeze deleted file mode 100644 index 4b01ba1fe06..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Register_a_new_App_Key_returns_Created_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2025-06-13T18:04:07.513Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Register_a_new_App_Key_returns_Created_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Register_a_new_App_Key_returns_Created_response.yaml deleted file mode 100644 index 791646bfbd9..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Register_a_new_App_Key_returns_Created_response.yaml +++ /dev/null @@ -1,19 +0,0 @@ -interactions: -- request: - body: '' - form: {} - headers: - Accept: - - application/json - id: 0 - method: PUT - url: https://api.datadoghq.com/api/v2/actions/app_key_registrations/b7feea52-994e-4714-a100-1bd9eff5aee1 - response: - body: '{"data":{"id":"b7feea52-994e-4714-a100-1bd9eff5aee1","type":"app_key_registration"}}' - code: 201 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 201 Created -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Unregister_an_App_Key_returns_Bad_request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Unregister_an_App_Key_returns_Bad_request_response.freeze deleted file mode 100644 index 4a543730c9d..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Unregister_an_App_Key_returns_Bad_request_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2025-06-13T17:55:00.202Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Unregister_an_App_Key_returns_Bad_request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Unregister_an_App_Key_returns_Bad_request_response.yaml deleted file mode 100644 index d01fbf6f456..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Unregister_an_App_Key_returns_Bad_request_response.yaml +++ /dev/null @@ -1,20 +0,0 @@ -interactions: -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - id: 0 - method: DELETE - url: https://api.datadoghq.com/api/v2/actions/app_key_registrations/not_valid_app_key_id - response: - body: '{"errors":[{"status":"400","title":"Invalid Parameter","detail":"invalid - parameter \"appKeyId\" in \"path\"; expected type \"uuid\""}]}' - code: 400 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 400 Bad Request -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Unregister_an_App_Key_returns_Not_found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Unregister_an_App_Key_returns_Not_found_response.freeze deleted file mode 100644 index d53b2da2cc0..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Unregister_an_App_Key_returns_Not_found_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2025-06-13T18:04:07.614Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Unregister_an_App_Key_returns_Not_found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Unregister_an_App_Key_returns_Not_found_response.yaml deleted file mode 100644 index 6550e2fe73e..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Action_Connection/Scenario_Unregister_an_App_Key_returns_Not_found_response.yaml +++ /dev/null @@ -1,19 +0,0 @@ -interactions: -- request: - body: '' - form: {} - headers: - Accept: - - '*/*' - id: 0 - method: DELETE - url: https://api.datadoghq.com/api/v2/actions/app_key_registrations/57cc69ae-9214-4ecc-8df8-43ecc1d92d99 - response: - body: '{"errors":[{"detail":"app key not found"}]}' - code: 404 - duration: 0ms - headers: - Content-Type: - - application/vnd.api+json - status: 404 Not Found -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Events/Scenario_Post_an_event_returns_Bad_request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Events/Scenario_Post_an_event_returns_Bad_request_response.freeze deleted file mode 100644 index a1cd4e8e4ac..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Events/Scenario_Post_an_event_returns_Bad_request_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2025-06-10T15:38:58.529Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Events/Scenario_Post_an_event_returns_Bad_request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Events/Scenario_Post_an_event_returns_Bad_request_response.yaml deleted file mode 100644 index 4cabd4af0a1..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Events/Scenario_Post_an_event_returns_Bad_request_response.yaml +++ /dev/null @@ -1,23 +0,0 @@ -interactions: -- request: - body: | - {"data":{"attributes":{"aggregation_key":"aggregation_key_123","attributes":{"author":{"name":"example@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":"invalid","integration_id":"custom-events","message":"payment_processed feature flag has been enabled","tags":["env:api_client_test"],"title":"payment_processed feature flag updated"},"type":"event"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - id: 0 - method: POST - url: https://event-management-intake.datadoghq.com/api/v2/events - response: - body: '{"errors":[{"status":"400","title":"Bad Request","detail":"JSON validation - failed at $.data.attributes.category: value must be one of: [\"alert\", \"change\"]."}]}' - code: 400 - duration: 0ms - headers: - Content-Type: - - application/json - status: 400 Bad Request -version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Events/Scenario_Post_an_event_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Events/Scenario_Post_an_event_returns_OK_response.freeze deleted file mode 100644 index 42309286e25..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Events/Scenario_Post_an_event_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2025-06-10T15:38:58.954Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Events/Scenario_Post_an_event_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Events/Scenario_Post_an_event_returns_OK_response.yaml deleted file mode 100644 index b3844e6493d..00000000000 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Events/Scenario_Post_an_event_returns_OK_response.yaml +++ /dev/null @@ -1,22 +0,0 @@ -interactions: -- request: - body: | - {"data":{"attributes":{"aggregation_key":"aggregation_key_123","attributes":{"author":{"name":"example@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","integration_id":"custom-events","message":"payment_processed feature flag has been enabled","tags":["env:api_client_test"],"title":"payment_processed feature flag updated"},"type":"event"}} - form: {} - headers: - Accept: - - application/json - Content-Type: - - application/json - id: 0 - method: POST - url: https://event-management-intake.datadoghq.com/api/v2/events - response: - body: '{"data":{"attributes":{"attributes":{"evt":{"uid":"AZdafqaTAACKG_iMQ82pmAAA"}}},"id":"_","type":"event"},"links":{"self":"https://app.datadoghq.com/event/event?uid=AZdafqaTAACKG_iMQ82pmAAA"}}' - code: 202 - duration: 0ms - headers: - Content-Type: - - application/json - status: 202 Accepted -version: 2 diff --git a/tests/scenarios/features/v2/action_connection.feature b/tests/scenarios/features/v2/action_connection.feature index 759615a8fd6..3189007fbcd 100644 --- a/tests/scenarios/features/v2/action_connection.feature +++ b/tests/scenarios/features/v2/action_connection.feature @@ -64,74 +64,6 @@ Feature: Action Connection When the request is sent Then the response status is 200 Successfully get Action Connection - @team:DataDog/workflow-automation-dev - Scenario: Get an existing App Key Registration returns "Bad request" response - Given new "GetAppKeyRegistration" request - And request contains "app_key_id" parameter with value "not_valid_app_key_id" - When the request is sent - Then the response status is 400 Bad request - - @team:DataDog/workflow-automation-dev - Scenario: Get an existing App Key Registration returns "Not found" response - Given new "GetAppKeyRegistration" request - And request contains "app_key_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" - When the request is sent - Then the response status is 404 Not found - - @team:DataDog/workflow-automation-dev - Scenario: Get an existing App Key Registration returns "OK" response - Given new "GetAppKeyRegistration" request - And request contains "app_key_id" parameter with value "b7feea52-994e-4714-a100-1bd9eff5aee1" - When the request is sent - Then the response status is 200 OK - - @skip @team:DataDog/workflow-automation-dev - Scenario: List App Key Registrations returns "Bad request" response - Given new "ListAppKeyRegistrations" request - When the request is sent - Then the response status is 400 Bad request - - @team:DataDog/workflow-automation-dev - Scenario: List App Key Registrations returns "OK" response - Given new "ListAppKeyRegistrations" request - When the request is sent - Then the response status is 200 OK - - @team:DataDog/workflow-automation-dev - Scenario: Register a new App Key returns "Bad request" response - Given new "RegisterAppKey" request - And request contains "app_key_id" parameter with value "not_valid_app_key_id" - When the request is sent - Then the response status is 400 Bad request - - @team:DataDog/workflow-automation-dev - Scenario: Register a new App Key returns "Created" response - Given new "RegisterAppKey" request - And request contains "app_key_id" parameter with value "b7feea52-994e-4714-a100-1bd9eff5aee1" - When the request is sent - Then the response status is 201 Created - - @team:DataDog/workflow-automation-dev - Scenario: Unregister an App Key returns "Bad request" response - Given new "UnregisterAppKey" request - And request contains "app_key_id" parameter with value "not_valid_app_key_id" - When the request is sent - Then the response status is 400 Bad request - - @skip @team:DataDog/workflow-automation-dev - Scenario: Unregister an App Key returns "No Content" response - Given new "UnregisterAppKey" request - And request contains "app_key_id" parameter with value "57cc69ae-9214-4ecc-8df8-43ecc1d92d99" - When the request is sent - Then the response status is 204 No Content - - @team:DataDog/workflow-automation-dev - Scenario: Unregister an App Key returns "Not found" response - Given new "UnregisterAppKey" request - And request contains "app_key_id" parameter with value "57cc69ae-9214-4ecc-8df8-43ecc1d92d99" - When the request is sent - Then the response status is 404 Not found - @team:DataDog/workflow-automation-dev Scenario: Update an existing Action Connection returns "Bad Request" response Given new "UpdateActionConnection" request diff --git a/tests/scenarios/features/v2/events.feature b/tests/scenarios/features/v2/events.feature index 0a69d195201..a8c1307ac68 100644 --- a/tests/scenarios/features/v2/events.feature +++ b/tests/scenarios/features/v2/events.feature @@ -50,21 +50,19 @@ Feature: Events Then the response status is 200 OK And the response "data" has length 0 - @team:DataDog/event-management + @generated @skip @team:DataDog/event-management Scenario: Post an event returns "Bad request" response Given new "CreateEvent" request - And body with value {"data": {"attributes": {"aggregation_key": "aggregation_key_123", "attributes": {"author": {"name": "example@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": "invalid", "integration_id": "custom-events", "message": "payment_processed feature flag has been enabled", "tags": ["env:api_client_test"], "title": "payment_processed feature flag updated"}, "type": "event"}} + 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": ["env:test"], "title": "payment_processed feature flag updated"}, "type": "event"}} When the request is sent Then the response status is 400 Bad request - @skip-validation @team:DataDog/event-management + @generated @skip @team:DataDog/event-management Scenario: Post an event returns "OK" response Given new "CreateEvent" request - And body with value {"data": {"attributes": {"aggregation_key": "aggregation_key_123", "attributes": {"author": {"name": "example@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", "integration_id": "custom-events", "message": "payment_processed feature flag has been enabled", "tags": ["env:api_client_test"], "title": "payment_processed feature flag updated"}, "type": "event"}} + 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": ["env:test"], "title": "payment_processed feature flag updated"}, "type": "event"}} When the request is sent - Then the response status is 202 OK - And the response "data.type" is equal to "event" - And the response "data.attributes.attributes.evt" has field "uid" + Then the response status is 200 OK @team:DataDog/event-management Scenario: Search events returns "Bad Request" response diff --git a/tests/scenarios/features/v2/undo.json b/tests/scenarios/features/v2/undo.json index 5c77eb80f04..e81cb7b7ce1 100644 --- a/tests/scenarios/features/v2/undo.json +++ b/tests/scenarios/features/v2/undo.json @@ -1,28 +1,4 @@ { - "ListAppKeyRegistrations": { - "tag": "Action Connection", - "undo": { - "type": "safe" - } - }, - "UnregisterAppKey": { - "tag": "Action Connection", - "undo": { - "type": "idempotent" - } - }, - "GetAppKeyRegistration": { - "tag": "Action Connection", - "undo": { - "type": "safe" - } - }, - "RegisterAppKey": { - "tag": "Action Connection", - "undo": { - "type": "idempotent" - } - }, "CreateActionConnection": { "tag": "Action Connection", "undo": { @@ -958,7 +934,7 @@ "CreateEvent": { "tag": "Events", "undo": { - "type": "safe" + "type": "unsafe" } }, "SearchEvents": {