From 249ca891f5e548f9e54b5dd2471a5449c227ab07 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 5 Aug 2026 21:54:13 +0000 Subject: [PATCH] Regenerate client from commit c5c58bd of spec repo --- .generator/schemas/v2/openapi.yaml | 237 ++++++++++++++++++ .../v2/status-pages/PatchMaintenanceUpdate.rb | 15 ++ features/scenarios_model_mapping.rb | 6 + features/v2/status_pages.feature | 10 + features/v2/undo.json | 6 + lib/datadog_api_client/inflector.rb | 13 + .../v2/api/status_pages_api.rb | 82 ++++++ .../v2/models/maintenance_update.rb | 105 ++++++++ .../v2/models/maintenance_update_data.rb | 153 +++++++++++ .../maintenance_update_data_attributes.rb | 167 ++++++++++++ ...intenance_update_data_attributes_status.rb | 29 +++ .../maintenance_update_data_relationships.rb | 125 +++++++++ ...e_update_data_relationships_maintenance.rb | 123 +++++++++ ...ate_data_relationships_maintenance_data.rb | 144 +++++++++++ ...ntenance_update_data_relationships_user.rb | 123 +++++++++ ...nce_update_data_relationships_user_data.rb | 144 +++++++++++ .../patch_maintenance_update_request.rb | 105 ++++++++ .../patch_maintenance_update_request_data.rb | 143 +++++++++++ ...ntenance_update_request_data_attributes.rb | 123 +++++++++ ...ch_maintenance_update_request_data_type.rb | 26 ++ 20 files changed, 1879 insertions(+) create mode 100644 examples/v2/status-pages/PatchMaintenanceUpdate.rb create mode 100644 lib/datadog_api_client/v2/models/maintenance_update.rb create mode 100644 lib/datadog_api_client/v2/models/maintenance_update_data.rb create mode 100644 lib/datadog_api_client/v2/models/maintenance_update_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/maintenance_update_data_attributes_status.rb create mode 100644 lib/datadog_api_client/v2/models/maintenance_update_data_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/maintenance_update_data_relationships_maintenance.rb create mode 100644 lib/datadog_api_client/v2/models/maintenance_update_data_relationships_maintenance_data.rb create mode 100644 lib/datadog_api_client/v2/models/maintenance_update_data_relationships_user.rb create mode 100644 lib/datadog_api_client/v2/models/maintenance_update_data_relationships_user_data.rb create mode 100644 lib/datadog_api_client/v2/models/patch_maintenance_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/patch_maintenance_update_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/patch_maintenance_update_request_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/patch_maintenance_update_request_data_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 05592fbb5535..fa728c9ccbff 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -64404,6 +64404,124 @@ components: - type - id type: object + MaintenanceUpdate: + description: Response object for a maintenance update. + properties: + data: + $ref: "#/components/schemas/MaintenanceUpdateData" + type: object + MaintenanceUpdateData: + description: The data object for a maintenance update. + properties: + attributes: + $ref: "#/components/schemas/MaintenanceUpdateDataAttributes" + id: + description: The ID of the maintenance update. + format: uuid + type: string + relationships: + $ref: "#/components/schemas/MaintenanceUpdateDataRelationships" + type: + $ref: "#/components/schemas/PatchMaintenanceUpdateRequestDataType" + required: + - type + type: object + MaintenanceUpdateDataAttributes: + description: Attributes of a maintenance update resource. + properties: + components_affected: + description: Components affected at the time of the update. + items: + $ref: "#/components/schemas/CreateMaintenanceRequestDataAttributesComponentsAffectedItems" + type: array + created_at: + description: The date and time the update was created. + format: date-time + type: string + description: + description: The message body of the update. + type: string + manual_transition: + description: Whether the update was applied manually by a user (true) or automatically by the system (false). + type: boolean + modified_at: + description: The date and time the update was last modified. + format: date-time + type: string + started_at: + description: The date and time the update started. + format: date-time + type: string + status: + $ref: "#/components/schemas/MaintenanceUpdateDataAttributesStatus" + type: object + MaintenanceUpdateDataAttributesStatus: + description: The status of the maintenance update. + enum: + - scheduled + - in_progress + - completed + - canceled + type: string + x-enum-varnames: + - SCHEDULED + - IN_PROGRESS + - COMPLETED + - CANCELED + MaintenanceUpdateDataRelationships: + description: Relationships of a maintenance update resource. + properties: + created_by_user: + $ref: "#/components/schemas/MaintenanceUpdateDataRelationshipsUser" + last_modified_by_user: + $ref: "#/components/schemas/MaintenanceUpdateDataRelationshipsUser" + maintenance: + $ref: "#/components/schemas/MaintenanceUpdateDataRelationshipsMaintenance" + type: object + MaintenanceUpdateDataRelationshipsMaintenance: + description: The parent maintenance of the update. + properties: + data: + $ref: "#/components/schemas/MaintenanceUpdateDataRelationshipsMaintenanceData" + required: + - data + type: object + MaintenanceUpdateDataRelationshipsMaintenanceData: + description: The maintenance linked to a maintenance update. + properties: + id: + description: The ID of the maintenance. + example: "" + format: uuid + type: string + type: + $ref: "#/components/schemas/PatchMaintenanceRequestDataType" + required: + - type + - id + type: object + MaintenanceUpdateDataRelationshipsUser: + description: A user relationship of a maintenance update. + properties: + data: + $ref: "#/components/schemas/MaintenanceUpdateDataRelationshipsUserData" + required: + - data + type: object + MaintenanceUpdateDataRelationshipsUserData: + description: The data object identifying a Datadog user linked to a maintenance update. + properties: + id: + description: The ID of the Datadog user. + example: "" + format: uuid + type: string + type: + $ref: "#/components/schemas/StatusPagesUserType" + required: + - type + - id + type: object MaintenanceWindow: description: A maintenance window that defines a scheduled time period during which case-related notifications and automation rules are suppressed. Each maintenance window applies to cases matching a specified query. properties: @@ -80114,6 +80232,50 @@ components: type: string x-enum-varnames: - MAINTENANCE_TEMPLATES + PatchMaintenanceUpdateRequest: + description: Request object for editing a maintenance update. + example: + data: + attributes: + description: We have completed maintenance on the API to improve performance. + id: 00000000-0000-0000-0000-000000000000 + type: maintenance_updates + properties: + data: + $ref: "#/components/schemas/PatchMaintenanceUpdateRequestData" + type: object + PatchMaintenanceUpdateRequestData: + description: The data object for editing a maintenance update. + properties: + attributes: + $ref: "#/components/schemas/PatchMaintenanceUpdateRequestDataAttributes" + id: + description: The ID of the maintenance update to edit. + type: string + type: + $ref: "#/components/schemas/PatchMaintenanceUpdateRequestDataType" + required: + - type + type: object + PatchMaintenanceUpdateRequestDataAttributes: + description: Attributes for editing a maintenance update. + properties: + description: + description: The message body of the update. + example: "" + type: string + required: + - description + type: object + PatchMaintenanceUpdateRequestDataType: + default: maintenance_updates + description: Maintenance updates resource type. + enum: + - maintenance_updates + example: maintenance_updates + type: string + x-enum-varnames: + - MAINTENANCE_UPDATES PatchNotificationRuleParameters: description: Body of the notification rule patch request. properties: @@ -202885,6 +203047,81 @@ paths: operator: AND permissions: - status_pages_incident_write + /api/v2/statuspages/{page_id}/maintenances/{maintenance_id}/updates/{update_id}: + patch: + description: Edits the message of a specific maintenance update. This is allowed regardless of the parent maintenance's status, including completed or canceled maintenances. + operationId: PatchMaintenanceUpdate + parameters: + - description: The ID of the status page. + in: path + name: page_id + required: true + schema: + format: uuid + type: string + - description: The ID of the maintenance. + in: path + name: maintenance_id + required: true + schema: + format: uuid + type: string + - description: The ID of the maintenance update. + in: path + name: update_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: We have completed maintenance on the API to improve performance. + id: 00000000-0000-0000-0000-000000000000 + type: maintenance_updates + schema: + $ref: "#/components/schemas/PatchMaintenanceUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + components_affected: [] + created_at: "2026-04-27T13:37:31+00:00" + description: We have completed maintenance on the API to improve performance. + manual_transition: true + modified_at: "2026-04-27T14:37:31+00:00" + started_at: "2026-04-27T13:37:31+00:00" + status: completed + id: 00000000-0000-0000-0000-000000000000 + type: maintenance_updates + schema: + $ref: "#/components/schemas/MaintenanceUpdate" + description: OK + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - status_pages_incident_write + summary: Edit maintenance update + tags: + - Status Pages + x-permission: + operator: AND + permissions: + - status_pages_incident_write /api/v2/statuspages/{page_id}/publish: post: description: Publishes a status page. For pages of type `public`, makes the status page available on the public internet and requires the `status_pages_public_page_publish` permission. For pages of type `internal`, makes the status page available under the `status-pages/$domain_prefix/view` route within the Datadog organization and requires the `status_pages_internal_page_publish` permission. The `status_pages_settings_write` permission is temporarily honored as we migrate publishing functionality from the update status page endpoint to the publish status page endpoint. diff --git a/examples/v2/status-pages/PatchMaintenanceUpdate.rb b/examples/v2/status-pages/PatchMaintenanceUpdate.rb new file mode 100644 index 000000000000..b622eb6e1b0d --- /dev/null +++ b/examples/v2/status-pages/PatchMaintenanceUpdate.rb @@ -0,0 +1,15 @@ +# Edit maintenance update returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::StatusPagesAPI.new + +body = DatadogAPIClient::V2::PatchMaintenanceUpdateRequest.new({ + data: DatadogAPIClient::V2::PatchMaintenanceUpdateRequestData.new({ + attributes: DatadogAPIClient::V2::PatchMaintenanceUpdateRequestDataAttributes.new({ + description: "We have completed maintenance on the API to improve performance.", + }), + id: "00000000-0000-0000-0000-000000000000", + type: DatadogAPIClient::V2::PatchMaintenanceUpdateRequestDataType::MAINTENANCE_UPDATES, + }), +}) +p api_instance.patch_maintenance_update("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 64c08de19d02..8add18fb697f 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -6042,6 +6042,12 @@ "include" => "String", "body" => "PatchMaintenanceRequest", }, + "v2.PatchMaintenanceUpdate" => { + "page_id" => "UUID", + "maintenance_id" => "UUID", + "update_id" => "UUID", + "body" => "PatchMaintenanceUpdateRequest", + }, "v2.PublishStatusPage" => { "page_id" => "UUID", }, diff --git a/features/v2/status_pages.feature b/features/v2/status_pages.feature index c7f922bf6ca3..95da2ead98a8 100644 --- a/features/v2/status_pages.feature +++ b/features/v2/status_pages.feature @@ -136,6 +136,16 @@ Feature: Status Pages When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app + Scenario: Edit maintenance update returns "OK" response + Given new "PatchMaintenanceUpdate" request + And request contains "page_id" parameter from "REPLACE.ME" + And request contains "maintenance_id" parameter from "REPLACE.ME" + And request contains "update_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "We have completed maintenance on the API to improve performance."}, "id": "00000000-0000-0000-0000-000000000000", "type": "maintenance_updates"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/incident-app Scenario: Get component returns "OK" response Given new "GetComponent" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 0f60e6dacc08..186ce105bf20 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -9131,6 +9131,12 @@ "type": "idempotent" } }, + "PatchMaintenanceUpdate": { + "tag": "Status Pages", + "undo": { + "type": "idempotent" + } + }, "PublishStatusPage": { "tag": "Status Pages", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 7f236b0012e7..caab6dd86412 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -4928,6 +4928,15 @@ def overrides "v2.maintenance_template_data_relationships_last_modified_by_user_data" => "MaintenanceTemplateDataRelationshipsLastModifiedByUserData", "v2.maintenance_template_data_relationships_status_page" => "MaintenanceTemplateDataRelationshipsStatusPage", "v2.maintenance_template_data_relationships_status_page_data" => "MaintenanceTemplateDataRelationshipsStatusPageData", + "v2.maintenance_update" => "MaintenanceUpdate", + "v2.maintenance_update_data" => "MaintenanceUpdateData", + "v2.maintenance_update_data_attributes" => "MaintenanceUpdateDataAttributes", + "v2.maintenance_update_data_attributes_status" => "MaintenanceUpdateDataAttributesStatus", + "v2.maintenance_update_data_relationships" => "MaintenanceUpdateDataRelationships", + "v2.maintenance_update_data_relationships_maintenance" => "MaintenanceUpdateDataRelationshipsMaintenance", + "v2.maintenance_update_data_relationships_maintenance_data" => "MaintenanceUpdateDataRelationshipsMaintenanceData", + "v2.maintenance_update_data_relationships_user" => "MaintenanceUpdateDataRelationshipsUser", + "v2.maintenance_update_data_relationships_user_data" => "MaintenanceUpdateDataRelationshipsUserData", "v2.maintenance_window" => "MaintenanceWindow", "v2.maintenance_window_attributes" => "MaintenanceWindowAttributes", "v2.maintenance_window_create" => "MaintenanceWindowCreate", @@ -5953,6 +5962,10 @@ def overrides "v2.patch_maintenance_template_request_data" => "PatchMaintenanceTemplateRequestData", "v2.patch_maintenance_template_request_data_attributes" => "PatchMaintenanceTemplateRequestDataAttributes", "v2.patch_maintenance_template_request_data_type" => "PatchMaintenanceTemplateRequestDataType", + "v2.patch_maintenance_update_request" => "PatchMaintenanceUpdateRequest", + "v2.patch_maintenance_update_request_data" => "PatchMaintenanceUpdateRequestData", + "v2.patch_maintenance_update_request_data_attributes" => "PatchMaintenanceUpdateRequestDataAttributes", + "v2.patch_maintenance_update_request_data_type" => "PatchMaintenanceUpdateRequestDataType", "v2.patch_notification_rule_parameters" => "PatchNotificationRuleParameters", "v2.patch_notification_rule_parameters_data" => "PatchNotificationRuleParametersData", "v2.patch_notification_rule_parameters_data_attributes" => "PatchNotificationRuleParametersDataAttributes", diff --git a/lib/datadog_api_client/v2/api/status_pages_api.rb b/lib/datadog_api_client/v2/api/status_pages_api.rb index 207056f16532..e9c528d1a3cc 100644 --- a/lib/datadog_api_client/v2/api/status_pages_api.rb +++ b/lib/datadog_api_client/v2/api/status_pages_api.rb @@ -1885,6 +1885,88 @@ def list_status_pages_with_http_info(opts = {}) return data, status_code, headers end + # Edit maintenance update. + # + # @see #patch_maintenance_update_with_http_info + def patch_maintenance_update(page_id, maintenance_id, update_id, body, opts = {}) + data, _status_code, _headers = patch_maintenance_update_with_http_info(page_id, maintenance_id, update_id, body, opts) + data + end + + # Edit maintenance update. + # + # Edits the message of a specific maintenance update. This is allowed regardless of the parent maintenance's status, including completed or canceled maintenances. + # + # @param page_id [UUID] The ID of the status page. + # @param maintenance_id [UUID] The ID of the maintenance. + # @param update_id [UUID] The ID of the maintenance update. + # @param body [PatchMaintenanceUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(MaintenanceUpdate, Integer, Hash)>] MaintenanceUpdate data, response status code and response headers + def patch_maintenance_update_with_http_info(page_id, maintenance_id, update_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StatusPagesAPI.patch_maintenance_update ...' + end + # verify the required parameter 'page_id' is set + if @api_client.config.client_side_validation && page_id.nil? + fail ArgumentError, "Missing the required parameter 'page_id' when calling StatusPagesAPI.patch_maintenance_update" + end + # verify the required parameter 'maintenance_id' is set + if @api_client.config.client_side_validation && maintenance_id.nil? + fail ArgumentError, "Missing the required parameter 'maintenance_id' when calling StatusPagesAPI.patch_maintenance_update" + end + # verify the required parameter 'update_id' is set + if @api_client.config.client_side_validation && update_id.nil? + fail ArgumentError, "Missing the required parameter 'update_id' when calling StatusPagesAPI.patch_maintenance_update" + 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 StatusPagesAPI.patch_maintenance_update" + end + # resource path + local_var_path = '/api/v2/statuspages/{page_id}/maintenances/{maintenance_id}/updates/{update_id}'.sub('{page_id}', CGI.escape(page_id.to_s).gsub('%2F', '/')).sub('{maintenance_id}', CGI.escape(maintenance_id.to_s).gsub('%2F', '/')).sub('{update_id}', CGI.escape(update_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['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] || 'MaintenanceUpdate' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :patch_maintenance_update, + :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: StatusPagesAPI#patch_maintenance_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Publish status page. # # @see #publish_status_page_with_http_info diff --git a/lib/datadog_api_client/v2/models/maintenance_update.rb b/lib/datadog_api_client/v2/models/maintenance_update.rb new file mode 100644 index 000000000000..9ee4ad23e7ac --- /dev/null +++ b/lib/datadog_api_client/v2/models/maintenance_update.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 + # Response object for a maintenance update. + class MaintenanceUpdate + include BaseGenericModel + + # The data object for a maintenance update. + attr_accessor :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' => :'MaintenanceUpdateData' + } + 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::MaintenanceUpdate` 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 + + # 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/maintenance_update_data.rb b/lib/datadog_api_client/v2/models/maintenance_update_data.rb new file mode 100644 index 000000000000..a0e7b6268f22 --- /dev/null +++ b/lib/datadog_api_client/v2/models/maintenance_update_data.rb @@ -0,0 +1,153 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The data object for a maintenance update. + class MaintenanceUpdateData + include BaseGenericModel + + # Attributes of a maintenance update resource. + attr_accessor :attributes + + # The ID of the maintenance update. + attr_accessor :id + + # Relationships of a maintenance update resource. + attr_accessor :relationships + + # Maintenance updates 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' => :'MaintenanceUpdateDataAttributes', + :'id' => :'UUID', + :'relationships' => :'MaintenanceUpdateDataRelationships', + :'type' => :'PatchMaintenanceUpdateRequestDataType' + } + 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::MaintenanceUpdateData` 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 @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 && + 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/maintenance_update_data_attributes.rb b/lib/datadog_api_client/v2/models/maintenance_update_data_attributes.rb new file mode 100644 index 000000000000..6070d9673ee0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/maintenance_update_data_attributes.rb @@ -0,0 +1,167 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a maintenance update resource. + class MaintenanceUpdateDataAttributes + include BaseGenericModel + + # Components affected at the time of the update. + attr_accessor :components_affected + + # The date and time the update was created. + attr_accessor :created_at + + # The message body of the update. + attr_accessor :description + + # Whether the update was applied manually by a user (true) or automatically by the system (false). + attr_accessor :manual_transition + + # The date and time the update was last modified. + attr_accessor :modified_at + + # The date and time the update started. + attr_accessor :started_at + + # The status of the maintenance update. + attr_accessor :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'components_affected' => :'components_affected', + :'created_at' => :'created_at', + :'description' => :'description', + :'manual_transition' => :'manual_transition', + :'modified_at' => :'modified_at', + :'started_at' => :'started_at', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'components_affected' => :'Array', + :'created_at' => :'Time', + :'description' => :'String', + :'manual_transition' => :'Boolean', + :'modified_at' => :'Time', + :'started_at' => :'Time', + :'status' => :'MaintenanceUpdateDataAttributesStatus' + } + 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::MaintenanceUpdateDataAttributes` 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?(:'components_affected') + if (value = attributes[:'components_affected']).is_a?(Array) + self.components_affected = value + end + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'manual_transition') + self.manual_transition = attributes[:'manual_transition'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'started_at') + self.started_at = attributes[:'started_at'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + 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 && + components_affected == o.components_affected && + created_at == o.created_at && + description == o.description && + manual_transition == o.manual_transition && + modified_at == o.modified_at && + started_at == o.started_at && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [components_affected, created_at, description, manual_transition, modified_at, started_at, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/maintenance_update_data_attributes_status.rb b/lib/datadog_api_client/v2/models/maintenance_update_data_attributes_status.rb new file mode 100644 index 000000000000..ee999145c34b --- /dev/null +++ b/lib/datadog_api_client/v2/models/maintenance_update_data_attributes_status.rb @@ -0,0 +1,29 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The status of the maintenance update. + class MaintenanceUpdateDataAttributesStatus + include BaseEnumModel + + SCHEDULED = "scheduled".freeze + IN_PROGRESS = "in_progress".freeze + COMPLETED = "completed".freeze + CANCELED = "canceled".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/maintenance_update_data_relationships.rb b/lib/datadog_api_client/v2/models/maintenance_update_data_relationships.rb new file mode 100644 index 000000000000..556f108556e8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/maintenance_update_data_relationships.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships of a maintenance update resource. + class MaintenanceUpdateDataRelationships + include BaseGenericModel + + # A user relationship of a maintenance update. + attr_accessor :created_by_user + + # A user relationship of a maintenance update. + attr_accessor :last_modified_by_user + + # The parent maintenance of the update. + attr_accessor :maintenance + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_by_user' => :'created_by_user', + :'last_modified_by_user' => :'last_modified_by_user', + :'maintenance' => :'maintenance' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_by_user' => :'MaintenanceUpdateDataRelationshipsUser', + :'last_modified_by_user' => :'MaintenanceUpdateDataRelationshipsUser', + :'maintenance' => :'MaintenanceUpdateDataRelationshipsMaintenance' + } + 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::MaintenanceUpdateDataRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_by_user') + self.created_by_user = attributes[:'created_by_user'] + end + + if attributes.key?(:'last_modified_by_user') + self.last_modified_by_user = attributes[:'last_modified_by_user'] + end + + if attributes.key?(:'maintenance') + self.maintenance = attributes[:'maintenance'] + 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 && + created_by_user == o.created_by_user && + last_modified_by_user == o.last_modified_by_user && + maintenance == o.maintenance && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_by_user, last_modified_by_user, maintenance, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/maintenance_update_data_relationships_maintenance.rb b/lib/datadog_api_client/v2/models/maintenance_update_data_relationships_maintenance.rb new file mode 100644 index 000000000000..9d02b4c4ebe9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/maintenance_update_data_relationships_maintenance.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 + # The parent maintenance of the update. + class MaintenanceUpdateDataRelationshipsMaintenance + include BaseGenericModel + + # The maintenance linked to a maintenance update. + 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' => :'MaintenanceUpdateDataRelationshipsMaintenanceData' + } + 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::MaintenanceUpdateDataRelationshipsMaintenance` 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/maintenance_update_data_relationships_maintenance_data.rb b/lib/datadog_api_client/v2/models/maintenance_update_data_relationships_maintenance_data.rb new file mode 100644 index 000000000000..b3a2ebb15ee7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/maintenance_update_data_relationships_maintenance_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 + # The maintenance linked to a maintenance update. + class MaintenanceUpdateDataRelationshipsMaintenanceData + include BaseGenericModel + + # The ID of the maintenance. + attr_reader :id + + # Maintenances 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 + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'UUID', + :'type' => :'PatchMaintenanceRequestDataType' + } + 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::MaintenanceUpdateDataRelationshipsMaintenanceData` 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/maintenance_update_data_relationships_user.rb b/lib/datadog_api_client/v2/models/maintenance_update_data_relationships_user.rb new file mode 100644 index 000000000000..33988aff1d38 --- /dev/null +++ b/lib/datadog_api_client/v2/models/maintenance_update_data_relationships_user.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 + # A user relationship of a maintenance update. + class MaintenanceUpdateDataRelationshipsUser + include BaseGenericModel + + # The data object identifying a Datadog user linked to a maintenance update. + 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' => :'MaintenanceUpdateDataRelationshipsUserData' + } + 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::MaintenanceUpdateDataRelationshipsUser` 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/maintenance_update_data_relationships_user_data.rb b/lib/datadog_api_client/v2/models/maintenance_update_data_relationships_user_data.rb new file mode 100644 index 000000000000..2197987bef88 --- /dev/null +++ b/lib/datadog_api_client/v2/models/maintenance_update_data_relationships_user_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 + # The data object identifying a Datadog user linked to a maintenance update. + class MaintenanceUpdateDataRelationshipsUserData + include BaseGenericModel + + # The ID of the Datadog user. + attr_reader :id + + # Users 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 + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'UUID', + :'type' => :'StatusPagesUserType' + } + 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::MaintenanceUpdateDataRelationshipsUserData` 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/patch_maintenance_update_request.rb b/lib/datadog_api_client/v2/models/patch_maintenance_update_request.rb new file mode 100644 index 000000000000..b569342b1c64 --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_maintenance_update_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 + # Request object for editing a maintenance update. + class PatchMaintenanceUpdateRequest + include BaseGenericModel + + # The data object for editing a maintenance update. + attr_accessor :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' => :'PatchMaintenanceUpdateRequestData' + } + 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::PatchMaintenanceUpdateRequest` 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 + + # 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/patch_maintenance_update_request_data.rb b/lib/datadog_api_client/v2/models/patch_maintenance_update_request_data.rb new file mode 100644 index 000000000000..5eaf143becce --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_maintenance_update_request_data.rb @@ -0,0 +1,143 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The data object for editing a maintenance update. + class PatchMaintenanceUpdateRequestData + include BaseGenericModel + + # Attributes for editing a maintenance update. + attr_accessor :attributes + + # The ID of the maintenance update to edit. + attr_accessor :id + + # Maintenance updates 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' => :'PatchMaintenanceUpdateRequestDataAttributes', + :'id' => :'String', + :'type' => :'PatchMaintenanceUpdateRequestDataType' + } + 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::PatchMaintenanceUpdateRequestData` 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 @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 && + 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/patch_maintenance_update_request_data_attributes.rb b/lib/datadog_api_client/v2/models/patch_maintenance_update_request_data_attributes.rb new file mode 100644 index 000000000000..adadd25ca257 --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_maintenance_update_request_data_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for editing a maintenance update. + class PatchMaintenanceUpdateRequestDataAttributes + include BaseGenericModel + + # The message body of the update. + attr_reader :description + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'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::PatchMaintenanceUpdateRequestDataAttributes` 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?(:'description') + self.description = attributes[:'description'] + 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 @description.nil? + true + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + 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 && + description == o.description && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/patch_maintenance_update_request_data_type.rb b/lib/datadog_api_client/v2/models/patch_maintenance_update_request_data_type.rb new file mode 100644 index 000000000000..f537f9c434d4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_maintenance_update_request_data_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 + # Maintenance updates resource type. + class PatchMaintenanceUpdateRequestDataType + include BaseEnumModel + + MAINTENANCE_UPDATES = "maintenance_updates".freeze + end +end