From 860ed525ad6caf60a50a7413275a92a7db5be41c Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 6 Feb 2026 10:16:03 +0000 Subject: [PATCH] Regenerate client from commit f1b97e5 of spec repo --- .generator/schemas/v2/openapi.yaml | 472 ++++++++++++++++++ .../CreateIncidentTimestampOverride.rb | 18 + .../DeleteIncidentTimestampOverride.rb | 8 + .../ListIncidentTimestampOverrides.rb | 8 + .../UpdateIncidentTimestampOverride.rb | 17 + features/scenarios_model_mapping.rb | 20 + features/v2/incidents.feature | 91 ++++ features/v2/undo.json | 24 + lib/datadog_api_client/configuration.rb | 4 + lib/datadog_api_client/inflector.rb | 17 + .../v2/api/incidents_api.rb | 316 ++++++++++++ .../incident_timestamp_override_attributes.rb | 225 +++++++++ ...nt_timestamp_override_create_attributes.rb | 144 ++++++ ...incident_timestamp_override_create_data.rb | 144 ++++++ ...ident_timestamp_override_create_request.rb | 123 +++++ .../incident_timestamp_override_data.rb | 186 +++++++ ...ent_timestamp_override_patch_attributes.rb | 123 +++++ .../incident_timestamp_override_patch_data.rb | 144 ++++++ ...cident_timestamp_override_patch_request.rb | 123 +++++ ...cident_timestamp_override_relationships.rb | 144 ++++++ .../incident_timestamp_override_response.rb | 135 +++++ .../incident_timestamp_overrides_response.rb | 137 +++++ .../incidents_timestamp_overrides_type.rb | 26 + .../timestamp_override_user_relationship.rb | 123 +++++ ...mestamp_override_user_relationship_data.rb | 144 ++++++ .../v2/models/timestamp_type.rb | 29 ++ .../v2/models/user_included.rb | 165 ++++++ .../v2/models/user_included_attributes.rb | 207 ++++++++ 28 files changed, 3317 insertions(+) create mode 100644 examples/v2/incidents/CreateIncidentTimestampOverride.rb create mode 100644 examples/v2/incidents/DeleteIncidentTimestampOverride.rb create mode 100644 examples/v2/incidents/ListIncidentTimestampOverrides.rb create mode 100644 examples/v2/incidents/UpdateIncidentTimestampOverride.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_override_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_override_create_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_override_create_data.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_override_create_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_override_data.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_override_patch_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_override_patch_data.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_override_patch_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_override_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_override_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_overrides_response.rb create mode 100644 lib/datadog_api_client/v2/models/incidents_timestamp_overrides_type.rb create mode 100644 lib/datadog_api_client/v2/models/timestamp_override_user_relationship.rb create mode 100644 lib/datadog_api_client/v2/models/timestamp_override_user_relationship_data.rb create mode 100644 lib/datadog_api_client/v2/models/timestamp_type.rb create mode 100644 lib/datadog_api_client/v2/models/user_included.rb create mode 100644 lib/datadog_api_client/v2/models/user_included_attributes.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e301432aca72..1fbbc4330265 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -494,6 +494,15 @@ components: items: $ref: '#/components/schemas/GetIssueIncludeQueryParameterItem' type: array + IncidentID: + description: The UUID of the incident. + in: path + name: incident_id + required: true + schema: + example: 9cecfde8-e35d-4387-8985-9b30dcb9cb1c + format: uuid + type: string IncidentIDPathParameter: description: The UUID of the incident. in: path @@ -660,6 +669,14 @@ components: schema: example: ExampleTeamName type: string + IncidentTimestampOverrideInclude: + description: Specifies which types of related objects are included in the response. + in: query + name: include + required: false + schema: + example: created_by_user,last_modified_by_user + type: string IncidentTodoIDPathParameter: description: The UUID of the incident todo. in: path @@ -689,6 +706,15 @@ components: required: false schema: $ref: '#/components/schemas/IncludeType' + IncludeDeleted: + description: Specifies whether to include deleted timestamp overrides in the + response. + in: query + name: include-deleted + required: false + schema: + example: false + type: boolean InstanceId: description: The ID of the workflow instance. in: path @@ -1152,6 +1178,15 @@ components: required: true schema: type: string + TimestampOverrideID: + description: The UUID of the timestamp override. + in: path + name: timestamp_override_id + required: true + schema: + example: 6f48a86f-9a39-4bcf-a76b-9a1b20188995 + format: uuid + type: string ToTimestamp: description: The ending timestamp for the SLO status query in epoch seconds. in: query @@ -30334,6 +30369,168 @@ components: nullable: false type: string type: object + IncidentTimestampOverrideAttributes: + description: Attributes of an incident timestamp override. + properties: + created_at: + description: Timestamp of when the override was created. + example: '2026-01-13T17:15:55.379155748Z' + format: date-time + type: string + deleted_at: + description: Timestamp of when the override was deleted (soft delete). + example: null + format: date-time + nullable: true + type: string + incident_id: + description: The UUID of the incident. + example: 9cecfde8-e35d-4387-8985-9b30dcb9cb1c + format: uuid + type: string + modified_at: + description: Timestamp of when the override was last modified. + example: '2026-01-13T17:15:55.379155834Z' + format: date-time + type: string + timestamp_type: + $ref: '#/components/schemas/TimestampType' + timestamp_value: + description: The timestamp value for the override. + example: '2024-12-29T10:00:00Z' + format: date-time + type: string + required: + - incident_id + - timestamp_type + - timestamp_value + - created_at + - modified_at + - deleted_at + type: object + IncidentTimestampOverrideCreateAttributes: + description: Attributes for creating an incident timestamp override. + properties: + timestamp_type: + $ref: '#/components/schemas/TimestampType' + timestamp_value: + description: The timestamp value for the override. + example: '2024-12-29T10:00:00Z' + format: date-time + type: string + required: + - timestamp_type + - timestamp_value + type: object + IncidentTimestampOverrideCreateData: + description: Data for creating an incident timestamp override. + properties: + attributes: + $ref: '#/components/schemas/IncidentTimestampOverrideCreateAttributes' + type: + $ref: '#/components/schemas/IncidentsTimestampOverridesType' + required: + - type + - attributes + type: object + IncidentTimestampOverrideCreateRequest: + description: Request to create an incident timestamp override. + properties: + data: + $ref: '#/components/schemas/IncidentTimestampOverrideCreateData' + required: + - data + type: object + IncidentTimestampOverrideData: + description: Data for a single incident timestamp override. + properties: + attributes: + $ref: '#/components/schemas/IncidentTimestampOverrideAttributes' + id: + description: The UUID of the timestamp override. + example: 35301c93-75c0-4ec4-a889-28e1dfc092a9 + format: uuid + type: string + relationships: + $ref: '#/components/schemas/IncidentTimestampOverrideRelationships' + type: + $ref: '#/components/schemas/IncidentsTimestampOverridesType' + required: + - id + - type + - attributes + - relationships + type: object + IncidentTimestampOverridePatchAttributes: + description: Attributes for patching an incident timestamp override. + properties: + timestamp_value: + description: The timestamp value for the override. + example: '2024-12-29T11:00:00Z' + format: date-time + type: string + required: + - timestamp_value + type: object + IncidentTimestampOverridePatchData: + description: Data for patching an incident timestamp override. + properties: + attributes: + $ref: '#/components/schemas/IncidentTimestampOverridePatchAttributes' + type: + $ref: '#/components/schemas/IncidentsTimestampOverridesType' + required: + - type + - attributes + type: object + IncidentTimestampOverridePatchRequest: + description: Request to patch an incident timestamp override. + properties: + data: + $ref: '#/components/schemas/IncidentTimestampOverridePatchData' + required: + - data + type: object + IncidentTimestampOverrideRelationships: + description: Relationships for incident timestamp override. + properties: + created_by_user: + $ref: '#/components/schemas/TimestampOverrideUserRelationship' + last_modified_by_user: + $ref: '#/components/schemas/TimestampOverrideUserRelationship' + required: + - created_by_user + - last_modified_by_user + type: object + IncidentTimestampOverrideResponse: + description: Response containing a single incident timestamp override. + properties: + data: + $ref: '#/components/schemas/IncidentTimestampOverrideData' + included: + description: Included related resources. + items: + $ref: '#/components/schemas/UserIncluded' + type: array + required: + - data + type: object + IncidentTimestampOverridesResponse: + description: Response containing a list of incident timestamp overrides. + properties: + data: + description: Array of incident timestamp overrides. + items: + $ref: '#/components/schemas/IncidentTimestampOverrideData' + type: array + included: + description: Included related resources. + items: + $ref: '#/components/schemas/UserIncluded' + type: array + required: + - data + type: object IncidentTodoAnonymousAssignee: description: Anonymous assignee entity. properties: @@ -30994,6 +31191,15 @@ components: required: - data type: object + IncidentsTimestampOverridesType: + default: incidents_timestamp_overrides + description: The JSON:API type for timestamp overrides. + enum: + - incidents_timestamp_overrides + example: incidents_timestamp_overrides + type: string + x-enum-varnames: + - INCIDENTS_TIMESTAMP_OVERRIDES IncludeType: description: Supported include types. enum: @@ -64053,6 +64259,44 @@ components: items: $ref: '#/components/schemas/TimeseriesResponseValues' type: array + TimestampOverrideUserRelationship: + description: Relationship to a user. + properties: + data: + $ref: '#/components/schemas/TimestampOverrideUserRelationshipData' + required: + - data + type: object + TimestampOverrideUserRelationshipData: + description: User relationship data. + properties: + id: + description: The UUID of the user. + example: 8ec982dd-cd99-41c6-992a-c47fc9168cad + format: uuid + type: string + type: + description: The type of the related resource. + example: users + type: string + required: + - id + - type + type: object + TimestampType: + description: The type of timestamp being overridden. + enum: + - created + - detected + - resolved + - declared + example: created + type: string + x-enum-varnames: + - CREATED + - DETECTED + - RESOLVED + - DECLARED TokenName: description: Name for tokens. example: MyTokenName @@ -65792,6 +66036,56 @@ components: required: - data type: object + UserIncluded: + description: Included user data. + properties: + attributes: + $ref: '#/components/schemas/UserIncludedAttributes' + id: + description: The UUID of the user. + example: 8ec982dd-cd99-41c6-992a-c47fc9168cad + format: uuid + type: string + type: + description: The type of the included resource. + example: users + type: string + required: + - id + - type + - attributes + type: object + UserIncludedAttributes: + description: Attributes of an included user. + properties: + email: + description: The email address of the user. + example: fake1@email.com + type: string + handle: + description: The handle of the user. + example: fakeUserHandle1 + type: string + icon: + description: The icon URL for the user. + example: http://a.com/some-icon-1.jpg + type: string + name: + description: The name of the user. + example: fakeUserName1 + type: string + uuid: + description: The UUID of the user. + example: 8ec982dd-cd99-41c6-992a-c47fc9168cad + format: uuid + type: string + required: + - email + - handle + - icon + - name + - uuid + type: object UserInvitationData: description: Object to create a user invitation. properties: @@ -79659,6 +79953,184 @@ paths: - incident_write x-unstable: '**Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/incidents/{incident_id}/timestamp-overrides: + get: + description: Get all timestamp overrides for a specific incident. + operationId: ListIncidentTimestampOverrides + parameters: + - $ref: '#/components/parameters/IncidentID' + - $ref: '#/components/parameters/IncidentTimestampOverrideInclude' + - $ref: '#/components/parameters/IncludeDeleted' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentTimestampOverridesResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_read + summary: List timestamp overrides for an incident + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create a new timestamp override for a specific incident. + operationId: CreateIncidentTimestampOverride + parameters: + - $ref: '#/components/parameters/IncidentID' + - $ref: '#/components/parameters/IncidentTimestampOverrideInclude' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentTimestampOverrideCreateRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentTimestampOverrideResponse' + 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 + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Create a timestamp override for an incident + tags: + - Incidents + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/incidents/{incident_id}/timestamp-overrides/{timestamp_override_id}: + delete: + description: Delete an existing timestamp override for a specific incident. + operationId: DeleteIncidentTimestampOverride + parameters: + - $ref: '#/components/parameters/IncidentID' + - $ref: '#/components/parameters/TimestampOverrideID' + responses: + '204': + description: No Content + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Delete a timestamp override for an incident + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: Update an existing timestamp override for a specific incident. + operationId: UpdateIncidentTimestampOverride + parameters: + - $ref: '#/components/parameters/IncidentID' + - $ref: '#/components/parameters/TimestampOverrideID' + - $ref: '#/components/parameters/IncidentTimestampOverrideInclude' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentTimestampOverridePatchRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentTimestampOverrideResponse' + 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': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Update a timestamp override for an incident + tags: + - Incidents + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/integration/aws/accounts: get: diff --git a/examples/v2/incidents/CreateIncidentTimestampOverride.rb b/examples/v2/incidents/CreateIncidentTimestampOverride.rb new file mode 100644 index 000000000000..f5b858309900 --- /dev/null +++ b/examples/v2/incidents/CreateIncidentTimestampOverride.rb @@ -0,0 +1,18 @@ +# Create a timestamp override for an incident returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_incident_timestamp_override".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new + +body = DatadogAPIClient::V2::IncidentTimestampOverrideCreateRequest.new({ + data: DatadogAPIClient::V2::IncidentTimestampOverrideCreateData.new({ + attributes: DatadogAPIClient::V2::IncidentTimestampOverrideCreateAttributes.new({ + timestamp_type: DatadogAPIClient::V2::TimestampType::CREATED, + timestamp_value: "2024-12-29T10:00:00Z", + }), + type: DatadogAPIClient::V2::IncidentsTimestampOverridesType::INCIDENTS_TIMESTAMP_OVERRIDES, + }), +}) +p api_instance.create_incident_timestamp_override("9cecfde8-e35d-4387-8985-9b30dcb9cb1c", body) diff --git a/examples/v2/incidents/DeleteIncidentTimestampOverride.rb b/examples/v2/incidents/DeleteIncidentTimestampOverride.rb new file mode 100644 index 000000000000..034116a975ac --- /dev/null +++ b/examples/v2/incidents/DeleteIncidentTimestampOverride.rb @@ -0,0 +1,8 @@ +# Delete a timestamp override for an incident returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_incident_timestamp_override".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new +api_instance.delete_incident_timestamp_override("9cecfde8-e35d-4387-8985-9b30dcb9cb1c", "6f48a86f-9a39-4bcf-a76b-9a1b20188995") diff --git a/examples/v2/incidents/ListIncidentTimestampOverrides.rb b/examples/v2/incidents/ListIncidentTimestampOverrides.rb new file mode 100644 index 000000000000..60faf6167a21 --- /dev/null +++ b/examples/v2/incidents/ListIncidentTimestampOverrides.rb @@ -0,0 +1,8 @@ +# List timestamp overrides for an incident returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_incident_timestamp_overrides".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new +p api_instance.list_incident_timestamp_overrides("9cecfde8-e35d-4387-8985-9b30dcb9cb1c") diff --git a/examples/v2/incidents/UpdateIncidentTimestampOverride.rb b/examples/v2/incidents/UpdateIncidentTimestampOverride.rb new file mode 100644 index 000000000000..b876ad4b12d9 --- /dev/null +++ b/examples/v2/incidents/UpdateIncidentTimestampOverride.rb @@ -0,0 +1,17 @@ +# Update a timestamp override for an incident returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_incident_timestamp_override".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new + +body = DatadogAPIClient::V2::IncidentTimestampOverridePatchRequest.new({ + data: DatadogAPIClient::V2::IncidentTimestampOverridePatchData.new({ + attributes: DatadogAPIClient::V2::IncidentTimestampOverridePatchAttributes.new({ + timestamp_value: "2024-12-29T11:00:00Z", + }), + type: DatadogAPIClient::V2::IncidentsTimestampOverridesType::INCIDENTS_TIMESTAMP_OVERRIDES, + }), +}) +p api_instance.update_incident_timestamp_override("9cecfde8-e35d-4387-8985-9b30dcb9cb1c", "6f48a86f-9a39-4bcf-a76b-9a1b20188995", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 833c51686656..1803de4eae19 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2276,6 +2276,26 @@ "todo_id" => "String", "body" => "IncidentTodoPatchRequest", }, + "v2.ListIncidentTimestampOverrides" => { + "incident_id" => "UUID", + "include" => "String", + "include_deleted" => "Boolean", + }, + "v2.CreateIncidentTimestampOverride" => { + "incident_id" => "UUID", + "include" => "String", + "body" => "IncidentTimestampOverrideCreateRequest", + }, + "v2.DeleteIncidentTimestampOverride" => { + "incident_id" => "UUID", + "timestamp_override_id" => "UUID", + }, + "v2.UpdateIncidentTimestampOverride" => { + "incident_id" => "UUID", + "timestamp_override_id" => "UUID", + "include" => "String", + "body" => "IncidentTimestampOverridePatchRequest", + }, "v2.ListAWSAccounts" => { "aws_account_id" => "String", }, diff --git a/features/v2/incidents.feature b/features/v2/incidents.feature index a683c2cac140..e90620931450 100644 --- a/features/v2/incidents.feature +++ b/features/v2/incidents.feature @@ -21,6 +21,33 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:Datadog/incident-app + Scenario: Create a timestamp override for an incident returns "Bad Request" response + Given operation "CreateIncidentTimestampOverride" enabled + And new "CreateIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"timestamp_type": "created", "timestamp_value": "2024-12-29T10:00:00Z"}, "type": "incidents_timestamp_overrides"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/incident-app + Scenario: Create a timestamp override for an incident returns "Created" response + Given operation "CreateIncidentTimestampOverride" enabled + And new "CreateIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"timestamp_type": "created", "timestamp_value": "2024-12-29T10:00:00Z"}, "type": "incidents_timestamp_overrides"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:Datadog/incident-app + Scenario: Create a timestamp override for an incident returns "Not Found" response + Given operation "CreateIncidentTimestampOverride" enabled + And new "CreateIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"timestamp_type": "created", "timestamp_value": "2024-12-29T10:00:00Z"}, "type": "incidents_timestamp_overrides"}} + When the request is sent + Then the response status is 404 Not Found + @skip @team:DataDog/incident-app Scenario: Create an incident impact returns "Bad Request" response Given operation "CreateIncidentImpact" enabled @@ -330,6 +357,24 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found + @generated @skip @team:Datadog/incident-app + Scenario: Delete a timestamp override for an incident returns "No Content" response + Given operation "DeleteIncidentTimestampOverride" enabled + And new "DeleteIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "timestamp_override_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:Datadog/incident-app + Scenario: Delete a timestamp override for an incident returns "Not Found" response + Given operation "DeleteIncidentTimestampOverride" enabled + And new "DeleteIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "timestamp_override_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app Scenario: Delete an existing incident returns "Bad Request" response Given operation "DeleteIncident" enabled @@ -1018,6 +1063,22 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:Datadog/incident-app + Scenario: List timestamp overrides for an incident returns "Not Found" response + Given operation "ListIncidentTimestampOverrides" enabled + And new "ListIncidentTimestampOverrides" request + And request contains "incident_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/incident-app + Scenario: List timestamp overrides for an incident returns "OK" response + Given operation "ListIncidentTimestampOverrides" enabled + And new "ListIncidentTimestampOverrides" request + And request contains "incident_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @team:DataDog/incident-app Scenario: Remove commander from an incident returns "OK" response Given operation "UpdateIncident" enabled @@ -1066,6 +1127,36 @@ Feature: Incidents Then the response status is 200 OK And the response has 3 items + @generated @skip @team:Datadog/incident-app + Scenario: Update a timestamp override for an incident returns "Bad Request" response + Given operation "UpdateIncidentTimestampOverride" enabled + And new "UpdateIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "timestamp_override_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"timestamp_value": "2024-12-29T11:00:00Z"}, "type": "incidents_timestamp_overrides"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:Datadog/incident-app + Scenario: Update a timestamp override for an incident returns "Not Found" response + Given operation "UpdateIncidentTimestampOverride" enabled + And new "UpdateIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "timestamp_override_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"timestamp_value": "2024-12-29T11:00:00Z"}, "type": "incidents_timestamp_overrides"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:Datadog/incident-app + Scenario: Update a timestamp override for an incident returns "OK" response + Given operation "UpdateIncidentTimestampOverride" enabled + And new "UpdateIncidentTimestampOverride" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "timestamp_override_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"timestamp_value": "2024-12-29T11:00:00Z"}, "type": "incidents_timestamp_overrides"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app Scenario: Update an existing incident integration metadata returns "Bad Request" response Given operation "UpdateIncidentIntegration" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index c77dfee33568..8c4911b6c299 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2013,6 +2013,30 @@ "type": "idempotent" } }, + "ListIncidentTimestampOverrides": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, + "CreateIncidentTimestampOverride": { + "tag": "Incidents", + "undo": { + "type": "unsafe" + } + }, + "DeleteIncidentTimestampOverride": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, + "UpdateIncidentTimestampOverride": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, "ListAWSAccounts": { "tag": "AWS Integration", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index f51747c826ed..58f3a02d8cfd 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -257,6 +257,7 @@ def initialize "v2.create_incident_notification_template": false, "v2.create_incident_postmortem_attachment": false, "v2.create_incident_postmortem_template": false, + "v2.create_incident_timestamp_override": false, "v2.create_incident_todo": false, "v2.create_incident_type": false, "v2.delete_global_incident_handle": false, @@ -266,6 +267,7 @@ def initialize "v2.delete_incident_notification_rule": false, "v2.delete_incident_notification_template": false, "v2.delete_incident_postmortem_template": false, + "v2.delete_incident_timestamp_override": false, "v2.delete_incident_todo": false, "v2.delete_incident_type": false, "v2.get_global_incident_settings": false, @@ -283,6 +285,7 @@ def initialize "v2.list_incident_notification_templates": false, "v2.list_incident_postmortem_templates": false, "v2.list_incidents": false, + "v2.list_incident_timestamp_overrides": false, "v2.list_incident_todos": false, "v2.list_incident_types": false, "v2.search_incidents": false, @@ -294,6 +297,7 @@ def initialize "v2.update_incident_notification_rule": false, "v2.update_incident_notification_template": false, "v2.update_incident_postmortem_template": false, + "v2.update_incident_timestamp_override": false, "v2.update_incident_todo": false, "v2.update_incident_type": false, "v2.create_jira_issue_template": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 5e43080ff1dc..c6941f4e68f0 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2787,6 +2787,7 @@ def overrides "v2.incident_service_update_request" => "IncidentServiceUpdateRequest", "v2.incident_severity" => "IncidentSeverity", "v2.incidents_response" => "IncidentsResponse", + "v2.incidents_timestamp_overrides_type" => "IncidentsTimestampOverridesType", "v2.incident_team_create_attributes" => "IncidentTeamCreateAttributes", "v2.incident_team_create_data" => "IncidentTeamCreateData", "v2.incident_team_create_request" => "IncidentTeamCreateRequest", @@ -2804,6 +2805,17 @@ def overrides "v2.incident_timeline_cell_markdown_content_type" => "IncidentTimelineCellMarkdownContentType", "v2.incident_timeline_cell_markdown_create_attributes" => "IncidentTimelineCellMarkdownCreateAttributes", "v2.incident_timeline_cell_markdown_create_attributes_content" => "IncidentTimelineCellMarkdownCreateAttributesContent", + "v2.incident_timestamp_override_attributes" => "IncidentTimestampOverrideAttributes", + "v2.incident_timestamp_override_create_attributes" => "IncidentTimestampOverrideCreateAttributes", + "v2.incident_timestamp_override_create_data" => "IncidentTimestampOverrideCreateData", + "v2.incident_timestamp_override_create_request" => "IncidentTimestampOverrideCreateRequest", + "v2.incident_timestamp_override_data" => "IncidentTimestampOverrideData", + "v2.incident_timestamp_override_patch_attributes" => "IncidentTimestampOverridePatchAttributes", + "v2.incident_timestamp_override_patch_data" => "IncidentTimestampOverridePatchData", + "v2.incident_timestamp_override_patch_request" => "IncidentTimestampOverridePatchRequest", + "v2.incident_timestamp_override_relationships" => "IncidentTimestampOverrideRelationships", + "v2.incident_timestamp_override_response" => "IncidentTimestampOverrideResponse", + "v2.incident_timestamp_overrides_response" => "IncidentTimestampOverridesResponse", "v2.incident_todo_anonymous_assignee" => "IncidentTodoAnonymousAssignee", "v2.incident_todo_anonymous_assignee_source" => "IncidentTodoAnonymousAssigneeSource", "v2.incident_todo_assignee" => "IncidentTodoAssignee", @@ -4986,6 +4998,9 @@ def overrides "v2.timeseries_response" => "TimeseriesResponse", "v2.timeseries_response_attributes" => "TimeseriesResponseAttributes", "v2.timeseries_response_series" => "TimeseriesResponseSeries", + "v2.timestamp_override_user_relationship" => "TimestampOverrideUserRelationship", + "v2.timestamp_override_user_relationship_data" => "TimestampOverrideUserRelationshipData", + "v2.timestamp_type" => "TimestampType", "v2.token_type" => "TokenType", "v2.trigger" => "Trigger", "v2.trigger_rate_limit" => "TriggerRateLimit", @@ -5097,6 +5112,8 @@ def overrides "v2.user_create_attributes" => "UserCreateAttributes", "v2.user_create_data" => "UserCreateData", "v2.user_create_request" => "UserCreateRequest", + "v2.user_included" => "UserIncluded", + "v2.user_included_attributes" => "UserIncludedAttributes", "v2.user_invitation_data" => "UserInvitationData", "v2.user_invitation_data_attributes" => "UserInvitationDataAttributes", "v2.user_invitation_relationships" => "UserInvitationRelationships", diff --git a/lib/datadog_api_client/v2/api/incidents_api.rb b/lib/datadog_api_client/v2/api/incidents_api.rb index 5f2fec4b9061..d4404ff5fa26 100644 --- a/lib/datadog_api_client/v2/api/incidents_api.rb +++ b/lib/datadog_api_client/v2/api/incidents_api.rb @@ -704,6 +704,86 @@ def create_incident_postmortem_template_with_http_info(body, opts = {}) return data, status_code, headers end + # Create a timestamp override for an incident. + # + # @see #create_incident_timestamp_override_with_http_info + def create_incident_timestamp_override(incident_id, body, opts = {}) + data, _status_code, _headers = create_incident_timestamp_override_with_http_info(incident_id, body, opts) + data + end + + # Create a timestamp override for an incident. + # + # Create a new timestamp override for a specific incident. + # + # @param incident_id [UUID] The UUID of the incident. + # @param body [IncidentTimestampOverrideCreateRequest] + # @param opts [Hash] the optional parameters + # @option opts [String] :include Specifies which types of related objects are included in the response. + # @return [Array<(IncidentTimestampOverrideResponse, Integer, Hash)>] IncidentTimestampOverrideResponse data, response status code and response headers + def create_incident_timestamp_override_with_http_info(incident_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_timestamp_override".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_timestamp_override") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_timestamp_override")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_timestamp_override ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.create_incident_timestamp_override" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_incident_timestamp_override" + end + # resource path + local_var_path = '/api/v2/incidents/{incident_id}/timestamp-overrides'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IncidentTimestampOverrideResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_incident_timestamp_override, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#create_incident_timestamp_override\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create an incident todo. # # @see #create_incident_todo_with_http_info @@ -1428,6 +1508,82 @@ def delete_incident_postmortem_template_with_http_info(template_id, opts = {}) return data, status_code, headers end + # Delete a timestamp override for an incident. + # + # @see #delete_incident_timestamp_override_with_http_info + def delete_incident_timestamp_override(incident_id, timestamp_override_id, opts = {}) + delete_incident_timestamp_override_with_http_info(incident_id, timestamp_override_id, opts) + nil + end + + # Delete a timestamp override for an incident. + # + # Delete an existing timestamp override for a specific incident. + # + # @param incident_id [UUID] The UUID of the incident. + # @param timestamp_override_id [UUID] The UUID of the timestamp override. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_incident_timestamp_override_with_http_info(incident_id, timestamp_override_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_timestamp_override".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_timestamp_override") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_timestamp_override")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_timestamp_override ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.delete_incident_timestamp_override" + end + # verify the required parameter 'timestamp_override_id' is set + if @api_client.config.client_side_validation && timestamp_override_id.nil? + fail ArgumentError, "Missing the required parameter 'timestamp_override_id' when calling IncidentsAPI.delete_incident_timestamp_override" + end + # resource path + local_var_path = '/api/v2/incidents/{incident_id}/timestamp-overrides/{timestamp_override_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{timestamp_override_id}', CGI.escape(timestamp_override_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_incident_timestamp_override, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_timestamp_override\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete an incident todo. # # @see #delete_incident_todo_with_http_info @@ -2732,6 +2888,81 @@ def list_incidents_with_pagination(opts = {}) end end + # List timestamp overrides for an incident. + # + # @see #list_incident_timestamp_overrides_with_http_info + def list_incident_timestamp_overrides(incident_id, opts = {}) + data, _status_code, _headers = list_incident_timestamp_overrides_with_http_info(incident_id, opts) + data + end + + # List timestamp overrides for an incident. + # + # Get all timestamp overrides for a specific incident. + # + # @param incident_id [UUID] The UUID of the incident. + # @param opts [Hash] the optional parameters + # @option opts [String] :include Specifies which types of related objects are included in the response. + # @option opts [Boolean] :include_deleted Specifies whether to include deleted timestamp overrides in the response. + # @return [Array<(IncidentTimestampOverridesResponse, Integer, Hash)>] IncidentTimestampOverridesResponse data, response status code and response headers + def list_incident_timestamp_overrides_with_http_info(incident_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_timestamp_overrides".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_timestamp_overrides") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_timestamp_overrides")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_timestamp_overrides ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.list_incident_timestamp_overrides" + end + # resource path + local_var_path = '/api/v2/incidents/{incident_id}/timestamp-overrides'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + query_params[:'include-deleted'] = opts[:'include_deleted'] if !opts[:'include_deleted'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentTimestampOverridesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_incident_timestamp_overrides, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_timestamp_overrides\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get a list of an incident's todos. # # @see #list_incident_todos_with_http_info @@ -3611,6 +3842,91 @@ def update_incident_postmortem_template_with_http_info(template_id, body, opts = return data, status_code, headers end + # Update a timestamp override for an incident. + # + # @see #update_incident_timestamp_override_with_http_info + def update_incident_timestamp_override(incident_id, timestamp_override_id, body, opts = {}) + data, _status_code, _headers = update_incident_timestamp_override_with_http_info(incident_id, timestamp_override_id, body, opts) + data + end + + # Update a timestamp override for an incident. + # + # Update an existing timestamp override for a specific incident. + # + # @param incident_id [UUID] The UUID of the incident. + # @param timestamp_override_id [UUID] The UUID of the timestamp override. + # @param body [IncidentTimestampOverridePatchRequest] + # @param opts [Hash] the optional parameters + # @option opts [String] :include Specifies which types of related objects are included in the response. + # @return [Array<(IncidentTimestampOverrideResponse, Integer, Hash)>] IncidentTimestampOverrideResponse data, response status code and response headers + def update_incident_timestamp_override_with_http_info(incident_id, timestamp_override_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_incident_timestamp_override".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_incident_timestamp_override") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_incident_timestamp_override")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_incident_timestamp_override ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.update_incident_timestamp_override" + end + # verify the required parameter 'timestamp_override_id' is set + if @api_client.config.client_side_validation && timestamp_override_id.nil? + fail ArgumentError, "Missing the required parameter 'timestamp_override_id' when calling IncidentsAPI.update_incident_timestamp_override" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.update_incident_timestamp_override" + end + # resource path + local_var_path = '/api/v2/incidents/{incident_id}/timestamp-overrides/{timestamp_override_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{timestamp_override_id}', CGI.escape(timestamp_override_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IncidentTimestampOverrideResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_incident_timestamp_override, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#update_incident_timestamp_override\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update an incident todo. # # @see #update_incident_todo_with_http_info diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_override_attributes.rb b/lib/datadog_api_client/v2/models/incident_timestamp_override_attributes.rb new file mode 100644 index 000000000000..dd40c660c34a --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_override_attributes.rb @@ -0,0 +1,225 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an incident timestamp override. + class IncidentTimestampOverrideAttributes + include BaseGenericModel + + # Timestamp of when the override was created. + attr_reader :created_at + + # Timestamp of when the override was deleted (soft delete). + attr_accessor :deleted_at + + # The UUID of the incident. + attr_reader :incident_id + + # Timestamp of when the override was last modified. + attr_reader :modified_at + + # The type of timestamp being overridden. + attr_reader :timestamp_type + + # The timestamp value for the override. + attr_reader :timestamp_value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'deleted_at' => :'deleted_at', + :'incident_id' => :'incident_id', + :'modified_at' => :'modified_at', + :'timestamp_type' => :'timestamp_type', + :'timestamp_value' => :'timestamp_value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'deleted_at' => :'Time', + :'incident_id' => :'UUID', + :'modified_at' => :'Time', + :'timestamp_type' => :'TimestampType', + :'timestamp_value' => :'Time' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'deleted_at', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTimestampOverrideAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'deleted_at') + self.deleted_at = attributes[:'deleted_at'] + end + + if attributes.key?(:'incident_id') + self.incident_id = attributes[:'incident_id'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'timestamp_type') + self.timestamp_type = attributes[:'timestamp_type'] + end + + if attributes.key?(:'timestamp_value') + self.timestamp_value = attributes[:'timestamp_value'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @incident_id.nil? + return false if @modified_at.nil? + return false if @timestamp_type.nil? + return false if @timestamp_value.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param incident_id [Object] Object to be assigned + # @!visibility private + def incident_id=(incident_id) + if incident_id.nil? + fail ArgumentError, 'invalid value for "incident_id", incident_id cannot be nil.' + end + @incident_id = incident_id + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Custom attribute writer method with validation + # @param timestamp_type [Object] Object to be assigned + # @!visibility private + def timestamp_type=(timestamp_type) + if timestamp_type.nil? + fail ArgumentError, 'invalid value for "timestamp_type", timestamp_type cannot be nil.' + end + @timestamp_type = timestamp_type + end + + # Custom attribute writer method with validation + # @param timestamp_value [Object] Object to be assigned + # @!visibility private + def timestamp_value=(timestamp_value) + if timestamp_value.nil? + fail ArgumentError, 'invalid value for "timestamp_value", timestamp_value cannot be nil.' + end + @timestamp_value = timestamp_value + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + deleted_at == o.deleted_at && + incident_id == o.incident_id && + modified_at == o.modified_at && + timestamp_type == o.timestamp_type && + timestamp_value == o.timestamp_value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, deleted_at, incident_id, modified_at, timestamp_type, timestamp_value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_override_create_attributes.rb b/lib/datadog_api_client/v2/models/incident_timestamp_override_create_attributes.rb new file mode 100644 index 000000000000..4dca80219f18 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_override_create_attributes.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating an incident timestamp override. + class IncidentTimestampOverrideCreateAttributes + include BaseGenericModel + + # The type of timestamp being overridden. + attr_reader :timestamp_type + + # The timestamp value for the override. + attr_reader :timestamp_value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'timestamp_type' => :'timestamp_type', + :'timestamp_value' => :'timestamp_value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'timestamp_type' => :'TimestampType', + :'timestamp_value' => :'Time' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTimestampOverrideCreateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'timestamp_type') + self.timestamp_type = attributes[:'timestamp_type'] + end + + if attributes.key?(:'timestamp_value') + self.timestamp_value = attributes[:'timestamp_value'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @timestamp_type.nil? + return false if @timestamp_value.nil? + true + end + + # Custom attribute writer method with validation + # @param timestamp_type [Object] Object to be assigned + # @!visibility private + def timestamp_type=(timestamp_type) + if timestamp_type.nil? + fail ArgumentError, 'invalid value for "timestamp_type", timestamp_type cannot be nil.' + end + @timestamp_type = timestamp_type + end + + # Custom attribute writer method with validation + # @param timestamp_value [Object] Object to be assigned + # @!visibility private + def timestamp_value=(timestamp_value) + if timestamp_value.nil? + fail ArgumentError, 'invalid value for "timestamp_value", timestamp_value cannot be nil.' + end + @timestamp_value = timestamp_value + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + timestamp_type == o.timestamp_type && + timestamp_value == o.timestamp_value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [timestamp_type, timestamp_value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_override_create_data.rb b/lib/datadog_api_client/v2/models/incident_timestamp_override_create_data.rb new file mode 100644 index 000000000000..f5c586c78515 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_override_create_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for creating an incident timestamp override. + class IncidentTimestampOverrideCreateData + include BaseGenericModel + + # Attributes for creating an incident timestamp override. + attr_reader :attributes + + # The JSON:API type for timestamp overrides. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentTimestampOverrideCreateAttributes', + :'type' => :'IncidentsTimestampOverridesType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTimestampOverrideCreateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_override_create_request.rb b/lib/datadog_api_client/v2/models/incident_timestamp_override_create_request.rb new file mode 100644 index 000000000000..29e62958b40d --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_override_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to create an incident timestamp override. + class IncidentTimestampOverrideCreateRequest + include BaseGenericModel + + # Data for creating an incident timestamp override. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentTimestampOverrideCreateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTimestampOverrideCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_override_data.rb b/lib/datadog_api_client/v2/models/incident_timestamp_override_data.rb new file mode 100644 index 000000000000..b94b8b8f237d --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_override_data.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for a single incident timestamp override. + class IncidentTimestampOverrideData + include BaseGenericModel + + # Attributes of an incident timestamp override. + attr_reader :attributes + + # The UUID of the timestamp override. + attr_reader :id + + # Relationships for incident timestamp override. + attr_reader :relationships + + # The JSON:API type for timestamp overrides. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentTimestampOverrideAttributes', + :'id' => :'UUID', + :'relationships' => :'IncidentTimestampOverrideRelationships', + :'type' => :'IncidentsTimestampOverridesType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTimestampOverrideData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @relationships.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param relationships [Object] Object to be assigned + # @!visibility private + def relationships=(relationships) + if relationships.nil? + fail ArgumentError, 'invalid value for "relationships", relationships cannot be nil.' + end + @relationships = relationships + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_override_patch_attributes.rb b/lib/datadog_api_client/v2/models/incident_timestamp_override_patch_attributes.rb new file mode 100644 index 000000000000..d8fbb582752e --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_override_patch_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for patching an incident timestamp override. + class IncidentTimestampOverridePatchAttributes + include BaseGenericModel + + # The timestamp value for the override. + attr_reader :timestamp_value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'timestamp_value' => :'timestamp_value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'timestamp_value' => :'Time' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTimestampOverridePatchAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'timestamp_value') + self.timestamp_value = attributes[:'timestamp_value'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @timestamp_value.nil? + true + end + + # Custom attribute writer method with validation + # @param timestamp_value [Object] Object to be assigned + # @!visibility private + def timestamp_value=(timestamp_value) + if timestamp_value.nil? + fail ArgumentError, 'invalid value for "timestamp_value", timestamp_value cannot be nil.' + end + @timestamp_value = timestamp_value + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + timestamp_value == o.timestamp_value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [timestamp_value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_override_patch_data.rb b/lib/datadog_api_client/v2/models/incident_timestamp_override_patch_data.rb new file mode 100644 index 000000000000..988f9c4058b8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_override_patch_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for patching an incident timestamp override. + class IncidentTimestampOverridePatchData + include BaseGenericModel + + # Attributes for patching an incident timestamp override. + attr_reader :attributes + + # The JSON:API type for timestamp overrides. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentTimestampOverridePatchAttributes', + :'type' => :'IncidentsTimestampOverridesType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTimestampOverridePatchData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_override_patch_request.rb b/lib/datadog_api_client/v2/models/incident_timestamp_override_patch_request.rb new file mode 100644 index 000000000000..5bf44eedaad6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_override_patch_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to patch an incident timestamp override. + class IncidentTimestampOverridePatchRequest + include BaseGenericModel + + # Data for patching an incident timestamp override. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentTimestampOverridePatchData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTimestampOverridePatchRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_override_relationships.rb b/lib/datadog_api_client/v2/models/incident_timestamp_override_relationships.rb new file mode 100644 index 000000000000..ed6a6c2f1e6c --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_override_relationships.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships for incident timestamp override. + class IncidentTimestampOverrideRelationships + include BaseGenericModel + + # Relationship to a user. + attr_reader :created_by_user + + # Relationship to a user. + attr_reader :last_modified_by_user + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_by_user' => :'created_by_user', + :'last_modified_by_user' => :'last_modified_by_user' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_by_user' => :'TimestampOverrideUserRelationship', + :'last_modified_by_user' => :'TimestampOverrideUserRelationship' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTimestampOverrideRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_by_user') + self.created_by_user = attributes[:'created_by_user'] + end + + if attributes.key?(:'last_modified_by_user') + self.last_modified_by_user = attributes[:'last_modified_by_user'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_by_user.nil? + return false if @last_modified_by_user.nil? + true + end + + # Custom attribute writer method with validation + # @param created_by_user [Object] Object to be assigned + # @!visibility private + def created_by_user=(created_by_user) + if created_by_user.nil? + fail ArgumentError, 'invalid value for "created_by_user", created_by_user cannot be nil.' + end + @created_by_user = created_by_user + end + + # Custom attribute writer method with validation + # @param last_modified_by_user [Object] Object to be assigned + # @!visibility private + def last_modified_by_user=(last_modified_by_user) + if last_modified_by_user.nil? + fail ArgumentError, 'invalid value for "last_modified_by_user", last_modified_by_user cannot be nil.' + end + @last_modified_by_user = last_modified_by_user + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_by_user == o.created_by_user && + last_modified_by_user == o.last_modified_by_user && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_by_user, last_modified_by_user, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_override_response.rb b/lib/datadog_api_client/v2/models/incident_timestamp_override_response.rb new file mode 100644 index 000000000000..e540e01a9d87 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_override_response.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a single incident timestamp override. + class IncidentTimestampOverrideResponse + include BaseGenericModel + + # Data for a single incident timestamp override. + attr_reader :data + + # Included related resources. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentTimestampOverrideData', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTimestampOverrideResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_overrides_response.rb b/lib/datadog_api_client/v2/models/incident_timestamp_overrides_response.rb new file mode 100644 index 000000000000..50dac21b891b --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_overrides_response.rb @@ -0,0 +1,137 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of incident timestamp overrides. + class IncidentTimestampOverridesResponse + include BaseGenericModel + + # Array of incident timestamp overrides. + attr_reader :data + + # Included related resources. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTimestampOverridesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incidents_timestamp_overrides_type.rb b/lib/datadog_api_client/v2/models/incidents_timestamp_overrides_type.rb new file mode 100644 index 000000000000..6f2449d43e28 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incidents_timestamp_overrides_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The JSON:API type for timestamp overrides. + class IncidentsTimestampOverridesType + include BaseEnumModel + + INCIDENTS_TIMESTAMP_OVERRIDES = "incidents_timestamp_overrides".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/timestamp_override_user_relationship.rb b/lib/datadog_api_client/v2/models/timestamp_override_user_relationship.rb new file mode 100644 index 000000000000..e680cdef4f97 --- /dev/null +++ b/lib/datadog_api_client/v2/models/timestamp_override_user_relationship.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to a user. + class TimestampOverrideUserRelationship + include BaseGenericModel + + # User relationship data. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'TimestampOverrideUserRelationshipData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TimestampOverrideUserRelationship` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/timestamp_override_user_relationship_data.rb b/lib/datadog_api_client/v2/models/timestamp_override_user_relationship_data.rb new file mode 100644 index 000000000000..3d25b5e46f49 --- /dev/null +++ b/lib/datadog_api_client/v2/models/timestamp_override_user_relationship_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # User relationship data. + class TimestampOverrideUserRelationshipData + include BaseGenericModel + + # The UUID of the user. + attr_reader :id + + # The type of the related resource. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'UUID', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TimestampOverrideUserRelationshipData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/timestamp_type.rb b/lib/datadog_api_client/v2/models/timestamp_type.rb new file mode 100644 index 000000000000..4f72990d7890 --- /dev/null +++ b/lib/datadog_api_client/v2/models/timestamp_type.rb @@ -0,0 +1,29 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of timestamp being overridden. + class TimestampType + include BaseEnumModel + + CREATED = "created".freeze + DETECTED = "detected".freeze + RESOLVED = "resolved".freeze + DECLARED = "declared".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/user_included.rb b/lib/datadog_api_client/v2/models/user_included.rb new file mode 100644 index 000000000000..249b1d0849fb --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_included.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Included user data. + class UserIncluded + include BaseGenericModel + + # Attributes of an included user. + attr_reader :attributes + + # The UUID of the user. + attr_reader :id + + # The type of the included resource. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'UserIncludedAttributes', + :'id' => :'UUID', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UserIncluded` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/user_included_attributes.rb b/lib/datadog_api_client/v2/models/user_included_attributes.rb new file mode 100644 index 000000000000..587ad405d051 --- /dev/null +++ b/lib/datadog_api_client/v2/models/user_included_attributes.rb @@ -0,0 +1,207 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an included user. + class UserIncludedAttributes + include BaseGenericModel + + # The email address of the user. + attr_reader :email + + # The handle of the user. + attr_reader :handle + + # The icon URL for the user. + attr_reader :icon + + # The name of the user. + attr_reader :name + + # The UUID of the user. + attr_reader :uuid + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'email' => :'email', + :'handle' => :'handle', + :'icon' => :'icon', + :'name' => :'name', + :'uuid' => :'uuid' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'email' => :'String', + :'handle' => :'String', + :'icon' => :'String', + :'name' => :'String', + :'uuid' => :'UUID' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UserIncludedAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'handle') + self.handle = attributes[:'handle'] + end + + if attributes.key?(:'icon') + self.icon = attributes[:'icon'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'uuid') + self.uuid = attributes[:'uuid'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @email.nil? + return false if @handle.nil? + return false if @icon.nil? + return false if @name.nil? + return false if @uuid.nil? + true + end + + # Custom attribute writer method with validation + # @param email [Object] Object to be assigned + # @!visibility private + def email=(email) + if email.nil? + fail ArgumentError, 'invalid value for "email", email cannot be nil.' + end + @email = email + end + + # Custom attribute writer method with validation + # @param handle [Object] Object to be assigned + # @!visibility private + def handle=(handle) + if handle.nil? + fail ArgumentError, 'invalid value for "handle", handle cannot be nil.' + end + @handle = handle + end + + # Custom attribute writer method with validation + # @param icon [Object] Object to be assigned + # @!visibility private + def icon=(icon) + if icon.nil? + fail ArgumentError, 'invalid value for "icon", icon cannot be nil.' + end + @icon = icon + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param uuid [Object] Object to be assigned + # @!visibility private + def uuid=(uuid) + if uuid.nil? + fail ArgumentError, 'invalid value for "uuid", uuid cannot be nil.' + end + @uuid = uuid + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + email == o.email && + handle == o.handle && + icon == o.icon && + name == o.name && + uuid == o.uuid && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [email, handle, icon, name, uuid, additional_properties].hash + end + end +end