From 432451b2ff9d1bd559b060dd8914b8154b2e2e22 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 15 May 2026 16:35:31 +0000 Subject: [PATCH 1/4] Bump versions and add changelog entries. --- CHANGELOG.md | 55 +++++++++++++++++++++++++++++++ lib/datadog_api_client/version.rb | 2 +- 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 909af658de78..a5933f58828b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,60 @@ # CHANGELOG +## 2.54.0/2026-05-15 + +### Added +* Add Compliance Findings rule-based view endpoint to OpenAPI v2 [#3329](https://github.com/DataDog/datadog-api-client-ruby/pull/3329) +* Add window[seconds] query parameter for look back [#3327](https://github.com/DataDog/datadog-api-client-ruby/pull/3327) +* Add OpenAPI spec for cost-planning-api commitment program endpoints [#3324](https://github.com/DataDog/datadog-api-client-ruby/pull/3324) +* Add regression fields to Error Tracking API responses [#3323](https://github.com/DataDog/datadog-api-client-ruby/pull/3323) +* Add OpenAPI for Cloud Cost Management anomalies endpoints [#3320](https://github.com/DataDog/datadog-api-client-ruby/pull/3320) +* Allow errors data source in formula event queries for dashboards [#3314](https://github.com/DataDog/datadog-api-client-ruby/pull/3314) +* Document Cloud Cost Management v2 tags and tag_keys endpoints [#3313](https://github.com/DataDog/datadog-api-client-ruby/pull/3313) +* Add OpenAPI definition for CCM ListCostTagDescriptions [#3310](https://github.com/DataDog/datadog-api-client-ruby/pull/3310) +* Add OpenAPI spec for current user endpoints [#3306](https://github.com/DataDog/datadog-api-client-ruby/pull/3306) +* Add state filter for Search Error Tracking Issues API [#3300](https://github.com/DataDog/datadog-api-client-ruby/pull/3300) +* Add OpenAPI spec for email transport webhook intake [#3299](https://github.com/DataDog/datadog-api-client-ruby/pull/3299) +* Add integration_type for Microsoft Teams to IncidentIntegrationMetadataAttributes [#3298](https://github.com/DataDog/datadog-api-client-ruby/pull/3298) +* Add cross_org_uuids to v2 query endpoints [#3296](https://github.com/DataDog/datadog-api-client-ruby/pull/3296) +* Add GKE Autopilot usage types to API documentation [#3291](https://github.com/DataDog/datadog-api-client-ruby/pull/3291) +* Add session interaction type to LLM Observability API spec [#3290](https://github.com/DataDog/datadog-api-client-ruby/pull/3290) +* Add OpenAPI spec for authn-validation /api/v2/validate endpoint [#3289](https://github.com/DataDog/datadog-api-client-ruby/pull/3289) +* Add OpenAPI definitions for CCM status endpoints [#3288](https://github.com/DataDog/datadog-api-client-ruby/pull/3288) +* Add style and sort to TreeMapWidgetRequest and sort to SunburstWidgetRequest for Dashboards [#3278](https://github.com/DataDog/datadog-api-client-ruby/pull/3278) +* Add `compression_method` field to Log Archives [#3277](https://github.com/DataDog/datadog-api-client-ruby/pull/3277) +* Cloud inventory api sync config endpoint documentation [#3276](https://github.com/DataDog/datadog-api-client-ruby/pull/3276) +* Add Point Plot widget to dashboard API spec [#3274](https://github.com/DataDog/datadog-api-client-ruby/pull/3274) +* Add backfilled degradation and maintenance endpoints to Status Pages [#3273](https://github.com/DataDog/datadog-api-client-ruby/pull/3273) +* Add Cloud Cost Management ListCostOCIConfigs endpoint [#3272](https://github.com/DataDog/datadog-api-client-ruby/pull/3272) +* Add Observability pipelines databricks_zerobus destination [#3266](https://github.com/DataDog/datadog-api-client-ruby/pull/3266) +* Add infra_storage_mgmt_objects_count_avg fields to usage summary API [#3265](https://github.com/DataDog/datadog-api-client-ruby/pull/3265) +* RUM - Add Source Map Intake API endpoint specification [#3264](https://github.com/DataDog/datadog-api-client-ruby/pull/3264) +* Document bulk delete security monitoring rules endpoint [#3260](https://github.com/DataDog/datadog-api-client-ruby/pull/3260) +* Add compliance_host to Agentless Scanning scan options [#3259](https://github.com/DataDog/datadog-api-client-ruby/pull/3259) +* Add MuteSecurityFindings endpoint spec [#3253](https://github.com/DataDog/datadog-api-client-ruby/pull/3253) +* Add OpenAPI documentation for Synthetics downtime endpoints [#3252](https://github.com/DataDog/datadog-api-client-ruby/pull/3252) +* Add feature_flags_config_requests to usage summary API [#3225](https://github.com/DataDog/datadog-api-client-ruby/pull/3225) +* Add specs for ListOrgsV2 and DeleteUserInvitations [#3206](https://github.com/DataDog/datadog-api-client-ruby/pull/3206) +* Add infra_host_basic and eph_infra_host_basic to usage metering API [#3178](https://github.com/DataDog/datadog-api-client-ruby/pull/3178) + +### Changed +* Mark email transport webhook endpoint as private [#3318](https://github.com/DataDog/datadog-api-client-ruby/pull/3318) +* Mark Test Optimization endpoints as stable [#3270](https://github.com/DataDog/datadog-api-client-ruby/pull/3270) +* Document Annotations label schema API for AI Observability [#3268](https://github.com/DataDog/datadog-api-client-ruby/pull/3268) +* Security Monitoring - expand learningDuration and forgetAfter to support up to 30 days [#3231](https://github.com/DataDog/datadog-api-client-ruby/pull/3231) + +### Removed +* Remove deprecated incident teams endpoints [#3304](https://github.com/DataDog/datadog-api-client-ruby/pull/3304) +* Remove deprecated allocation key fields from feature flags API [#3247](https://github.com/DataDog/datadog-api-client-ruby/pull/3247) + +### Fixed +* Widgets API - add complete create/update example for cloud_cost_summary [#3286](https://github.com/DataDog/datadog-api-client-ruby/pull/3286) +* Fix Org Groups pagination response shape (meta.page + links) [#3279](https://github.com/DataDog/datadog-api-client-ruby/pull/3279) +* Clarify metrics API query strings [#3269](https://github.com/DataDog/datadog-api-client-ruby/pull/3269) + +### Deprecated +* Update Status Pages API documentation to reflect deprecation of creating a published status page [#3256](https://github.com/DataDog/datadog-api-client-ruby/pull/3256) + ## 2.53.0/2026-04-24 ### Changed diff --git a/lib/datadog_api_client/version.rb b/lib/datadog_api_client/version.rb index ef5f3b07f43a..805070be4c65 100644 --- a/lib/datadog_api_client/version.rb +++ b/lib/datadog_api_client/version.rb @@ -1,5 +1,5 @@ # Define library version. module DatadogAPIClient - VERSION = '2.53.0' + VERSION = '2.54.0' end From e7f870a2b0217ead35d552d6bbf4164c15099791 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 15 May 2026 17:07:32 +0000 Subject: [PATCH 2/4] [incidents] Skip terraform generation for noisy synthetics (#3336) Co-authored-by: ci.datadog-api-spec --- features/v2/incidents.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/features/v2/incidents.feature b/features/v2/incidents.feature index df4c5fe28da5..e30ccb252928 100644 --- a/features/v2/incidents.feature +++ b/features/v2/incidents.feature @@ -275,7 +275,7 @@ Feature: Incidents When the request is sent Then the response status is 400 Bad Request - @team:Datadog/incident-app + @skip-terraform-config @team:Datadog/incident-app Scenario: Create incident notification template returns "Created" response Given there is a valid "incident_type" in the system And operation "CreateIncidentNotificationTemplate" enabled @@ -497,7 +497,7 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found - @skip-validation @team:Datadog/incident-app + @skip-terraform-config @skip-validation @team:Datadog/incident-app Scenario: Delete an incident type returns "OK" response Given operation "DeleteIncidentType" enabled And new "DeleteIncidentType" request @@ -1311,7 +1311,7 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found - @skip-validation @team:Datadog/incident-app + @skip-terraform-config @skip-validation @team:Datadog/incident-app Scenario: Update an incident type returns "OK" response Given operation "UpdateIncidentType" enabled And new "UpdateIncidentType" request From 45c99d0aab12afd2dd40bba87276893b8ab77022 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 15 May 2026 19:04:08 +0000 Subject: [PATCH 3/4] Add display_block interaction type to LLM Obs annotation queues (#3328) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 418 +++++++++++++++--- ...CreateLLMObsAnnotationQueueInteractions.rb | 4 +- ...sAnnotationQueueInteractions_2021594537.rb | 27 ++ features/v2/llm_observability.feature | 18 + lib/datadog_api_client/inflector.rb | 14 +- .../v2/api/llm_observability_api.rb | 12 +- .../llm_obs_annotated_interaction_item.rb | 197 ++------- ...m_obs_annotation_queue_interaction_item.rb | 151 ++----- ...otation_queue_interaction_response_item.rb | 195 ++------ .../v2/models/llm_obs_content_block.rb | 238 ++++++++++ .../llm_obs_content_block_header_level.rb | 29 ++ ...nt_block_llm_obs_trace_interaction_type.rb | 28 ++ .../llm_obs_content_block_time_frame.rb | 144 ++++++ .../v2/models/llm_obs_content_block_type.rb | 33 ++ ...isplay_block_annotated_interaction_item.rb | 216 +++++++++ .../llm_obs_display_block_interaction_item.rb | 153 +++++++ ...display_block_interaction_response_item.rb | 214 +++++++++ .../llm_obs_display_block_interaction_type.rb | 26 ++ ...lm_obs_trace_annotated_interaction_item.rb | 188 ++++++++ .../models/llm_obs_trace_interaction_item.rb | 144 ++++++ ...llm_obs_trace_interaction_response_item.rb | 186 ++++++++ ...e.rb => llm_obs_trace_interaction_type.rb} | 4 +- 22 files changed, 2128 insertions(+), 511 deletions(-) create mode 100644 examples/v2/llm-observability/CreateLLMObsAnnotationQueueInteractions_2021594537.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_content_block.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_content_block_header_level.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_content_block_llm_obs_trace_interaction_type.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_content_block_time_frame.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_content_block_type.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_display_block_annotated_interaction_item.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_display_block_interaction_item.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_display_block_interaction_response_item.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_display_block_interaction_type.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_trace_annotated_interaction_item.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_trace_interaction_item.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_trace_interaction_response_item.rb rename lib/datadog_api_client/v2/models/{llm_obs_interaction_type.rb => llm_obs_trace_interaction_type.rb} (89%) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 39623cac69e0..b0ee5756e156 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -39902,33 +39902,19 @@ components: type: object LLMObsAnnotatedInteractionItem: description: An interaction with its associated annotations. - properties: - annotations: - description: List of annotations for this interaction. - items: - $ref: "#/components/schemas/LLMObsAnnotationItem" - type: array - content_id: - description: Identifier of the content (trace ID or session ID) for this interaction. - example: "trace-abc-123" - type: string - id: - description: Unique identifier of the interaction. - example: "interaction-456" - type: string - type: - $ref: "#/components/schemas/LLMObsInteractionType" - required: - - id - - type - - content_id - - annotations - type: object + oneOf: + - $ref: "#/components/schemas/LLMObsTraceAnnotatedInteractionItem" + - $ref: "#/components/schemas/LLMObsDisplayBlockAnnotatedInteractionItem" LLMObsAnnotatedInteractionsDataAttributesResponse: description: Attributes containing the list of annotated interactions. properties: annotated_interactions: description: List of interactions with their annotations. + example: + - annotations: [] + content_id: trace-abc-123 + id: "interaction-456" + type: trace items: $ref: "#/components/schemas/LLMObsAnnotatedInteractionItem" type: array @@ -40110,45 +40096,22 @@ components: type: object LLMObsAnnotationQueueInteractionItem: description: A single interaction to add to an annotation queue. - properties: - content_id: - description: Identifier of the content (trace ID or session ID) for this interaction. - example: "trace-abc-123" - type: string - type: - $ref: "#/components/schemas/LLMObsInteractionType" - required: - - type - - content_id - type: object + oneOf: + - $ref: "#/components/schemas/LLMObsTraceInteractionItem" + - $ref: "#/components/schemas/LLMObsDisplayBlockInteractionItem" LLMObsAnnotationQueueInteractionResponseItem: description: A single interaction result. - properties: - already_existed: - description: Whether this interaction already existed in the queue. - example: false - type: boolean - content_id: - description: Identifier of the content (trace ID or session ID) for this interaction. - example: "trace-abc-123" - type: string - id: - description: Unique identifier of the interaction. - example: "00000000-0000-0000-0000-000000000000" - type: string - type: - $ref: "#/components/schemas/LLMObsInteractionType" - required: - - id - - type - - content_id - - already_existed - type: object + oneOf: + - $ref: "#/components/schemas/LLMObsTraceInteractionResponseItem" + - $ref: "#/components/schemas/LLMObsDisplayBlockInteractionResponseItem" LLMObsAnnotationQueueInteractionsDataAttributesRequest: description: Attributes for adding interactions to an annotation queue. properties: interactions: description: List of interactions to add to the queue. Must contain at least one item. + example: + - content_id: trace-abc-123 + type: trace items: $ref: "#/components/schemas/LLMObsAnnotationQueueInteractionItem" minItems: 1 @@ -40161,6 +40124,11 @@ components: properties: interactions: description: List of interactions that were processed. + example: + - already_existed: false + content_id: trace-abc-123 + id: "00000000-0000-0000-0000-000000000000" + type: trace items: $ref: "#/components/schemas/LLMObsAnnotationQueueInteractionResponseItem" type: array @@ -40356,6 +40324,144 @@ components: required: - label_schemas type: object + LLMObsContentBlock: + description: |- + A single content block rendered inside a `display_block` interaction. + `type` discriminates which other fields are meaningful: + + - `markdown` / `text`: `content` must be a string. + - `header`: `content` must be a string; `level`, when set, must be one of `sm`, `md`, `lg`, `xl`. + - `json`: `content` must be a well-formed JSON value (object, array, or scalar). + - `image`: `url` is required. + - `widget`: `tileDef` is required (any well-formed JSON; the frontend owns the renderable schema). + - `llmobs_trace`: `traceId` is required; `interactionType`, when set, must be `trace` or `experiment_trace`. + + `height`, when set, must be positive. + properties: + alt: + description: Alternative text for an `image` block. + example: "Example image" + type: string + content: + description: |- + Block payload. A string for `markdown`, `header`, and `text`; an + arbitrary JSON value (object, array, or scalar) for `json`. Omitted + for `image`, `widget`, and `llmobs_trace`. + example: "## Triage Instructions" + height: + description: Optional rendered height. Must be positive when set. + example: 240 + format: int64 + type: integer + interactionType: + $ref: "#/components/schemas/LLMObsContentBlockLLMObsTraceInteractionType" + label: + description: Optional label rendered alongside the block. + example: "Triage Instructions" + type: string + level: + $ref: "#/components/schemas/LLMObsContentBlockHeaderLevel" + tileDef: + description: |- + Tile definition for a `widget` block. Required for `widget`. The + schema is owned by the frontend renderer. + example: + requests: + - queries: + - data_source: metrics + name: q + query: "avg:system.cpu.user{*}" + response_format: timeseries + type: line + viz: timeseries + timeFrame: + $ref: "#/components/schemas/LLMObsContentBlockTimeFrame" + traceId: + description: Trace identifier. Required for `llmobs_trace` blocks. + example: "69fcc2bb0000000003113989d83069ba" + type: string + type: + $ref: "#/components/schemas/LLMObsContentBlockType" + url: + description: URL of the image. Required for `image` blocks. + example: "https://example.com/image.png" + type: string + required: + - type + type: object + LLMObsContentBlockHeaderLevel: + description: Visual size for a `header` block. + enum: + - sm + - md + - lg + - xl + example: md + type: string + x-enum-varnames: + - SM + - MD + - LG + - XL + LLMObsContentBlockLLMObsTraceInteractionType: + description: |- + Upstream interaction type referenced by an `llmobs_trace` block. + Restricted to `trace` or `experiment_trace`. + enum: + - trace + - experiment_trace + example: trace + type: string + x-enum-varnames: + - TRACE + - EXPERIMENT_TRACE + LLMObsContentBlockTimeFrame: + description: Unix-millis time range used by chart blocks. + properties: + end: + description: End of the range, in Unix milliseconds. + example: 1705315800000 + format: int64 + type: integer + start: + description: Start of the range, in Unix milliseconds. + example: 1705312200000 + format: int64 + type: integer + required: + - start + - end + type: object + LLMObsContentBlockType: + description: |- + Discriminator for a single `display_block` content block. Adding a + variant requires coordinated changes in the frontend renderer. + enum: + - markdown + - header + - text + - json + - image + - widget + - llmobs_trace + example: markdown + type: string + x-enum-varnames: + - MARKDOWN + - HEADER + - TEXT + - JSON + - IMAGE + - WIDGET + - LLMOBS_TRACE + LLMObsContentBlocks: + description: |- + List of content blocks that make up a `display_block` interaction. + Must contain at least one block. + items: + $ref: "#/components/schemas/LLMObsContentBlock" + minItems: 1 + type: array LLMObsCursorMeta: description: Pagination cursor metadata. properties: @@ -41266,6 +41372,81 @@ components: required: - data type: object + LLMObsDisplayBlockAnnotatedInteractionItem: + description: A display_block interaction with its associated annotations. + properties: + annotations: + description: List of annotations for this interaction. + items: + $ref: "#/components/schemas/LLMObsAnnotationItem" + type: array + content_id: + description: Server-generated deterministic identifier derived from the block list. + example: "9a87f3e2b1d4c5a6f8b3e2d1c4a7b5f6e3d2a1c4b7e5f8a3d6c2e1b4a7d5f8c2" + type: string + display_block: + $ref: "#/components/schemas/LLMObsContentBlocks" + id: + description: Unique identifier of the interaction. + example: "interaction-456" + type: string + type: + $ref: "#/components/schemas/LLMObsDisplayBlockInteractionType" + required: + - id + - type + - content_id + - annotations + - display_block + type: object + LLMObsDisplayBlockInteractionItem: + description: |- + An interaction whose rendered content is supplied directly as a list + of display blocks. The server generates `content_id` deterministically + from the block list. + properties: + display_block: + $ref: "#/components/schemas/LLMObsContentBlocks" + type: + $ref: "#/components/schemas/LLMObsDisplayBlockInteractionType" + required: + - type + - display_block + type: object + LLMObsDisplayBlockInteractionResponseItem: + description: A display_block interaction result. + properties: + already_existed: + description: Whether this interaction already existed in the queue. + example: false + type: boolean + content_id: + description: Server-generated deterministic identifier derived from the block list. + example: "9a87f3e2b1d4c5a6f8b3e2d1c4a7b5f6e3d2a1c4b7e5f8a3d6c2e1b4a7d5f8c2" + type: string + display_block: + $ref: "#/components/schemas/LLMObsContentBlocks" + id: + description: Unique identifier of the interaction. + example: "00000000-0000-0000-0000-000000000000" + type: string + type: + $ref: "#/components/schemas/LLMObsDisplayBlockInteractionType" + required: + - id + - type + - content_id + - already_existed + - display_block + type: object + LLMObsDisplayBlockInteractionType: + description: Type discriminator for a `display_block` interaction. + enum: + - display_block + example: display_block + type: string + x-enum-varnames: + - DISPLAY_BLOCK LLMObsEventType: description: Resource type for LLM Observability experiment events. enum: @@ -41643,18 +41824,6 @@ components: required: - data type: object - LLMObsInteractionType: - description: Type of interaction in an annotation queue. - enum: - - trace - - experiment_trace - - session - example: trace - type: string - x-enum-varnames: - - TRACE - - EXPERIMENT_TRACE - - SESSION LLMObsLabelSchema: description: Schema definition for a single label in an annotation queue. properties: @@ -41896,6 +42065,78 @@ components: type: string x-enum-varnames: - RECORDS + LLMObsTraceAnnotatedInteractionItem: + description: A trace, experiment trace, or session interaction with its associated annotations. + properties: + annotations: + description: List of annotations for this interaction. + items: + $ref: "#/components/schemas/LLMObsAnnotationItem" + type: array + content_id: + description: Upstream entity identifier supplied by the caller. + example: "trace-abc-123" + type: string + id: + description: Unique identifier of the interaction. + example: "interaction-456" + type: string + type: + $ref: "#/components/schemas/LLMObsTraceInteractionType" + required: + - id + - type + - content_id + - annotations + type: object + LLMObsTraceInteractionItem: + description: An interaction that references an upstream trace, experiment trace, or session. + properties: + content_id: + description: Upstream entity identifier (trace, experiment trace, or session ID). + example: "trace-abc-123" + type: string + type: + $ref: "#/components/schemas/LLMObsTraceInteractionType" + required: + - type + - content_id + type: object + LLMObsTraceInteractionResponseItem: + description: A trace, experiment trace, or session interaction result. + properties: + already_existed: + description: Whether this interaction already existed in the queue. + example: false + type: boolean + content_id: + description: Upstream entity identifier supplied by the caller. + example: "trace-abc-123" + type: string + id: + description: Unique identifier of the interaction. + example: "00000000-0000-0000-0000-000000000000" + type: string + type: + $ref: "#/components/schemas/LLMObsTraceInteractionType" + required: + - id + - type + - content_id + - already_existed + type: object + LLMObsTraceInteractionType: + description: Type of an upstream-entity interaction. + enum: + - trace + - experiment_trace + - session + example: trace + type: string + x-enum-varnames: + - TRACE + - EXPERIMENT_TRACE + - SESSION Language: description: Programming language enum: @@ -113835,8 +114076,16 @@ paths: /api/v2/llm-obs/v1/annotation-queues/{queue_id}/interactions: post: description: |- - Add one or more interactions (traces or sessions) to an annotation queue. - At least one interaction must be provided. + Add one or more interactions to an annotation queue. At least one + interaction must be provided. Each interaction has a `type`: + + - `trace`, `experiment_trace`, `session`: `content_id` references the + upstream entity; the server fetches the actual content. + - `display_block`: omit `content_id` and provide the rendered content + in `display_block`. The server generates `content_id` as a + deterministic hash of the block list. + + Items of different types can be mixed in a single request. operationId: CreateLLMObsAnnotationQueueInteractions parameters: - $ref: "#/components/parameters/LLMObsAnnotationQueueIDPathParameter" @@ -113852,6 +114101,24 @@ paths: - content_id: trace-abc-123 type: trace type: interactions + display_block: + summary: Add a display_block interaction + value: + data: + attributes: + interactions: + - display_block: + - content: "## Triage Instructions" + type: markdown + - content: "Inputs" + level: md + type: header + - content: + experiment_id: abc-123 + label: "Experiments" + type: json + type: display_block + type: interactions schema: $ref: "#/components/schemas/LLMObsAnnotationQueueInteractionsRequest" description: Add interactions payload. @@ -113872,6 +114139,21 @@ paths: type: trace id: 00000000-0000-0000-0000-000000000001 type: interactions + display_block: + summary: display_block response + value: + data: + attributes: + interactions: + - already_existed: false + content_id: 9a87f3e2b1d4c5a6f8b3e2d1c4a7b5f6e3d2a1c4b7e5f8a3d6c2e1b4a7d5f8c2 + display_block: + - content: "## Triage Instructions" + type: markdown + id: 00000000-0000-0000-0000-000000000000 + type: display_block + id: 00000000-0000-0000-0000-000000000001 + type: interactions schema: $ref: "#/components/schemas/LLMObsAnnotationQueueInteractionsResponse" description: Created diff --git a/examples/v2/llm-observability/CreateLLMObsAnnotationQueueInteractions.rb b/examples/v2/llm-observability/CreateLLMObsAnnotationQueueInteractions.rb index 44cbcd3b61ce..ba908f873220 100644 --- a/examples/v2/llm-observability/CreateLLMObsAnnotationQueueInteractions.rb +++ b/examples/v2/llm-observability/CreateLLMObsAnnotationQueueInteractions.rb @@ -10,9 +10,9 @@ data: DatadogAPIClient::V2::LLMObsAnnotationQueueInteractionsDataRequest.new({ attributes: DatadogAPIClient::V2::LLMObsAnnotationQueueInteractionsDataAttributesRequest.new({ interactions: [ - DatadogAPIClient::V2::LLMObsAnnotationQueueInteractionItem.new({ + DatadogAPIClient::V2::LLMObsTraceInteractionItem.new({ content_id: "trace-abc-123", - type: DatadogAPIClient::V2::LLMObsInteractionType::TRACE, + type: DatadogAPIClient::V2::LLMObsTraceInteractionType::TRACE, }), ], }), diff --git a/examples/v2/llm-observability/CreateLLMObsAnnotationQueueInteractions_2021594537.rb b/examples/v2/llm-observability/CreateLLMObsAnnotationQueueInteractions_2021594537.rb new file mode 100644 index 000000000000..5591e81d6e04 --- /dev/null +++ b/examples/v2/llm-observability/CreateLLMObsAnnotationQueueInteractions_2021594537.rb @@ -0,0 +1,27 @@ +# Add a display_block interaction returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_llm_obs_annotation_queue_interactions".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new + +body = DatadogAPIClient::V2::LLMObsAnnotationQueueInteractionsRequest.new({ + data: DatadogAPIClient::V2::LLMObsAnnotationQueueInteractionsDataRequest.new({ + attributes: DatadogAPIClient::V2::LLMObsAnnotationQueueInteractionsDataAttributesRequest.new({ + interactions: [ + DatadogAPIClient::V2::LLMObsDisplayBlockInteractionItem.new({ + type: DatadogAPIClient::V2::LLMObsDisplayBlockInteractionType::DISPLAY_BLOCK, + display_block: [ + DatadogAPIClient::V2::LLMObsContentBlock.new({ + type: DatadogAPIClient::V2::LLMObsContentBlockType::MARKDOWN, + content: "## Triage Instructions", + }), + ], + }), + ], + }), + type: DatadogAPIClient::V2::LLMObsAnnotationQueueInteractionsType::INTERACTIONS, + }), +}) +p api_instance.create_llm_obs_annotation_queue_interactions("queue_id", body) diff --git a/features/v2/llm_observability.feature b/features/v2/llm_observability.feature index 639121ad2382..20b95487da8b 100644 --- a/features/v2/llm_observability.feature +++ b/features/v2/llm_observability.feature @@ -8,6 +8,24 @@ Feature: LLM Observability And a valid "appKeyAuth" key in the system And an instance of "LLMObservability" API + @skip @team:DataDog/ml-observability + Scenario: Add a display_block interaction returns "Created" response + Given operation "CreateLLMObsAnnotationQueueInteractions" enabled + And new "CreateLLMObsAnnotationQueueInteractions" request + And request contains "queue_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"interactions": [{"type": "display_block", "display_block": [{"type": "markdown", "content": "## Triage Instructions"}]}]}, "type": "interactions"}} + When the request is sent + Then the response status is 201 Created + + @skip @team:DataDog/ml-observability + Scenario: Add a display_block interaction with an image block missing url returns "Bad Request" response + Given operation "CreateLLMObsAnnotationQueueInteractions" enabled + And new "CreateLLMObsAnnotationQueueInteractions" request + And request contains "queue_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"interactions": [{"type": "display_block", "display_block": [{"type": "image"}]}]}, "type": "interactions"}} + When the request is sent + Then the response status is 400 Bad Request + @generated @skip @team:DataDog/ml-observability Scenario: Add annotation queue interactions returns "Bad Request" response Given operation "CreateLLMObsAnnotationQueueInteractions" enabled diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 9c4f484bec99..cfd25d9e44ea 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3600,6 +3600,11 @@ def overrides "v2.llm_obs_annotation_queue_update_data_request" => "LLMObsAnnotationQueueUpdateDataRequest", "v2.llm_obs_annotation_queue_update_request" => "LLMObsAnnotationQueueUpdateRequest", "v2.llm_obs_annotation_schema" => "LLMObsAnnotationSchema", + "v2.llm_obs_content_block" => "LLMObsContentBlock", + "v2.llm_obs_content_block_header_level" => "LLMObsContentBlockHeaderLevel", + "v2.llm_obs_content_block_llm_obs_trace_interaction_type" => "LLMObsContentBlockLLMObsTraceInteractionType", + "v2.llm_obs_content_block_time_frame" => "LLMObsContentBlockTimeFrame", + "v2.llm_obs_content_block_type" => "LLMObsContentBlockType", "v2.llm_obs_cursor_meta" => "LLMObsCursorMeta", "v2.llm_obs_custom_eval_config_assessment_criteria" => "LLMObsCustomEvalConfigAssessmentCriteria", "v2.llm_obs_custom_eval_config_attributes" => "LLMObsCustomEvalConfigAttributes", @@ -3662,6 +3667,10 @@ def overrides "v2.llm_obs_delete_projects_data_attributes_request" => "LLMObsDeleteProjectsDataAttributesRequest", "v2.llm_obs_delete_projects_data_request" => "LLMObsDeleteProjectsDataRequest", "v2.llm_obs_delete_projects_request" => "LLMObsDeleteProjectsRequest", + "v2.llm_obs_display_block_annotated_interaction_item" => "LLMObsDisplayBlockAnnotatedInteractionItem", + "v2.llm_obs_display_block_interaction_item" => "LLMObsDisplayBlockInteractionItem", + "v2.llm_obs_display_block_interaction_response_item" => "LLMObsDisplayBlockInteractionResponseItem", + "v2.llm_obs_display_block_interaction_type" => "LLMObsDisplayBlockInteractionType", "v2.llm_obs_event_type" => "LLMObsEventType", "v2.llm_obs_experiment_data_attributes_request" => "LLMObsExperimentDataAttributesRequest", "v2.llm_obs_experiment_data_attributes_response" => "LLMObsExperimentDataAttributesResponse", @@ -3683,7 +3692,6 @@ def overrides "v2.llm_obs_experiment_update_data_attributes_request" => "LLMObsExperimentUpdateDataAttributesRequest", "v2.llm_obs_experiment_update_data_request" => "LLMObsExperimentUpdateDataRequest", "v2.llm_obs_experiment_update_request" => "LLMObsExperimentUpdateRequest", - "v2.llm_obs_interaction_type" => "LLMObsInteractionType", "v2.llm_obs_label_schema" => "LLMObsLabelSchema", "v2.llm_obs_label_schema_type" => "LLMObsLabelSchemaType", "v2.llm_obs_metric_assessment" => "LLMObsMetricAssessment", @@ -3700,6 +3708,10 @@ def overrides "v2.llm_obs_project_update_data_request" => "LLMObsProjectUpdateDataRequest", "v2.llm_obs_project_update_request" => "LLMObsProjectUpdateRequest", "v2.llm_obs_record_type" => "LLMObsRecordType", + "v2.llm_obs_trace_annotated_interaction_item" => "LLMObsTraceAnnotatedInteractionItem", + "v2.llm_obs_trace_interaction_item" => "LLMObsTraceInteractionItem", + "v2.llm_obs_trace_interaction_response_item" => "LLMObsTraceInteractionResponseItem", + "v2.llm_obs_trace_interaction_type" => "LLMObsTraceInteractionType", "v2.log" => "Log", "v2.log_attributes" => "LogAttributes", "v2.logs_aggregate_bucket" => "LogsAggregateBucket", diff --git a/lib/datadog_api_client/v2/api/llm_observability_api.rb b/lib/datadog_api_client/v2/api/llm_observability_api.rb index 28c76c4b6501..5686a030aca6 100644 --- a/lib/datadog_api_client/v2/api/llm_observability_api.rb +++ b/lib/datadog_api_client/v2/api/llm_observability_api.rb @@ -109,8 +109,16 @@ def create_llm_obs_annotation_queue_interactions(queue_id, body, opts = {}) # Add annotation queue interactions. # - # Add one or more interactions (traces or sessions) to an annotation queue. - # At least one interaction must be provided. + # Add one or more interactions to an annotation queue. At least one + # interaction must be provided. Each interaction has a `type`: + # + # - `trace`, `experiment_trace`, `session`: `content_id` references the + # upstream entity; the server fetches the actual content. + # - `display_block`: omit `content_id` and provide the rendered content + # in `display_block`. The server generates `content_id` as a + # deterministic hash of the block list. + # + # Items of different types can be mixed in a single request. # # @param queue_id [String] The ID of the LLM Observability annotation queue. # @param body [LLMObsAnnotationQueueInteractionsRequest] Add interactions payload. diff --git a/lib/datadog_api_client/v2/models/llm_obs_annotated_interaction_item.rb b/lib/datadog_api_client/v2/models/llm_obs_annotated_interaction_item.rb index fb01c9d09b07..66fdafed5365 100644 --- a/lib/datadog_api_client/v2/models/llm_obs_annotated_interaction_item.rb +++ b/lib/datadog_api_client/v2/models/llm_obs_annotated_interaction_item.rb @@ -18,171 +18,46 @@ module DatadogAPIClient::V2 # An interaction with its associated annotations. - class LLMObsAnnotatedInteractionItem - include BaseGenericModel - - # List of annotations for this interaction. - attr_reader :annotations - - # Identifier of the content (trace ID or session ID) for this interaction. - attr_reader :content_id - - # Unique identifier of the interaction. - attr_reader :id - - # Type of interaction in an annotation queue. - attr_reader :type - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'annotations' => :'annotations', - :'content_id' => :'content_id', - :'id' => :'id', - :'type' => :'type' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'annotations' => :'Array', - :'content_id' => :'String', - :'id' => :'String', - :'type' => :'LLMObsInteractionType' - } - 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::LLMObsAnnotatedInteractionItem` 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?(:'annotations') - if (value = attributes[:'annotations']).is_a?(Array) - self.annotations = value + module LLMObsAnnotatedInteractionItem + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'LLMObsTraceAnnotatedInteractionItem', + :'LLMObsDisplayBlockAnnotatedInteractionItem' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end end - end - - if attributes.key?(:'content_id') - self.content_id = attributes[:'content_id'] - 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 @annotations.nil? - return false if @content_id.nil? - return false if @id.nil? - return false if @type.nil? - true - end - - # Custom attribute writer method with validation - # @param annotations [Object] Object to be assigned - # @!visibility private - def annotations=(annotations) - if annotations.nil? - fail ArgumentError, 'invalid value for "annotations", annotations cannot be nil.' - end - @annotations = annotations - end - - # Custom attribute writer method with validation - # @param content_id [Object] Object to be assigned - # @!visibility private - def content_id=(content_id) - if content_id.nil? - fail ArgumentError, 'invalid value for "content_id", content_id cannot be nil.' - end - @content_id = content_id - 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}")) + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) 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 && - annotations == o.annotations && - content_id == o.content_id && - 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 - [annotations, content_id, id, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/llm_obs_annotation_queue_interaction_item.rb b/lib/datadog_api_client/v2/models/llm_obs_annotation_queue_interaction_item.rb index 2f8b1b8c7723..1f9307d0cbf6 100644 --- a/lib/datadog_api_client/v2/models/llm_obs_annotation_queue_interaction_item.rb +++ b/lib/datadog_api_client/v2/models/llm_obs_annotation_queue_interaction_item.rb @@ -18,127 +18,46 @@ module DatadogAPIClient::V2 # A single interaction to add to an annotation queue. - class LLMObsAnnotationQueueInteractionItem - include BaseGenericModel - - # Identifier of the content (trace ID or session ID) for this interaction. - attr_reader :content_id - - # Type of interaction in an annotation queue. - attr_reader :type - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'content_id' => :'content_id', - :'type' => :'type' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'content_id' => :'String', - :'type' => :'LLMObsInteractionType' - } - 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::LLMObsAnnotationQueueInteractionItem` initialize method" + module LLMObsAnnotationQueueInteractionItem + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'LLMObsTraceInteractionItem', + :'LLMObsDisplayBlockInteractionItem' + ] 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 + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end end - } - - if attributes.key?(:'content_id') - self.content_id = attributes[:'content_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 @content_id.nil? - return false if @type.nil? - true - end - - # Custom attribute writer method with validation - # @param content_id [Object] Object to be assigned - # @!visibility private - def content_id=(content_id) - if content_id.nil? - fail ArgumentError, 'invalid value for "content_id", content_id cannot be nil.' - end - @content_id = content_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}")) + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) 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 && - content_id == o.content_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 - [content_id, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/llm_obs_annotation_queue_interaction_response_item.rb b/lib/datadog_api_client/v2/models/llm_obs_annotation_queue_interaction_response_item.rb index b9887ec352c9..77bf88f7a36f 100644 --- a/lib/datadog_api_client/v2/models/llm_obs_annotation_queue_interaction_response_item.rb +++ b/lib/datadog_api_client/v2/models/llm_obs_annotation_queue_interaction_response_item.rb @@ -18,169 +18,46 @@ module DatadogAPIClient::V2 # A single interaction result. - class LLMObsAnnotationQueueInteractionResponseItem - include BaseGenericModel - - # Whether this interaction already existed in the queue. - attr_reader :already_existed - - # Identifier of the content (trace ID or session ID) for this interaction. - attr_reader :content_id - - # Unique identifier of the interaction. - attr_reader :id - - # Type of interaction in an annotation queue. - attr_reader :type - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'already_existed' => :'already_existed', - :'content_id' => :'content_id', - :'id' => :'id', - :'type' => :'type' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'already_existed' => :'Boolean', - :'content_id' => :'String', - :'id' => :'String', - :'type' => :'LLMObsInteractionType' - } - 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::LLMObsAnnotationQueueInteractionResponseItem` 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 + module LLMObsAnnotationQueueInteractionResponseItem + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'LLMObsTraceInteractionResponseItem', + :'LLMObsDisplayBlockInteractionResponseItem' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end end - } - - if attributes.key?(:'already_existed') - self.already_existed = attributes[:'already_existed'] - end - - if attributes.key?(:'content_id') - self.content_id = attributes[:'content_id'] - 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 @already_existed.nil? - return false if @content_id.nil? - return false if @id.nil? - return false if @type.nil? - true - end - - # Custom attribute writer method with validation - # @param already_existed [Object] Object to be assigned - # @!visibility private - def already_existed=(already_existed) - if already_existed.nil? - fail ArgumentError, 'invalid value for "already_existed", already_existed cannot be nil.' - end - @already_existed = already_existed - end - - # Custom attribute writer method with validation - # @param content_id [Object] Object to be assigned - # @!visibility private - def content_id=(content_id) - if content_id.nil? - fail ArgumentError, 'invalid value for "content_id", content_id cannot be nil.' - end - @content_id = content_id - 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}")) + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) 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 && - already_existed == o.already_existed && - content_id == o.content_id && - 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 - [already_existed, content_id, id, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/llm_obs_content_block.rb b/lib/datadog_api_client/v2/models/llm_obs_content_block.rb new file mode 100644 index 000000000000..e70890624bd8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_content_block.rb @@ -0,0 +1,238 @@ +=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 single content block rendered inside a `display_block` interaction. + # `type` discriminates which other fields are meaningful: + # + # - `markdown` / `text`: `content` must be a string. + # - `header`: `content` must be a string; `level`, when set, must be one of `sm`, `md`, `lg`, `xl`. + # - `json`: `content` must be a well-formed JSON value (object, array, or scalar). + # - `image`: `url` is required. + # - `widget`: `tileDef` is required (any well-formed JSON; the frontend owns the renderable schema). + # - `llmobs_trace`: `traceId` is required; `interactionType`, when set, must be `trace` or `experiment_trace`. + # + # `height`, when set, must be positive. + class LLMObsContentBlock + include BaseGenericModel + + # Alternative text for an `image` block. + attr_accessor :alt + + # Block payload. A string for `markdown`, `header`, and `text`; an + # arbitrary JSON value (object, array, or scalar) for `json`. Omitted + # for `image`, `widget`, and `llmobs_trace`. + attr_accessor :content + + # Optional rendered height. Must be positive when set. + attr_accessor :height + + # Upstream interaction type referenced by an `llmobs_trace` block. + # Restricted to `trace` or `experiment_trace`. + attr_accessor :interaction_type + + # Optional label rendered alongside the block. + attr_accessor :label + + # Visual size for a `header` block. + attr_accessor :level + + # Tile definition for a `widget` block. Required for `widget`. The + # schema is owned by the frontend renderer. + attr_accessor :tile_def + + # Unix-millis time range used by chart blocks. + attr_accessor :time_frame + + # Trace identifier. Required for `llmobs_trace` blocks. + attr_accessor :trace_id + + # Discriminator for a single `display_block` content block. Adding a + # variant requires coordinated changes in the frontend renderer. + attr_reader :type + + # URL of the image. Required for `image` blocks. + attr_accessor :url + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'alt' => :'alt', + :'content' => :'content', + :'height' => :'height', + :'interaction_type' => :'interactionType', + :'label' => :'label', + :'level' => :'level', + :'tile_def' => :'tileDef', + :'time_frame' => :'timeFrame', + :'trace_id' => :'traceId', + :'type' => :'type', + :'url' => :'url' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'alt' => :'String', + :'content' => :'Object', + :'height' => :'Integer', + :'interaction_type' => :'LLMObsContentBlockLLMObsTraceInteractionType', + :'label' => :'String', + :'level' => :'LLMObsContentBlockHeaderLevel', + :'tile_def' => :'Object', + :'time_frame' => :'LLMObsContentBlockTimeFrame', + :'trace_id' => :'String', + :'type' => :'LLMObsContentBlockType', + :'url' => :'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::LLMObsContentBlock` 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?(:'alt') + self.alt = attributes[:'alt'] + end + + if attributes.key?(:'content') + self.content = attributes[:'content'] + end + + if attributes.key?(:'height') + self.height = attributes[:'height'] + end + + if attributes.key?(:'interaction_type') + self.interaction_type = attributes[:'interaction_type'] + end + + if attributes.key?(:'label') + self.label = attributes[:'label'] + end + + if attributes.key?(:'level') + self.level = attributes[:'level'] + end + + if attributes.key?(:'tile_def') + self.tile_def = attributes[:'tile_def'] + end + + if attributes.key?(:'time_frame') + self.time_frame = attributes[:'time_frame'] + end + + if attributes.key?(:'trace_id') + self.trace_id = attributes[:'trace_id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'url') + self.url = attributes[:'url'] + 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 && + alt == o.alt && + content == o.content && + height == o.height && + interaction_type == o.interaction_type && + label == o.label && + level == o.level && + tile_def == o.tile_def && + time_frame == o.time_frame && + trace_id == o.trace_id && + type == o.type && + url == o.url && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [alt, content, height, interaction_type, label, level, tile_def, time_frame, trace_id, type, url, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_content_block_header_level.rb b/lib/datadog_api_client/v2/models/llm_obs_content_block_header_level.rb new file mode 100644 index 000000000000..75db1da2c76a --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_content_block_header_level.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 + # Visual size for a `header` block. + class LLMObsContentBlockHeaderLevel + include BaseEnumModel + + SM = "sm".freeze + MD = "md".freeze + LG = "lg".freeze + XL = "xl".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_content_block_llm_obs_trace_interaction_type.rb b/lib/datadog_api_client/v2/models/llm_obs_content_block_llm_obs_trace_interaction_type.rb new file mode 100644 index 000000000000..c6946bee74fa --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_content_block_llm_obs_trace_interaction_type.rb @@ -0,0 +1,28 @@ +=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 + # Upstream interaction type referenced by an `llmobs_trace` block. + # Restricted to `trace` or `experiment_trace`. + class LLMObsContentBlockLLMObsTraceInteractionType + include BaseEnumModel + + TRACE = "trace".freeze + EXPERIMENT_TRACE = "experiment_trace".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_content_block_time_frame.rb b/lib/datadog_api_client/v2/models/llm_obs_content_block_time_frame.rb new file mode 100644 index 000000000000..5bfbb2088733 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_content_block_time_frame.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 + # Unix-millis time range used by chart blocks. + class LLMObsContentBlockTimeFrame + include BaseGenericModel + + # End of the range, in Unix milliseconds. + attr_reader :_end + + # Start of the range, in Unix milliseconds. + attr_reader :start + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_end' => :'end', + :'start' => :'start' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_end' => :'Integer', + :'start' => :'Integer' + } + 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::LLMObsContentBlockTimeFrame` 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?(:'_end') + self._end = attributes[:'_end'] + end + + if attributes.key?(:'start') + self.start = attributes[:'start'] + 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 @_end.nil? + return false if @start.nil? + true + end + + # Custom attribute writer method with validation + # @param _end [Object] Object to be assigned + # @!visibility private + def _end=(_end) + if _end.nil? + fail ArgumentError, 'invalid value for "_end", _end cannot be nil.' + end + @_end = _end + end + + # Custom attribute writer method with validation + # @param start [Object] Object to be assigned + # @!visibility private + def start=(start) + if start.nil? + fail ArgumentError, 'invalid value for "start", start cannot be nil.' + end + @start = start + 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 && + _end == o._end && + start == o.start && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_end, start, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_content_block_type.rb b/lib/datadog_api_client/v2/models/llm_obs_content_block_type.rb new file mode 100644 index 000000000000..339b2c1a600c --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_content_block_type.rb @@ -0,0 +1,33 @@ +=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 + # Discriminator for a single `display_block` content block. Adding a + # variant requires coordinated changes in the frontend renderer. + class LLMObsContentBlockType + include BaseEnumModel + + MARKDOWN = "markdown".freeze + HEADER = "header".freeze + TEXT = "text".freeze + JSON = "json".freeze + IMAGE = "image".freeze + WIDGET = "widget".freeze + LLMOBS_TRACE = "llmobs_trace".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_display_block_annotated_interaction_item.rb b/lib/datadog_api_client/v2/models/llm_obs_display_block_annotated_interaction_item.rb new file mode 100644 index 000000000000..ba264b0c8d73 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_display_block_annotated_interaction_item.rb @@ -0,0 +1,216 @@ +=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 display_block interaction with its associated annotations. + class LLMObsDisplayBlockAnnotatedInteractionItem + include BaseGenericModel + + # List of annotations for this interaction. + attr_reader :annotations + + # Server-generated deterministic identifier derived from the block list. + attr_reader :content_id + + # List of content blocks that make up a `display_block` interaction. + # Must contain at least one block. + attr_reader :display_block + + # Unique identifier of the interaction. + attr_reader :id + + # Type discriminator for a `display_block` interaction. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'annotations' => :'annotations', + :'content_id' => :'content_id', + :'display_block' => :'display_block', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'annotations' => :'Array', + :'content_id' => :'String', + :'display_block' => :'Array', + :'id' => :'String', + :'type' => :'LLMObsDisplayBlockInteractionType' + } + 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::LLMObsDisplayBlockAnnotatedInteractionItem` 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?(:'annotations') + if (value = attributes[:'annotations']).is_a?(Array) + self.annotations = value + end + end + + if attributes.key?(:'content_id') + self.content_id = attributes[:'content_id'] + end + + if attributes.key?(:'display_block') + if (value = attributes[:'display_block']).is_a?(Array) + self.display_block = value + end + 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 @annotations.nil? + return false if @content_id.nil? + return false if @display_block.nil? + return false if @display_block.length < 1 + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param annotations [Object] Object to be assigned + # @!visibility private + def annotations=(annotations) + if annotations.nil? + fail ArgumentError, 'invalid value for "annotations", annotations cannot be nil.' + end + @annotations = annotations + end + + # Custom attribute writer method with validation + # @param content_id [Object] Object to be assigned + # @!visibility private + def content_id=(content_id) + if content_id.nil? + fail ArgumentError, 'invalid value for "content_id", content_id cannot be nil.' + end + @content_id = content_id + end + + # Custom attribute writer method with validation + # @param display_block [Object] Object to be assigned + # @!visibility private + def display_block=(display_block) + if display_block.nil? + fail ArgumentError, 'invalid value for "display_block", display_block cannot be nil.' + end + if display_block.length < 1 + fail ArgumentError, 'invalid value for "display_block", number of items must be greater than or equal to 1.' + end + @display_block = display_block + 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 && + annotations == o.annotations && + content_id == o.content_id && + display_block == o.display_block && + 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 + [annotations, content_id, display_block, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_display_block_interaction_item.rb b/lib/datadog_api_client/v2/models/llm_obs_display_block_interaction_item.rb new file mode 100644 index 000000000000..f8ad86f3c645 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_display_block_interaction_item.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 + # An interaction whose rendered content is supplied directly as a list + # of display blocks. The server generates `content_id` deterministically + # from the block list. + class LLMObsDisplayBlockInteractionItem + include BaseGenericModel + + # List of content blocks that make up a `display_block` interaction. + # Must contain at least one block. + attr_reader :display_block + + # Type discriminator for a `display_block` interaction. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'display_block' => :'display_block', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'display_block' => :'Array', + :'type' => :'LLMObsDisplayBlockInteractionType' + } + 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::LLMObsDisplayBlockInteractionItem` 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?(:'display_block') + if (value = attributes[:'display_block']).is_a?(Array) + self.display_block = value + end + 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 @display_block.nil? + return false if @display_block.length < 1 + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param display_block [Object] Object to be assigned + # @!visibility private + def display_block=(display_block) + if display_block.nil? + fail ArgumentError, 'invalid value for "display_block", display_block cannot be nil.' + end + if display_block.length < 1 + fail ArgumentError, 'invalid value for "display_block", number of items must be greater than or equal to 1.' + end + @display_block = display_block + 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 && + display_block == o.display_block && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [display_block, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_display_block_interaction_response_item.rb b/lib/datadog_api_client/v2/models/llm_obs_display_block_interaction_response_item.rb new file mode 100644 index 000000000000..240d5fab7bee --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_display_block_interaction_response_item.rb @@ -0,0 +1,214 @@ +=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 display_block interaction result. + class LLMObsDisplayBlockInteractionResponseItem + include BaseGenericModel + + # Whether this interaction already existed in the queue. + attr_reader :already_existed + + # Server-generated deterministic identifier derived from the block list. + attr_reader :content_id + + # List of content blocks that make up a `display_block` interaction. + # Must contain at least one block. + attr_reader :display_block + + # Unique identifier of the interaction. + attr_reader :id + + # Type discriminator for a `display_block` interaction. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'already_existed' => :'already_existed', + :'content_id' => :'content_id', + :'display_block' => :'display_block', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'already_existed' => :'Boolean', + :'content_id' => :'String', + :'display_block' => :'Array', + :'id' => :'String', + :'type' => :'LLMObsDisplayBlockInteractionType' + } + 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::LLMObsDisplayBlockInteractionResponseItem` 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?(:'already_existed') + self.already_existed = attributes[:'already_existed'] + end + + if attributes.key?(:'content_id') + self.content_id = attributes[:'content_id'] + end + + if attributes.key?(:'display_block') + if (value = attributes[:'display_block']).is_a?(Array) + self.display_block = value + end + 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 @already_existed.nil? + return false if @content_id.nil? + return false if @display_block.nil? + return false if @display_block.length < 1 + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param already_existed [Object] Object to be assigned + # @!visibility private + def already_existed=(already_existed) + if already_existed.nil? + fail ArgumentError, 'invalid value for "already_existed", already_existed cannot be nil.' + end + @already_existed = already_existed + end + + # Custom attribute writer method with validation + # @param content_id [Object] Object to be assigned + # @!visibility private + def content_id=(content_id) + if content_id.nil? + fail ArgumentError, 'invalid value for "content_id", content_id cannot be nil.' + end + @content_id = content_id + end + + # Custom attribute writer method with validation + # @param display_block [Object] Object to be assigned + # @!visibility private + def display_block=(display_block) + if display_block.nil? + fail ArgumentError, 'invalid value for "display_block", display_block cannot be nil.' + end + if display_block.length < 1 + fail ArgumentError, 'invalid value for "display_block", number of items must be greater than or equal to 1.' + end + @display_block = display_block + 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 && + already_existed == o.already_existed && + content_id == o.content_id && + display_block == o.display_block && + 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 + [already_existed, content_id, display_block, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_display_block_interaction_type.rb b/lib/datadog_api_client/v2/models/llm_obs_display_block_interaction_type.rb new file mode 100644 index 000000000000..7e1a7adfc48b --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_display_block_interaction_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 discriminator for a `display_block` interaction. + class LLMObsDisplayBlockInteractionType + include BaseEnumModel + + DISPLAY_BLOCK = "display_block".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_trace_annotated_interaction_item.rb b/lib/datadog_api_client/v2/models/llm_obs_trace_annotated_interaction_item.rb new file mode 100644 index 000000000000..254a74d968be --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_trace_annotated_interaction_item.rb @@ -0,0 +1,188 @@ +=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 trace, experiment trace, or session interaction with its associated annotations. + class LLMObsTraceAnnotatedInteractionItem + include BaseGenericModel + + # List of annotations for this interaction. + attr_reader :annotations + + # Upstream entity identifier supplied by the caller. + attr_reader :content_id + + # Unique identifier of the interaction. + attr_reader :id + + # Type of an upstream-entity interaction. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'annotations' => :'annotations', + :'content_id' => :'content_id', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'annotations' => :'Array', + :'content_id' => :'String', + :'id' => :'String', + :'type' => :'LLMObsTraceInteractionType' + } + 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::LLMObsTraceAnnotatedInteractionItem` 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?(:'annotations') + if (value = attributes[:'annotations']).is_a?(Array) + self.annotations = value + end + end + + if attributes.key?(:'content_id') + self.content_id = attributes[:'content_id'] + 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 @annotations.nil? + return false if @content_id.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param annotations [Object] Object to be assigned + # @!visibility private + def annotations=(annotations) + if annotations.nil? + fail ArgumentError, 'invalid value for "annotations", annotations cannot be nil.' + end + @annotations = annotations + end + + # Custom attribute writer method with validation + # @param content_id [Object] Object to be assigned + # @!visibility private + def content_id=(content_id) + if content_id.nil? + fail ArgumentError, 'invalid value for "content_id", content_id cannot be nil.' + end + @content_id = content_id + 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 && + annotations == o.annotations && + content_id == o.content_id && + 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 + [annotations, content_id, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_trace_interaction_item.rb b/lib/datadog_api_client/v2/models/llm_obs_trace_interaction_item.rb new file mode 100644 index 000000000000..b05b8158e203 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_trace_interaction_item.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 + # An interaction that references an upstream trace, experiment trace, or session. + class LLMObsTraceInteractionItem + include BaseGenericModel + + # Upstream entity identifier (trace, experiment trace, or session ID). + attr_reader :content_id + + # Type of an upstream-entity interaction. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'content_id' => :'content_id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'content_id' => :'String', + :'type' => :'LLMObsTraceInteractionType' + } + 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::LLMObsTraceInteractionItem` 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?(:'content_id') + self.content_id = attributes[:'content_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 @content_id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param content_id [Object] Object to be assigned + # @!visibility private + def content_id=(content_id) + if content_id.nil? + fail ArgumentError, 'invalid value for "content_id", content_id cannot be nil.' + end + @content_id = content_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 && + content_id == o.content_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 + [content_id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_trace_interaction_response_item.rb b/lib/datadog_api_client/v2/models/llm_obs_trace_interaction_response_item.rb new file mode 100644 index 000000000000..734867e96a2b --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_trace_interaction_response_item.rb @@ -0,0 +1,186 @@ +=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 trace, experiment trace, or session interaction result. + class LLMObsTraceInteractionResponseItem + include BaseGenericModel + + # Whether this interaction already existed in the queue. + attr_reader :already_existed + + # Upstream entity identifier supplied by the caller. + attr_reader :content_id + + # Unique identifier of the interaction. + attr_reader :id + + # Type of an upstream-entity interaction. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'already_existed' => :'already_existed', + :'content_id' => :'content_id', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'already_existed' => :'Boolean', + :'content_id' => :'String', + :'id' => :'String', + :'type' => :'LLMObsTraceInteractionType' + } + 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::LLMObsTraceInteractionResponseItem` 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?(:'already_existed') + self.already_existed = attributes[:'already_existed'] + end + + if attributes.key?(:'content_id') + self.content_id = attributes[:'content_id'] + 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 @already_existed.nil? + return false if @content_id.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param already_existed [Object] Object to be assigned + # @!visibility private + def already_existed=(already_existed) + if already_existed.nil? + fail ArgumentError, 'invalid value for "already_existed", already_existed cannot be nil.' + end + @already_existed = already_existed + end + + # Custom attribute writer method with validation + # @param content_id [Object] Object to be assigned + # @!visibility private + def content_id=(content_id) + if content_id.nil? + fail ArgumentError, 'invalid value for "content_id", content_id cannot be nil.' + end + @content_id = content_id + 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 && + already_existed == o.already_existed && + content_id == o.content_id && + 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 + [already_existed, content_id, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_interaction_type.rb b/lib/datadog_api_client/v2/models/llm_obs_trace_interaction_type.rb similarity index 89% rename from lib/datadog_api_client/v2/models/llm_obs_interaction_type.rb rename to lib/datadog_api_client/v2/models/llm_obs_trace_interaction_type.rb index f0cdde032576..1f13396dd854 100644 --- a/lib/datadog_api_client/v2/models/llm_obs_interaction_type.rb +++ b/lib/datadog_api_client/v2/models/llm_obs_trace_interaction_type.rb @@ -17,8 +17,8 @@ require 'time' module DatadogAPIClient::V2 - # Type of interaction in an annotation queue. - class LLMObsInteractionType + # Type of an upstream-entity interaction. + class LLMObsTraceInteractionType include BaseEnumModel TRACE = "trace".freeze From f1b941b8ddf3c4c5d0adbaaff0e1e0aac0e24220 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 15 May 2026 21:07:47 +0000 Subject: [PATCH 4/4] Add Cloud Cost Management tag_metadata endpoints (#3333) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 654 +++++++++++++++++- .../GetCostTagMetadataCurrency.rb | 8 + .../ListCostTagKeySources.rb | 8 + .../ListCostTagMetadata.rb | 8 + .../ListCostTagMetadataMetrics.rb | 8 + .../ListCostTagMetadataOrchestrators.rb | 8 + features/scenarios_model_mapping.rb | 23 + features/v2/cloud_cost_management.feature | 80 +++ features/v2/undo.json | 30 + lib/datadog_api_client/configuration.rb | 5 + lib/datadog_api_client/inflector.rb | 18 + .../v2/api/cloud_cost_management_api.rb | 380 ++++++++++ .../v2/models/cost_currency.rb | 144 ++++ .../v2/models/cost_currency_response.rb | 125 ++++ .../v2/models/cost_currency_type.rb | 26 + .../v2/models/cost_metric.rb | 144 ++++ .../v2/models/cost_metric_type.rb | 26 + .../v2/models/cost_metrics_response.rb | 125 ++++ .../v2/models/cost_orchestrator.rb | 144 ++++ .../v2/models/cost_orchestrator_type.rb | 26 + .../v2/models/cost_orchestrators_response.rb | 125 ++++ .../v2/models/cost_tag_key_metadata.rb | 165 +++++ .../cost_tag_key_metadata_attributes.rb | 240 +++++++ .../models/cost_tag_key_metadata_response.rb | 125 ++++ .../v2/models/cost_tag_key_metadata_type.rb | 26 + .../v2/models/cost_tag_key_source.rb | 165 +++++ .../models/cost_tag_key_source_attributes.rb | 146 ++++ .../v2/models/cost_tag_key_source_type.rb | 26 + .../models/cost_tag_key_sources_response.rb | 125 ++++ .../models/cost_tag_metadata_daily_filter.rb | 27 + 30 files changed, 3159 insertions(+), 1 deletion(-) create mode 100644 examples/v2/cloud-cost-management/GetCostTagMetadataCurrency.rb create mode 100644 examples/v2/cloud-cost-management/ListCostTagKeySources.rb create mode 100644 examples/v2/cloud-cost-management/ListCostTagMetadata.rb create mode 100644 examples/v2/cloud-cost-management/ListCostTagMetadataMetrics.rb create mode 100644 examples/v2/cloud-cost-management/ListCostTagMetadataOrchestrators.rb create mode 100644 lib/datadog_api_client/v2/models/cost_currency.rb create mode 100644 lib/datadog_api_client/v2/models/cost_currency_response.rb create mode 100644 lib/datadog_api_client/v2/models/cost_currency_type.rb create mode 100644 lib/datadog_api_client/v2/models/cost_metric.rb create mode 100644 lib/datadog_api_client/v2/models/cost_metric_type.rb create mode 100644 lib/datadog_api_client/v2/models/cost_metrics_response.rb create mode 100644 lib/datadog_api_client/v2/models/cost_orchestrator.rb create mode 100644 lib/datadog_api_client/v2/models/cost_orchestrator_type.rb create mode 100644 lib/datadog_api_client/v2/models/cost_orchestrators_response.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_key_metadata.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_key_metadata_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_key_metadata_response.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_key_metadata_type.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_key_source.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_key_source_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_key_source_type.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_key_sources_response.rb create mode 100644 lib/datadog_api_client/v2/models/cost_tag_metadata_daily_filter.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b0ee5756e156..c554255f1343 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -14680,7 +14680,8 @@ components: example: - 0.85 - 0.72 - items: {} + items: + description: A scalar column value, either a group key (string) or a numeric metric. type: array CommitmentsScalarColumns: description: Array of scalar columns in the response. @@ -14708,6 +14709,7 @@ components: CommitmentsTimeseriesValues: description: A series of numeric values for a timeseries metric. items: + description: A single numeric value in the timeseries. format: double type: number type: array @@ -14717,6 +14719,7 @@ components: - 1693526400 - 1693612800 items: + description: A Unix timestamp in seconds. format: int64 type: integer type: array @@ -16478,6 +16481,7 @@ components: additionalProperties: description: The list of correlated values for the tag key. items: + description: A correlated tag value. type: string type: array description: Map of correlated tag keys to the list of correlated tag values. @@ -16658,6 +16662,121 @@ components: type: string x-enum-varnames: - COST_BY_ORG + CostCurrency: + description: A Cloud Cost Management billing currency entry. + properties: + id: + description: The currency code (for example, `USD`). + example: USD + type: string + type: + $ref: "#/components/schemas/CostCurrencyType" + required: + - id + - type + type: object + CostCurrencyResponse: + description: The dominant Cloud Cost Management billing currency for the requested period. The `data` array contains at most one entry, and is empty when no currency data is available. + example: + data: + - id: USD + type: cost_currency + properties: + data: + description: The dominant billing currency. Empty when no data is available, or a single entry otherwise. + items: + $ref: "#/components/schemas/CostCurrency" + type: array + required: + - data + type: object + CostCurrencyType: + default: cost_currency + description: Type of the Cloud Cost Management billing currency resource. + enum: + - cost_currency + example: cost_currency + type: string + x-enum-varnames: + - COST_CURRENCY + CostMetric: + description: A Cloud Cost Management metric that has data for the requested period. + properties: + id: + description: The metric name, for example `aws.cost.net.amortized`. + example: aws.cost.net.amortized + type: string + type: + $ref: "#/components/schemas/CostMetricType" + required: + - id + - type + type: object + CostMetricType: + default: cost_metric + description: Type of the Cloud Cost Management available metric resource. + enum: + - cost_metric + example: cost_metric + type: string + x-enum-varnames: + - COST_METRIC + CostMetricsResponse: + description: List of available Cloud Cost Management metrics for the requested period. + example: + data: + - id: aws.cost.net.amortized + type: cost_metric + - id: gcp.cost.amortized + type: cost_metric + properties: + data: + description: List of available metrics. + items: + $ref: "#/components/schemas/CostMetric" + type: array + required: + - data + type: object + CostOrchestrator: + description: A container orchestrator detected in Cloud Cost Management data. + properties: + id: + description: The orchestrator name, for example `kubernetes` or `ecs`. + example: kubernetes + type: string + type: + $ref: "#/components/schemas/CostOrchestratorType" + required: + - id + - type + type: object + CostOrchestratorType: + default: cost_orchestrator + description: Type of the Cloud Cost Management orchestrator resource. + enum: + - cost_orchestrator + example: cost_orchestrator + type: string + x-enum-varnames: + - COST_ORCHESTRATOR + CostOrchestratorsResponse: + description: List of container orchestrators detected in Cloud Cost Management data for the requested period. + example: + data: + - id: ecs + type: cost_orchestrator + - id: kubernetes + type: cost_orchestrator + properties: + data: + description: List of detected container orchestrators. + items: + $ref: "#/components/schemas/CostOrchestrator" + type: array + required: + - data + type: object CostTag: description: A Cloud Cost Management tag. properties: @@ -16843,6 +16962,121 @@ components: - description - tag_values type: object + CostTagKeyMetadata: + description: A Cloud Cost Management tag key metadata entry, aggregating coverage and example values for a single tag key, metric, and period. + properties: + attributes: + $ref: "#/components/schemas/CostTagKeyMetadataAttributes" + id: + description: A composite identifier of the form `tag_key:metric` for monthly roll-ups, or `tag_key:metric:YYYY-MM-DD` when `filter[daily]=true`. + example: env:aws.cost.net.amortized + type: string + type: + $ref: "#/components/schemas/CostTagKeyMetadataType" + required: + - attributes + - id + - type + type: object + CostTagKeyMetadataAttributes: + description: Attributes of a Cloud Cost Management tag key metadata entry. + properties: + cardinality_by_account: + $ref: "#/components/schemas/CostTagKeyMetadataCardinalityByAccount" + cost_covered: + description: Total cost (in the report currency) of cost line items that carry this tag key for the requested period. + example: 1234.56 + format: double + type: number + date: + description: The day this row corresponds to, in `YYYY-MM-DD` format. Present only when `filter[daily]=true`; omitted for the monthly roll-up returned by default. + example: "2026-02-15" + type: string + metric: + description: The Cloud Cost Management metric this row aggregates, for example `aws.cost.net.amortized`. + example: aws.cost.net.amortized + type: string + row_count: + description: Number of cost rows that carry this tag key over the requested period. + example: 100 + format: int64 + type: integer + tag_sources: + description: Origins where this tag key was observed (for example, `aws-user-defined`). + example: + - aws-user-defined + items: + description: A tag source. + type: string + type: array + top_values_by_account: + $ref: "#/components/schemas/CostTagKeyMetadataTopValuesByAccount" + required: + - cardinality_by_account + - cost_covered + - metric + - row_count + - tag_sources + - top_values_by_account + type: object + CostTagKeyMetadataCardinalityByAccount: + additionalProperties: + description: Number of unique tag values observed in the account. + format: int64 + type: integer + description: Number of unique tag values observed for this tag key, keyed by cloud account ID. + example: + "123456789012": 42 + type: object + CostTagKeyMetadataResponse: + description: List of Cloud Cost Management tag key metadata entries for the requested period. + example: + data: + - attributes: + cardinality_by_account: + "123456789012": 42 + cost_covered: 1234.56 + metric: aws.cost.net.amortized + row_count: 100 + tag_sources: + - aws-user-defined + top_values_by_account: + "123456789012": + - prod + - staging + id: env:aws.cost.net.amortized + type: cost_tag_key_metadata + properties: + data: + description: List of tag key metadata entries. + items: + $ref: "#/components/schemas/CostTagKeyMetadata" + type: array + required: + - data + type: object + CostTagKeyMetadataTopValuesByAccount: + additionalProperties: + description: A sample of the most frequent tag values observed in the account. + items: + description: A tag value observed for this tag key. + type: string + type: array + description: A sample of the most frequent tag values observed for this tag key, keyed by cloud account ID. + example: + "123456789012": + - prod + - staging + type: object + CostTagKeyMetadataType: + default: cost_tag_key_metadata + description: Type of the Cloud Cost Management tag key metadata resource. + enum: + - cost_tag_key_metadata + example: cost_tag_key_metadata + type: string + x-enum-varnames: + - COST_TAG_KEY_METADATA CostTagKeyResponse: description: A single Cloud Cost Management tag key. example: @@ -16865,6 +17099,77 @@ components: required: - data type: object + CostTagKeySource: + description: A Cloud Cost Management tag key paired with the sources that produced it. + properties: + attributes: + $ref: "#/components/schemas/CostTagKeySourceAttributes" + id: + description: The tag key identifier. Equal to the empty-tag sentinel `__empty_tag_key__` when the tag key is empty. + example: env + type: string + type: + $ref: "#/components/schemas/CostTagKeySourceType" + required: + - attributes + - id + - type + type: object + CostTagKeySourceAttributes: + description: Attributes of a Cloud Cost Management tag source. + properties: + tag_key: + description: The tag key name. + example: env + type: string + tag_sources: + description: Origins where this tag key was observed (for example, `aws-user-defined`). + example: + - aws-user-defined + - custom + items: + description: A tag source. + type: string + type: array + required: + - tag_key + - tag_sources + type: object + CostTagKeySourceType: + default: cost_tag_key_source + description: Type of the Cloud Cost Management tag source resource. + enum: + - cost_tag_key_source + example: cost_tag_key_source + type: string + x-enum-varnames: + - COST_TAG_KEY_SOURCE + CostTagKeySourcesResponse: + description: List of Cloud Cost Management tag keys with their origin sources for the requested period. + example: + data: + - attributes: + tag_key: env + tag_sources: + - aws-user-defined + - custom + id: env + type: cost_tag_key_source + - attributes: + tag_key: service + tag_sources: + - aws + id: service + type: cost_tag_key_source + properties: + data: + description: List of tag keys with their origin sources. + items: + $ref: "#/components/schemas/CostTagKeySource" + type: array + required: + - data + type: object CostTagKeyType: default: cost_tag_key description: Type of the Cloud Cost Management tag key resource. @@ -16898,6 +17203,16 @@ components: required: - data type: object + CostTagMetadataDailyFilter: + description: Granularity for tag metadata results. `true` returns one row per day, `false` (or omitted) returns the monthly roll-up. + enum: + - "true" + - "false" + example: "true" + type: string + x-enum-varnames: + - "TRUE" + - "FALSE" CostTagType: default: cost_tag description: Type of the Cloud Cost Management tag resource. @@ -100289,6 +100604,343 @@ paths: operator: OR permissions: - cloud_cost_management_read + /api/v2/cost/tag_metadata: + get: + description: List Cloud Cost Management tag key metadata, including row counts, cost covered, cardinality, and a sample of top tag values per cloud account. Use `filter[daily]=true` to return daily rows instead of the default monthly roll-up. + operationId: ListCostTagMetadata + parameters: + - description: The month to scope the query to, in `YYYY-MM` format. + example: "2026-02" + in: query + name: filter[month] + required: true + schema: + type: string + - description: Filter results to a specific provider. Common cloud values are `aws`, `azure`, `gcp`, `Oracle` (OCI), and `custom`. SaaS billing integrations (for example, `Snowflake`, `MongoDB`, `Databricks`) are also accepted using their display-name string. Values are case-sensitive. + in: query + name: filter[provider] + schema: + type: string + - description: Filter results to a specific Cloud Cost Management metric (for example, `aws.cost.net.amortized`). When omitted, every available metric for the requested period is returned. + in: query + name: filter[metric] + schema: + type: string + - description: Restrict results to a single tag key. + in: query + name: filter[tag_key] + schema: + type: string + - description: When `true`, return one row per day with the day in the `date` attribute. Defaults to the monthly roll-up when omitted. + in: query + name: filter[daily] + schema: + $ref: "#/components/schemas/CostTagMetadataDailyFilter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + cardinality_by_account: + "123456789012": 42 + cost_covered: 1234.56 + metric: aws.cost.net.amortized + row_count: 100 + tag_sources: + - aws-user-defined + top_values_by_account: + "123456789012": + - prod + - staging + id: env:aws.cost.net.amortized + type: cost_tag_key_metadata + schema: + $ref: "#/components/schemas/CostTagKeyMetadataResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: List Cloud Cost Management tag key metadata + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/tag_metadata/currency: + get: + description: Get the dominant billing currency observed in Cloud Cost Management data for the requested period. The response wraps the currency in a JSON:API `data` array containing at most one entry; the array is empty when no currency data is available. + operationId: GetCostTagMetadataCurrency + parameters: + - description: The month to scope the query to, in `YYYY-MM` format. + example: "2026-02" + in: query + name: filter[month] + required: true + schema: + type: string + - description: Filter results to a specific provider. Common cloud values are `aws`, `azure`, `gcp`, `Oracle` (OCI), and `custom`. SaaS billing integrations (for example, `Snowflake`, `MongoDB`, `Databricks`) are also accepted using their display-name string. Values are case-sensitive. + in: query + name: filter[provider] + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: USD + type: cost_currency + schema: + $ref: "#/components/schemas/CostCurrencyResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get the Cloud Cost Management billing currency + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/tag_metadata/metrics: + get: + description: List Cloud Cost Management metrics that have data for the requested period. + operationId: ListCostTagMetadataMetrics + parameters: + - description: The month to scope the query to, in `YYYY-MM` format. + example: "2026-02" + in: query + name: filter[month] + required: true + schema: + type: string + - description: Filter results to a specific provider. Common cloud values are `aws`, `azure`, `gcp`, `Oracle` (OCI), and `custom`. SaaS billing integrations (for example, `Snowflake`, `MongoDB`, `Databricks`) are also accepted using their display-name string. Values are case-sensitive. + in: query + name: filter[provider] + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: aws.cost.net.amortized + type: cost_metric + - id: gcp.cost.amortized + type: cost_metric + schema: + $ref: "#/components/schemas/CostMetricsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: List available Cloud Cost Management metrics + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/tag_metadata/orchestrators: + get: + description: List container orchestrators (for example, `kubernetes`, `ecs`) detected in Cloud Cost Management data for the requested period. + operationId: ListCostTagMetadataOrchestrators + parameters: + - description: The month to scope the query to, in `YYYY-MM` format. + example: "2026-02" + in: query + name: filter[month] + required: true + schema: + type: string + - description: Filter results to a specific provider. Common cloud values are `aws`, `azure`, `gcp`, `Oracle` (OCI), and `custom`. SaaS billing integrations (for example, `Snowflake`, `MongoDB`, `Databricks`) are also accepted using their display-name string. Values are case-sensitive. + in: query + name: filter[provider] + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: ecs + type: cost_orchestrator + - id: kubernetes + type: cost_orchestrator + schema: + $ref: "#/components/schemas/CostOrchestratorsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: List Cloud Cost Management orchestrators + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/tag_metadata/tag_sources: + get: + description: List Cloud Cost Management tag keys observed for the requested period, along with the origin sources that produced them (for example, `aws-user-defined`, `custom`). + operationId: ListCostTagKeySources + parameters: + - description: The month to scope the query to, in `YYYY-MM` format. + example: "2026-02" + in: query + name: filter[month] + required: true + schema: + type: string + - description: Filter results to a specific provider. Common cloud values are `aws`, `azure`, `gcp`, `Oracle` (OCI), and `custom`. SaaS billing integrations (for example, `Snowflake`, `MongoDB`, `Databricks`) are also accepted using their display-name string. Values are case-sensitive. + in: query + name: filter[provider] + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + tag_key: env + tag_sources: + - aws-user-defined + - custom + id: env + type: cost_tag_key_source + - attributes: + tag_key: service + tag_sources: + - aws + id: service + type: cost_tag_key_source + schema: + $ref: "#/components/schemas/CostTagKeySourcesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: List Cloud Cost Management tag sources + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/cost/tags: get: description: List Cloud Cost Management tags for a given metric. diff --git a/examples/v2/cloud-cost-management/GetCostTagMetadataCurrency.rb b/examples/v2/cloud-cost-management/GetCostTagMetadataCurrency.rb new file mode 100644 index 000000000000..8492f900c41d --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCostTagMetadataCurrency.rb @@ -0,0 +1,8 @@ +# Get the Cloud Cost Management billing currency returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_cost_tag_metadata_currency".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.get_cost_tag_metadata_currency("filter[month]") diff --git a/examples/v2/cloud-cost-management/ListCostTagKeySources.rb b/examples/v2/cloud-cost-management/ListCostTagKeySources.rb new file mode 100644 index 000000000000..d081b22a7014 --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostTagKeySources.rb @@ -0,0 +1,8 @@ +# List Cloud Cost Management tag sources returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_cost_tag_key_sources".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.list_cost_tag_key_sources("filter[month]") diff --git a/examples/v2/cloud-cost-management/ListCostTagMetadata.rb b/examples/v2/cloud-cost-management/ListCostTagMetadata.rb new file mode 100644 index 000000000000..cfb014cc2461 --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostTagMetadata.rb @@ -0,0 +1,8 @@ +# List Cloud Cost Management tag key metadata returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_cost_tag_metadata".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.list_cost_tag_metadata("filter[month]") diff --git a/examples/v2/cloud-cost-management/ListCostTagMetadataMetrics.rb b/examples/v2/cloud-cost-management/ListCostTagMetadataMetrics.rb new file mode 100644 index 000000000000..b3ea503851ce --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostTagMetadataMetrics.rb @@ -0,0 +1,8 @@ +# List available Cloud Cost Management metrics returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_cost_tag_metadata_metrics".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.list_cost_tag_metadata_metrics("filter[month]") diff --git a/examples/v2/cloud-cost-management/ListCostTagMetadataOrchestrators.rb b/examples/v2/cloud-cost-management/ListCostTagMetadataOrchestrators.rb new file mode 100644 index 000000000000..69f287884e47 --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostTagMetadataOrchestrators.rb @@ -0,0 +1,8 @@ +# List Cloud Cost Management orchestrators returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_cost_tag_metadata_orchestrators".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.list_cost_tag_metadata_orchestrators("filter[month]") diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index e0af6c74bf75..6e10b197f4fe 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2315,6 +2315,29 @@ "filter_metric" => "String", "page_size" => "Integer", }, + "v2.ListCostTagMetadata" => { + "filter_month" => "String", + "filter_provider" => "String", + "filter_metric" => "String", + "filter_tag_key" => "String", + "filter_daily" => "CostTagMetadataDailyFilter", + }, + "v2.GetCostTagMetadataCurrency" => { + "filter_month" => "String", + "filter_provider" => "String", + }, + "v2.ListCostTagMetadataMetrics" => { + "filter_month" => "String", + "filter_provider" => "String", + }, + "v2.ListCostTagMetadataOrchestrators" => { + "filter_month" => "String", + "filter_provider" => "String", + }, + "v2.ListCostTagKeySources" => { + "filter_month" => "String", + "filter_provider" => "String", + }, "v2.ListCostTags" => { "filter_metric" => "String", "filter_match" => "String", diff --git a/features/v2/cloud_cost_management.feature b/features/v2/cloud_cost_management.feature index 76cb7c1d63ec..578dbb420012 100644 --- a/features/v2/cloud_cost_management.feature +++ b/features/v2/cloud_cost_management.feature @@ -520,6 +520,22 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get the Cloud Cost Management billing currency returns "Bad Request" response + Given operation "GetCostTagMetadataCurrency" enabled + And new "GetCostTagMetadataCurrency" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get the Cloud Cost Management billing currency returns "OK" response + Given operation "GetCostTagMetadataCurrency" enabled + And new "GetCostTagMetadataCurrency" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management Scenario: List Cloud Cost Management AWS CUR configs returns "OK" response Given new "ListCostAWSCURConfigs" request @@ -540,12 +556,44 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management orchestrators returns "Bad Request" response + Given operation "ListCostTagMetadataOrchestrators" enabled + And new "ListCostTagMetadataOrchestrators" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management orchestrators returns "OK" response + Given operation "ListCostTagMetadataOrchestrators" enabled + And new "ListCostTagMetadataOrchestrators" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management Scenario: List Cloud Cost Management tag descriptions returns "OK" response Given new "ListCostTagDescriptions" request When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management tag key metadata returns "Bad Request" response + Given operation "ListCostTagMetadata" enabled + And new "ListCostTagMetadata" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management tag key metadata returns "OK" response + Given operation "ListCostTagMetadata" enabled + And new "ListCostTagMetadata" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management Scenario: List Cloud Cost Management tag keys returns "Bad Request" response Given new "ListCostTagKeys" request @@ -558,6 +606,22 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management tag sources returns "Bad Request" response + Given operation "ListCostTagKeySources" enabled + And new "ListCostTagKeySources" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management tag sources returns "OK" response + Given operation "ListCostTagKeySources" enabled + And new "ListCostTagKeySources" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management Scenario: List Cloud Cost Management tags returns "Bad Request" response Given new "ListCostTags" request @@ -596,6 +660,22 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List available Cloud Cost Management metrics returns "Bad Request" response + Given operation "ListCostTagMetadataMetrics" enabled + And new "ListCostTagMetadataMetrics" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List available Cloud Cost Management metrics returns "OK" response + Given operation "ListCostTagMetadataMetrics" enabled + And new "ListCostTagMetadataMetrics" request + And request contains "filter[month]" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @team:DataDog/cloud-cost-management Scenario: List budgets returns "OK" response Given new "ListBudgets" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 7a5941a2c04d..faa660d7de0b 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1609,6 +1609,36 @@ "type": "safe" } }, + "ListCostTagMetadata": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCostTagMetadataCurrency": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "ListCostTagMetadataMetrics": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "ListCostTagMetadataOrchestrators": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "ListCostTagKeySources": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "ListCostTags": { "tag": "Cloud Cost Management", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 3a758c49609b..7859a1a65a96 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -303,7 +303,12 @@ def initialize "v2.get_commitments_utilization_scalar": false, "v2.get_commitments_utilization_timeseries": false, "v2.get_cost_anomaly": false, + "v2.get_cost_tag_metadata_currency": false, "v2.list_cost_anomalies": false, + "v2.list_cost_tag_key_sources": false, + "v2.list_cost_tag_metadata": false, + "v2.list_cost_tag_metadata_metrics": false, + "v2.list_cost_tag_metadata_orchestrators": false, "v2.create_dashboard_secure_embed": false, "v2.delete_dashboard_secure_embed": false, "v2.get_dashboard_secure_embed": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index cfd25d9e44ea..ffb9b3c3429a 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2031,6 +2031,15 @@ def overrides "v2.cost_by_org_attributes" => "CostByOrgAttributes", "v2.cost_by_org_response" => "CostByOrgResponse", "v2.cost_by_org_type" => "CostByOrgType", + "v2.cost_currency" => "CostCurrency", + "v2.cost_currency_response" => "CostCurrencyResponse", + "v2.cost_currency_type" => "CostCurrencyType", + "v2.cost_metric" => "CostMetric", + "v2.cost_metrics_response" => "CostMetricsResponse", + "v2.cost_metric_type" => "CostMetricType", + "v2.cost_orchestrator" => "CostOrchestrator", + "v2.cost_orchestrators_response" => "CostOrchestratorsResponse", + "v2.cost_orchestrator_type" => "CostOrchestratorType", "v2.cost_tag" => "CostTag", "v2.cost_tag_attributes" => "CostTagAttributes", "v2.cost_tag_description" => "CostTagDescription", @@ -2041,9 +2050,18 @@ def overrides "v2.cost_tag_key" => "CostTagKey", "v2.cost_tag_key_attributes" => "CostTagKeyAttributes", "v2.cost_tag_key_details" => "CostTagKeyDetails", + "v2.cost_tag_key_metadata" => "CostTagKeyMetadata", + "v2.cost_tag_key_metadata_attributes" => "CostTagKeyMetadataAttributes", + "v2.cost_tag_key_metadata_response" => "CostTagKeyMetadataResponse", + "v2.cost_tag_key_metadata_type" => "CostTagKeyMetadataType", "v2.cost_tag_key_response" => "CostTagKeyResponse", + "v2.cost_tag_key_source" => "CostTagKeySource", + "v2.cost_tag_key_source_attributes" => "CostTagKeySourceAttributes", + "v2.cost_tag_key_sources_response" => "CostTagKeySourcesResponse", + "v2.cost_tag_key_source_type" => "CostTagKeySourceType", "v2.cost_tag_keys_response" => "CostTagKeysResponse", "v2.cost_tag_key_type" => "CostTagKeyType", + "v2.cost_tag_metadata_daily_filter" => "CostTagMetadataDailyFilter", "v2.cost_tags_response" => "CostTagsResponse", "v2.cost_tag_type" => "CostTagType", "v2.coverage_summary_attributes" => "CoverageSummaryAttributes", diff --git a/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb b/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb index 2bf010d7e35e..bed6e5726f5a 100644 --- a/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb +++ b/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb @@ -2022,6 +2022,80 @@ def get_cost_tag_key_with_http_info(tag_key, opts = {}) return data, status_code, headers end + # Get the Cloud Cost Management billing currency. + # + # @see #get_cost_tag_metadata_currency_with_http_info + def get_cost_tag_metadata_currency(filter_month, opts = {}) + data, _status_code, _headers = get_cost_tag_metadata_currency_with_http_info(filter_month, opts) + data + end + + # Get the Cloud Cost Management billing currency. + # + # Get the dominant billing currency observed in Cloud Cost Management data for the requested period. The response wraps the currency in a JSON:API `data` array containing at most one entry; the array is empty when no currency data is available. + # + # @param filter_month [String] The month to scope the query to, in `YYYY-MM` format. + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_provider Filter results to a specific provider. Common cloud values are `aws`, `azure`, `gcp`, `Oracle` (OCI), and `custom`. SaaS billing integrations (for example, `Snowflake`, `MongoDB`, `Databricks`) are also accepted using their display-name string. Values are case-sensitive. + # @return [Array<(CostCurrencyResponse, Integer, Hash)>] CostCurrencyResponse data, response status code and response headers + def get_cost_tag_metadata_currency_with_http_info(filter_month, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_cost_tag_metadata_currency".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_cost_tag_metadata_currency") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_cost_tag_metadata_currency")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.get_cost_tag_metadata_currency ...' + end + # verify the required parameter 'filter_month' is set + if @api_client.config.client_side_validation && filter_month.nil? + fail ArgumentError, "Missing the required parameter 'filter_month' when calling CloudCostManagementAPI.get_cost_tag_metadata_currency" + end + # resource path + local_var_path = '/api/v2/cost/tag_metadata/currency' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[month]'] = filter_month + query_params[:'filter[provider]'] = opts[:'filter_provider'] if !opts[:'filter_provider'].nil? + + # 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] || 'CostCurrencyResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_cost_tag_metadata_currency, + :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: CloudCostManagementAPI#get_cost_tag_metadata_currency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get custom allocation rule. # # @see #get_custom_allocation_rule_with_http_info @@ -2733,6 +2807,312 @@ def list_cost_tag_keys_with_http_info(opts = {}) return data, status_code, headers end + # List Cloud Cost Management tag sources. + # + # @see #list_cost_tag_key_sources_with_http_info + def list_cost_tag_key_sources(filter_month, opts = {}) + data, _status_code, _headers = list_cost_tag_key_sources_with_http_info(filter_month, opts) + data + end + + # List Cloud Cost Management tag sources. + # + # List Cloud Cost Management tag keys observed for the requested period, along with the origin sources that produced them (for example, `aws-user-defined`, `custom`). + # + # @param filter_month [String] The month to scope the query to, in `YYYY-MM` format. + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_provider Filter results to a specific provider. Common cloud values are `aws`, `azure`, `gcp`, `Oracle` (OCI), and `custom`. SaaS billing integrations (for example, `Snowflake`, `MongoDB`, `Databricks`) are also accepted using their display-name string. Values are case-sensitive. + # @return [Array<(CostTagKeySourcesResponse, Integer, Hash)>] CostTagKeySourcesResponse data, response status code and response headers + def list_cost_tag_key_sources_with_http_info(filter_month, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_cost_tag_key_sources".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_cost_tag_key_sources") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_cost_tag_key_sources")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_cost_tag_key_sources ...' + end + # verify the required parameter 'filter_month' is set + if @api_client.config.client_side_validation && filter_month.nil? + fail ArgumentError, "Missing the required parameter 'filter_month' when calling CloudCostManagementAPI.list_cost_tag_key_sources" + end + # resource path + local_var_path = '/api/v2/cost/tag_metadata/tag_sources' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[month]'] = filter_month + query_params[:'filter[provider]'] = opts[:'filter_provider'] if !opts[:'filter_provider'].nil? + + # 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] || 'CostTagKeySourcesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_cost_tag_key_sources, + :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: CloudCostManagementAPI#list_cost_tag_key_sources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List Cloud Cost Management tag key metadata. + # + # @see #list_cost_tag_metadata_with_http_info + def list_cost_tag_metadata(filter_month, opts = {}) + data, _status_code, _headers = list_cost_tag_metadata_with_http_info(filter_month, opts) + data + end + + # List Cloud Cost Management tag key metadata. + # + # List Cloud Cost Management tag key metadata, including row counts, cost covered, cardinality, and a sample of top tag values per cloud account. Use `filter[daily]=true` to return daily rows instead of the default monthly roll-up. + # + # @param filter_month [String] The month to scope the query to, in `YYYY-MM` format. + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_provider Filter results to a specific provider. Common cloud values are `aws`, `azure`, `gcp`, `Oracle` (OCI), and `custom`. SaaS billing integrations (for example, `Snowflake`, `MongoDB`, `Databricks`) are also accepted using their display-name string. Values are case-sensitive. + # @option opts [String] :filter_metric Filter results to a specific Cloud Cost Management metric (for example, `aws.cost.net.amortized`). When omitted, every available metric for the requested period is returned. + # @option opts [String] :filter_tag_key Restrict results to a single tag key. + # @option opts [CostTagMetadataDailyFilter] :filter_daily When `true`, return one row per day with the day in the `date` attribute. Defaults to the monthly roll-up when omitted. + # @return [Array<(CostTagKeyMetadataResponse, Integer, Hash)>] CostTagKeyMetadataResponse data, response status code and response headers + def list_cost_tag_metadata_with_http_info(filter_month, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_cost_tag_metadata".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_cost_tag_metadata") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_cost_tag_metadata")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_cost_tag_metadata ...' + end + # verify the required parameter 'filter_month' is set + if @api_client.config.client_side_validation && filter_month.nil? + fail ArgumentError, "Missing the required parameter 'filter_month' when calling CloudCostManagementAPI.list_cost_tag_metadata" + end + allowable_values = ['true', 'false'] + if @api_client.config.client_side_validation && opts[:'filter_daily'] && !allowable_values.include?(opts[:'filter_daily']) + fail ArgumentError, "invalid value for \"filter_daily\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/cost/tag_metadata' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[month]'] = filter_month + query_params[:'filter[provider]'] = opts[:'filter_provider'] if !opts[:'filter_provider'].nil? + query_params[:'filter[metric]'] = opts[:'filter_metric'] if !opts[:'filter_metric'].nil? + query_params[:'filter[tag_key]'] = opts[:'filter_tag_key'] if !opts[:'filter_tag_key'].nil? + query_params[:'filter[daily]'] = opts[:'filter_daily'] if !opts[:'filter_daily'].nil? + + # 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] || 'CostTagKeyMetadataResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_cost_tag_metadata, + :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: CloudCostManagementAPI#list_cost_tag_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List available Cloud Cost Management metrics. + # + # @see #list_cost_tag_metadata_metrics_with_http_info + def list_cost_tag_metadata_metrics(filter_month, opts = {}) + data, _status_code, _headers = list_cost_tag_metadata_metrics_with_http_info(filter_month, opts) + data + end + + # List available Cloud Cost Management metrics. + # + # List Cloud Cost Management metrics that have data for the requested period. + # + # @param filter_month [String] The month to scope the query to, in `YYYY-MM` format. + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_provider Filter results to a specific provider. Common cloud values are `aws`, `azure`, `gcp`, `Oracle` (OCI), and `custom`. SaaS billing integrations (for example, `Snowflake`, `MongoDB`, `Databricks`) are also accepted using their display-name string. Values are case-sensitive. + # @return [Array<(CostMetricsResponse, Integer, Hash)>] CostMetricsResponse data, response status code and response headers + def list_cost_tag_metadata_metrics_with_http_info(filter_month, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_cost_tag_metadata_metrics".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_cost_tag_metadata_metrics") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_cost_tag_metadata_metrics")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_cost_tag_metadata_metrics ...' + end + # verify the required parameter 'filter_month' is set + if @api_client.config.client_side_validation && filter_month.nil? + fail ArgumentError, "Missing the required parameter 'filter_month' when calling CloudCostManagementAPI.list_cost_tag_metadata_metrics" + end + # resource path + local_var_path = '/api/v2/cost/tag_metadata/metrics' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[month]'] = filter_month + query_params[:'filter[provider]'] = opts[:'filter_provider'] if !opts[:'filter_provider'].nil? + + # 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] || 'CostMetricsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_cost_tag_metadata_metrics, + :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: CloudCostManagementAPI#list_cost_tag_metadata_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List Cloud Cost Management orchestrators. + # + # @see #list_cost_tag_metadata_orchestrators_with_http_info + def list_cost_tag_metadata_orchestrators(filter_month, opts = {}) + data, _status_code, _headers = list_cost_tag_metadata_orchestrators_with_http_info(filter_month, opts) + data + end + + # List Cloud Cost Management orchestrators. + # + # List container orchestrators (for example, `kubernetes`, `ecs`) detected in Cloud Cost Management data for the requested period. + # + # @param filter_month [String] The month to scope the query to, in `YYYY-MM` format. + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_provider Filter results to a specific provider. Common cloud values are `aws`, `azure`, `gcp`, `Oracle` (OCI), and `custom`. SaaS billing integrations (for example, `Snowflake`, `MongoDB`, `Databricks`) are also accepted using their display-name string. Values are case-sensitive. + # @return [Array<(CostOrchestratorsResponse, Integer, Hash)>] CostOrchestratorsResponse data, response status code and response headers + def list_cost_tag_metadata_orchestrators_with_http_info(filter_month, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_cost_tag_metadata_orchestrators".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_cost_tag_metadata_orchestrators") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_cost_tag_metadata_orchestrators")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.list_cost_tag_metadata_orchestrators ...' + end + # verify the required parameter 'filter_month' is set + if @api_client.config.client_side_validation && filter_month.nil? + fail ArgumentError, "Missing the required parameter 'filter_month' when calling CloudCostManagementAPI.list_cost_tag_metadata_orchestrators" + end + # resource path + local_var_path = '/api/v2/cost/tag_metadata/orchestrators' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[month]'] = filter_month + query_params[:'filter[provider]'] = opts[:'filter_provider'] if !opts[:'filter_provider'].nil? + + # 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] || 'CostOrchestratorsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_cost_tag_metadata_orchestrators, + :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: CloudCostManagementAPI#list_cost_tag_metadata_orchestrators\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List Cloud Cost Management tags. # # @see #list_cost_tags_with_http_info diff --git a/lib/datadog_api_client/v2/models/cost_currency.rb b/lib/datadog_api_client/v2/models/cost_currency.rb new file mode 100644 index 000000000000..484a37a11411 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_currency.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 + # A Cloud Cost Management billing currency entry. + class CostCurrency + include BaseGenericModel + + # The currency code (for example, `USD`). + attr_reader :id + + # Type of the Cloud Cost Management billing currency resource. + 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' => :'String', + :'type' => :'CostCurrencyType' + } + 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::CostCurrency` 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/cost_currency_response.rb b/lib/datadog_api_client/v2/models/cost_currency_response.rb new file mode 100644 index 000000000000..60e6b4136e1c --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_currency_response.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 + # The dominant Cloud Cost Management billing currency for the requested period. The `data` array contains at most one entry, and is empty when no currency data is available. + class CostCurrencyResponse + include BaseGenericModel + + # The dominant billing currency. Empty when no data is available, or a single entry otherwise. + 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' => :'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::CostCurrencyResponse` 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') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + 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/cost_currency_type.rb b/lib/datadog_api_client/v2/models/cost_currency_type.rb new file mode 100644 index 000000000000..90f2f71b3cc5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_currency_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 the Cloud Cost Management billing currency resource. + class CostCurrencyType + include BaseEnumModel + + COST_CURRENCY = "cost_currency".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/cost_metric.rb b/lib/datadog_api_client/v2/models/cost_metric.rb new file mode 100644 index 000000000000..0250b46ddefd --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_metric.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 + # A Cloud Cost Management metric that has data for the requested period. + class CostMetric + include BaseGenericModel + + # The metric name, for example `aws.cost.net.amortized`. + attr_reader :id + + # Type of the Cloud Cost Management available metric resource. + 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' => :'String', + :'type' => :'CostMetricType' + } + 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::CostMetric` 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/cost_metric_type.rb b/lib/datadog_api_client/v2/models/cost_metric_type.rb new file mode 100644 index 000000000000..bc7896e23852 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_metric_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 the Cloud Cost Management available metric resource. + class CostMetricType + include BaseEnumModel + + COST_METRIC = "cost_metric".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/cost_metrics_response.rb b/lib/datadog_api_client/v2/models/cost_metrics_response.rb new file mode 100644 index 000000000000..74e13589da1a --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_metrics_response.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 + # List of available Cloud Cost Management metrics for the requested period. + class CostMetricsResponse + include BaseGenericModel + + # List of available metrics. + 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' => :'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::CostMetricsResponse` 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') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + 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/cost_orchestrator.rb b/lib/datadog_api_client/v2/models/cost_orchestrator.rb new file mode 100644 index 000000000000..e94947ec35c5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_orchestrator.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 + # A container orchestrator detected in Cloud Cost Management data. + class CostOrchestrator + include BaseGenericModel + + # The orchestrator name, for example `kubernetes` or `ecs`. + attr_reader :id + + # Type of the Cloud Cost Management orchestrator resource. + 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' => :'String', + :'type' => :'CostOrchestratorType' + } + 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::CostOrchestrator` 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/cost_orchestrator_type.rb b/lib/datadog_api_client/v2/models/cost_orchestrator_type.rb new file mode 100644 index 000000000000..8269a5e4284c --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_orchestrator_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 the Cloud Cost Management orchestrator resource. + class CostOrchestratorType + include BaseEnumModel + + COST_ORCHESTRATOR = "cost_orchestrator".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/cost_orchestrators_response.rb b/lib/datadog_api_client/v2/models/cost_orchestrators_response.rb new file mode 100644 index 000000000000..2e002d451a83 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_orchestrators_response.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 + # List of container orchestrators detected in Cloud Cost Management data for the requested period. + class CostOrchestratorsResponse + include BaseGenericModel + + # List of detected container orchestrators. + 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' => :'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::CostOrchestratorsResponse` 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') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + 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/cost_tag_key_metadata.rb b/lib/datadog_api_client/v2/models/cost_tag_key_metadata.rb new file mode 100644 index 000000000000..d3cda73e8bb5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_key_metadata.rb @@ -0,0 +1,165 @@ +=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 Cloud Cost Management tag key metadata entry, aggregating coverage and example values for a single tag key, metric, and period. + class CostTagKeyMetadata + include BaseGenericModel + + # Attributes of a Cloud Cost Management tag key metadata entry. + attr_reader :attributes + + # A composite identifier of the form `tag_key:metric` for monthly roll-ups, or `tag_key:metric:YYYY-MM-DD` when `filter[daily]=true`. + attr_reader :id + + # Type of the Cloud Cost Management tag key metadata resource. + 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' => :'CostTagKeyMetadataAttributes', + :'id' => :'String', + :'type' => :'CostTagKeyMetadataType' + } + 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::CostTagKeyMetadata` 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 @attributes.nil? + return false if @id.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 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 && + 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/cost_tag_key_metadata_attributes.rb b/lib/datadog_api_client/v2/models/cost_tag_key_metadata_attributes.rb new file mode 100644 index 000000000000..746e17abf6b3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_key_metadata_attributes.rb @@ -0,0 +1,240 @@ +=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 Cloud Cost Management tag key metadata entry. + class CostTagKeyMetadataAttributes + include BaseGenericModel + + # Number of unique tag values observed for this tag key, keyed by cloud account ID. + attr_reader :cardinality_by_account + + # Total cost (in the report currency) of cost line items that carry this tag key for the requested period. + attr_reader :cost_covered + + # The day this row corresponds to, in `YYYY-MM-DD` format. Present only when `filter[daily]=true`; omitted for the monthly roll-up returned by default. + attr_accessor :date + + # The Cloud Cost Management metric this row aggregates, for example `aws.cost.net.amortized`. + attr_reader :metric + + # Number of cost rows that carry this tag key over the requested period. + attr_reader :row_count + + # Origins where this tag key was observed (for example, `aws-user-defined`). + attr_reader :tag_sources + + # A sample of the most frequent tag values observed for this tag key, keyed by cloud account ID. + attr_reader :top_values_by_account + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cardinality_by_account' => :'cardinality_by_account', + :'cost_covered' => :'cost_covered', + :'date' => :'date', + :'metric' => :'metric', + :'row_count' => :'row_count', + :'tag_sources' => :'tag_sources', + :'top_values_by_account' => :'top_values_by_account' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cardinality_by_account' => :'Hash', + :'cost_covered' => :'Float', + :'date' => :'String', + :'metric' => :'String', + :'row_count' => :'Integer', + :'tag_sources' => :'Array', + :'top_values_by_account' => :'Hash>' + } + 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::CostTagKeyMetadataAttributes` 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?(:'cardinality_by_account') + self.cardinality_by_account = attributes[:'cardinality_by_account'] + end + + if attributes.key?(:'cost_covered') + self.cost_covered = attributes[:'cost_covered'] + end + + if attributes.key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'metric') + self.metric = attributes[:'metric'] + end + + if attributes.key?(:'row_count') + self.row_count = attributes[:'row_count'] + end + + if attributes.key?(:'tag_sources') + if (value = attributes[:'tag_sources']).is_a?(Array) + self.tag_sources = value + end + end + + if attributes.key?(:'top_values_by_account') + self.top_values_by_account = attributes[:'top_values_by_account'] + 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 @cardinality_by_account.nil? + return false if @cost_covered.nil? + return false if @metric.nil? + return false if @row_count.nil? + return false if @tag_sources.nil? + return false if @top_values_by_account.nil? + true + end + + # Custom attribute writer method with validation + # @param cardinality_by_account [Object] Object to be assigned + # @!visibility private + def cardinality_by_account=(cardinality_by_account) + if cardinality_by_account.nil? + fail ArgumentError, 'invalid value for "cardinality_by_account", cardinality_by_account cannot be nil.' + end + @cardinality_by_account = cardinality_by_account + end + + # Custom attribute writer method with validation + # @param cost_covered [Object] Object to be assigned + # @!visibility private + def cost_covered=(cost_covered) + if cost_covered.nil? + fail ArgumentError, 'invalid value for "cost_covered", cost_covered cannot be nil.' + end + @cost_covered = cost_covered + end + + # Custom attribute writer method with validation + # @param metric [Object] Object to be assigned + # @!visibility private + def metric=(metric) + if metric.nil? + fail ArgumentError, 'invalid value for "metric", metric cannot be nil.' + end + @metric = metric + end + + # Custom attribute writer method with validation + # @param row_count [Object] Object to be assigned + # @!visibility private + def row_count=(row_count) + if row_count.nil? + fail ArgumentError, 'invalid value for "row_count", row_count cannot be nil.' + end + @row_count = row_count + end + + # Custom attribute writer method with validation + # @param tag_sources [Object] Object to be assigned + # @!visibility private + def tag_sources=(tag_sources) + if tag_sources.nil? + fail ArgumentError, 'invalid value for "tag_sources", tag_sources cannot be nil.' + end + @tag_sources = tag_sources + end + + # Custom attribute writer method with validation + # @param top_values_by_account [Object] Object to be assigned + # @!visibility private + def top_values_by_account=(top_values_by_account) + if top_values_by_account.nil? + fail ArgumentError, 'invalid value for "top_values_by_account", top_values_by_account cannot be nil.' + end + @top_values_by_account = top_values_by_account + 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 && + cardinality_by_account == o.cardinality_by_account && + cost_covered == o.cost_covered && + date == o.date && + metric == o.metric && + row_count == o.row_count && + tag_sources == o.tag_sources && + top_values_by_account == o.top_values_by_account && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cardinality_by_account, cost_covered, date, metric, row_count, tag_sources, top_values_by_account, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_key_metadata_response.rb b/lib/datadog_api_client/v2/models/cost_tag_key_metadata_response.rb new file mode 100644 index 000000000000..19f613ed06b6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_key_metadata_response.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 + # List of Cloud Cost Management tag key metadata entries for the requested period. + class CostTagKeyMetadataResponse + include BaseGenericModel + + # List of tag key metadata entries. + 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' => :'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::CostTagKeyMetadataResponse` 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') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + 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/cost_tag_key_metadata_type.rb b/lib/datadog_api_client/v2/models/cost_tag_key_metadata_type.rb new file mode 100644 index 000000000000..c33d88d4c8f2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_key_metadata_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 the Cloud Cost Management tag key metadata resource. + class CostTagKeyMetadataType + include BaseEnumModel + + COST_TAG_KEY_METADATA = "cost_tag_key_metadata".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_key_source.rb b/lib/datadog_api_client/v2/models/cost_tag_key_source.rb new file mode 100644 index 000000000000..6fc0e294ad05 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_key_source.rb @@ -0,0 +1,165 @@ +=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 Cloud Cost Management tag key paired with the sources that produced it. + class CostTagKeySource + include BaseGenericModel + + # Attributes of a Cloud Cost Management tag source. + attr_reader :attributes + + # The tag key identifier. Equal to the empty-tag sentinel `__empty_tag_key__` when the tag key is empty. + attr_reader :id + + # Type of the Cloud Cost Management tag source resource. + 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' => :'CostTagKeySourceAttributes', + :'id' => :'String', + :'type' => :'CostTagKeySourceType' + } + 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::CostTagKeySource` 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 @attributes.nil? + return false if @id.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 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 && + 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/cost_tag_key_source_attributes.rb b/lib/datadog_api_client/v2/models/cost_tag_key_source_attributes.rb new file mode 100644 index 000000000000..5f608955c2d0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_key_source_attributes.rb @@ -0,0 +1,146 @@ +=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 Cloud Cost Management tag source. + class CostTagKeySourceAttributes + include BaseGenericModel + + # The tag key name. + attr_reader :tag_key + + # Origins where this tag key was observed (for example, `aws-user-defined`). + attr_reader :tag_sources + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'tag_key' => :'tag_key', + :'tag_sources' => :'tag_sources' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'tag_key' => :'String', + :'tag_sources' => :'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::CostTagKeySourceAttributes` 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?(:'tag_key') + self.tag_key = attributes[:'tag_key'] + end + + if attributes.key?(:'tag_sources') + if (value = attributes[:'tag_sources']).is_a?(Array) + self.tag_sources = value + end + 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 @tag_key.nil? + return false if @tag_sources.nil? + true + end + + # Custom attribute writer method with validation + # @param tag_key [Object] Object to be assigned + # @!visibility private + def tag_key=(tag_key) + if tag_key.nil? + fail ArgumentError, 'invalid value for "tag_key", tag_key cannot be nil.' + end + @tag_key = tag_key + end + + # Custom attribute writer method with validation + # @param tag_sources [Object] Object to be assigned + # @!visibility private + def tag_sources=(tag_sources) + if tag_sources.nil? + fail ArgumentError, 'invalid value for "tag_sources", tag_sources cannot be nil.' + end + @tag_sources = tag_sources + 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 && + tag_key == o.tag_key && + tag_sources == o.tag_sources && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [tag_key, tag_sources, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_key_source_type.rb b/lib/datadog_api_client/v2/models/cost_tag_key_source_type.rb new file mode 100644 index 000000000000..3ea49b519955 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_key_source_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 the Cloud Cost Management tag source resource. + class CostTagKeySourceType + include BaseEnumModel + + COST_TAG_KEY_SOURCE = "cost_tag_key_source".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/cost_tag_key_sources_response.rb b/lib/datadog_api_client/v2/models/cost_tag_key_sources_response.rb new file mode 100644 index 000000000000..7113bd95bbef --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_key_sources_response.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 + # List of Cloud Cost Management tag keys with their origin sources for the requested period. + class CostTagKeySourcesResponse + include BaseGenericModel + + # List of tag keys with their origin sources. + 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' => :'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::CostTagKeySourcesResponse` 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') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + 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/cost_tag_metadata_daily_filter.rb b/lib/datadog_api_client/v2/models/cost_tag_metadata_daily_filter.rb new file mode 100644 index 000000000000..8de442b570e0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/cost_tag_metadata_daily_filter.rb @@ -0,0 +1,27 @@ +=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 + # Granularity for tag metadata results. `true` returns one row per day, `false` (or omitted) returns the monthly roll-up. + class CostTagMetadataDailyFilter + include BaseEnumModel + + TRUE = "true".freeze + FALSE = "false".freeze + end +end