diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 42168cb0f30..095006c0c12 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -51339,6 +51339,49 @@ components: $ref: '#/components/schemas/ServiceDefinitionData' type: array type: object + ServiceList: + properties: + data: + $ref: '#/components/schemas/ServiceListData' + type: object + ServiceListData: + properties: + attributes: + $ref: '#/components/schemas/ServiceListDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/ServiceListDataType' + required: + - type + type: object + ServiceListDataAttributes: + properties: + metadata: + items: + $ref: '#/components/schemas/ServiceListDataAttributesMetadataItems' + type: array + services: + items: + type: string + type: array + type: object + ServiceListDataAttributesMetadataItems: + properties: + isTraced: + type: boolean + isUsm: + type: boolean + type: object + ServiceListDataType: + default: services_list + description: Services list resource type. + enum: + - services_list + example: services_list + type: string + x-enum-varnames: + - SERVICES_LIST ServiceNowBasicAuth: description: The definition of the `ServiceNowBasicAuth` object. properties: @@ -61601,6 +61644,26 @@ paths: permissions: - apm_retention_filter_write - apm_pipelines_write + /api/v2/apm/services: + get: + operationId: GetServiceList + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceList' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_read + summary: Get service list + tags: + - APM /api/v2/app-builder/apps: delete: description: Delete multiple apps in a single request from a list of app IDs. @@ -69334,9 +69397,6 @@ paths: operator: OR permissions: - incident_read - x-unstable: '**Note**: This endpoint is in Preview. - - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' post: description: Create an impact for an incident. operationId: CreateIncidentImpact @@ -69380,9 +69440,6 @@ paths: operator: OR permissions: - incident_write - x-unstable: '**Note**: This endpoint is in Preview. - - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/incidents/{incident_id}/impacts/{impact_id}: delete: description: Delete an incident impact. @@ -69413,9 +69470,6 @@ paths: operator: OR permissions: - incident_write - x-unstable: '**Note**: This endpoint is in Preview. - - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/incidents/{incident_id}/relationships/integrations: get: description: Get all integration metadata for an incident. @@ -88586,6 +88640,9 @@ servers: tags: - description: Configure your API endpoints through the Datadog API. name: API Management +- description: Observe, troubleshoot, and improve cloud-scale applications with all + telemetry in context + name: APM - description: Manage configuration of [APM retention filters](https://app.datadoghq.com/apm/traces/retention-filters) for your organization. You need an API and application key with Admin rights to interact with this endpoint. See [retention filters](https://docs.datadoghq.com/tracing/trace_pipeline/trace_retention/#retention-filters) diff --git a/examples/v2/apm/GetServiceList.rb b/examples/v2/apm/GetServiceList.rb new file mode 100644 index 00000000000..d535894f09c --- /dev/null +++ b/examples/v2/apm/GetServiceList.rb @@ -0,0 +1,5 @@ +# Get service list returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::APMAPI.new +p api_instance.get_service_list() diff --git a/features/v2/apm.feature b/features/v2/apm.feature new file mode 100644 index 00000000000..e35bd4d4750 --- /dev/null +++ b/features/v2/apm.feature @@ -0,0 +1,13 @@ +@endpoint(apm) @endpoint(apm-v2) +Feature: APM + Observe, troubleshoot, and improve cloud-scale applications with all + telemetry in context + + @generated @skip @team:DataDog/apm-aoe + Scenario: Get service list returns "OK" response + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "APM" API + And new "GetServiceList" request + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/incidents.feature b/features/v2/incidents.feature index 74ae965968f..12ab3e2f5ba 100644 --- a/features/v2/incidents.feature +++ b/features/v2/incidents.feature @@ -806,16 +806,14 @@ Feature: Incidents @generated @skip @team:DataDog/incident-app Scenario: List an incident's impacts returns "Bad Request" response - Given operation "ListIncidentImpacts" enabled - And new "ListIncidentImpacts" request + Given new "ListIncidentImpacts" request And request contains "incident_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/incident-app Scenario: List an incident's impacts returns "Not Found" response - Given operation "ListIncidentImpacts" enabled - And new "ListIncidentImpacts" request + Given new "ListIncidentImpacts" request And request contains "incident_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found diff --git a/features/v2/undo.json b/features/v2/undo.json index 8aec373cdd9..e0f0b98d0c9 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -516,6 +516,12 @@ "type": "idempotent" } }, + "GetServiceList": { + "tag": "APM", + "undo": { + "type": "safe" + } + }, "DeleteApps": { "tag": "App Builder", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 358c6549b86..707078fa917 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -249,14 +249,12 @@ def initialize "v2.update_deployment_gate": false, "v2.update_deployment_rule": false, "v2.create_incident": false, - "v2.create_incident_impact": false, "v2.create_incident_integration": false, "v2.create_incident_notification_rule": false, "v2.create_incident_notification_template": false, "v2.create_incident_todo": false, "v2.create_incident_type": false, "v2.delete_incident": false, - "v2.delete_incident_impact": false, "v2.delete_incident_integration": false, "v2.delete_incident_notification_rule": false, "v2.delete_incident_notification_template": false, @@ -269,7 +267,6 @@ def initialize "v2.get_incident_todo": false, "v2.get_incident_type": false, "v2.list_incident_attachments": false, - "v2.list_incident_impacts": false, "v2.list_incident_integrations": false, "v2.list_incident_notification_rules": false, "v2.list_incident_notification_templates": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 0a3bb74f57f..3410b967b97 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -4163,6 +4163,11 @@ def overrides "v2.service_definition_v2_slack" => "ServiceDefinitionV2Slack", "v2.service_definition_v2_slack_type" => "ServiceDefinitionV2SlackType", "v2.service_definition_v2_version" => "ServiceDefinitionV2Version", + "v2.service_list" => "ServiceList", + "v2.service_list_data" => "ServiceListData", + "v2.service_list_data_attributes" => "ServiceListDataAttributes", + "v2.service_list_data_attributes_metadata_items" => "ServiceListDataAttributesMetadataItems", + "v2.service_list_data_type" => "ServiceListDataType", "v2.service_now_basic_auth" => "ServiceNowBasicAuth", "v2.service_now_basic_auth_type" => "ServiceNowBasicAuthType", "v2.service_now_basic_auth_update" => "ServiceNowBasicAuthUpdate", @@ -4671,6 +4676,7 @@ def overrides "v2.actions_datastores_api" => "ActionsDatastoresAPI", "v2.agentless_scanning_api" => "AgentlessScanningAPI", "v2.api_management_api" => "APIManagementAPI", + "v2.apm_api" => "APMAPI", "v2.apm_retention_filters_api" => "APMRetentionFiltersAPI", "v2.app_builder_api" => "AppBuilderAPI", "v2.application_security_api" => "ApplicationSecurityAPI", diff --git a/lib/datadog_api_client/v2/api/apm_api.rb b/lib/datadog_api_client/v2/api/apm_api.rb new file mode 100644 index 00000000000..2df4704b037 --- /dev/null +++ b/lib/datadog_api_client/v2/api/apm_api.rb @@ -0,0 +1,83 @@ +=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 'cgi' + +module DatadogAPIClient::V2 + class APMAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Get service list. + # + # @see #get_service_list_with_http_info + def get_service_list(opts = {}) + data, _status_code, _headers = get_service_list_with_http_info(opts) + data + end + + # Get service list. + # @param opts [Hash] the optional parameters + # @return [Array<(ServiceList, Integer, Hash)>] ServiceList data, response status code and response headers + def get_service_list_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: APMAPI.get_service_list ...' + end + # resource path + local_var_path = '/api/v2/apm/services' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ServiceList' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_service_list, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: APMAPI#get_service_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/api/incidents_api.rb b/lib/datadog_api_client/v2/api/incidents_api.rb index 6c19ac5d3bc..a1f004c3f4b 100644 --- a/lib/datadog_api_client/v2/api/incidents_api.rb +++ b/lib/datadog_api_client/v2/api/incidents_api.rb @@ -114,12 +114,6 @@ def create_incident_impact(incident_id, body, opts = {}) # @option opts [Array] :include Specifies which related resources should be included in the response. # @return [Array<(IncidentImpactResponse, Integer, Hash)>] IncidentImpactResponse data, response status code and response headers def create_incident_impact_with_http_info(incident_id, body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_impact".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_impact") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_impact")) - end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_impact ...' @@ -639,12 +633,6 @@ def delete_incident_impact(incident_id, impact_id, opts = {}) # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_incident_impact_with_http_info(incident_id, impact_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_impact".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_impact") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_impact")) - end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_impact ...' @@ -1601,12 +1589,6 @@ def list_incident_impacts(incident_id, opts = {}) # @option opts [Array] :include Specifies which related resources should be included in the response. # @return [Array<(IncidentImpactsResponse, Integer, Hash)>] IncidentImpactsResponse data, response status code and response headers def list_incident_impacts_with_http_info(incident_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_impacts".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_impacts") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_impacts")) - end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_impacts ...' diff --git a/lib/datadog_api_client/v2/models/service_list.rb b/lib/datadog_api_client/v2/models/service_list.rb new file mode 100644 index 00000000000..622b30ead8c --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_list.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 + # + class ServiceList + include BaseGenericModel + + # + 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' => :'ServiceListData' + } + 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::ServiceList` 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/service_list_data.rb b/lib/datadog_api_client/v2/models/service_list_data.rb new file mode 100644 index 00000000000..8e064f176eb --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_list_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 + # + class ServiceListData + include BaseGenericModel + + # + attr_accessor :attributes + + # + attr_accessor :id + + # Services list 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' => :'ServiceListDataAttributes', + :'id' => :'String', + :'type' => :'ServiceListDataType' + } + 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::ServiceListData` 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/service_list_data_attributes.rb b/lib/datadog_api_client/v2/models/service_list_data_attributes.rb new file mode 100644 index 00000000000..a97253a7789 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_list_data_attributes.rb @@ -0,0 +1,119 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class ServiceListDataAttributes + include BaseGenericModel + + # + attr_accessor :metadata + + # + attr_accessor :services + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'metadata' => :'metadata', + :'services' => :'services' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'metadata' => :'Array', + :'services' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceListDataAttributes` 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?(:'metadata') + if (value = attributes[:'metadata']).is_a?(Array) + self.metadata = value + end + end + + if attributes.key?(:'services') + if (value = attributes[:'services']).is_a?(Array) + self.services = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + metadata == o.metadata && + services == o.services && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [metadata, services, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_list_data_attributes_metadata_items.rb b/lib/datadog_api_client/v2/models/service_list_data_attributes_metadata_items.rb new file mode 100644 index 00000000000..290b7d61c0a --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_list_data_attributes_metadata_items.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class ServiceListDataAttributesMetadataItems + include BaseGenericModel + + # + attr_accessor :is_traced + + # + attr_accessor :is_usm + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'is_traced' => :'isTraced', + :'is_usm' => :'isUsm' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'is_traced' => :'Boolean', + :'is_usm' => :'Boolean' + } + 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::ServiceListDataAttributesMetadataItems` 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?(:'is_traced') + self.is_traced = attributes[:'is_traced'] + end + + if attributes.key?(:'is_usm') + self.is_usm = attributes[:'is_usm'] + 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 && + is_traced == o.is_traced && + is_usm == o.is_usm && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [is_traced, is_usm, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_list_data_type.rb b/lib/datadog_api_client/v2/models/service_list_data_type.rb new file mode 100644 index 00000000000..b6632c8ae64 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_list_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 + # Services list resource type. + class ServiceListDataType + include BaseEnumModel + + SERVICES_LIST = "services_list".freeze + end +end