diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e0e9db98e4a4..9fb143795213 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -105453,6 +105453,54 @@ components: type: string x-enum-varnames: - SCHEDULE + RerouteOnCallPageRequest: + description: Full request to reroute an On-Call Page to a different team or user. + example: + data: + attributes: + comment: Rerouting to the database team. + target: + identifier: my-team + type: team_handle + type: reroute + properties: + data: + $ref: "#/components/schemas/RerouteOnCallPageRequestData" + required: + - data + type: object + RerouteOnCallPageRequestData: + description: The data for rerouting an On-Call Page, including attributes and resource type. + properties: + attributes: + $ref: "#/components/schemas/RerouteOnCallPageRequestDataAttributes" + type: + $ref: "#/components/schemas/RerouteOnCallPageRequestDataType" + required: + - attributes + - type + type: object + RerouteOnCallPageRequestDataAttributes: + description: Details about where to reroute the On-Call Page. + properties: + comment: + description: An optional comment explaining why the page is being rerouted. + example: Rerouting to the database team. + type: string + target: + $ref: "#/components/schemas/CreatePageRequestDataAttributesTarget" + required: + - target + type: object + RerouteOnCallPageRequestDataType: + default: reroute + description: The type of resource used when rerouting an On-Call Page. + enum: + - reroute + example: reroute + type: string + x-enum-varnames: + - REROUTE ResolveVulnerableSymbolsRequest: description: The top-level request object for resolving vulnerable symbols in a set of packages. properties: @@ -208728,6 +208776,142 @@ paths: summary: Escalate On-Call Page tags: - On-Call Paging + /api/v2/on-call/pages/{page_id}/reroute: + post: + description: |- + Reroutes an On-Call Page. + operationId: RerouteOnCallPage + parameters: + - description: The page ID. + in: path + name: page_id + required: true + schema: + example: 15e74b8b-f865-48d0-bcc5-453323ed2c8f + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + comment: Rerouting to the database team. + target: + identifier: my-team + type: team_handle + type: reroute + schema: + $ref: "#/components/schemas/RerouteOnCallPageRequest" + required: true + responses: + "204": + description: No Content. + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + servers: + - url: https://{site} + variables: + site: + default: navy.oncall.datadoghq.com + description: The globally available endpoint for On-Call. + enum: + - lava.oncall.datadoghq.com + - saffron.oncall.datadoghq.com + - navy.oncall.datadoghq.com + - coral.oncall.datadoghq.com + - teal.oncall.datadoghq.com + - beige.oncall.datadoghq.eu + - scarlet.oncall.datadoghq.com + x-enum-varnames: + - LAVA + - SAFFRON + - NAVY + - CORAL + - TEAL + - BEIGE + - SCARLET + - url: "{protocol}://{name}" + variables: + name: + default: navy.oncall.datadoghq.com + description: The full DNS name of the On-Call paging endpoint. + enum: + - lava.oncall.datadoghq.com + - saffron.oncall.datadoghq.com + - navy.oncall.datadoghq.com + - coral.oncall.datadoghq.com + - teal.oncall.datadoghq.com + - beige.oncall.datadoghq.eu + - scarlet.oncall.datadoghq.com + x-enum-varnames: + - LAVA + - SAFFRON + - NAVY + - CORAL + - TEAL + - BEIGE + - SCARLET + protocol: + default: https + description: The protocol for accessing the API. + - url: https://{subdomain}.{site} + variables: + site: + default: datadoghq.com + description: The Datadog site where the On-Call paging endpoint is deployed. + enum: + - datadoghq.com + - datadoghq.eu + x-enum-varnames: + - DATADOGHQ_COM + - DATADOGHQ_EU + subdomain: + default: navy.oncall + description: The On-Call paging subdomain. + enum: + - lava.oncall + - saffron.oncall + - navy.oncall + - coral.oncall + - teal.oncall + - beige.oncall + - scarlet.oncall + x-enum-varnames: + - LAVA + - SAFFRON + - NAVY + - CORAL + - TEAL + - BEIGE + - SCARLET + summary: Reroute On-Call Page + tags: + - On-Call Paging /api/v2/on-call/pages/{page_id}/resolve: post: description: |- diff --git a/examples/v2/on-call-paging/RerouteOnCallPage.rb b/examples/v2/on-call-paging/RerouteOnCallPage.rb new file mode 100644 index 000000000000..f619a8fd2942 --- /dev/null +++ b/examples/v2/on-call-paging/RerouteOnCallPage.rb @@ -0,0 +1,21 @@ +# Reroute On-Call Page returns "No Content." response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] +end +api_instance = DatadogAPIClient::V2::OnCallPagingAPI.new + +body = DatadogAPIClient::V2::RerouteOnCallPageRequest.new({ + data: DatadogAPIClient::V2::RerouteOnCallPageRequestData.new({ + attributes: DatadogAPIClient::V2::RerouteOnCallPageRequestDataAttributes.new({ + comment: "Rerouting to the database team.", + target: DatadogAPIClient::V2::CreatePageRequestDataAttributesTarget.new({ + identifier: "my-team", + type: DatadogAPIClient::V2::OnCallPageTargetType::TEAM_HANDLE, + }), + }), + type: DatadogAPIClient::V2::RerouteOnCallPageRequestDataType::REROUTE, + }), +}) +api_instance.reroute_on_call_page("15e74b8b-f865-48d0-bcc5-453323ed2c8f", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 0a5d70a36faa..4c032f143d62 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -5495,6 +5495,10 @@ "v2.EscalateOnCallPage" => { "page_id" => "UUID", }, + "v2.RerouteOnCallPage" => { + "page_id" => "UUID", + "body" => "RerouteOnCallPageRequest", + }, "v2.ResolveOnCallPage" => { "page_id" => "UUID", }, diff --git a/features/v2/on-call_paging.feature b/features/v2/on-call_paging.feature index fc26fabd4c12..1a8b5a3b97cc 100644 --- a/features/v2/on-call_paging.feature +++ b/features/v2/on-call_paging.feature @@ -30,6 +30,22 @@ Feature: On-Call Paging When the request is sent Then the response status is 202 Accepted. + @generated @skip @team:ddoghq/on-call + Scenario: Reroute On-Call Page returns "Bad Request" response + Given new "RerouteOnCallPage" request + And request contains "page_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"comment": "Rerouting to the database team.", "target": {"identifier": "my-team", "type": "team_handle"}}, "type": "reroute"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:ddoghq/on-call + Scenario: Reroute On-Call Page returns "No Content." response + Given new "RerouteOnCallPage" request + And request contains "page_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"comment": "Rerouting to the database team.", "target": {"identifier": "my-team", "type": "team_handle"}}, "type": "reroute"}} + When the request is sent + Then the response status is 204 No Content. + @generated @skip @team:ddoghq/on-call Scenario: Resolve On-Call Page returns "Accepted." response Given new "ResolveOnCallPage" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 8ce55668e7f2..fa3ab60a6b3a 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -6801,6 +6801,12 @@ "type": "unsafe" } }, + "RerouteOnCallPage": { + "tag": "On-Call Paging", + "undo": { + "type": "idempotent" + } + }, "ResolveOnCallPage": { "tag": "On-Call Paging", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 8423be51c663..99ddd4320987 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -1533,6 +1533,77 @@ def operation_server_settings } } ], + "v2.reroute_on_call_page": [ + { + url: +"https://{site}", + description: "No description provided", + variables: { + site: { + description: "The globally available endpoint for On-Call.", + default_value: "navy.oncall.datadoghq.com", + enum_values: [ + "lava.oncall.datadoghq.com", + "saffron.oncall.datadoghq.com", + "navy.oncall.datadoghq.com", + "coral.oncall.datadoghq.com", + "teal.oncall.datadoghq.com", + "beige.oncall.datadoghq.eu", + "scarlet.oncall.datadoghq.com" + ] + } + } + }, + { + url: +"{protocol}://{name}", + description: "No description provided", + variables: { + name: { + description: "The full DNS name of the On-Call paging endpoint.", + default_value: "navy.oncall.datadoghq.com", + enum_values: [ + "lava.oncall.datadoghq.com", + "saffron.oncall.datadoghq.com", + "navy.oncall.datadoghq.com", + "coral.oncall.datadoghq.com", + "teal.oncall.datadoghq.com", + "beige.oncall.datadoghq.eu", + "scarlet.oncall.datadoghq.com" + ] + }, + protocol: { + description: "The protocol for accessing the API.", + default_value: "https", + } + } + }, + { + url: +"https://{subdomain}.{site}", + description: "No description provided", + variables: { + site: { + description: "The Datadog site where the On-Call paging endpoint is deployed.", + default_value: "datadoghq.com", + enum_values: [ + "datadoghq.com", + "datadoghq.eu" + ] + }, + subdomain: { + description: "The On-Call paging subdomain.", + default_value: "navy.oncall", + enum_values: [ + "lava.oncall", + "saffron.oncall", + "navy.oncall", + "coral.oncall", + "teal.oncall", + "beige.oncall", + "scarlet.oncall" + ] + } + } + } + ], "v2.resolve_on_call_page": [ { url: +"https://{site}", diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index b91e938d2b73..cec38bb5cec9 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -7254,6 +7254,10 @@ def overrides "v2.report_schedule_toggle_request_attributes" => "ReportScheduleToggleRequestAttributes", "v2.report_schedule_toggle_request_data" => "ReportScheduleToggleRequestData", "v2.report_schedule_type" => "ReportScheduleType", + "v2.reroute_on_call_page_request" => "RerouteOnCallPageRequest", + "v2.reroute_on_call_page_request_data" => "RerouteOnCallPageRequestData", + "v2.reroute_on_call_page_request_data_attributes" => "RerouteOnCallPageRequestDataAttributes", + "v2.reroute_on_call_page_request_data_type" => "RerouteOnCallPageRequestDataType", "v2.resolve_vulnerable_symbols_request" => "ResolveVulnerableSymbolsRequest", "v2.resolve_vulnerable_symbols_request_data" => "ResolveVulnerableSymbolsRequestData", "v2.resolve_vulnerable_symbols_request_data_attributes" => "ResolveVulnerableSymbolsRequestDataAttributes", diff --git a/lib/datadog_api_client/v2/api/on_call_paging_api.rb b/lib/datadog_api_client/v2/api/on_call_paging_api.rb index 8a023a192961..eb1707249d70 100644 --- a/lib/datadog_api_client/v2/api/on_call_paging_api.rb +++ b/lib/datadog_api_client/v2/api/on_call_paging_api.rb @@ -220,6 +220,78 @@ def escalate_on_call_page_with_http_info(page_id, opts = {}) return data, status_code, headers end + # Reroute On-Call Page. + # + # @see #reroute_on_call_page_with_http_info + def reroute_on_call_page(page_id, body, opts = {}) + reroute_on_call_page_with_http_info(page_id, body, opts) + nil + end + + # Reroute On-Call Page. + # + # Reroutes an On-Call Page. + # + # @param page_id [UUID] The page ID. + # @param body [RerouteOnCallPageRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def reroute_on_call_page_with_http_info(page_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OnCallPagingAPI.reroute_on_call_page ...' + 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 OnCallPagingAPI.reroute_on_call_page" + 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 OnCallPagingAPI.reroute_on_call_page" + end + # resource path + local_var_path = '/api/v2/on-call/pages/{page_id}/reroute'.sub('{page_id}', CGI.escape(page_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(['*/*']) + # 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] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :reroute_on_call_page, + :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: OnCallPagingAPI#reroute_on_call_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Resolve On-Call Page. # # @see #resolve_on_call_page_with_http_info diff --git a/lib/datadog_api_client/v2/models/reroute_on_call_page_request.rb b/lib/datadog_api_client/v2/models/reroute_on_call_page_request.rb new file mode 100644 index 000000000000..d0aba8d5e405 --- /dev/null +++ b/lib/datadog_api_client/v2/models/reroute_on_call_page_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 + # Full request to reroute an On-Call Page to a different team or user. + class RerouteOnCallPageRequest + include BaseGenericModel + + # The data for rerouting an On-Call Page, including attributes and resource type. + 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' => :'RerouteOnCallPageRequestData' + } + 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::RerouteOnCallPageRequest` 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/reroute_on_call_page_request_data.rb b/lib/datadog_api_client/v2/models/reroute_on_call_page_request_data.rb new file mode 100644 index 000000000000..804a1f1253ad --- /dev/null +++ b/lib/datadog_api_client/v2/models/reroute_on_call_page_request_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 for rerouting an On-Call Page, including attributes and resource type. + class RerouteOnCallPageRequestData + include BaseGenericModel + + # Details about where to reroute the On-Call Page. + attr_reader :attributes + + # The type of resource used when rerouting an On-Call Page. + 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' => :'RerouteOnCallPageRequestDataAttributes', + :'type' => :'RerouteOnCallPageRequestDataType' + } + 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::RerouteOnCallPageRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/reroute_on_call_page_request_data_attributes.rb b/lib/datadog_api_client/v2/models/reroute_on_call_page_request_data_attributes.rb new file mode 100644 index 000000000000..a96888482c10 --- /dev/null +++ b/lib/datadog_api_client/v2/models/reroute_on_call_page_request_data_attributes.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 + # Details about where to reroute the On-Call Page. + class RerouteOnCallPageRequestDataAttributes + include BaseGenericModel + + # An optional comment explaining why the page is being rerouted. + attr_accessor :comment + + # Information about the target to notify (such as a team or user). + attr_reader :target + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'comment' => :'comment', + :'target' => :'target' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'comment' => :'String', + :'target' => :'CreatePageRequestDataAttributesTarget' + } + 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::RerouteOnCallPageRequestDataAttributes` 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?(:'comment') + self.comment = attributes[:'comment'] + end + + if attributes.key?(:'target') + self.target = attributes[:'target'] + 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 @target.nil? + true + end + + # Custom attribute writer method with validation + # @param target [Object] Object to be assigned + # @!visibility private + def target=(target) + if target.nil? + fail ArgumentError, 'invalid value for "target", target cannot be nil.' + end + @target = target + 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 && + comment == o.comment && + target == o.target && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [comment, target, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/reroute_on_call_page_request_data_type.rb b/lib/datadog_api_client/v2/models/reroute_on_call_page_request_data_type.rb new file mode 100644 index 000000000000..d75d805ce6a8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/reroute_on_call_page_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 + # The type of resource used when rerouting an On-Call Page. + class RerouteOnCallPageRequestDataType + include BaseEnumModel + + REROUTE = "reroute".freeze + end +end