From 6fa493c049026fe085f91af89480f7cada6f0833 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 16 Nov 2023 18:34:54 +0000 Subject: [PATCH] Regenerate client from commit 973bd612 of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 82 ++++++++++++++ ...ost-attribution-returns-OK-response.frozen | 1 + ...r-cost-attribution-returns-OK-response.yml | 22 ++++ .../GetActiveBillingDimensions.rb | 8 ++ features/scenarios_model_mapping.rb | 82 +++++++------- features/v2/undo.json | 6 ++ features/v2/usage_metering.feature | 14 +++ lib/datadog_api_client/configuration.rb | 1 + lib/datadog_api_client/inflector.rb | 4 + .../v2/api/usage_metering_api.rb | 66 ++++++++++++ .../active_billing_dimensions_attributes.rb | 92 ++++++++++++++++ .../models/active_billing_dimensions_body.rb | 100 ++++++++++++++++++ .../active_billing_dimensions_response.rb | 80 ++++++++++++++ .../models/active_billing_dimensions_type.rb | 26 +++++ 15 files changed, 547 insertions(+), 45 deletions(-) create mode 100644 cassettes/features/v2/usage_metering/Get-active-billing-dimensions-for-cost-attribution-returns-OK-response.frozen create mode 100644 cassettes/features/v2/usage_metering/Get-active-billing-dimensions-for-cost-attribution-returns-OK-response.yml create mode 100644 examples/v2/usage-metering/GetActiveBillingDimensions.rb create mode 100644 lib/datadog_api_client/v2/models/active_billing_dimensions_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/active_billing_dimensions_body.rb create mode 100644 lib/datadog_api_client/v2/models/active_billing_dimensions_response.rb create mode 100644 lib/datadog_api_client/v2/models/active_billing_dimensions_type.rb diff --git a/.apigentools-info b/.apigentools-info index edda92f38dfb..3e54a97bb2dd 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2023-11-16 17:18:50.463919", - "spec_repo_commit": "0e97d7dd" + "regenerated": "2023-11-16 18:34:28.089542", + "spec_repo_commit": "973bd612" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2023-11-16 17:18:50.487034", - "spec_repo_commit": "0e97d7dd" + "regenerated": "2023-11-16 18:34:28.104136", + "spec_repo_commit": "973bd612" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 14dbd6c999f3..eeffb0fb8c30 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -721,6 +721,47 @@ components: type: string x-enum-varnames: - API_KEYS + ActiveBillingDimensionsAttributes: + description: List of active billing dimensions. + properties: + month: + description: 'Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]`.' + format: date-time + type: string + values: + description: 'List of active billing dimensions. Example: `[infra_host, + apm_host, serverless_infra]`.' + items: + description: A given billing dimension in a list. + example: infra_host + type: string + type: array + type: object + ActiveBillingDimensionsBody: + description: Active billing dimensions data. + properties: + attributes: + $ref: '#/components/schemas/ActiveBillingDimensionsAttributes' + id: + description: Unique ID of the response. + type: string + type: + $ref: '#/components/schemas/ActiveBillingDimensionsType' + type: object + ActiveBillingDimensionsResponse: + description: Active billing dimensions response. + properties: + data: + $ref: '#/components/schemas/ActiveBillingDimensionsBody' + type: object + ActiveBillingDimensionsType: + default: billing_dimensions + description: Type of active billing dimensions data. + enum: + - billing_dimensions + type: string + x-enum-varnames: + - BILLING_DIMENSIONS ApmRetentionFilterType: default: apm_retention_filter description: The type of the resource. @@ -20823,6 +20864,47 @@ paths: resultsPath: data x-unstable: '**Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/cost_by_tag/active_billing_dimensions: + get: + description: Get active billing dimensions for cost attribution. Cost data for + a given month becomes available no later than the 17th of the following month. + operationId: GetActiveBillingDimensions + responses: + '200': + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/ActiveBillingDimensionsResponse' + description: OK + '400': + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden - User is not authorized + '429': + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - usage_read + summary: Get active billing dimensions for cost attribution + tags: + - Usage Metering + x-unstable: '**Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/current_user/application_keys: get: diff --git a/cassettes/features/v2/usage_metering/Get-active-billing-dimensions-for-cost-attribution-returns-OK-response.frozen b/cassettes/features/v2/usage_metering/Get-active-billing-dimensions-for-cost-attribution-returns-OK-response.frozen new file mode 100644 index 000000000000..39059c18a997 --- /dev/null +++ b/cassettes/features/v2/usage_metering/Get-active-billing-dimensions-for-cost-attribution-returns-OK-response.frozen @@ -0,0 +1 @@ +2023-11-16T16:03:39.691Z \ No newline at end of file diff --git a/cassettes/features/v2/usage_metering/Get-active-billing-dimensions-for-cost-attribution-returns-OK-response.yml b/cassettes/features/v2/usage_metering/Get-active-billing-dimensions-for-cost-attribution-returns-OK-response.yml new file mode 100644 index 000000000000..e39b6680e3c0 --- /dev/null +++ b/cassettes/features/v2/usage_metering/Get-active-billing-dimensions-for-cost-attribution-returns-OK-response.yml @@ -0,0 +1,22 @@ +http_interactions: +- recorded_at: Thu, 16 Nov 2023 16:03:39 GMT + request: + body: null + headers: + Accept: + - application/json;datetime-format=rfc3339 + method: GET + uri: https://api.datadoghq.com/api/v2/cost_by_tag/active_billing_dimensions + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"billing_dimensions","id":"f145e21e840c6db03f75c179877629eb08531aa6f314f97658261680e49ab1f1","attributes":{"values":["apm_fargate","apm_host","apm_host_enterprise","apm_host_no_usm","apm_host_pro","apm_profiler_host","apm_trace_search","application_security_fargate","application_security_host","application_vulnerability_management_oss_host","audit_trail","ci_pipeline","ci_pipeline_indexed_spans","ci_test_indexed_spans","ci_testing","cloud_cost_management","csm_container_enterprise","csm_host_enterprise","csm_host_pro","cspm_container","cspm_host","custom_event","cws_container","cws_host","data_stream_monitoring","dbm_host","dbm_normalized_queries","fargate_container","fargate_container_apm_and_profiler","fargate_container_profiler","incident_management","infra_and_apm_host","infra_container","infra_container_excl_agent","infra_host","ingested_spans","ingested_timeseries","iot","lambda_function","logs_forwarding","logs_indexed_15day","logs_indexed_180day","logs_indexed_30day","logs_indexed_360day","logs_indexed_3day","logs_indexed_45day","logs_indexed_60day","logs_indexed_7day","logs_indexed_90day","logs_indexed_custom_retention","logs_ingested","network_device","npm_host","observability_pipeline","online_archive","premier_support","prof_container","prof_host","rum","rum_lite","rum_replay","sensitive_data_scanner","serverless_apm","serverless_infra","serverless_invocation","siem","standard_timeseries","synthetics_api_tests","synthetics_app_testing","synthetics_browser_checks","timeseries","usm_standalone","usm_within_infra_host","workflow_execution"],"month":"2023-10-01T00:00:00Z"}}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v2/usage-metering/GetActiveBillingDimensions.rb b/examples/v2/usage-metering/GetActiveBillingDimensions.rb new file mode 100644 index 000000000000..ff973d286563 --- /dev/null +++ b/examples/v2/usage-metering/GetActiveBillingDimensions.rb @@ -0,0 +1,8 @@ +# Get active billing dimensions for cost attribution returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_active_billing_dimensions".to_sym] = true +end +api_instance = DatadogAPIClient::V2::UsageMeteringAPI.new +p api_instance.get_active_billing_dimensions() diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 2d2a7a1d799d..af01ebf54aa8 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -991,6 +991,47 @@ "page_size" => "Integer", "page_cursor" => "String", }, + "v2.GetUsageApplicationSecurityMonitoring" => { + "start_hr" => "Time", + "end_hr" => "Time", + }, + "v2.GetCostByOrg" => { + "start_month" => "Time", + "end_month" => "Time", + }, + "v2.GetEstimatedCostByOrg" => { + "view" => "String", + "start_month" => "Time", + "end_month" => "Time", + "start_date" => "Time", + "end_date" => "Time", + }, + "v2.GetHistoricalCostByOrg" => { + "view" => "String", + "start_month" => "Time", + "end_month" => "Time", + }, + "v2.GetHourlyUsage" => { + "filter_timestamp_start" => "Time", + "filter_timestamp_end" => "Time", + "filter_product_families" => "String", + "filter_include_descendants" => "Boolean", + "filter_include_breakdown" => "Boolean", + "filter_versions" => "String", + "page_limit" => "Integer", + "page_next_record_id" => "String", + }, + "v2.GetUsageLambdaTracedInvocations" => { + "start_hr" => "Time", + "end_hr" => "Time", + }, + "v2.GetUsageObservabilityPipelines" => { + "start_hr" => "Time", + "end_hr" => "Time", + }, + "v2.GetProjectedCost" => { + "view" => "String", + }, "v2.DeleteDashboardListItems" => { "dashboard_list_id" => "Integer", "body" => "DashboardListDeleteItemsRequest", @@ -1793,47 +1834,6 @@ "team_id" => "String", "body" => "IncidentTeamUpdateRequest", }, - "v2.GetUsageApplicationSecurityMonitoring" => { - "start_hr" => "Time", - "end_hr" => "Time", - }, - "v2.GetCostByOrg" => { - "start_month" => "Time", - "end_month" => "Time", - }, - "v2.GetEstimatedCostByOrg" => { - "view" => "String", - "start_month" => "Time", - "end_month" => "Time", - "start_date" => "Time", - "end_date" => "Time", - }, - "v2.GetHistoricalCostByOrg" => { - "view" => "String", - "start_month" => "Time", - "end_month" => "Time", - }, - "v2.GetHourlyUsage" => { - "filter_timestamp_start" => "Time", - "filter_timestamp_end" => "Time", - "filter_product_families" => "String", - "filter_include_descendants" => "Boolean", - "filter_include_breakdown" => "Boolean", - "filter_versions" => "String", - "page_limit" => "Integer", - "page_next_record_id" => "String", - }, - "v2.GetUsageLambdaTracedInvocations" => { - "start_hr" => "Time", - "end_hr" => "Time", - }, - "v2.GetUsageObservabilityPipelines" => { - "start_hr" => "Time", - "end_hr" => "Time", - }, - "v2.GetProjectedCost" => { - "view" => "String", - }, "v2.SendInvitations" => { "body" => "UserInvitationsRequest", }, diff --git a/features/v2/undo.json b/features/v2/undo.json index da720f58d79f..0875a6ee9a6d 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -243,6 +243,12 @@ "type": "safe" } }, + "GetActiveBillingDimensions": { + "tag": "Usage Metering", + "undo": { + "type": "safe" + } + }, "ListCurrentUserApplicationKeys": { "tag": "Key Management", "undo": { diff --git a/features/v2/usage_metering.feature b/features/v2/usage_metering.feature index 9911e8582be2..a9891a75d3ee 100644 --- a/features/v2/usage_metering.feature +++ b/features/v2/usage_metering.feature @@ -14,6 +14,20 @@ Feature: Usage Metering And a valid "appKeyAuth" key in the system And an instance of "UsageMetering" API + @generated @skip @team:DataDog/red-zone-revenue-query + Scenario: Get active billing dimensions for cost attribution returns "Bad Request" response + Given operation "GetActiveBillingDimensions" enabled + And new "GetActiveBillingDimensions" request + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/red-zone-revenue-query + Scenario: Get active billing dimensions for cost attribution returns "OK" response + Given operation "GetActiveBillingDimensions" enabled + And new "GetActiveBillingDimensions" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/red-zone-revenue-query Scenario: Get cost across multi-org account returns "Bad Request" response Given new "GetCostByOrg" request diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 63de3e5cbc79..e9d2706d9e04 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -192,6 +192,7 @@ def initialize "v2.create_ci_app_pipeline_event": false, "v2.list_container_images": false, "v2.list_containers": false, + "v2.get_active_billing_dimensions": false, "v2.list_events": false, "v2.search_events": false, "v2.create_incident": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index ecd6bdc3ab17..becc88d90707 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -839,6 +839,10 @@ def overrides "v1.widget_vertical_align" => "WidgetVerticalAlign", "v1.widget_view_mode" => "WidgetViewMode", "v1.widget_viz_type" => "WidgetVizType", + "v2.active_billing_dimensions_attributes" => "ActiveBillingDimensionsAttributes", + "v2.active_billing_dimensions_body" => "ActiveBillingDimensionsBody", + "v2.active_billing_dimensions_response" => "ActiveBillingDimensionsResponse", + "v2.active_billing_dimensions_type" => "ActiveBillingDimensionsType", "v2.api_error_response" => "APIErrorResponse", "v2.api_key_create_attributes" => "APIKeyCreateAttributes", "v2.api_key_create_data" => "APIKeyCreateData", diff --git a/lib/datadog_api_client/v2/api/usage_metering_api.rb b/lib/datadog_api_client/v2/api/usage_metering_api.rb index 0a4ec2404d88..854dfeeb742a 100644 --- a/lib/datadog_api_client/v2/api/usage_metering_api.rb +++ b/lib/datadog_api_client/v2/api/usage_metering_api.rb @@ -23,6 +23,72 @@ def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end + # Get active billing dimensions for cost attribution. + # + # @see #get_active_billing_dimensions_with_http_info + def get_active_billing_dimensions(opts = {}) + data, _status_code, _headers = get_active_billing_dimensions_with_http_info(opts) + data + end + + # Get active billing dimensions for cost attribution. + # + # Get active billing dimensions for cost attribution. Cost data for a given month becomes available no later than the 17th of the following month. + # + # @param opts [Hash] the optional parameters + # @return [Array<(ActiveBillingDimensionsResponse, Integer, Hash)>] ActiveBillingDimensionsResponse data, response status code and response headers + def get_active_billing_dimensions_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_active_billing_dimensions".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_active_billing_dimensions") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_active_billing_dimensions")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: UsageMeteringAPI.get_active_billing_dimensions ...' + end + # resource path + local_var_path = '/api/v2/cost_by_tag/active_billing_dimensions' + + # 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;datetime-format=rfc3339']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ActiveBillingDimensionsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_active_billing_dimensions, + :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: UsageMeteringAPI#get_active_billing_dimensions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get cost across multi-org account. # # @see #get_cost_by_org_with_http_info diff --git a/lib/datadog_api_client/v2/models/active_billing_dimensions_attributes.rb b/lib/datadog_api_client/v2/models/active_billing_dimensions_attributes.rb new file mode 100644 index 000000000000..c198a747d9cc --- /dev/null +++ b/lib/datadog_api_client/v2/models/active_billing_dimensions_attributes.rb @@ -0,0 +1,92 @@ +=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 + # List of active billing dimensions. + class ActiveBillingDimensionsAttributes + include BaseGenericModel + + # Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]`. + attr_accessor :month + + # List of active billing dimensions. Example: `[infra_host, apm_host, serverless_infra]`. + attr_accessor :values + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'month' => :'month', + :'values' => :'values' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'month' => :'Time', + :'values' => :'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::ActiveBillingDimensionsAttributes` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ActiveBillingDimensionsAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'month') + self.month = attributes[:'month'] + end + + if attributes.key?(:'values') + if (value = attributes[:'values']).is_a?(Array) + self.values = value + end + end + 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 && + month == o.month && + values == o.values + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [month, values].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/active_billing_dimensions_body.rb b/lib/datadog_api_client/v2/models/active_billing_dimensions_body.rb new file mode 100644 index 000000000000..5be4f6b54dd6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/active_billing_dimensions_body.rb @@ -0,0 +1,100 @@ +=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 + # Active billing dimensions data. + class ActiveBillingDimensionsBody + include BaseGenericModel + + # List of active billing dimensions. + attr_accessor :attributes + + # Unique ID of the response. + attr_accessor :id + + # Type of active billing dimensions data. + attr_accessor :type + + # 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' => :'ActiveBillingDimensionsAttributes', + :'id' => :'String', + :'type' => :'ActiveBillingDimensionsType' + } + 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::ActiveBillingDimensionsBody` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ActiveBillingDimensionsBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + 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 + + # 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 + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/active_billing_dimensions_response.rb b/lib/datadog_api_client/v2/models/active_billing_dimensions_response.rb new file mode 100644 index 000000000000..f24b38f46a42 --- /dev/null +++ b/lib/datadog_api_client/v2/models/active_billing_dimensions_response.rb @@ -0,0 +1,80 @@ +=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 + # Active billing dimensions response. + class ActiveBillingDimensionsResponse + include BaseGenericModel + + # Active billing dimensions data. + attr_accessor :data + + # 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' => :'ActiveBillingDimensionsBody' + } + 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::ActiveBillingDimensionsResponse` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::ActiveBillingDimensionsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + 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 + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/active_billing_dimensions_type.rb b/lib/datadog_api_client/v2/models/active_billing_dimensions_type.rb new file mode 100644 index 000000000000..efa5c135c894 --- /dev/null +++ b/lib/datadog_api_client/v2/models/active_billing_dimensions_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 + # Type of active billing dimensions data. + class ActiveBillingDimensionsType + include BaseEnumModel + + BILLING_DIMENSIONS = "billing_dimensions".freeze + end +end