diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index a0bee37b6436..6f740471bdda 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -9156,29 +9156,39 @@ components: properties: description: description: Metric description. + example: Number of requests received. + nullable: true type: string integration: description: Name of the integration that sent the metric if applicable. + nullable: true readOnly: true type: string per_unit: description: Per unit of the metric such as `second` in `bytes per second`. example: second + nullable: true type: string short_name: description: A more human-readable and abbreviated version of the metric name. + example: requests + nullable: true type: string statsd_interval: description: StatsD flush interval of the metric in seconds if applicable. + example: 10 format: int64 + nullable: true type: integer type: description: Metric type such as `gauge` or `rate`. example: count + nullable: true type: string unit: description: Primary unit of the metric such as `byte` or `operation`. example: byte + nullable: true type: string type: object MetricSearchResponse: diff --git a/examples/v1/metrics/UpdateMetricMetadata.rb b/examples/v1/metrics/UpdateMetricMetadata.rb index 2b9faf5459d9..11b46e369afc 100644 --- a/examples/v1/metrics/UpdateMetricMetadata.rb +++ b/examples/v1/metrics/UpdateMetricMetadata.rb @@ -7,7 +7,10 @@ api_instance = DatadogAPIClient::V1::MetricsAPI.new body = DatadogAPIClient::V1::MetricMetadata.new({ + description: "Number of requests received.", per_unit: "second", + short_name: "requests", + statsd_interval: 10, type: "count", unit: "byte", }) diff --git a/features/v1/metrics.feature b/features/v1/metrics.feature index 4e1edbc437d6..53efc0fcc457 100644 --- a/features/v1/metrics.feature +++ b/features/v1/metrics.feature @@ -19,7 +19,7 @@ Feature: Metrics Given a valid "appKeyAuth" key in the system And new "UpdateMetricMetadata" request And request contains "metric_name" parameter from "REPLACE.ME" - And body with value {"per_unit": "second", "type": "count", "unit": "byte"} + And body with value {"description": "Number of requests received.", "per_unit": "second", "short_name": "requests", "statsd_interval": 10, "type": "count", "unit": "byte"} When the request is sent Then the response status is 400 Bad Request @@ -28,7 +28,7 @@ Feature: Metrics Given a valid "appKeyAuth" key in the system And new "UpdateMetricMetadata" request And request contains "metric_name" parameter from "REPLACE.ME" - And body with value {"per_unit": "second", "type": "count", "unit": "byte"} + And body with value {"description": "Number of requests received.", "per_unit": "second", "short_name": "requests", "statsd_interval": 10, "type": "count", "unit": "byte"} When the request is sent Then the response status is 404 Not Found @@ -37,7 +37,7 @@ Feature: Metrics Given a valid "appKeyAuth" key in the system And new "UpdateMetricMetadata" request And request contains "metric_name" parameter from "REPLACE.ME" - And body with value {"per_unit": "second", "type": "count", "unit": "byte"} + And body with value {"description": "Number of requests received.", "per_unit": "second", "short_name": "requests", "statsd_interval": 10, "type": "count", "unit": "byte"} When the request is sent Then the response status is 200 OK diff --git a/lib/datadog_api_client/v1/models/metric_metadata.rb b/lib/datadog_api_client/v1/models/metric_metadata.rb index d5188bba7f9c..5f19594009a8 100644 --- a/lib/datadog_api_client/v1/models/metric_metadata.rb +++ b/lib/datadog_api_client/v1/models/metric_metadata.rb @@ -72,6 +72,20 @@ def self.openapi_types } end + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'description', + :'integration', + :'per_unit', + :'short_name', + :'statsd_interval', + :'type', + :'unit', + ]) + end + # Initializes the object # @param attributes [Hash] Model attributes in the form of hash # @!visibility private