diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index de9b3ca4f4d..b8747eb334f 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -26666,6 +26666,82 @@ components: required: - type type: object + GlobalIncidentSettingsAttributesRequest: + description: Global incident settings attributes + properties: + analytics_dashboard_id: + description: The analytics dashboard ID + example: abc-123-def + type: string + type: object + GlobalIncidentSettingsAttributesResponse: + description: Global incident settings attributes + properties: + analytics_dashboard_id: + description: The analytics dashboard ID + example: abc-123-def + type: string + created: + description: Timestamp when the settings were created + example: '2026-01-13T17:15:56.557278191Z' + format: date-time + type: string + modified: + description: Timestamp when the settings were last modified + example: '2026-01-13T17:15:56.557278191Z' + format: date-time + type: string + required: + - created + - modified + - analytics_dashboard_id + type: object + GlobalIncidentSettingsDataRequest: + properties: + attributes: + $ref: '#/components/schemas/GlobalIncidentSettingsAttributesRequest' + type: + $ref: '#/components/schemas/GlobalIncidentSettingsType' + required: + - type + type: object + GlobalIncidentSettingsDataResponse: + properties: + attributes: + $ref: '#/components/schemas/GlobalIncidentSettingsAttributesResponse' + id: + description: The unique identifier for the global incident settings + example: f8b9a915-ed85-48b4-9071-ceba567a3db5 + type: string + type: + $ref: '#/components/schemas/GlobalIncidentSettingsType' + required: + - id + - type + - attributes + type: object + GlobalIncidentSettingsRequest: + properties: + data: + $ref: '#/components/schemas/GlobalIncidentSettingsDataRequest' + required: + - data + type: object + GlobalIncidentSettingsResponse: + properties: + data: + $ref: '#/components/schemas/GlobalIncidentSettingsDataResponse' + required: + - data + type: object + GlobalIncidentSettingsType: + description: Global incident settings resource type + enum: + - incidents_global_settings + example: incidents_global_settings + type: string + x-enum-varnames: + - INCIDENTS_GLOBAL_SETTINGS GlobalVariableData: description: Synthetics global variable data. Wrapper around the global variable object. @@ -27694,6 +27770,184 @@ components: - TEXTARRAY - METRICTAG - AUTOCOMPLETE + IncidentHandleAttributesFields: + description: Dynamic fields associated with the handle + example: + severity: + - SEV-1 + properties: + severity: + description: Severity levels associated with the handle + items: + $ref: '#/components/schemas/IncidentHandleAttributesFieldsSeverity' + type: array + type: object + IncidentHandleAttributesFieldsSeverity: + example: SEV-1 + type: string + IncidentHandleAttributesRequest: + description: Incident handle attributes for requests + properties: + fields: + $ref: '#/components/schemas/IncidentHandleAttributesFields' + name: + description: The handle name + example: '@incident-sev-1' + type: string + required: + - name + type: object + IncidentHandleAttributesResponse: + description: Incident handle attributes for responses + properties: + created_at: + description: Timestamp when the handle was created + example: '2026-01-13T17:15:52.726905Z' + format: date-time + type: string + fields: + $ref: '#/components/schemas/IncidentHandleAttributesFields' + modified_at: + description: Timestamp when the handle was last modified + example: '2026-01-13T17:15:52.726905Z' + format: date-time + type: string + name: + description: The handle name + example: '@incident-sev-1' + type: string + required: + - name + - fields + - created_at + - modified_at + type: object + IncidentHandleDataRequest: + properties: + attributes: + $ref: '#/components/schemas/IncidentHandleAttributesRequest' + id: + description: The ID of the incident handle (required for PUT requests) + example: b2494081-cdf0-4205-b366-4e1dd4fdf0bf + type: string + relationships: + $ref: '#/components/schemas/IncidentHandleRelationshipsRequest' + type: + $ref: '#/components/schemas/IncidentHandleType' + required: + - type + - attributes + type: object + IncidentHandleDataResponse: + properties: + attributes: + $ref: '#/components/schemas/IncidentHandleAttributesResponse' + id: + description: The ID of the incident handle + example: 12ceee6d-a7c0-4407-bc54-30e54140d7f0 + type: string + relationships: + $ref: '#/components/schemas/IncidentHandleRelationships' + type: + $ref: '#/components/schemas/IncidentHandleType' + required: + - id + - type + - attributes + type: object + IncidentHandleIncludedItemResponse: + oneOf: + - $ref: '#/components/schemas/IncidentUserData' + - $ref: '#/components/schemas/IncidentTypeObject' + IncidentHandleIncludedResponse: + description: Included related resources + items: + $ref: '#/components/schemas/IncidentHandleIncludedItemResponse' + type: array + IncidentHandleRelationship: + properties: + data: + $ref: '#/components/schemas/IncidentHandleRelationshipData' + required: + - data + type: object + IncidentHandleRelationshipData: + properties: + id: + description: The ID of the related resource + example: f7b538b1-ed7c-4e84-82de-fdf84a539d40 + type: string + type: + description: The type of the related resource + example: incident_types + type: string + required: + - id + - type + type: object + IncidentHandleRelationships: + nullable: true + properties: + commander_user: + $ref: '#/components/schemas/IncidentHandleRelationship' + created_by_user: + $ref: '#/components/schemas/IncidentHandleRelationship' + incident_type: + $ref: '#/components/schemas/IncidentHandleRelationship' + last_modified_by_user: + $ref: '#/components/schemas/IncidentHandleRelationship' + required: + - incident_type + - created_by_user + - last_modified_by_user + type: object + IncidentHandleRelationshipsRequest: + nullable: true + properties: + commander_user: + $ref: '#/components/schemas/IncidentHandleRelationship' + incident_type: + $ref: '#/components/schemas/IncidentHandleRelationship' + required: + - incident_type + type: object + IncidentHandleRequest: + properties: + data: + $ref: '#/components/schemas/IncidentHandleDataRequest' + required: + - data + type: object + IncidentHandleResponse: + properties: + data: + $ref: '#/components/schemas/IncidentHandleDataResponse' + included: + $ref: '#/components/schemas/IncidentHandleIncludedResponse' + required: + - data + type: object + IncidentHandleType: + description: Incident handle resource type + enum: + - incidents_handles + example: incidents_handles + type: string + x-enum-varnames: + - INCIDENTS_HANDLES + IncidentHandlesResponse: + properties: + data: + $ref: '#/components/schemas/IncidentHandlesResponseData' + included: + $ref: '#/components/schemas/IncidentHandleIncludedResponse' + required: + - data + type: object + IncidentHandlesResponseData: + items: + $ref: '#/components/schemas/IncidentHandleDataResponse' + type: array IncidentImpactAttributes: description: The incident impact's attributes. properties: @@ -74583,6 +74837,190 @@ 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/config/global/incident-handles: + delete: + description: Delete a global incident handle. + operationId: DeleteGlobalIncidentHandle + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete global incident handle + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Retrieve a list of global incident handles. + operationId: ListGlobalIncidentHandles + parameters: + - description: Comma-separated list of related resources to include in the response + in: query + name: include + required: false + schema: + example: created_by_user,last_modified_by_user,commander_user,incident_type + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentHandlesResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List global incident handles + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create a new global incident handle. + operationId: CreateGlobalIncidentHandle + parameters: + - description: Comma-separated list of related resources to include in the response + in: query + name: include + required: false + schema: + example: created_by_user,last_modified_by_user,commander_user,incident_type + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentHandleRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentHandleResponse' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create global incident handle + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + put: + description: Update an existing global incident handle. + operationId: UpdateGlobalIncidentHandle + parameters: + - description: Comma-separated list of related resources to include in the response + in: query + name: include + required: false + schema: + example: created_by_user,last_modified_by_user,commander_user,incident_type + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentHandleRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentHandleResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update global incident handle + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/incidents/config/global/settings: + get: + description: Retrieve global incident settings for the organization. + operationId: GetGlobalIncidentSettings + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GlobalIncidentSettingsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get global incident settings + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: Update global incident settings for the organization. + operationId: UpdateGlobalIncidentSettings + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GlobalIncidentSettingsRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GlobalIncidentSettingsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update global incident settings + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/incidents/config/notification-rules: get: diff --git a/examples/v2/incidents/CreateGlobalIncidentHandle.rb b/examples/v2/incidents/CreateGlobalIncidentHandle.rb new file mode 100644 index 00000000000..bfe441cd6b9 --- /dev/null +++ b/examples/v2/incidents/CreateGlobalIncidentHandle.rb @@ -0,0 +1,37 @@ +# Create global incident handle returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_global_incident_handle".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new + +body = DatadogAPIClient::V2::IncidentHandleRequest.new({ + data: DatadogAPIClient::V2::IncidentHandleDataRequest.new({ + attributes: DatadogAPIClient::V2::IncidentHandleAttributesRequest.new({ + fields: DatadogAPIClient::V2::IncidentHandleAttributesFields.new({ + severity: [ + "SEV-1", + ], + }), + name: "@incident-sev-1", + }), + id: "b2494081-cdf0-4205-b366-4e1dd4fdf0bf", + relationships: DatadogAPIClient::V2::IncidentHandleRelationshipsRequest.new({ + commander_user: DatadogAPIClient::V2::IncidentHandleRelationship.new({ + data: DatadogAPIClient::V2::IncidentHandleRelationshipData.new({ + id: "f7b538b1-ed7c-4e84-82de-fdf84a539d40", + type: "incident_types", + }), + }), + incident_type: DatadogAPIClient::V2::IncidentHandleRelationship.new({ + data: DatadogAPIClient::V2::IncidentHandleRelationshipData.new({ + id: "f7b538b1-ed7c-4e84-82de-fdf84a539d40", + type: "incident_types", + }), + }), + }), + type: DatadogAPIClient::V2::IncidentHandleType::INCIDENTS_HANDLES, + }), +}) +p api_instance.create_global_incident_handle(body) diff --git a/examples/v2/incidents/DeleteGlobalIncidentHandle.rb b/examples/v2/incidents/DeleteGlobalIncidentHandle.rb new file mode 100644 index 00000000000..915ed755db8 --- /dev/null +++ b/examples/v2/incidents/DeleteGlobalIncidentHandle.rb @@ -0,0 +1,8 @@ +# Delete global incident handle returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_global_incident_handle".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new +api_instance.delete_global_incident_handle() diff --git a/examples/v2/incidents/GetGlobalIncidentSettings.rb b/examples/v2/incidents/GetGlobalIncidentSettings.rb new file mode 100644 index 00000000000..790f56c595e --- /dev/null +++ b/examples/v2/incidents/GetGlobalIncidentSettings.rb @@ -0,0 +1,8 @@ +# Get global incident settings returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_global_incident_settings".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new +p api_instance.get_global_incident_settings() diff --git a/examples/v2/incidents/ListGlobalIncidentHandles.rb b/examples/v2/incidents/ListGlobalIncidentHandles.rb new file mode 100644 index 00000000000..033c8911a81 --- /dev/null +++ b/examples/v2/incidents/ListGlobalIncidentHandles.rb @@ -0,0 +1,8 @@ +# List global incident handles returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_global_incident_handles".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new +p api_instance.list_global_incident_handles() diff --git a/examples/v2/incidents/UpdateGlobalIncidentHandle.rb b/examples/v2/incidents/UpdateGlobalIncidentHandle.rb new file mode 100644 index 00000000000..fb6f6799816 --- /dev/null +++ b/examples/v2/incidents/UpdateGlobalIncidentHandle.rb @@ -0,0 +1,37 @@ +# Update global incident handle returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_global_incident_handle".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new + +body = DatadogAPIClient::V2::IncidentHandleRequest.new({ + data: DatadogAPIClient::V2::IncidentHandleDataRequest.new({ + attributes: DatadogAPIClient::V2::IncidentHandleAttributesRequest.new({ + fields: DatadogAPIClient::V2::IncidentHandleAttributesFields.new({ + severity: [ + "SEV-1", + ], + }), + name: "@incident-sev-1", + }), + id: "b2494081-cdf0-4205-b366-4e1dd4fdf0bf", + relationships: DatadogAPIClient::V2::IncidentHandleRelationshipsRequest.new({ + commander_user: DatadogAPIClient::V2::IncidentHandleRelationship.new({ + data: DatadogAPIClient::V2::IncidentHandleRelationshipData.new({ + id: "f7b538b1-ed7c-4e84-82de-fdf84a539d40", + type: "incident_types", + }), + }), + incident_type: DatadogAPIClient::V2::IncidentHandleRelationship.new({ + data: DatadogAPIClient::V2::IncidentHandleRelationshipData.new({ + id: "f7b538b1-ed7c-4e84-82de-fdf84a539d40", + type: "incident_types", + }), + }), + }), + type: DatadogAPIClient::V2::IncidentHandleType::INCIDENTS_HANDLES, + }), +}) +p api_instance.update_global_incident_handle(body) diff --git a/examples/v2/incidents/UpdateGlobalIncidentSettings.rb b/examples/v2/incidents/UpdateGlobalIncidentSettings.rb new file mode 100644 index 00000000000..c02035568d0 --- /dev/null +++ b/examples/v2/incidents/UpdateGlobalIncidentSettings.rb @@ -0,0 +1,17 @@ +# Update global incident settings returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_global_incident_settings".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new + +body = DatadogAPIClient::V2::GlobalIncidentSettingsRequest.new({ + data: DatadogAPIClient::V2::GlobalIncidentSettingsDataRequest.new({ + attributes: DatadogAPIClient::V2::GlobalIncidentSettingsAttributesRequest.new({ + analytics_dashboard_id: "abc-123-def", + }), + type: DatadogAPIClient::V2::GlobalIncidentSettingsType::INCIDENTS_GLOBAL_SETTINGS, + }), +}) +p api_instance.update_global_incident_settings(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 3191a9dc2ba..69988f3e6d5 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2068,6 +2068,20 @@ "v2.CreateIncident" => { "body" => "IncidentCreateRequest", }, + "v2.ListGlobalIncidentHandles" => { + "include" => "String", + }, + "v2.CreateGlobalIncidentHandle" => { + "include" => "String", + "body" => "IncidentHandleRequest", + }, + "v2.UpdateGlobalIncidentHandle" => { + "include" => "String", + "body" => "IncidentHandleRequest", + }, + "v2.UpdateGlobalIncidentSettings" => { + "body" => "GlobalIncidentSettingsRequest", + }, "v2.ListIncidentNotificationRules" => { "include" => "String", }, diff --git a/features/v2/incidents.feature b/features/v2/incidents.feature index ad60148dd7d..db706355841 100644 --- a/features/v2/incidents.feature +++ b/features/v2/incidents.feature @@ -186,6 +186,22 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app + Scenario: Create global incident handle returns "Bad Request" response + Given operation "CreateGlobalIncidentHandle" enabled + And new "CreateGlobalIncidentHandle" request + And body with value {"data": {"attributes": {"fields": {"severity": ["SEV-1"]}, "name": "@incident-sev-1"}, "id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf", "relationships": {"commander_user": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}, "incident_type": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}}, "type": "incidents_handles"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Create global incident handle returns "Created" response + Given operation "CreateGlobalIncidentHandle" enabled + And new "CreateGlobalIncidentHandle" request + And body with value {"data": {"attributes": {"fields": {"severity": ["SEV-1"]}, "name": "@incident-sev-1"}, "id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf", "relationships": {"commander_user": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}, "incident_type": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}}, "type": "incidents_handles"}} + When the request is sent + Then the response status is 201 Created + @skip @team:DataDog/incident-app Scenario: Create incident attachment returns "Bad Request" response Given operation "CreateIncidentAttachment" enabled @@ -450,6 +466,20 @@ Feature: Incidents When the request is sent Then the response status is 204 OK + @generated @skip @team:DataDog/incident-app + Scenario: Delete global incident handle returns "Bad Request" response + Given operation "DeleteGlobalIncidentHandle" enabled + And new "DeleteGlobalIncidentHandle" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Delete global incident handle returns "No Content" response + Given operation "DeleteGlobalIncidentHandle" enabled + And new "DeleteGlobalIncidentHandle" request + When the request is sent + Then the response status is 204 No Content + @skip @team:DataDog/incident-app Scenario: Delete incident attachment returns "Bad Request" response Given operation "DeleteIncidentAttachment" enabled @@ -633,6 +663,20 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app + Scenario: Get global incident settings returns "Bad Request" response + Given operation "GetGlobalIncidentSettings" enabled + And new "GetGlobalIncidentSettings" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Get global incident settings returns "OK" response + Given operation "GetGlobalIncidentSettings" enabled + And new "GetGlobalIncidentSettings" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app Scenario: Get incident integration metadata details returns "Bad Request" response Given operation "GetIncidentIntegration" enabled @@ -816,6 +860,20 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app + Scenario: List global incident handles returns "Bad Request" response + Given operation "ListGlobalIncidentHandles" enabled + And new "ListGlobalIncidentHandles" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: List global incident handles returns "OK" response + Given operation "ListGlobalIncidentHandles" enabled + And new "ListGlobalIncidentHandles" request + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/incident-app Scenario: List incident attachments returns "Bad Request" response Given operation "ListIncidentAttachments" enabled @@ -1081,6 +1139,38 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app + Scenario: Update global incident handle returns "Bad Request" response + Given operation "UpdateGlobalIncidentHandle" enabled + And new "UpdateGlobalIncidentHandle" request + And body with value {"data": {"attributes": {"fields": {"severity": ["SEV-1"]}, "name": "@incident-sev-1"}, "id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf", "relationships": {"commander_user": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}, "incident_type": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}}, "type": "incidents_handles"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Update global incident handle returns "OK" response + Given operation "UpdateGlobalIncidentHandle" enabled + And new "UpdateGlobalIncidentHandle" request + And body with value {"data": {"attributes": {"fields": {"severity": ["SEV-1"]}, "name": "@incident-sev-1"}, "id": "b2494081-cdf0-4205-b366-4e1dd4fdf0bf", "relationships": {"commander_user": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}, "incident_type": {"data": {"id": "f7b538b1-ed7c-4e84-82de-fdf84a539d40", "type": "incident_types"}}}, "type": "incidents_handles"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/incident-app + Scenario: Update global incident settings returns "Bad Request" response + Given operation "UpdateGlobalIncidentSettings" enabled + And new "UpdateGlobalIncidentSettings" request + And body with value {"data": {"attributes": {"analytics_dashboard_id": "abc-123-def"}, "type": "incidents_global_settings"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Update global incident settings returns "OK" response + Given operation "UpdateGlobalIncidentSettings" enabled + And new "UpdateGlobalIncidentSettings" request + And body with value {"data": {"attributes": {"analytics_dashboard_id": "abc-123-def"}, "type": "incidents_global_settings"}} + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/incident-app Scenario: Update incident attachment returns "Bad Request" response Given operation "UpdateIncidentAttachment" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index 7619933d2f8..b8d90f223ac 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1602,6 +1602,44 @@ "type": "unsafe" } }, + "DeleteGlobalIncidentHandle": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, + "ListGlobalIncidentHandles": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, + "CreateGlobalIncidentHandle": { + "tag": "Incidents", + "undo": { + "operationId": "DeleteGlobalIncidentHandle", + "parameters": [], + "type": "unsafe" + } + }, + "UpdateGlobalIncidentHandle": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, + "GetGlobalIncidentSettings": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, + "UpdateGlobalIncidentSettings": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, "ListIncidentNotificationRules": { "tag": "Incidents", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 362812c942a..95e92ee6bde 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -246,6 +246,7 @@ def initialize "v2.update_deployment_rule": false, "v2.create_hamr_org_connection": false, "v2.get_hamr_org_connection": false, + "v2.create_global_incident_handle": false, "v2.create_incident": false, "v2.create_incident_attachment": false, "v2.create_incident_integration": false, @@ -254,6 +255,7 @@ def initialize "v2.create_incident_postmortem_attachment": false, "v2.create_incident_todo": false, "v2.create_incident_type": false, + "v2.delete_global_incident_handle": false, "v2.delete_incident": false, "v2.delete_incident_attachment": false, "v2.delete_incident_integration": false, @@ -261,12 +263,14 @@ def initialize "v2.delete_incident_notification_template": false, "v2.delete_incident_todo": false, "v2.delete_incident_type": false, + "v2.get_global_incident_settings": false, "v2.get_incident": false, "v2.get_incident_integration": false, "v2.get_incident_notification_rule": false, "v2.get_incident_notification_template": false, "v2.get_incident_todo": false, "v2.get_incident_type": false, + "v2.list_global_incident_handles": false, "v2.list_incident_attachments": false, "v2.list_incident_integrations": false, "v2.list_incident_notification_rules": false, @@ -275,6 +279,8 @@ def initialize "v2.list_incident_todos": false, "v2.list_incident_types": false, "v2.search_incidents": false, + "v2.update_global_incident_handle": false, + "v2.update_global_incident_settings": false, "v2.update_incident": false, "v2.update_incident_attachment": false, "v2.update_incident_integration": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 61b293125f8..f7de6da6173 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2574,6 +2574,13 @@ def overrides "v2.gitlab_integration" => "GitlabIntegration", "v2.gitlab_integration_type" => "GitlabIntegrationType", "v2.gitlab_integration_update" => "GitlabIntegrationUpdate", + "v2.global_incident_settings_attributes_request" => "GlobalIncidentSettingsAttributesRequest", + "v2.global_incident_settings_attributes_response" => "GlobalIncidentSettingsAttributesResponse", + "v2.global_incident_settings_data_request" => "GlobalIncidentSettingsDataRequest", + "v2.global_incident_settings_data_response" => "GlobalIncidentSettingsDataResponse", + "v2.global_incident_settings_request" => "GlobalIncidentSettingsRequest", + "v2.global_incident_settings_response" => "GlobalIncidentSettingsResponse", + "v2.global_incident_settings_type" => "GlobalIncidentSettingsType", "v2.global_variable_data" => "GlobalVariableData", "v2.global_variable_json_patch_request" => "GlobalVariableJsonPatchRequest", "v2.global_variable_json_patch_request_data" => "GlobalVariableJsonPatchRequestData", @@ -2639,6 +2646,20 @@ def overrides "v2.incident_field_attributes_single_value" => "IncidentFieldAttributesSingleValue", "v2.incident_field_attributes_single_value_type" => "IncidentFieldAttributesSingleValueType", "v2.incident_field_attributes_value_type" => "IncidentFieldAttributesValueType", + "v2.incident_handle_attributes_fields" => "IncidentHandleAttributesFields", + "v2.incident_handle_attributes_request" => "IncidentHandleAttributesRequest", + "v2.incident_handle_attributes_response" => "IncidentHandleAttributesResponse", + "v2.incident_handle_data_request" => "IncidentHandleDataRequest", + "v2.incident_handle_data_response" => "IncidentHandleDataResponse", + "v2.incident_handle_included_item_response" => "IncidentHandleIncludedItemResponse", + "v2.incident_handle_relationship" => "IncidentHandleRelationship", + "v2.incident_handle_relationship_data" => "IncidentHandleRelationshipData", + "v2.incident_handle_relationships" => "IncidentHandleRelationships", + "v2.incident_handle_relationships_request" => "IncidentHandleRelationshipsRequest", + "v2.incident_handle_request" => "IncidentHandleRequest", + "v2.incident_handle_response" => "IncidentHandleResponse", + "v2.incident_handles_response" => "IncidentHandlesResponse", + "v2.incident_handle_type" => "IncidentHandleType", "v2.incident_impact_attributes" => "IncidentImpactAttributes", "v2.incident_impact_create_attributes" => "IncidentImpactCreateAttributes", "v2.incident_impact_create_data" => "IncidentImpactCreateData", diff --git a/lib/datadog_api_client/v2/api/incidents_api.rb b/lib/datadog_api_client/v2/api/incidents_api.rb index eee238aae89..8d70192d255 100644 --- a/lib/datadog_api_client/v2/api/incidents_api.rb +++ b/lib/datadog_api_client/v2/api/incidents_api.rb @@ -23,6 +23,81 @@ def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end + # Create global incident handle. + # + # @see #create_global_incident_handle_with_http_info + def create_global_incident_handle(body, opts = {}) + data, _status_code, _headers = create_global_incident_handle_with_http_info(body, opts) + data + end + + # Create global incident handle. + # + # Create a new global incident handle. + # + # @param body [IncidentHandleRequest] + # @param opts [Hash] the optional parameters + # @option opts [String] :include Comma-separated list of related resources to include in the response + # @return [Array<(IncidentHandleResponse, Integer, Hash)>] IncidentHandleResponse data, response status code and response headers + def create_global_incident_handle_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_global_incident_handle".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_global_incident_handle") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_global_incident_handle")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_global_incident_handle ...' + 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_global_incident_handle" + end + # resource path + local_var_path = '/api/v2/incidents/config/global/incident-handles' + + # 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] || 'IncidentHandleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_global_incident_handle, + :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_global_incident_handle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create an incident. # # @see #create_incident_with_http_info @@ -703,6 +778,72 @@ def create_incident_type_with_http_info(body, opts = {}) return data, status_code, headers end + # Delete global incident handle. + # + # @see #delete_global_incident_handle_with_http_info + def delete_global_incident_handle(opts = {}) + delete_global_incident_handle_with_http_info(opts) + nil + end + + # Delete global incident handle. + # + # Delete a global incident handle. + # + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_global_incident_handle_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_global_incident_handle".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_global_incident_handle") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_global_incident_handle")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_global_incident_handle ...' + end + # resource path + local_var_path = '/api/v2/incidents/config/global/incident-handles' + + # 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] + + new_options = opts.merge( + :operation => :delete_global_incident_handle, + :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_global_incident_handle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete an existing incident. # # @see #delete_incident_with_http_info @@ -1286,6 +1427,72 @@ def delete_incident_type_with_http_info(incident_type_id, opts = {}) return data, status_code, headers end + # Get global incident settings. + # + # @see #get_global_incident_settings_with_http_info + def get_global_incident_settings(opts = {}) + data, _status_code, _headers = get_global_incident_settings_with_http_info(opts) + data + end + + # Get global incident settings. + # + # Retrieve global incident settings for the organization. + # + # @param opts [Hash] the optional parameters + # @return [Array<(GlobalIncidentSettingsResponse, Integer, Hash)>] GlobalIncidentSettingsResponse data, response status code and response headers + def get_global_incident_settings_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_global_incident_settings".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_global_incident_settings") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_global_incident_settings")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_global_incident_settings ...' + end + # resource path + local_var_path = '/api/v2/incidents/config/global/settings' + + # 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(['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] || 'GlobalIncidentSettingsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_global_incident_settings, + :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#get_global_incident_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get the details of an incident. # # @see #get_incident_with_http_info @@ -1728,6 +1935,74 @@ def get_incident_type_with_http_info(incident_type_id, opts = {}) return data, status_code, headers end + # List global incident handles. + # + # @see #list_global_incident_handles_with_http_info + def list_global_incident_handles(opts = {}) + data, _status_code, _headers = list_global_incident_handles_with_http_info(opts) + data + end + + # List global incident handles. + # + # Retrieve a list of global incident handles. + # + # @param opts [Hash] the optional parameters + # @option opts [String] :include Comma-separated list of related resources to include in the response + # @return [Array<(IncidentHandlesResponse, Integer, Hash)>] IncidentHandlesResponse data, response status code and response headers + def list_global_incident_handles_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_global_incident_handles".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_global_incident_handles") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_global_incident_handles")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_global_incident_handles ...' + end + # resource path + local_var_path = '/api/v2/incidents/config/global/incident-handles' + + # 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']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentHandlesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_global_incident_handles, + :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_global_incident_handles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List incident attachments. # # @see #list_incident_attachments_with_http_info @@ -2420,6 +2695,154 @@ def search_incidents_with_pagination(query, opts = {}) end end + # Update global incident handle. + # + # @see #update_global_incident_handle_with_http_info + def update_global_incident_handle(body, opts = {}) + data, _status_code, _headers = update_global_incident_handle_with_http_info(body, opts) + data + end + + # Update global incident handle. + # + # Update an existing global incident handle. + # + # @param body [IncidentHandleRequest] + # @param opts [Hash] the optional parameters + # @option opts [String] :include Comma-separated list of related resources to include in the response + # @return [Array<(IncidentHandleResponse, Integer, Hash)>] IncidentHandleResponse data, response status code and response headers + def update_global_incident_handle_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_global_incident_handle".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_global_incident_handle") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_global_incident_handle")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_global_incident_handle ...' + 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_global_incident_handle" + end + # resource path + local_var_path = '/api/v2/incidents/config/global/incident-handles' + + # 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] || 'IncidentHandleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_global_incident_handle, + :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::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#update_global_incident_handle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update global incident settings. + # + # @see #update_global_incident_settings_with_http_info + def update_global_incident_settings(body, opts = {}) + data, _status_code, _headers = update_global_incident_settings_with_http_info(body, opts) + data + end + + # Update global incident settings. + # + # Update global incident settings for the organization. + # + # @param body [GlobalIncidentSettingsRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(GlobalIncidentSettingsResponse, Integer, Hash)>] GlobalIncidentSettingsResponse data, response status code and response headers + def update_global_incident_settings_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_global_incident_settings".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_global_incident_settings") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_global_incident_settings")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_global_incident_settings ...' + 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_global_incident_settings" + end + # resource path + local_var_path = '/api/v2/incidents/config/global/settings' + + # 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(['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] || 'GlobalIncidentSettingsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_global_incident_settings, + :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_global_incident_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update an existing incident. # # @see #update_incident_with_http_info diff --git a/lib/datadog_api_client/v2/models/global_incident_settings_attributes_request.rb b/lib/datadog_api_client/v2/models/global_incident_settings_attributes_request.rb new file mode 100644 index 00000000000..30d61d5874d --- /dev/null +++ b/lib/datadog_api_client/v2/models/global_incident_settings_attributes_request.rb @@ -0,0 +1,105 @@ +=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 + # Global incident settings attributes + class GlobalIncidentSettingsAttributesRequest + include BaseGenericModel + + # The analytics dashboard ID + attr_accessor :analytics_dashboard_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'analytics_dashboard_id' => :'analytics_dashboard_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'analytics_dashboard_id' => :'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::GlobalIncidentSettingsAttributesRequest` 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?(:'analytics_dashboard_id') + self.analytics_dashboard_id = attributes[:'analytics_dashboard_id'] + end + 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 && + analytics_dashboard_id == o.analytics_dashboard_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [analytics_dashboard_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/global_incident_settings_attributes_response.rb b/lib/datadog_api_client/v2/models/global_incident_settings_attributes_response.rb new file mode 100644 index 00000000000..809f1c7216d --- /dev/null +++ b/lib/datadog_api_client/v2/models/global_incident_settings_attributes_response.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 + # Global incident settings attributes + class GlobalIncidentSettingsAttributesResponse + include BaseGenericModel + + # The analytics dashboard ID + attr_reader :analytics_dashboard_id + + # Timestamp when the settings were created + attr_reader :created + + # Timestamp when the settings were last modified + attr_reader :modified + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'analytics_dashboard_id' => :'analytics_dashboard_id', + :'created' => :'created', + :'modified' => :'modified' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'analytics_dashboard_id' => :'String', + :'created' => :'Time', + :'modified' => :'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::GlobalIncidentSettingsAttributesResponse` 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?(:'analytics_dashboard_id') + self.analytics_dashboard_id = attributes[:'analytics_dashboard_id'] + end + + if attributes.key?(:'created') + self.created = attributes[:'created'] + end + + if attributes.key?(:'modified') + self.modified = attributes[:'modified'] + 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 @analytics_dashboard_id.nil? + return false if @created.nil? + return false if @modified.nil? + true + end + + # Custom attribute writer method with validation + # @param analytics_dashboard_id [Object] Object to be assigned + # @!visibility private + def analytics_dashboard_id=(analytics_dashboard_id) + if analytics_dashboard_id.nil? + fail ArgumentError, 'invalid value for "analytics_dashboard_id", analytics_dashboard_id cannot be nil.' + end + @analytics_dashboard_id = analytics_dashboard_id + end + + # Custom attribute writer method with validation + # @param created [Object] Object to be assigned + # @!visibility private + def created=(created) + if created.nil? + fail ArgumentError, 'invalid value for "created", created cannot be nil.' + end + @created = created + end + + # Custom attribute writer method with validation + # @param modified [Object] Object to be assigned + # @!visibility private + def modified=(modified) + if modified.nil? + fail ArgumentError, 'invalid value for "modified", modified cannot be nil.' + end + @modified = modified + 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 && + analytics_dashboard_id == o.analytics_dashboard_id && + created == o.created && + modified == o.modified && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [analytics_dashboard_id, created, modified, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/global_incident_settings_data_request.rb b/lib/datadog_api_client/v2/models/global_incident_settings_data_request.rb new file mode 100644 index 00000000000..0db05ad67b1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/global_incident_settings_data_request.rb @@ -0,0 +1,133 @@ +=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 + # + class GlobalIncidentSettingsDataRequest + include BaseGenericModel + + # Global incident settings attributes + attr_accessor :attributes + + # Global incident settings resource type + 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' => :'GlobalIncidentSettingsAttributesRequest', + :'type' => :'GlobalIncidentSettingsType' + } + 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::GlobalIncidentSettingsDataRequest` 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 @type.nil? + true + 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/global_incident_settings_data_response.rb b/lib/datadog_api_client/v2/models/global_incident_settings_data_response.rb new file mode 100644 index 00000000000..e64fb605493 --- /dev/null +++ b/lib/datadog_api_client/v2/models/global_incident_settings_data_response.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 + # + class GlobalIncidentSettingsDataResponse + include BaseGenericModel + + # Global incident settings attributes + attr_reader :attributes + + # The unique identifier for the global incident settings + attr_reader :id + + # Global incident settings resource type + 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' => :'GlobalIncidentSettingsAttributesResponse', + :'id' => :'String', + :'type' => :'GlobalIncidentSettingsType' + } + 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::GlobalIncidentSettingsDataResponse` 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/global_incident_settings_request.rb b/lib/datadog_api_client/v2/models/global_incident_settings_request.rb new file mode 100644 index 00000000000..fff1d5e664a --- /dev/null +++ b/lib/datadog_api_client/v2/models/global_incident_settings_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 + # + class GlobalIncidentSettingsRequest + include BaseGenericModel + + # + 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' => :'GlobalIncidentSettingsDataRequest' + } + 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::GlobalIncidentSettingsRequest` 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/global_incident_settings_response.rb b/lib/datadog_api_client/v2/models/global_incident_settings_response.rb new file mode 100644 index 00000000000..f03183d014f --- /dev/null +++ b/lib/datadog_api_client/v2/models/global_incident_settings_response.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 + # + class GlobalIncidentSettingsResponse + include BaseGenericModel + + # + 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' => :'GlobalIncidentSettingsDataResponse' + } + 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::GlobalIncidentSettingsResponse` 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/global_incident_settings_type.rb b/lib/datadog_api_client/v2/models/global_incident_settings_type.rb new file mode 100644 index 00000000000..3f18f57dd7a --- /dev/null +++ b/lib/datadog_api_client/v2/models/global_incident_settings_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 + # Global incident settings resource type + class GlobalIncidentSettingsType + include BaseEnumModel + + INCIDENTS_GLOBAL_SETTINGS = "incidents_global_settings".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_handle_attributes_fields.rb b/lib/datadog_api_client/v2/models/incident_handle_attributes_fields.rb new file mode 100644 index 00000000000..f3a13dc674e --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_handle_attributes_fields.rb @@ -0,0 +1,107 @@ +=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 + # Dynamic fields associated with the handle + class IncidentHandleAttributesFields + include BaseGenericModel + + # Severity levels associated with the handle + attr_accessor :severity + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'severity' => :'severity' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'severity' => :'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::IncidentHandleAttributesFields` 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?(:'severity') + if (value = attributes[:'severity']).is_a?(Array) + self.severity = value + end + end + 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 && + severity == o.severity && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [severity, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_handle_attributes_request.rb b/lib/datadog_api_client/v2/models/incident_handle_attributes_request.rb new file mode 100644 index 00000000000..0c8269e37c1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_handle_attributes_request.rb @@ -0,0 +1,133 @@ +=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 + # Incident handle attributes for requests + class IncidentHandleAttributesRequest + include BaseGenericModel + + # Dynamic fields associated with the handle + attr_accessor :fields + + # The handle name + attr_reader :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'fields' => :'fields', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'fields' => :'IncidentHandleAttributesFields', + :'name' => :'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::IncidentHandleAttributesRequest` 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?(:'fields') + self.fields = attributes[:'fields'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + 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 @name.nil? + true + 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 + + # 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 && + fields == o.fields && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [fields, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_handle_attributes_response.rb b/lib/datadog_api_client/v2/models/incident_handle_attributes_response.rb new file mode 100644 index 00000000000..f9334ec25c4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_handle_attributes_response.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 + # Incident handle attributes for responses + class IncidentHandleAttributesResponse + include BaseGenericModel + + # Timestamp when the handle was created + attr_reader :created_at + + # Dynamic fields associated with the handle + attr_reader :fields + + # Timestamp when the handle was last modified + attr_reader :modified_at + + # The handle name + attr_reader :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'fields' => :'fields', + :'modified_at' => :'modified_at', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'fields' => :'IncidentHandleAttributesFields', + :'modified_at' => :'Time', + :'name' => :'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::IncidentHandleAttributesResponse` 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?(:'fields') + self.fields = attributes[:'fields'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + 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 @fields.nil? + return false if @modified_at.nil? + return false if @name.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 fields [Object] Object to be assigned + # @!visibility private + def fields=(fields) + if fields.nil? + fail ArgumentError, 'invalid value for "fields", fields cannot be nil.' + end + @fields = fields + 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 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 + + # 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 && + fields == o.fields && + modified_at == o.modified_at && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, fields, modified_at, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_handle_data_request.rb b/lib/datadog_api_client/v2/models/incident_handle_data_request.rb new file mode 100644 index 00000000000..e2e8afa9be9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_handle_data_request.rb @@ -0,0 +1,172 @@ +=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 + # + class IncidentHandleDataRequest + include BaseGenericModel + + # Incident handle attributes for requests + attr_reader :attributes + + # The ID of the incident handle (required for PUT requests) + attr_accessor :id + + # + attr_accessor :relationships + + # Incident handle resource type + 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' => :'IncidentHandleAttributesRequest', + :'id' => :'String', + :'relationships' => :'IncidentHandleRelationshipsRequest', + :'type' => :'IncidentHandleType' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'relationships', + ]) + 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::IncidentHandleDataRequest` 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 @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 && + 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_handle_data_response.rb b/lib/datadog_api_client/v2/models/incident_handle_data_response.rb new file mode 100644 index 00000000000..03a362e6546 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_handle_data_response.rb @@ -0,0 +1,183 @@ +=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 + # + class IncidentHandleDataResponse + include BaseGenericModel + + # Incident handle attributes for responses + attr_reader :attributes + + # The ID of the incident handle + attr_reader :id + + # + attr_accessor :relationships + + # Incident handle resource type + 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' => :'IncidentHandleAttributesResponse', + :'id' => :'String', + :'relationships' => :'IncidentHandleRelationships', + :'type' => :'IncidentHandleType' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'relationships', + ]) + 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::IncidentHandleDataResponse` 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 @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 && + 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_handle_included_item_response.rb b/lib/datadog_api_client/v2/models/incident_handle_included_item_response.rb new file mode 100644 index 00000000000..29c5dda707e --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_handle_included_item_response.rb @@ -0,0 +1,63 @@ +=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 + # + module IncidentHandleIncludedItemResponse + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'IncidentUserData', + :'IncidentTypeObject' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_handle_relationship.rb b/lib/datadog_api_client/v2/models/incident_handle_relationship.rb new file mode 100644 index 00000000000..09e0852ddce --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_handle_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 + # + class IncidentHandleRelationship + include BaseGenericModel + + # + 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' => :'IncidentHandleRelationshipData' + } + 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::IncidentHandleRelationship` 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_handle_relationship_data.rb b/lib/datadog_api_client/v2/models/incident_handle_relationship_data.rb new file mode 100644 index 00000000000..caf8b4430c3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_handle_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 + # + class IncidentHandleRelationshipData + include BaseGenericModel + + # The ID of the related resource + 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' => :'String', + :'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::IncidentHandleRelationshipData` 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/incident_handle_relationships.rb b/lib/datadog_api_client/v2/models/incident_handle_relationships.rb new file mode 100644 index 00000000000..571f3dc6c57 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_handle_relationships.rb @@ -0,0 +1,175 @@ +=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 + # + class IncidentHandleRelationships + include BaseGenericModel + + # + attr_accessor :commander_user + + # + attr_reader :created_by_user + + # + attr_reader :incident_type + + # + 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 + { + :'commander_user' => :'commander_user', + :'created_by_user' => :'created_by_user', + :'incident_type' => :'incident_type', + :'last_modified_by_user' => :'last_modified_by_user' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'commander_user' => :'IncidentHandleRelationship', + :'created_by_user' => :'IncidentHandleRelationship', + :'incident_type' => :'IncidentHandleRelationship', + :'last_modified_by_user' => :'IncidentHandleRelationship' + } + 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::IncidentHandleRelationships` 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?(:'commander_user') + self.commander_user = attributes[:'commander_user'] + end + + if attributes.key?(:'created_by_user') + self.created_by_user = attributes[:'created_by_user'] + end + + if attributes.key?(:'incident_type') + self.incident_type = attributes[:'incident_type'] + 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 @incident_type.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 incident_type [Object] Object to be assigned + # @!visibility private + def incident_type=(incident_type) + if incident_type.nil? + fail ArgumentError, 'invalid value for "incident_type", incident_type cannot be nil.' + end + @incident_type = incident_type + 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 && + commander_user == o.commander_user && + created_by_user == o.created_by_user && + incident_type == o.incident_type && + 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 + [commander_user, created_by_user, incident_type, last_modified_by_user, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_handle_relationships_request.rb b/lib/datadog_api_client/v2/models/incident_handle_relationships_request.rb new file mode 100644 index 00000000000..3b8e26455ac --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_handle_relationships_request.rb @@ -0,0 +1,133 @@ +=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 + # + class IncidentHandleRelationshipsRequest + include BaseGenericModel + + # + attr_accessor :commander_user + + # + attr_reader :incident_type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'commander_user' => :'commander_user', + :'incident_type' => :'incident_type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'commander_user' => :'IncidentHandleRelationship', + :'incident_type' => :'IncidentHandleRelationship' + } + 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::IncidentHandleRelationshipsRequest` 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?(:'commander_user') + self.commander_user = attributes[:'commander_user'] + end + + if attributes.key?(:'incident_type') + self.incident_type = attributes[:'incident_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 @incident_type.nil? + true + end + + # Custom attribute writer method with validation + # @param incident_type [Object] Object to be assigned + # @!visibility private + def incident_type=(incident_type) + if incident_type.nil? + fail ArgumentError, 'invalid value for "incident_type", incident_type cannot be nil.' + end + @incident_type = incident_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 && + commander_user == o.commander_user && + incident_type == o.incident_type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [commander_user, incident_type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_handle_request.rb b/lib/datadog_api_client/v2/models/incident_handle_request.rb new file mode 100644 index 00000000000..a48f053c622 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_handle_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 + # + class IncidentHandleRequest + include BaseGenericModel + + # + 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' => :'IncidentHandleDataRequest' + } + 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::IncidentHandleRequest` 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_handle_response.rb b/lib/datadog_api_client/v2/models/incident_handle_response.rb new file mode 100644 index 00000000000..9f2cd237d62 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_handle_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 + # + class IncidentHandleResponse + include BaseGenericModel + + # + 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' => :'IncidentHandleDataResponse', + :'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::IncidentHandleResponse` 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_handle_type.rb b/lib/datadog_api_client/v2/models/incident_handle_type.rb new file mode 100644 index 00000000000..dd3ec49b8b1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_handle_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 + # Incident handle resource type + class IncidentHandleType + include BaseEnumModel + + INCIDENTS_HANDLES = "incidents_handles".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_handles_response.rb b/lib/datadog_api_client/v2/models/incident_handles_response.rb new file mode 100644 index 00000000000..42553e2d43e --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_handles_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 + # + class IncidentHandlesResponse + include BaseGenericModel + + # + 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::IncidentHandlesResponse` 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