From 77e139446912ff5b64f4210c186febb486431d42 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Wed, 24 Jun 2026 13:24:52 +0000 Subject: [PATCH 1/5] Regenerate client from commit 0460aa0 of spec repo (#3510) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 21 ++++++++++++++++--- .../v2/api/security_monitoring_api.rb | 14 +++++++------ ...rity_monitoring_terraform_resource_type.rb | 2 ++ 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b1469c0ac20a..9cf6db8ad896 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -88816,10 +88816,14 @@ components: enum: - suppressions - critical_assets + - security_filters + - rules type: string x-enum-varnames: - SUPPRESSIONS - CRITICAL_ASSETS + - SECURITY_FILTERS + - RULES SecurityMonitoringThirdPartyRootQuery: description: A query to be combined with the third party case query. properties: @@ -177523,8 +177527,9 @@ paths: description: |- Export multiple security monitoring resources to Terraform, packaged as a zip archive. The `resource_type` path parameter specifies the type of resources to export - and must be one of `suppressions` or `critical_assets`. + and must be one of `suppressions`, `critical_assets`, `security_filters`, or `rules`. A maximum of 1000 resources can be exported in a single request. + For `rules`, partner rules cannot be exported and return a 400 error. operationId: BulkExportSecurityMonitoringTerraformResources parameters: - $ref: "#/components/parameters/SecurityMonitoringTerraformResourceType" @@ -177569,6 +177574,8 @@ paths: - security_monitoring_suppressions_read - AuthZ: - security_monitoring_rules_read + - AuthZ: + - security_monitoring_filters_read summary: Export security monitoring resources to Terraform tags: - Security Monitoring @@ -177578,13 +177585,14 @@ paths: permissions: - security_monitoring_suppressions_read - security_monitoring_rules_read + - security_monitoring_filters_read x-unstable: "**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." /api/v2/security_monitoring/terraform/{resource_type}/convert: post: description: |- Convert a security monitoring resource that doesn't (yet) exist from JSON to Terraform. The `resource_type` path parameter specifies the type of resource to convert - and must be one of `suppressions` or `critical_assets`. + and must be one of `suppressions`, `critical_assets`, `security_filters`, or `rules`. operationId: ConvertSecurityMonitoringTerraformResource parameters: - $ref: "#/components/parameters/SecurityMonitoringTerraformResourceType" @@ -177637,6 +177645,8 @@ paths: - security_monitoring_suppressions_read - AuthZ: - security_monitoring_rules_read + - AuthZ: + - security_monitoring_filters_read summary: Convert security monitoring resource to Terraform tags: - Security Monitoring @@ -177646,13 +177656,15 @@ paths: permissions: - security_monitoring_suppressions_read - security_monitoring_rules_read + - security_monitoring_filters_read x-unstable: "**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." /api/v2/security_monitoring/terraform/{resource_type}/{resource_id}: get: description: |- Export a security monitoring resource to a Terraform configuration. The `resource_type` path parameter specifies the type of resource to export - and must be one of `suppressions` or `critical_assets`. + and must be one of `suppressions`, `critical_assets`, `security_filters`, or `rules`. + For `rules`, partner rules cannot be exported and return a 400 error. operationId: ExportSecurityMonitoringTerraformResource parameters: - $ref: "#/components/parameters/SecurityMonitoringTerraformResourceType" @@ -177687,6 +177699,8 @@ paths: - security_monitoring_suppressions_read - AuthZ: - security_monitoring_rules_read + - AuthZ: + - security_monitoring_filters_read summary: Export security monitoring resource to Terraform tags: - Security Monitoring @@ -177695,6 +177709,7 @@ paths: permissions: - security_monitoring_suppressions_read - security_monitoring_rules_read + - security_monitoring_filters_read x-unstable: "**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." /api/v2/sensitive-data-scanner/config: get: diff --git a/lib/datadog_api_client/v2/api/security_monitoring_api.rb b/lib/datadog_api_client/v2/api/security_monitoring_api.rb index 87ad9daa5f92..a0d5f1b64780 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -888,8 +888,9 @@ def bulk_export_security_monitoring_terraform_resources(resource_type, body, opt # # Export multiple security monitoring resources to Terraform, packaged as a zip archive. # The `resource_type` path parameter specifies the type of resources to export - # and must be one of `suppressions` or `critical_assets`. + # and must be one of `suppressions`, `critical_assets`, `security_filters`, or `rules`. # A maximum of 1000 resources can be exported in a single request. + # For `rules`, partner rules cannot be exported and return a 400 error. # # @param resource_type [SecurityMonitoringTerraformResourceType] The type of security monitoring resource to export. # @param body [SecurityMonitoringTerraformBulkExportRequest] The resource IDs to export. @@ -911,7 +912,7 @@ def bulk_export_security_monitoring_terraform_resources_with_http_info(resource_ fail ArgumentError, "Missing the required parameter 'resource_type' when calling SecurityMonitoringAPI.bulk_export_security_monitoring_terraform_resources" end # verify enum value - allowable_values = ['suppressions', 'critical_assets'] + allowable_values = ['suppressions', 'critical_assets', 'security_filters', 'rules'] if @api_client.config.client_side_validation && !allowable_values.include?(resource_type) fail ArgumentError, "invalid value for \"resource_type\", must be one of #{allowable_values}" end @@ -1262,7 +1263,7 @@ def convert_security_monitoring_terraform_resource(resource_type, body, opts = { # # Convert a security monitoring resource that doesn't (yet) exist from JSON to Terraform. # The `resource_type` path parameter specifies the type of resource to convert - # and must be one of `suppressions` or `critical_assets`. + # and must be one of `suppressions`, `critical_assets`, `security_filters`, or `rules`. # # @param resource_type [SecurityMonitoringTerraformResourceType] The type of security monitoring resource to export. # @param body [SecurityMonitoringTerraformConvertRequest] The resource JSON to convert. @@ -1284,7 +1285,7 @@ def convert_security_monitoring_terraform_resource_with_http_info(resource_type, fail ArgumentError, "Missing the required parameter 'resource_type' when calling SecurityMonitoringAPI.convert_security_monitoring_terraform_resource" end # verify enum value - allowable_values = ['suppressions', 'critical_assets'] + allowable_values = ['suppressions', 'critical_assets', 'security_filters', 'rules'] if @api_client.config.client_side_validation && !allowable_values.include?(resource_type) fail ArgumentError, "invalid value for \"resource_type\", must be one of #{allowable_values}" end @@ -4088,7 +4089,8 @@ def export_security_monitoring_terraform_resource(resource_type, resource_id, op # # Export a security monitoring resource to a Terraform configuration. # The `resource_type` path parameter specifies the type of resource to export - # and must be one of `suppressions` or `critical_assets`. + # and must be one of `suppressions`, `critical_assets`, `security_filters`, or `rules`. + # For `rules`, partner rules cannot be exported and return a 400 error. # # @param resource_type [SecurityMonitoringTerraformResourceType] The type of security monitoring resource to export. # @param resource_id [String] The ID of the security monitoring resource to export. @@ -4110,7 +4112,7 @@ def export_security_monitoring_terraform_resource_with_http_info(resource_type, fail ArgumentError, "Missing the required parameter 'resource_type' when calling SecurityMonitoringAPI.export_security_monitoring_terraform_resource" end # verify enum value - allowable_values = ['suppressions', 'critical_assets'] + allowable_values = ['suppressions', 'critical_assets', 'security_filters', 'rules'] if @api_client.config.client_side_validation && !allowable_values.include?(resource_type) fail ArgumentError, "invalid value for \"resource_type\", must be one of #{allowable_values}" end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_terraform_resource_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_terraform_resource_type.rb index 653743d0d402..a2e1b02e126c 100644 --- a/lib/datadog_api_client/v2/models/security_monitoring_terraform_resource_type.rb +++ b/lib/datadog_api_client/v2/models/security_monitoring_terraform_resource_type.rb @@ -23,5 +23,7 @@ class SecurityMonitoringTerraformResourceType SUPPRESSIONS = "suppressions".freeze CRITICAL_ASSETS = "critical_assets".freeze + SECURITY_FILTERS = "security_filters".freeze + RULES = "rules".freeze end end From cc9c4b5bb079d3df9ec740c40a7fa5ad8c5bff27 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Wed, 24 Jun 2026 13:30:18 +0000 Subject: [PATCH 2/5] Regenerate client from commit 9991619 of spec repo (#3512) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 123 +++++++++ ...rce-bearer-auth-returns-OK-response.frozen | 1 + ...source-bearer-auth-returns-OK-response.yml | 27 ++ .../ValidatePipeline_337125830.rb | 56 ++++ features/v2/observability_pipelines.feature | 8 + lib/datadog_api_client/inflector.rb | 8 + ...servability_pipeline_config_source_item.rb | 1 + ...observability_pipeline_websocket_source.rb | 248 ++++++++++++++++++ ...pipeline_websocket_source_auth_strategy.rb | 29 ++ ...rvability_pipeline_websocket_source_tls.rb | 63 +++++ ...y_pipeline_websocket_source_tls_enabled.rb | 123 +++++++++ ...eline_websocket_source_tls_enabled_mode.rb | 26 ++ ...e_websocket_source_tls_with_client_cert.rb | 174 ++++++++++++ ...socket_source_tls_with_client_cert_mode.rb | 26 ++ ...vability_pipeline_websocket_source_type.rb | 26 ++ 15 files changed, 939 insertions(+) create mode 100644 cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-websocket-source-bearer-auth-returns-OK-response.frozen create mode 100644 cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-websocket-source-bearer-auth-returns-OK-response.yml create mode 100644 examples/v2/observability-pipelines/ValidatePipeline_337125830.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_websocket_source.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_auth_strategy.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_enabled.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_enabled_mode.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_with_client_cert.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_with_client_cert_mode.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9cf6db8ad896..63f76505a12b 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -64152,6 +64152,7 @@ components: - $ref: "#/components/schemas/ObservabilityPipelineSplunkTcpSource" - $ref: "#/components/schemas/ObservabilityPipelineSumoLogicSource" - $ref: "#/components/schemas/ObservabilityPipelineSyslogNgSource" + - $ref: "#/components/schemas/ObservabilityPipelineWebsocketSource" - $ref: "#/components/schemas/ObservabilityPipelineOpentelemetrySource" ObservabilityPipelineCrowdStrikeNextGenSiemDestination: description: |- @@ -68808,6 +68809,128 @@ components: required: - crt_file type: object + ObservabilityPipelineWebsocketSource: + description: |- + The `websocket` source ingests logs from a WebSocket server using the `ws://` or `wss://` protocol. + + **Supported pipeline types:** logs. + properties: + auth_strategy: + $ref: "#/components/schemas/ObservabilityPipelineWebsocketSourceAuthStrategy" + custom_key: + description: Name of the environment variable or secret that holds the custom authorization header value. Used when `auth_strategy` is `custom`. + example: WS_AUTH_CUSTOM_HEADER + type: string + decoding: + $ref: "#/components/schemas/ObservabilityPipelineDecoding" + id: + description: The unique identifier for this component. + example: websocket-source + type: string + password_key: + description: Name of the environment variable or secret that holds the password. Used when `auth_strategy` is `basic`. + example: WS_AUTH_PASSWORD + type: string + tls: + $ref: "#/components/schemas/ObservabilityPipelineWebsocketSourceTls" + token_key: + description: Name of the environment variable or secret that holds the bearer token. Used when `auth_strategy` is `bearer`. + example: WS_BEARER_TOKEN + type: string + type: + $ref: "#/components/schemas/ObservabilityPipelineWebsocketSourceType" + uri_key: + description: Name of the environment variable or secret that holds the WebSocket server URI (`ws://` or `wss://`). + example: WS_URI + type: string + username_key: + description: Name of the environment variable or secret that holds the username. Used when `auth_strategy` is `basic`. + example: WS_AUTH_USERNAME + type: string + required: + - id + - type + - decoding + - auth_strategy + type: object + x-pipeline-types: [logs] + ObservabilityPipelineWebsocketSourceAuthStrategy: + description: Authentication strategy for the WebSocket source connection. + enum: + - none + - basic + - bearer + - custom + example: bearer + type: string + x-enum-varnames: + - NONE + - BASIC + - BEARER + - CUSTOM + ObservabilityPipelineWebsocketSourceTls: + description: TLS configuration for the WebSocket source. Use `enabled` for standard `wss://` connections, or `with_client_cert` to present a client certificate for mutual TLS. + oneOf: + - $ref: "#/components/schemas/ObservabilityPipelineWebsocketSourceTlsEnabled" + - $ref: "#/components/schemas/ObservabilityPipelineWebsocketSourceTlsWithClientCert" + ObservabilityPipelineWebsocketSourceTlsEnabled: + description: TLS configuration that enables encryption without a client certificate. Use this for standard `wss://` connections that do not require mutual TLS. + properties: + mode: + $ref: "#/components/schemas/ObservabilityPipelineWebsocketSourceTlsEnabledMode" + required: + - mode + type: object + ObservabilityPipelineWebsocketSourceTlsEnabledMode: + description: TLS mode. Must be `enabled`. + enum: + - enabled + example: enabled + type: string + x-enum-varnames: + - ENABLED + ObservabilityPipelineWebsocketSourceTlsWithClientCert: + description: TLS configuration that enables encryption and presents a client certificate for mutual TLS authentication. + properties: + ca_file: + description: Path to the Certificate Authority (CA) file used to validate the remote server's TLS certificate. + example: /path/to/ca.crt + type: string + crt_file: + description: Path to the TLS client certificate file used to identify this source to the remote server. + example: /path/to/client.crt + type: string + key_file: + description: Path to the private key file associated with the client certificate. + example: /path/to/client.key + type: string + key_pass_key: + description: Name of the environment variable or secret that holds the passphrase for the private key file. + example: WS_TLS_KEY_PASSPHRASE + type: string + mode: + $ref: "#/components/schemas/ObservabilityPipelineWebsocketSourceTlsWithClientCertMode" + required: + - mode + - crt_file + type: object + ObservabilityPipelineWebsocketSourceTlsWithClientCertMode: + description: TLS mode. Must be `with_client_cert`. + enum: + - with_client_cert + example: with_client_cert + type: string + x-enum-varnames: + - WITH_CLIENT_CERT + ObservabilityPipelineWebsocketSourceType: + default: websocket + description: The source type. The value should always be `websocket`. + enum: + - websocket + example: websocket + type: string + x-enum-varnames: + - WEBSOCKET OktaAPIToken: description: The definition of the `OktaAPIToken` object. properties: diff --git a/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-websocket-source-bearer-auth-returns-OK-response.frozen b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-websocket-source-bearer-auth-returns-OK-response.frozen new file mode 100644 index 000000000000..e092c16a233e --- /dev/null +++ b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-websocket-source-bearer-auth-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-06-22T19:51:31.598Z \ No newline at end of file diff --git a/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-websocket-source-bearer-auth-returns-OK-response.yml b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-websocket-source-bearer-auth-returns-OK-response.yml new file mode 100644 index 000000000000..a54a8bded108 --- /dev/null +++ b/cassettes/features/v2/observability_pipelines/Validate-an-observability-pipeline-with-websocket-source-bearer-auth-returns-OK-response.yml @@ -0,0 +1,27 @@ +http_interactions: +- recorded_at: Mon, 22 Jun 2026 19:51:31 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"config":{"destinations":[{"id":"datadog-logs-destination","inputs":["my-processor-group"],"type":"datadog_logs"}],"processor_groups":[{"enabled":true,"id":"my-processor-group","include":"service:my-service","inputs":["websocket-source"],"processors":[{"enabled":true,"id":"filter-processor","include":"status:error","type":"filter"}]}],"sources":[{"auth_strategy":"bearer","decoding":"json","id":"websocket-source","tls":{"mode":"enabled"},"token_key":"WS_BEARER_TOKEN","type":"websocket","uri_key":"WS_URI"}]},"name":"Pipeline + with WebSocket Source"},"type":"pipelines"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/obs-pipelines/pipelines/validate + response: + body: + encoding: UTF-8 + string: '{"errors":[]} + + ' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v2/observability-pipelines/ValidatePipeline_337125830.rb b/examples/v2/observability-pipelines/ValidatePipeline_337125830.rb new file mode 100644 index 000000000000..71a7792d58bb --- /dev/null +++ b/examples/v2/observability-pipelines/ValidatePipeline_337125830.rb @@ -0,0 +1,56 @@ +# Validate an observability pipeline with websocket source bearer auth returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ObservabilityPipelinesAPI.new + +body = DatadogAPIClient::V2::ObservabilityPipelineSpec.new({ + data: DatadogAPIClient::V2::ObservabilityPipelineSpecData.new({ + attributes: DatadogAPIClient::V2::ObservabilityPipelineDataAttributes.new({ + config: DatadogAPIClient::V2::ObservabilityPipelineConfig.new({ + destinations: [ + DatadogAPIClient::V2::ObservabilityPipelineDatadogLogsDestination.new({ + id: "datadog-logs-destination", + inputs: [ + "my-processor-group", + ], + type: DatadogAPIClient::V2::ObservabilityPipelineDatadogLogsDestinationType::DATADOG_LOGS, + }), + ], + processor_groups: [ + DatadogAPIClient::V2::ObservabilityPipelineConfigProcessorGroup.new({ + enabled: true, + id: "my-processor-group", + include: "service:my-service", + inputs: [ + "websocket-source", + ], + processors: [ + DatadogAPIClient::V2::ObservabilityPipelineFilterProcessor.new({ + enabled: true, + id: "filter-processor", + include: "status:error", + type: DatadogAPIClient::V2::ObservabilityPipelineFilterProcessorType::FILTER, + }), + ], + }), + ], + sources: [ + DatadogAPIClient::V2::ObservabilityPipelineWebsocketSource.new({ + id: "websocket-source", + type: DatadogAPIClient::V2::ObservabilityPipelineWebsocketSourceType::WEBSOCKET, + decoding: DatadogAPIClient::V2::ObservabilityPipelineDecoding::DECODE_JSON, + auth_strategy: DatadogAPIClient::V2::ObservabilityPipelineWebsocketSourceAuthStrategy::BEARER, + token_key: "WS_BEARER_TOKEN", + uri_key: "WS_URI", + tls: DatadogAPIClient::V2::ObservabilityPipelineWebsocketSourceTlsEnabled.new({ + mode: DatadogAPIClient::V2::ObservabilityPipelineWebsocketSourceTlsEnabledMode::ENABLED, + }), + }), + ], + }), + name: "Pipeline with WebSocket Source", + }), + type: "pipelines", + }), +}) +p api_instance.validate_pipeline(body) diff --git a/features/v2/observability_pipelines.feature b/features/v2/observability_pipelines.feature index a57aed2a0325..e5ee4d0545d8 100644 --- a/features/v2/observability_pipelines.feature +++ b/features/v2/observability_pipelines.feature @@ -294,3 +294,11 @@ Feature: Observability Pipelines When the request is sent Then the response status is 200 OK And the response "errors" has length 0 + + @team:DataDog/observability-pipelines + Scenario: Validate an observability pipeline with websocket source bearer auth returns "OK" response + Given new "ValidatePipeline" request + And body with value {"data": {"attributes": {"config": {"destinations": [{"id": "datadog-logs-destination", "inputs": ["my-processor-group"], "type": "datadog_logs"}], "processor_groups": [{"enabled": true, "id": "my-processor-group", "include": "service:my-service", "inputs": ["websocket-source"], "processors": [{"enabled": true, "id": "filter-processor", "include": "status:error", "type": "filter"}]}], "sources": [{"id": "websocket-source", "type": "websocket", "decoding": "json", "auth_strategy": "bearer", "token_key": "WS_BEARER_TOKEN", "uri_key": "WS_URI", "tls": {"mode": "enabled"}}]}, "name": "Pipeline with WebSocket Source"}, "type": "pipelines"}} + When the request is sent + Then the response status is 200 OK + And the response "errors" has length 0 diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index d834896942fe..76a1b3ee9f13 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -5200,6 +5200,14 @@ def overrides "v2.observability_pipeline_throttle_processor" => "ObservabilityPipelineThrottleProcessor", "v2.observability_pipeline_throttle_processor_type" => "ObservabilityPipelineThrottleProcessorType", "v2.observability_pipeline_tls" => "ObservabilityPipelineTls", + "v2.observability_pipeline_websocket_source" => "ObservabilityPipelineWebsocketSource", + "v2.observability_pipeline_websocket_source_auth_strategy" => "ObservabilityPipelineWebsocketSourceAuthStrategy", + "v2.observability_pipeline_websocket_source_tls" => "ObservabilityPipelineWebsocketSourceTls", + "v2.observability_pipeline_websocket_source_tls_enabled" => "ObservabilityPipelineWebsocketSourceTlsEnabled", + "v2.observability_pipeline_websocket_source_tls_enabled_mode" => "ObservabilityPipelineWebsocketSourceTlsEnabledMode", + "v2.observability_pipeline_websocket_source_tls_with_client_cert" => "ObservabilityPipelineWebsocketSourceTlsWithClientCert", + "v2.observability_pipeline_websocket_source_tls_with_client_cert_mode" => "ObservabilityPipelineWebsocketSourceTlsWithClientCertMode", + "v2.observability_pipeline_websocket_source_type" => "ObservabilityPipelineWebsocketSourceType", "v2.oci_config" => "OCIConfig", "v2.oci_config_attributes" => "OCIConfigAttributes", "v2.oci_configs_response" => "OCIConfigsResponse", diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_config_source_item.rb b/lib/datadog_api_client/v2/models/observability_pipeline_config_source_item.rb index 74579da90735..67797d23ff0d 100644 --- a/lib/datadog_api_client/v2/models/observability_pipeline_config_source_item.rb +++ b/lib/datadog_api_client/v2/models/observability_pipeline_config_source_item.rb @@ -42,6 +42,7 @@ def openapi_one_of :'ObservabilityPipelineSplunkTcpSource', :'ObservabilityPipelineSumoLogicSource', :'ObservabilityPipelineSyslogNgSource', + :'ObservabilityPipelineWebsocketSource', :'ObservabilityPipelineOpentelemetrySource' ] end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source.rb b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source.rb new file mode 100644 index 000000000000..0212eb44ba5a --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source.rb @@ -0,0 +1,248 @@ +=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 `websocket` source ingests logs from a WebSocket server using the `ws://` or `wss://` protocol. + # + # **Supported pipeline types:** logs. + class ObservabilityPipelineWebsocketSource + include BaseGenericModel + + # Authentication strategy for the WebSocket source connection. + attr_reader :auth_strategy + + # Name of the environment variable or secret that holds the custom authorization header value. Used when `auth_strategy` is `custom`. + attr_accessor :custom_key + + # The decoding format used to interpret incoming logs. + attr_reader :decoding + + # The unique identifier for this component. + attr_reader :id + + # Name of the environment variable or secret that holds the password. Used when `auth_strategy` is `basic`. + attr_accessor :password_key + + # TLS configuration for the WebSocket source. Use `enabled` for standard `wss://` connections, or `with_client_cert` to present a client certificate for mutual TLS. + attr_accessor :tls + + # Name of the environment variable or secret that holds the bearer token. Used when `auth_strategy` is `bearer`. + attr_accessor :token_key + + # The source type. The value should always be `websocket`. + attr_reader :type + + # Name of the environment variable or secret that holds the WebSocket server URI (`ws://` or `wss://`). + attr_accessor :uri_key + + # Name of the environment variable or secret that holds the username. Used when `auth_strategy` is `basic`. + attr_accessor :username_key + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'auth_strategy' => :'auth_strategy', + :'custom_key' => :'custom_key', + :'decoding' => :'decoding', + :'id' => :'id', + :'password_key' => :'password_key', + :'tls' => :'tls', + :'token_key' => :'token_key', + :'type' => :'type', + :'uri_key' => :'uri_key', + :'username_key' => :'username_key' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'auth_strategy' => :'ObservabilityPipelineWebsocketSourceAuthStrategy', + :'custom_key' => :'String', + :'decoding' => :'ObservabilityPipelineDecoding', + :'id' => :'String', + :'password_key' => :'String', + :'tls' => :'ObservabilityPipelineWebsocketSourceTls', + :'token_key' => :'String', + :'type' => :'ObservabilityPipelineWebsocketSourceType', + :'uri_key' => :'String', + :'username_key' => :'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::ObservabilityPipelineWebsocketSource` 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?(:'auth_strategy') + self.auth_strategy = attributes[:'auth_strategy'] + end + + if attributes.key?(:'custom_key') + self.custom_key = attributes[:'custom_key'] + end + + if attributes.key?(:'decoding') + self.decoding = attributes[:'decoding'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'password_key') + self.password_key = attributes[:'password_key'] + end + + if attributes.key?(:'tls') + self.tls = attributes[:'tls'] + end + + if attributes.key?(:'token_key') + self.token_key = attributes[:'token_key'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'uri_key') + self.uri_key = attributes[:'uri_key'] + end + + if attributes.key?(:'username_key') + self.username_key = attributes[:'username_key'] + 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 @auth_strategy.nil? + return false if @decoding.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param auth_strategy [Object] Object to be assigned + # @!visibility private + def auth_strategy=(auth_strategy) + if auth_strategy.nil? + fail ArgumentError, 'invalid value for "auth_strategy", auth_strategy cannot be nil.' + end + @auth_strategy = auth_strategy + end + + # Custom attribute writer method with validation + # @param decoding [Object] Object to be assigned + # @!visibility private + def decoding=(decoding) + if decoding.nil? + fail ArgumentError, 'invalid value for "decoding", decoding cannot be nil.' + end + @decoding = decoding + 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 && + auth_strategy == o.auth_strategy && + custom_key == o.custom_key && + decoding == o.decoding && + id == o.id && + password_key == o.password_key && + tls == o.tls && + token_key == o.token_key && + type == o.type && + uri_key == o.uri_key && + username_key == o.username_key && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [auth_strategy, custom_key, decoding, id, password_key, tls, token_key, type, uri_key, username_key, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_auth_strategy.rb b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_auth_strategy.rb new file mode 100644 index 000000000000..5c6d20678067 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_auth_strategy.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 + # Authentication strategy for the WebSocket source connection. + class ObservabilityPipelineWebsocketSourceAuthStrategy + include BaseEnumModel + + NONE = "none".freeze + BASIC = "basic".freeze + BEARER = "bearer".freeze + CUSTOM = "custom".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls.rb b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls.rb new file mode 100644 index 000000000000..f5f8af2efc65 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls.rb @@ -0,0 +1,63 @@ +=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 + # TLS configuration for the WebSocket source. Use `enabled` for standard `wss://` connections, or `with_client_cert` to present a client certificate for mutual TLS. + module ObservabilityPipelineWebsocketSourceTls + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ObservabilityPipelineWebsocketSourceTlsEnabled', + :'ObservabilityPipelineWebsocketSourceTlsWithClientCert' + ] + 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 openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_enabled.rb b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_enabled.rb new file mode 100644 index 000000000000..913ab70afc98 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_enabled.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # TLS configuration that enables encryption without a client certificate. Use this for standard `wss://` connections that do not require mutual TLS. + class ObservabilityPipelineWebsocketSourceTlsEnabled + include BaseGenericModel + + # TLS mode. Must be `enabled`. + attr_reader :mode + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'mode' => :'mode' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'mode' => :'ObservabilityPipelineWebsocketSourceTlsEnabledMode' + } + 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::ObservabilityPipelineWebsocketSourceTlsEnabled` 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?(:'mode') + self.mode = attributes[:'mode'] + 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 @mode.nil? + true + end + + # Custom attribute writer method with validation + # @param mode [Object] Object to be assigned + # @!visibility private + def mode=(mode) + if mode.nil? + fail ArgumentError, 'invalid value for "mode", mode cannot be nil.' + end + @mode = mode + 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 && + mode == o.mode && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [mode, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_enabled_mode.rb b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_enabled_mode.rb new file mode 100644 index 000000000000..ddf9994f4ea8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_enabled_mode.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 + # TLS mode. Must be `enabled`. + class ObservabilityPipelineWebsocketSourceTlsEnabledMode + include BaseEnumModel + + ENABLED = "enabled".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_with_client_cert.rb b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_with_client_cert.rb new file mode 100644 index 000000000000..a26dec8b2faa --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_with_client_cert.rb @@ -0,0 +1,174 @@ +=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 + # TLS configuration that enables encryption and presents a client certificate for mutual TLS authentication. + class ObservabilityPipelineWebsocketSourceTlsWithClientCert + include BaseGenericModel + + # Path to the Certificate Authority (CA) file used to validate the remote server's TLS certificate. + attr_accessor :ca_file + + # Path to the TLS client certificate file used to identify this source to the remote server. + attr_reader :crt_file + + # Path to the private key file associated with the client certificate. + attr_accessor :key_file + + # Name of the environment variable or secret that holds the passphrase for the private key file. + attr_accessor :key_pass_key + + # TLS mode. Must be `with_client_cert`. + attr_reader :mode + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'ca_file' => :'ca_file', + :'crt_file' => :'crt_file', + :'key_file' => :'key_file', + :'key_pass_key' => :'key_pass_key', + :'mode' => :'mode' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'ca_file' => :'String', + :'crt_file' => :'String', + :'key_file' => :'String', + :'key_pass_key' => :'String', + :'mode' => :'ObservabilityPipelineWebsocketSourceTlsWithClientCertMode' + } + 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::ObservabilityPipelineWebsocketSourceTlsWithClientCert` 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?(:'ca_file') + self.ca_file = attributes[:'ca_file'] + end + + if attributes.key?(:'crt_file') + self.crt_file = attributes[:'crt_file'] + end + + if attributes.key?(:'key_file') + self.key_file = attributes[:'key_file'] + end + + if attributes.key?(:'key_pass_key') + self.key_pass_key = attributes[:'key_pass_key'] + end + + if attributes.key?(:'mode') + self.mode = attributes[:'mode'] + 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 @crt_file.nil? + return false if @mode.nil? + true + end + + # Custom attribute writer method with validation + # @param crt_file [Object] Object to be assigned + # @!visibility private + def crt_file=(crt_file) + if crt_file.nil? + fail ArgumentError, 'invalid value for "crt_file", crt_file cannot be nil.' + end + @crt_file = crt_file + end + + # Custom attribute writer method with validation + # @param mode [Object] Object to be assigned + # @!visibility private + def mode=(mode) + if mode.nil? + fail ArgumentError, 'invalid value for "mode", mode cannot be nil.' + end + @mode = mode + 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 && + ca_file == o.ca_file && + crt_file == o.crt_file && + key_file == o.key_file && + key_pass_key == o.key_pass_key && + mode == o.mode && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [ca_file, crt_file, key_file, key_pass_key, mode, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_with_client_cert_mode.rb b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_with_client_cert_mode.rb new file mode 100644 index 000000000000..6d5c26f4a41b --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_tls_with_client_cert_mode.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 + # TLS mode. Must be `with_client_cert`. + class ObservabilityPipelineWebsocketSourceTlsWithClientCertMode + include BaseEnumModel + + WITH_CLIENT_CERT = "with_client_cert".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_type.rb b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_source_type.rb new file mode 100644 index 000000000000..6461f0837f5d --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_websocket_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 + # The source type. The value should always be `websocket`. + class ObservabilityPipelineWebsocketSourceType + include BaseEnumModel + + WEBSOCKET = "websocket".freeze + end +end From d1c0b9134e8084d8d2bbbfd766ae072eee670baf Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Wed, 24 Jun 2026 14:26:52 +0000 Subject: [PATCH 3/5] Regenerate client from commit f82b21c of spec repo (#3508) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 8 ++++---- ...w-returns-Successfully-created-a-workflow-response.yml | 4 ++-- ...w-returns-Successfully-created-a-workflow-response.yml | 4 ++-- ...te-an-existing-Workflow-returns-Not-found-response.yml | 2 +- ...w-returns-Successfully-updated-a-workflow-response.yml | 4 ++-- examples/v2/workflow-automation/CreateWorkflow.rb | 2 +- examples/v2/workflow-automation/UpdateWorkflow.rb | 2 +- features/v2/workflow_automation.feature | 6 +++--- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 63f76505a12b..da74b2821596 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -25163,7 +25163,7 @@ components: text: "Example annotation." connectionEnvs: - connections: - - connectionId: "11111111-1111-1111-1111-111111111111" + - connectionId: "e1e64943-c7c5-4487-aece-25aaec7d3aad" label: "INTEGRATION_DATADOG" env: "default" handle: "my-handle" @@ -105989,7 +105989,7 @@ components: text: "Example annotation." connectionEnvs: - connections: - - connectionId: "11111111-1111-1111-1111-111111111111" + - connectionId: "e1e64943-c7c5-4487-aece-25aaec7d3aad" label: "INTEGRATION_DATADOG" env: "default" handle: "my-handle" @@ -193432,7 +193432,7 @@ paths: text: Example annotation. connectionEnvs: - connections: - - connectionId: 11111111-1111-1111-1111-111111111111 + - connectionId: e1e64943-c7c5-4487-aece-25aaec7d3aad label: INTEGRATION_DATADOG env: default handle: my-handle @@ -193637,7 +193637,7 @@ paths: text: Example annotation. connectionEnvs: - connections: - - connectionId: 11111111-1111-1111-1111-111111111111 + - connectionId: e1e64943-c7c5-4487-aece-25aaec7d3aad label: INTEGRATION_DATADOG env: default handle: my-handle diff --git a/cassettes/features/v2/workflow_automation/Create-Workflow-returns-Successfully-created-a-workflow-response.yml b/cassettes/features/v2/workflow_automation/Create-Workflow-returns-Successfully-created-a-workflow-response.yml index e1ba0f26137f..e195bb3e8258 100644 --- a/cassettes/features/v2/workflow_automation/Create-Workflow-returns-Successfully-created-a-workflow-response.yml +++ b/cassettes/features/v2/workflow_automation/Create-Workflow-returns-Successfully-created-a-workflow-response.yml @@ -4,7 +4,7 @@ http_interactions: body: encoding: UTF-8 string: '{"data":{"attributes":{"description":"A sample workflow.","name":"Example - Workflow","published":true,"spec":{"connectionEnvs":[{"connections":[{"connectionId":"11111111-1111-1111-1111-111111111111","label":"INTEGRATION_DATADOG"}],"env":"default"}],"handle":"my-handle","inputSchema":{"parameters":[{"defaultValue":"default","name":"input","type":"STRING"}]},"outputSchema":{"parameters":[{"name":"output","type":"ARRAY_OBJECT","value":"outputValue"}]},"steps":[{"actionId":"com.datadoghq.dd.monitor.listMonitors","connectionLabel":"INTEGRATION_DATADOG","name":"Step1","outboundEdges":[{"branchName":"main","nextStepName":"Step2"}],"parameters":[{"name":"tags","value":"service:monitoring"}]},{"actionId":"com.datadoghq.core.noop","name":"Step2"}],"triggers":[{"monitorTrigger":{"rateLimit":{"count":1,"interval":"3600s"}},"startStepNames":["Step1"]},{"githubWebhookTrigger":{},"startStepNames":["Step1"]}]},"tags":["team:infra","service:monitoring","foo:bar"]},"type":"workflows"}}' + Workflow","published":true,"spec":{"connectionEnvs":[{"connections":[{"connectionId":"e1e64943-c7c5-4487-aece-25aaec7d3aad","label":"INTEGRATION_DATADOG"}],"env":"default"}],"handle":"my-handle","inputSchema":{"parameters":[{"defaultValue":"default","name":"input","type":"STRING"}]},"outputSchema":{"parameters":[{"name":"output","type":"ARRAY_OBJECT","value":"outputValue"}]},"steps":[{"actionId":"com.datadoghq.dd.monitor.listMonitors","connectionLabel":"INTEGRATION_DATADOG","name":"Step1","outboundEdges":[{"branchName":"main","nextStepName":"Step2"}],"parameters":[{"name":"tags","value":"service:monitoring"}]},{"actionId":"com.datadoghq.core.noop","name":"Step2"}],"triggers":[{"monitorTrigger":{"rateLimit":{"count":1,"interval":"3600s"}},"startStepNames":["Step1"]},{"githubWebhookTrigger":{},"startStepNames":["Step1"]}]},"tags":["team:infra","service:monitoring","foo:bar"]},"type":"workflows"}}' headers: Accept: - application/json @@ -16,7 +16,7 @@ http_interactions: body: encoding: UTF-8 string: '{"data":{"id":"9c250b4e-3d0c-433d-84e6-60a6bde81adb","type":"workflows","attributes":{"createdAt":"2025-02-04T04:34:39.501028Z","description":"A - sample workflow.","name":"Example Workflow","published":true,"spec":{"triggers":[{"startStepNames":["Step1"],"monitorTrigger":{"rateLimit":{"count":1,"interval":"3600s"}}},{"startStepNames":["Step1"],"githubWebhookTrigger":{}}],"steps":[{"name":"Step1","actionId":"com.datadoghq.dd.monitor.listMonitors","connectionLabel":"INTEGRATION_DATADOG","parameters":[{"name":"tags","value":"service:monitoring"}],"outboundEdges":[{"nextStepName":"Step2","branchName":"main"}]},{"name":"Step2","actionId":"com.datadoghq.core.noop"}],"handle":"my-handle","connectionEnvs":[{"env":"default","connections":[{"connectionId":"11111111-1111-1111-1111-111111111111","label":"INTEGRATION_DATADOG"}]}],"inputSchema":{"parameters":[{"name":"input","type":"STRING","defaultValue":"default"}]},"outputSchema":{"parameters":[{"name":"output","type":"ARRAY_OBJECT","value":"outputValue"}]}},"tags":["foo:bar","team:infra","service:monitoring"],"updatedAt":"2025-02-04T04:34:39.501028Z"},"relationships":{"creator":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"owner":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + sample workflow.","name":"Example Workflow","published":true,"spec":{"triggers":[{"startStepNames":["Step1"],"monitorTrigger":{"rateLimit":{"count":1,"interval":"3600s"}}},{"startStepNames":["Step1"],"githubWebhookTrigger":{}}],"steps":[{"name":"Step1","actionId":"com.datadoghq.dd.monitor.listMonitors","connectionLabel":"INTEGRATION_DATADOG","parameters":[{"name":"tags","value":"service:monitoring"}],"outboundEdges":[{"nextStepName":"Step2","branchName":"main"}]},{"name":"Step2","actionId":"com.datadoghq.core.noop"}],"handle":"my-handle","connectionEnvs":[{"env":"default","connections":[{"connectionId":"e1e64943-c7c5-4487-aece-25aaec7d3aad","label":"INTEGRATION_DATADOG"}]}],"inputSchema":{"parameters":[{"name":"input","type":"STRING","defaultValue":"default"}]},"outputSchema":{"parameters":[{"name":"output","type":"ARRAY_OBJECT","value":"outputValue"}]}},"tags":["foo:bar","team:infra","service:monitoring"],"updatedAt":"2025-02-04T04:34:39.501028Z"},"relationships":{"creator":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"owner":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' headers: Content-Type: - application/vnd.api+json diff --git a/cassettes/features/v2/workflow_automation/Create-a-Workflow-returns-Successfully-created-a-workflow-response.yml b/cassettes/features/v2/workflow_automation/Create-a-Workflow-returns-Successfully-created-a-workflow-response.yml index d5cd9e9ff3f1..d361b9429442 100644 --- a/cassettes/features/v2/workflow_automation/Create-a-Workflow-returns-Successfully-created-a-workflow-response.yml +++ b/cassettes/features/v2/workflow_automation/Create-a-Workflow-returns-Successfully-created-a-workflow-response.yml @@ -4,7 +4,7 @@ http_interactions: body: encoding: UTF-8 string: '{"data":{"attributes":{"description":"A sample workflow.","name":"Example - Workflow","published":true,"spec":{"connectionEnvs":[{"connections":[{"connectionId":"11111111-1111-1111-1111-111111111111","label":"INTEGRATION_DATADOG"}],"env":"default"}],"inputSchema":{"parameters":[{"defaultValue":"default","name":"input","type":"STRING"}]},"outputSchema":{"parameters":[{"name":"output","type":"ARRAY_OBJECT","value":"outputValue"}]},"steps":[{"actionId":"com.datadoghq.dd.monitor.listMonitors","connectionLabel":"INTEGRATION_DATADOG","name":"Step1","outboundEdges":[{"branchName":"main","nextStepName":"Step2"}],"parameters":[{"name":"tags","value":"service:monitoring"}]},{"actionId":"com.datadoghq.core.noop","name":"Step2"}],"triggers":[{"monitorTrigger":{"rateLimit":{"count":1,"interval":"3600s"}},"startStepNames":["Step1"]},{"githubWebhookTrigger":{},"startStepNames":["Step1"]}]},"tags":["team:infra","service:monitoring","foo:bar"]},"type":"workflows"}}' + Workflow","published":true,"spec":{"connectionEnvs":[{"connections":[{"connectionId":"e1e64943-c7c5-4487-aece-25aaec7d3aad","label":"INTEGRATION_DATADOG"}],"env":"default"}],"inputSchema":{"parameters":[{"defaultValue":"default","name":"input","type":"STRING"}]},"outputSchema":{"parameters":[{"name":"output","type":"ARRAY_OBJECT","value":"outputValue"}]},"steps":[{"actionId":"com.datadoghq.dd.monitor.listMonitors","connectionLabel":"INTEGRATION_DATADOG","name":"Step1","outboundEdges":[{"branchName":"main","nextStepName":"Step2"}],"parameters":[{"name":"tags","value":"service:monitoring"}]},{"actionId":"com.datadoghq.core.noop","name":"Step2"}],"triggers":[{"monitorTrigger":{"rateLimit":{"count":1,"interval":"3600s"}},"startStepNames":["Step1"]},{"githubWebhookTrigger":{},"startStepNames":["Step1"]}]},"tags":["team:infra","service:monitoring","foo:bar"]},"type":"workflows"}}' headers: Accept: - application/json @@ -16,7 +16,7 @@ http_interactions: body: encoding: UTF-8 string: '{"data":{"id":"c850935f-15fc-4e5b-8903-d68066c5343a","type":"workflows","attributes":{"createdAt":"2025-05-26T17:23:43.255617Z","description":"A - sample workflow.","name":"Example Workflow","published":true,"spec":{"triggers":[{"startStepNames":["Step1"],"monitorTrigger":{"rateLimit":{"count":1,"interval":"3600s"}}},{"startStepNames":["Step1"],"githubWebhookTrigger":{}}],"steps":[{"name":"Step1","actionId":"com.datadoghq.dd.monitor.listMonitors","connectionLabel":"INTEGRATION_DATADOG","parameters":[{"name":"tags","value":"service:monitoring"}],"outboundEdges":[{"nextStepName":"Step2","branchName":"main"}]},{"name":"Step2","actionId":"com.datadoghq.core.noop"}],"connectionEnvs":[{"env":"default","connections":[{"connectionId":"11111111-1111-1111-1111-111111111111","label":"INTEGRATION_DATADOG"}]}],"inputSchema":{"parameters":[{"name":"input","type":"STRING","defaultValue":"default"}]},"outputSchema":{"parameters":[{"name":"output","type":"ARRAY_OBJECT","value":"outputValue"}]}},"tags":["foo:bar","service:monitoring","team:infra"],"updatedAt":"2025-05-26T17:23:43.255617Z"},"relationships":{"creator":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"owner":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + sample workflow.","name":"Example Workflow","published":true,"spec":{"triggers":[{"startStepNames":["Step1"],"monitorTrigger":{"rateLimit":{"count":1,"interval":"3600s"}}},{"startStepNames":["Step1"],"githubWebhookTrigger":{}}],"steps":[{"name":"Step1","actionId":"com.datadoghq.dd.monitor.listMonitors","connectionLabel":"INTEGRATION_DATADOG","parameters":[{"name":"tags","value":"service:monitoring"}],"outboundEdges":[{"nextStepName":"Step2","branchName":"main"}]},{"name":"Step2","actionId":"com.datadoghq.core.noop"}],"connectionEnvs":[{"env":"default","connections":[{"connectionId":"e1e64943-c7c5-4487-aece-25aaec7d3aad","label":"INTEGRATION_DATADOG"}]}],"inputSchema":{"parameters":[{"name":"input","type":"STRING","defaultValue":"default"}]},"outputSchema":{"parameters":[{"name":"output","type":"ARRAY_OBJECT","value":"outputValue"}]}},"tags":["foo:bar","service:monitoring","team:infra"],"updatedAt":"2025-05-26T17:23:43.255617Z"},"relationships":{"creator":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"owner":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' headers: Content-Type: - application/vnd.api+json diff --git a/cassettes/features/v2/workflow_automation/Update-an-existing-Workflow-returns-Not-found-response.yml b/cassettes/features/v2/workflow_automation/Update-an-existing-Workflow-returns-Not-found-response.yml index 91c16238003e..8477c861642f 100644 --- a/cassettes/features/v2/workflow_automation/Update-an-existing-Workflow-returns-Not-found-response.yml +++ b/cassettes/features/v2/workflow_automation/Update-an-existing-Workflow-returns-Not-found-response.yml @@ -4,7 +4,7 @@ http_interactions: body: encoding: UTF-8 string: '{"data":{"attributes":{"description":"A sample workflow.","name":"Example - Workflow","published":true,"spec":{"connectionEnvs":[{"connections":[{"connectionId":"11111111-1111-1111-1111-111111111111","label":"INTEGRATION_DATADOG"}],"env":"default"}],"inputSchema":{"parameters":[{"defaultValue":"default","name":"input","type":"STRING"}]},"outputSchema":{"parameters":[{"name":"output","type":"ARRAY_OBJECT","value":"outputValue"}]},"steps":[{"actionId":"com.datadoghq.dd.monitor.listMonitors","connectionLabel":"INTEGRATION_DATADOG","name":"Step1","outboundEdges":[{"branchName":"main","nextStepName":"Step2"}],"parameters":[{"name":"tags","value":"service:monitoring"}]},{"actionId":"com.datadoghq.core.noop","name":"Step2"}],"triggers":[{"monitorTrigger":{"rateLimit":{"count":1,"interval":"3600s"}},"startStepNames":["Step1"]},{"githubWebhookTrigger":{},"startStepNames":["Step1"]}]},"tags":["team:infra","service:monitoring","foo:bar"]},"id":"22222222-2222-2222-2222-222222222222","type":"workflows"}}' + Workflow","published":true,"spec":{"connectionEnvs":[{"connections":[{"connectionId":"e1e64943-c7c5-4487-aece-25aaec7d3aad","label":"INTEGRATION_DATADOG"}],"env":"default"}],"inputSchema":{"parameters":[{"defaultValue":"default","name":"input","type":"STRING"}]},"outputSchema":{"parameters":[{"name":"output","type":"ARRAY_OBJECT","value":"outputValue"}]},"steps":[{"actionId":"com.datadoghq.dd.monitor.listMonitors","connectionLabel":"INTEGRATION_DATADOG","name":"Step1","outboundEdges":[{"branchName":"main","nextStepName":"Step2"}],"parameters":[{"name":"tags","value":"service:monitoring"}]},{"actionId":"com.datadoghq.core.noop","name":"Step2"}],"triggers":[{"monitorTrigger":{"rateLimit":{"count":1,"interval":"3600s"}},"startStepNames":["Step1"]},{"githubWebhookTrigger":{},"startStepNames":["Step1"]}]},"tags":["team:infra","service:monitoring","foo:bar"]},"id":"22222222-2222-2222-2222-222222222222","type":"workflows"}}' headers: Accept: - application/json diff --git a/cassettes/features/v2/workflow_automation/Update-an-existing-Workflow-returns-Successfully-updated-a-workflow-response.yml b/cassettes/features/v2/workflow_automation/Update-an-existing-Workflow-returns-Successfully-updated-a-workflow-response.yml index 7f45e3feb8a1..5fcbf200063c 100644 --- a/cassettes/features/v2/workflow_automation/Update-an-existing-Workflow-returns-Successfully-updated-a-workflow-response.yml +++ b/cassettes/features/v2/workflow_automation/Update-an-existing-Workflow-returns-Successfully-updated-a-workflow-response.yml @@ -27,7 +27,7 @@ http_interactions: body: encoding: UTF-8 string: '{"data":{"attributes":{"description":"A sample workflow.","name":"Example - Workflow","published":true,"spec":{"connectionEnvs":[{"connections":[{"connectionId":"11111111-1111-1111-1111-111111111111","label":"INTEGRATION_DATADOG"}],"env":"default"}],"inputSchema":{"parameters":[{"defaultValue":"default","name":"input","type":"STRING"}]},"outputSchema":{"parameters":[{"name":"output","type":"ARRAY_OBJECT","value":"outputValue"}]},"steps":[{"actionId":"com.datadoghq.dd.monitor.listMonitors","connectionLabel":"INTEGRATION_DATADOG","name":"Step1","outboundEdges":[{"branchName":"main","nextStepName":"Step2"}],"parameters":[{"name":"tags","value":"service:monitoring"}]},{"actionId":"com.datadoghq.core.noop","name":"Step2"}],"triggers":[{"monitorTrigger":{"rateLimit":{"count":1,"interval":"3600s"}},"startStepNames":["Step1"]},{"githubWebhookTrigger":{},"startStepNames":["Step1"]}]},"tags":["team:infra","service:monitoring","foo:bar"]},"id":"22222222-2222-2222-2222-222222222222","type":"workflows"}}' + Workflow","published":true,"spec":{"connectionEnvs":[{"connections":[{"connectionId":"e1e64943-c7c5-4487-aece-25aaec7d3aad","label":"INTEGRATION_DATADOG"}],"env":"default"}],"inputSchema":{"parameters":[{"defaultValue":"default","name":"input","type":"STRING"}]},"outputSchema":{"parameters":[{"name":"output","type":"ARRAY_OBJECT","value":"outputValue"}]},"steps":[{"actionId":"com.datadoghq.dd.monitor.listMonitors","connectionLabel":"INTEGRATION_DATADOG","name":"Step1","outboundEdges":[{"branchName":"main","nextStepName":"Step2"}],"parameters":[{"name":"tags","value":"service:monitoring"}]},{"actionId":"com.datadoghq.core.noop","name":"Step2"}],"triggers":[{"monitorTrigger":{"rateLimit":{"count":1,"interval":"3600s"}},"startStepNames":["Step1"]},{"githubWebhookTrigger":{},"startStepNames":["Step1"]}]},"tags":["team:infra","service:monitoring","foo:bar"]},"id":"22222222-2222-2222-2222-222222222222","type":"workflows"}}' headers: Accept: - application/json @@ -39,7 +39,7 @@ http_interactions: body: encoding: UTF-8 string: '{"data":{"id":"a08f59a2-97d7-484e-8dda-b5abbb003869","type":"workflows","attributes":{"createdAt":"2025-05-26T17:23:45.112536Z","description":"A - sample workflow.","name":"Example Workflow","published":true,"spec":{"triggers":[{"startStepNames":["Step1"],"monitorTrigger":{"rateLimit":{"count":1,"interval":"3600s"}}},{"startStepNames":["Step1"],"githubWebhookTrigger":{}}],"steps":[{"name":"Step1","actionId":"com.datadoghq.dd.monitor.listMonitors","connectionLabel":"INTEGRATION_DATADOG","parameters":[{"name":"tags","value":"service:monitoring"}],"outboundEdges":[{"nextStepName":"Step2","branchName":"main"}]},{"name":"Step2","actionId":"com.datadoghq.core.noop"}],"connectionEnvs":[{"env":"default","connections":[{"connectionId":"11111111-1111-1111-1111-111111111111","label":"INTEGRATION_DATADOG"}]}],"inputSchema":{"parameters":[{"name":"input","type":"STRING","defaultValue":"default"}]},"outputSchema":{"parameters":[{"name":"output","type":"ARRAY_OBJECT","value":"outputValue"}]}},"tags":["foo:bar","service:monitoring","team:infra"],"updatedAt":"2025-05-26T17:23:45.365681Z"},"relationships":{"creator":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"owner":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + sample workflow.","name":"Example Workflow","published":true,"spec":{"triggers":[{"startStepNames":["Step1"],"monitorTrigger":{"rateLimit":{"count":1,"interval":"3600s"}}},{"startStepNames":["Step1"],"githubWebhookTrigger":{}}],"steps":[{"name":"Step1","actionId":"com.datadoghq.dd.monitor.listMonitors","connectionLabel":"INTEGRATION_DATADOG","parameters":[{"name":"tags","value":"service:monitoring"}],"outboundEdges":[{"nextStepName":"Step2","branchName":"main"}]},{"name":"Step2","actionId":"com.datadoghq.core.noop"}],"connectionEnvs":[{"env":"default","connections":[{"connectionId":"e1e64943-c7c5-4487-aece-25aaec7d3aad","label":"INTEGRATION_DATADOG"}]}],"inputSchema":{"parameters":[{"name":"input","type":"STRING","defaultValue":"default"}]},"outputSchema":{"parameters":[{"name":"output","type":"ARRAY_OBJECT","value":"outputValue"}]}},"tags":["foo:bar","service:monitoring","team:infra"],"updatedAt":"2025-05-26T17:23:45.365681Z"},"relationships":{"creator":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"owner":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' headers: Content-Type: - application/vnd.api+json diff --git a/examples/v2/workflow-automation/CreateWorkflow.rb b/examples/v2/workflow-automation/CreateWorkflow.rb index 241dc41226d7..63a8407aa343 100644 --- a/examples/v2/workflow-automation/CreateWorkflow.rb +++ b/examples/v2/workflow-automation/CreateWorkflow.rb @@ -14,7 +14,7 @@ DatadogAPIClient::V2::ConnectionEnv.new({ connections: [ DatadogAPIClient::V2::Connection.new({ - connection_id: "11111111-1111-1111-1111-111111111111", + connection_id: "e1e64943-c7c5-4487-aece-25aaec7d3aad", label: "INTEGRATION_DATADOG", }), ], diff --git a/examples/v2/workflow-automation/UpdateWorkflow.rb b/examples/v2/workflow-automation/UpdateWorkflow.rb index be789f845fd2..207330a717fb 100644 --- a/examples/v2/workflow-automation/UpdateWorkflow.rb +++ b/examples/v2/workflow-automation/UpdateWorkflow.rb @@ -17,7 +17,7 @@ DatadogAPIClient::V2::ConnectionEnv.new({ connections: [ DatadogAPIClient::V2::Connection.new({ - connection_id: "11111111-1111-1111-1111-111111111111", + connection_id: "e1e64943-c7c5-4487-aece-25aaec7d3aad", label: "INTEGRATION_DATADOG", }), ], diff --git a/features/v2/workflow_automation.feature b/features/v2/workflow_automation.feature index 96b0adf4e22b..a3df6e14b0a8 100644 --- a/features/v2/workflow_automation.feature +++ b/features/v2/workflow_automation.feature @@ -47,7 +47,7 @@ Feature: Workflow Automation @team:DataDog/workflow-automation-dev Scenario: Create a Workflow returns "Successfully created a workflow." response Given new "CreateWorkflow" request - And body with value {"data": {"attributes": {"description": "A sample workflow.", "name": "Example Workflow", "published": true, "spec": {"connectionEnvs": [{"connections": [{"connectionId": "11111111-1111-1111-1111-111111111111", "label": "INTEGRATION_DATADOG"}], "env": "default"}], "inputSchema": {"parameters": [{"defaultValue": "default", "name": "input", "type": "STRING"}]}, "outputSchema": {"parameters": [{"name": "output", "type": "ARRAY_OBJECT", "value": "outputValue"}]}, "steps": [{"actionId": "com.datadoghq.dd.monitor.listMonitors", "connectionLabel": "INTEGRATION_DATADOG", "name": "Step1", "outboundEdges": [{"branchName": "main", "nextStepName": "Step2"}], "parameters": [{"name": "tags", "value": "service:monitoring"}]}, {"actionId": "com.datadoghq.core.noop", "name": "Step2"}], "triggers": [{"monitorTrigger": {"rateLimit": {"count": 1, "interval": "3600s"}}, "startStepNames": ["Step1"]}, {"startStepNames": ["Step1"], "githubWebhookTrigger": {}}]}, "tags": ["team:infra", "service:monitoring", "foo:bar"]}, "type": "workflows"}} + And body with value {"data": {"attributes": {"description": "A sample workflow.", "name": "Example Workflow", "published": true, "spec": {"connectionEnvs": [{"connections": [{"connectionId": "e1e64943-c7c5-4487-aece-25aaec7d3aad", "label": "INTEGRATION_DATADOG"}], "env": "default"}], "inputSchema": {"parameters": [{"defaultValue": "default", "name": "input", "type": "STRING"}]}, "outputSchema": {"parameters": [{"name": "output", "type": "ARRAY_OBJECT", "value": "outputValue"}]}, "steps": [{"actionId": "com.datadoghq.dd.monitor.listMonitors", "connectionLabel": "INTEGRATION_DATADOG", "name": "Step1", "outboundEdges": [{"branchName": "main", "nextStepName": "Step2"}], "parameters": [{"name": "tags", "value": "service:monitoring"}]}, {"actionId": "com.datadoghq.core.noop", "name": "Step2"}], "triggers": [{"monitorTrigger": {"rateLimit": {"count": 1, "interval": "3600s"}}, "startStepNames": ["Step1"]}, {"startStepNames": ["Step1"], "githubWebhookTrigger": {}}]}, "tags": ["team:infra", "service:monitoring", "foo:bar"]}, "type": "workflows"}} When the request is sent Then the response status is 201 Successfully created a workflow. @@ -177,7 +177,7 @@ Feature: Workflow Automation Scenario: Update an existing Workflow returns "Not found" response Given new "UpdateWorkflow" request And request contains "workflow_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" - And body with value {"data": {"attributes": {"description": "A sample workflow.", "name": "Example Workflow", "published": true, "spec": {"connectionEnvs": [{"connections": [{"connectionId": "11111111-1111-1111-1111-111111111111", "label": "INTEGRATION_DATADOG"}], "env": "default"}], "inputSchema": {"parameters": [{"defaultValue": "default", "name": "input", "type": "STRING"}]}, "outputSchema": {"parameters": [{"name": "output", "type": "ARRAY_OBJECT", "value": "outputValue"}]}, "steps": [{"actionId": "com.datadoghq.dd.monitor.listMonitors", "connectionLabel": "INTEGRATION_DATADOG", "name": "Step1", "outboundEdges": [{"branchName": "main", "nextStepName": "Step2"}], "parameters": [{"name": "tags", "value": "service:monitoring"}]}, {"actionId": "com.datadoghq.core.noop", "name": "Step2"}], "triggers": [{"monitorTrigger": {"rateLimit": {"count": 1, "interval": "3600s"}}, "startStepNames": ["Step1"]}, {"startStepNames": ["Step1"], "githubWebhookTrigger": {}}]}, "tags": ["team:infra", "service:monitoring", "foo:bar"]}, "id": "22222222-2222-2222-2222-222222222222", "type": "workflows"}} + And body with value {"data": {"attributes": {"description": "A sample workflow.", "name": "Example Workflow", "published": true, "spec": {"connectionEnvs": [{"connections": [{"connectionId": "e1e64943-c7c5-4487-aece-25aaec7d3aad", "label": "INTEGRATION_DATADOG"}], "env": "default"}], "inputSchema": {"parameters": [{"defaultValue": "default", "name": "input", "type": "STRING"}]}, "outputSchema": {"parameters": [{"name": "output", "type": "ARRAY_OBJECT", "value": "outputValue"}]}, "steps": [{"actionId": "com.datadoghq.dd.monitor.listMonitors", "connectionLabel": "INTEGRATION_DATADOG", "name": "Step1", "outboundEdges": [{"branchName": "main", "nextStepName": "Step2"}], "parameters": [{"name": "tags", "value": "service:monitoring"}]}, {"actionId": "com.datadoghq.core.noop", "name": "Step2"}], "triggers": [{"monitorTrigger": {"rateLimit": {"count": 1, "interval": "3600s"}}, "startStepNames": ["Step1"]}, {"startStepNames": ["Step1"], "githubWebhookTrigger": {}}]}, "tags": ["team:infra", "service:monitoring", "foo:bar"]}, "id": "22222222-2222-2222-2222-222222222222", "type": "workflows"}} When the request is sent Then the response status is 404 Not found @@ -186,6 +186,6 @@ Feature: Workflow Automation Given there is a valid "workflow" in the system And new "UpdateWorkflow" request And request contains "workflow_id" parameter from "workflow.data.id" - And body with value {"data": {"attributes": {"description": "A sample workflow.", "name": "Example Workflow", "published": true, "spec": {"connectionEnvs": [{"connections": [{"connectionId": "11111111-1111-1111-1111-111111111111", "label": "INTEGRATION_DATADOG"}], "env": "default"}], "inputSchema": {"parameters": [{"defaultValue": "default", "name": "input", "type": "STRING"}]}, "outputSchema": {"parameters": [{"name": "output", "type": "ARRAY_OBJECT", "value": "outputValue"}]}, "steps": [{"actionId": "com.datadoghq.dd.monitor.listMonitors", "connectionLabel": "INTEGRATION_DATADOG", "name": "Step1", "outboundEdges": [{"branchName": "main", "nextStepName": "Step2"}], "parameters": [{"name": "tags", "value": "service:monitoring"}]}, {"actionId": "com.datadoghq.core.noop", "name": "Step2"}], "triggers": [{"monitorTrigger": {"rateLimit": {"count": 1, "interval": "3600s"}}, "startStepNames": ["Step1"]}, {"startStepNames": ["Step1"], "githubWebhookTrigger": {}}]}, "tags": ["team:infra", "service:monitoring", "foo:bar"]}, "id": "22222222-2222-2222-2222-222222222222", "type": "workflows"}} + And body with value {"data": {"attributes": {"description": "A sample workflow.", "name": "Example Workflow", "published": true, "spec": {"connectionEnvs": [{"connections": [{"connectionId": "e1e64943-c7c5-4487-aece-25aaec7d3aad", "label": "INTEGRATION_DATADOG"}], "env": "default"}], "inputSchema": {"parameters": [{"defaultValue": "default", "name": "input", "type": "STRING"}]}, "outputSchema": {"parameters": [{"name": "output", "type": "ARRAY_OBJECT", "value": "outputValue"}]}, "steps": [{"actionId": "com.datadoghq.dd.monitor.listMonitors", "connectionLabel": "INTEGRATION_DATADOG", "name": "Step1", "outboundEdges": [{"branchName": "main", "nextStepName": "Step2"}], "parameters": [{"name": "tags", "value": "service:monitoring"}]}, {"actionId": "com.datadoghq.core.noop", "name": "Step2"}], "triggers": [{"monitorTrigger": {"rateLimit": {"count": 1, "interval": "3600s"}}, "startStepNames": ["Step1"]}, {"startStepNames": ["Step1"], "githubWebhookTrigger": {}}]}, "tags": ["team:infra", "service:monitoring", "foo:bar"]}, "id": "22222222-2222-2222-2222-222222222222", "type": "workflows"}} When the request is sent Then the response status is 200 Successfully updated a workflow. From 99d0325c50cf17bbd2804f4e61c0e16beacf831e Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Wed, 24 Jun 2026 15:04:34 +0000 Subject: [PATCH 4/5] Regenerate client from commit 27b019f of spec repo (#3509) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 250 ++++++++++++++++++ .../DeleteCustomForecast.rb | 8 + .../UpsertCustomForecast.rb | 30 +++ features/scenarios_model_mapping.rb | 6 + features/v2/cloud_cost_management.feature | 48 ++++ features/v2/undo.json | 12 + lib/datadog_api_client/configuration.rb | 2 + lib/datadog_api_client/inflector.rb | 9 + .../v2/api/cloud_cost_management_api.rb | 145 ++++++++++ .../v2/models/custom_forecast_entry.rb | 167 ++++++++++++ .../custom_forecast_entry_tag_filter.rb | 144 ++++++++++ .../v2/models/custom_forecast_response.rb | 123 +++++++++ .../models/custom_forecast_response_data.rb | 165 ++++++++++++ ...ustom_forecast_response_data_attributes.rb | 230 ++++++++++++++++ .../v2/models/custom_forecast_type.rb | 26 ++ .../models/custom_forecast_upsert_request.rb | 123 +++++++++ .../custom_forecast_upsert_request_data.rb | 154 +++++++++++ ...forecast_upsert_request_data_attributes.rb | 147 ++++++++++ 18 files changed, 1789 insertions(+) create mode 100644 examples/v2/cloud-cost-management/DeleteCustomForecast.rb create mode 100644 examples/v2/cloud-cost-management/UpsertCustomForecast.rb create mode 100644 lib/datadog_api_client/v2/models/custom_forecast_entry.rb create mode 100644 lib/datadog_api_client/v2/models/custom_forecast_entry_tag_filter.rb create mode 100644 lib/datadog_api_client/v2/models/custom_forecast_response.rb create mode 100644 lib/datadog_api_client/v2/models/custom_forecast_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/custom_forecast_response_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/custom_forecast_type.rb create mode 100644 lib/datadog_api_client/v2/models/custom_forecast_upsert_request.rb create mode 100644 lib/datadog_api_client/v2/models/custom_forecast_upsert_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/custom_forecast_upsert_request_data_attributes.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index da74b2821596..6c1656eab6c8 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -27158,6 +27158,156 @@ components: $ref: "#/components/schemas/CustomDestinationResponseDefinition" type: array type: object + CustomForecastEntry: + description: A monthly entry of a custom budget forecast. + properties: + amount: + description: Forecast amount for the month. + example: 400 + format: double + type: number + month: + description: Month the custom forecast entry applies to, in `YYYYMM` format. + example: 202501 + format: int64 + type: integer + tag_filters: + description: Tag filters that scope this custom forecast entry to specific resources. + items: + $ref: "#/components/schemas/CustomForecastEntryTagFilter" + type: array + required: + - month + - amount + - tag_filters + type: object + CustomForecastEntryTagFilter: + description: A tag filter that scopes a custom forecast entry to specific resource tags. + properties: + tag_key: + description: The tag key to filter on. + example: service + type: string + tag_value: + description: The tag value to filter on. + example: ec2 + type: string + required: + - tag_key + - tag_value + type: object + CustomForecastResponse: + description: Response object containing the custom forecast for a budget. + properties: + data: + $ref: "#/components/schemas/CustomForecastResponseData" + required: + - data + type: object + CustomForecastResponseData: + description: Custom forecast resource wrapper in a response. + properties: + attributes: + $ref: "#/components/schemas/CustomForecastResponseDataAttributes" + id: + description: The unique identifier of the custom forecast. + example: 11111111-1111-1111-1111-111111111111 + type: string + type: + $ref: "#/components/schemas/CustomForecastType" + required: + - id + - type + - attributes + type: object + CustomForecastResponseDataAttributes: + description: Attributes of a custom forecast. + properties: + budget_uid: + description: The UUID of the budget that this custom forecast belongs to. + example: 00000000-0000-0000-0000-000000000001 + type: string + created_at: + description: Timestamp the custom forecast was created, in Unix milliseconds. + example: 1738258683590 + format: int64 + type: integer + created_by: + description: The id of the user that created the custom forecast. + example: 00000000-0a0a-0a0a-aaa0-00000000000a + type: string + entries: + description: Monthly custom forecast entries. + items: + $ref: "#/components/schemas/CustomForecastEntry" + type: array + updated_at: + description: Timestamp the custom forecast was last updated, in Unix milliseconds. + example: 1738258683590 + format: int64 + type: integer + updated_by: + description: The id of the user that last updated the custom forecast. + example: 00000000-0a0a-0a0a-aaa0-00000000000a + type: string + required: + - budget_uid + - created_at + - updated_at + - created_by + - updated_by + - entries + type: object + CustomForecastType: + default: custom_forecast + description: The type of the custom forecast resource. Must be `custom_forecast`. + enum: + - custom_forecast + example: custom_forecast + type: string + x-enum-varnames: + - CUSTOM_FORECAST + CustomForecastUpsertRequest: + description: Request body to upsert (create or replace) the custom forecast for a budget. + properties: + data: + $ref: "#/components/schemas/CustomForecastUpsertRequestData" + required: + - data + type: object + CustomForecastUpsertRequestData: + description: Custom forecast resource wrapper in an upsert request. + properties: + attributes: + $ref: "#/components/schemas/CustomForecastUpsertRequestDataAttributes" + id: + description: Unused on upsert; the resource is keyed by `budget_uid`. Send an empty string. + example: "" + type: string + type: + $ref: "#/components/schemas/CustomForecastType" + required: + - type + - attributes + type: object + CustomForecastUpsertRequestDataAttributes: + description: Attributes of a custom forecast upsert request. + properties: + budget_uid: + description: The UUID of the budget that this custom forecast belongs to. + example: 00000000-0000-0000-0000-000000000001 + type: string + entries: + description: |- + Monthly custom forecast entries. An empty list deletes any existing + custom forecast for the budget. + items: + $ref: "#/components/schemas/CustomForecastEntry" + type: array + required: + - budget_uid + - entries + type: object CustomFrameworkControl: description: Framework Control. properties: @@ -124191,6 +124341,82 @@ paths: summary: Validate CSV budget tags: - Cloud Cost Management + /api/v2/cost/budget/custom-forecast: + put: + description: |- + Create or replace the custom forecast for an existing budget. + Pass an empty `entries` list to delete the custom forecast for the budget. + operationId: UpsertCustomForecast + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + budget_uid: 00000000-0000-0000-0000-000000000001 + entries: + - amount: 400 + month: 202501 + tag_filters: + - tag_key: service + tag_value: ec2 + - amount: 450 + month: 202502 + tag_filters: + - tag_key: service + tag_value: ec2 + id: "" + type: custom_forecast + schema: + $ref: "#/components/schemas/CustomForecastUpsertRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + budget_uid: 00000000-0000-0000-0000-000000000001 + created_at: 1738258683590 + created_by: 00000000-0a0a-0a0a-aaa0-00000000000a + entries: + - amount: 400 + month: 202501 + tag_filters: + - tag_key: service + tag_value: ec2 + - amount: 450 + month: 202502 + tag_filters: + - tag_key: service + tag_value: ec2 + updated_at: 1738258683590 + updated_by: 00000000-0a0a-0a0a-aaa0-00000000000a + id: 11111111-1111-1111-1111-111111111111 + type: custom_forecast + schema: + $ref: "#/components/schemas/CustomForecastResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create or replace a budget's custom forecast + tags: + - Cloud Cost Management + 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/budget/validate: post: description: Validate a budget configuration without creating or modifying it @@ -124313,6 +124539,30 @@ paths: summary: Get budget tags: - Cloud Cost Management + /api/v2/cost/budget/{budget_id}/custom-forecast: + delete: + description: Delete the custom forecast for a budget. + operationId: DeleteCustomForecast + parameters: + - $ref: "#/components/parameters/BudgetID" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequestResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete a budget's custom forecast + tags: + - Cloud Cost Management + 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/budgets: get: description: List budgets. diff --git a/examples/v2/cloud-cost-management/DeleteCustomForecast.rb b/examples/v2/cloud-cost-management/DeleteCustomForecast.rb new file mode 100644 index 000000000000..6c6afafc8e63 --- /dev/null +++ b/examples/v2/cloud-cost-management/DeleteCustomForecast.rb @@ -0,0 +1,8 @@ +# Delete a budget's custom forecast returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_custom_forecast".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +api_instance.delete_custom_forecast("budget_id") diff --git a/examples/v2/cloud-cost-management/UpsertCustomForecast.rb b/examples/v2/cloud-cost-management/UpsertCustomForecast.rb new file mode 100644 index 000000000000..a7887bcf1f09 --- /dev/null +++ b/examples/v2/cloud-cost-management/UpsertCustomForecast.rb @@ -0,0 +1,30 @@ +# Create or replace a budget's custom forecast returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.upsert_custom_forecast".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new + +body = DatadogAPIClient::V2::CustomForecastUpsertRequest.new({ + data: DatadogAPIClient::V2::CustomForecastUpsertRequestData.new({ + attributes: DatadogAPIClient::V2::CustomForecastUpsertRequestDataAttributes.new({ + budget_uid: "00000000-0000-0000-0000-000000000001", + entries: [ + DatadogAPIClient::V2::CustomForecastEntry.new({ + amount: 400, + month: 202501, + tag_filters: [ + DatadogAPIClient::V2::CustomForecastEntryTagFilter.new({ + tag_key: "service", + tag_value: "ec2", + }), + ], + }), + ], + }), + id: "", + type: DatadogAPIClient::V2::CustomForecastType::CUSTOM_FORECAST, + }), +}) +p api_instance.upsert_custom_forecast(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 2182ae397869..daadeda87205 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2699,6 +2699,9 @@ "v2.UpsertBudget" => { "body" => "BudgetWithEntries", }, + "v2.UpsertCustomForecast" => { + "body" => "CustomForecastUpsertRequest", + }, "v2.ValidateBudget" => { "body" => "BudgetValidationRequest", }, @@ -2708,6 +2711,9 @@ "v2.GetBudget" => { "budget_id" => "String", }, + "v2.DeleteCustomForecast" => { + "budget_id" => "String", + }, "v2.GetCommitmentsCommitmentList" => { "provider" => "CommitmentsProvider", "product" => "String", diff --git a/features/v2/cloud_cost_management.feature b/features/v2/cloud_cost_management.feature index 535fe88d7c7b..d9434ef40755 100644 --- a/features/v2/cloud_cost_management.feature +++ b/features/v2/cloud_cost_management.feature @@ -67,6 +67,30 @@ Feature: Cloud Cost Management And the response "data.type" is equal to "arbitrary_rule" And the response "data.attributes.rule_name" is equal to "example-arbitrary-cost-rule" + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Create or replace a budget's custom forecast returns "Bad Request" response + Given operation "UpsertCustomForecast" enabled + And new "UpsertCustomForecast" request + And body with value {"data": {"attributes": {"budget_uid": "00000000-0000-0000-0000-000000000001", "entries": [{"amount": 400, "month": 202501, "tag_filters": [{"tag_key": "service", "tag_value": "ec2"}]}]}, "id": "", "type": "custom_forecast"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Create or replace a budget's custom forecast returns "Not Found" response + Given operation "UpsertCustomForecast" enabled + And new "UpsertCustomForecast" request + And body with value {"data": {"attributes": {"budget_uid": "00000000-0000-0000-0000-000000000001", "entries": [{"amount": 400, "month": 202501, "tag_filters": [{"tag_key": "service", "tag_value": "ec2"}]}]}, "id": "", "type": "custom_forecast"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Create or replace a budget's custom forecast returns "OK" response + Given operation "UpsertCustomForecast" enabled + And new "UpsertCustomForecast" request + And body with value {"data": {"attributes": {"budget_uid": "00000000-0000-0000-0000-000000000001", "entries": [{"amount": 400, "month": 202501, "tag_filters": [{"tag_key": "service", "tag_value": "ec2"}]}]}, "id": "", "type": "custom_forecast"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management Scenario: Create or update a budget returns "Bad Request" response Given new "UpsertBudget" request @@ -211,6 +235,30 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 400 Bad Request + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Delete a budget's custom forecast returns "Bad Request" response + Given operation "DeleteCustomForecast" enabled + And new "DeleteCustomForecast" request + And request contains "budget_id" 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: Delete a budget's custom forecast returns "No Content" response + Given operation "DeleteCustomForecast" enabled + And new "DeleteCustomForecast" request + And request contains "budget_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Delete a budget's custom forecast returns "Not Found" response + Given operation "DeleteCustomForecast" enabled + And new "DeleteCustomForecast" request + And request contains "budget_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/cloud-cost-management Scenario: Delete budget returns "No Content" response Given new "DeleteBudget" request diff --git a/features/v2/undo.json b/features/v2/undo.json index b0dab3582baa..ae9e01d109a0 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1755,6 +1755,12 @@ "type": "safe" } }, + "UpsertCustomForecast": { + "tag": "Cloud Cost Management", + "undo": { + "type": "idempotent" + } + }, "ValidateBudget": { "tag": "Cloud Cost Management", "undo": { @@ -1773,6 +1779,12 @@ "type": "safe" } }, + "DeleteCustomForecast": { + "tag": "Cloud Cost Management", + "undo": { + "type": "idempotent" + } + }, "ListBudgets": { "tag": "Cloud Cost Management", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index c21dc889eb38..16ab9c7e5254 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -417,6 +417,7 @@ def initialize "v2.get_code_coverage_branch_summary": false, "v2.get_code_coverage_commit_summary": false, "v2.get_rule_based_view": false, + "v2.delete_custom_forecast": false, "v2.get_commitments_commitment_list": false, "v2.get_commitments_coverage_scalar": false, "v2.get_commitments_coverage_timeseries": false, @@ -434,6 +435,7 @@ def initialize "v2.list_cost_tag_metadata_months": false, "v2.list_cost_tag_metadata_orchestrators": false, "v2.search_cost_recommendations": false, + "v2.upsert_custom_forecast": false, "v2.create_ownership_feedback": false, "v2.get_ownership_evidence": false, "v2.get_ownership_inference": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 76a1b3ee9f13..140c5f1bc37f 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2644,6 +2644,15 @@ def overrides "v2.customer_org_disable_response_type" => "CustomerOrgDisableResponseType", "v2.customer_org_disable_status" => "CustomerOrgDisableStatus", "v2.customer_org_disable_type" => "CustomerOrgDisableType", + "v2.custom_forecast_entry" => "CustomForecastEntry", + "v2.custom_forecast_entry_tag_filter" => "CustomForecastEntryTagFilter", + "v2.custom_forecast_response" => "CustomForecastResponse", + "v2.custom_forecast_response_data" => "CustomForecastResponseData", + "v2.custom_forecast_response_data_attributes" => "CustomForecastResponseDataAttributes", + "v2.custom_forecast_type" => "CustomForecastType", + "v2.custom_forecast_upsert_request" => "CustomForecastUpsertRequest", + "v2.custom_forecast_upsert_request_data" => "CustomForecastUpsertRequestData", + "v2.custom_forecast_upsert_request_data_attributes" => "CustomForecastUpsertRequestDataAttributes", "v2.custom_framework_control" => "CustomFrameworkControl", "v2.custom_framework_data" => "CustomFrameworkData", "v2.custom_framework_data_attributes" => "CustomFrameworkDataAttributes", 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 f08216a7ad1b..3d33df0c58dc 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 @@ -827,6 +827,77 @@ def delete_custom_costs_file_with_http_info(file_id, opts = {}) return data, status_code, headers end + # Delete a budget's custom forecast. + # + # @see #delete_custom_forecast_with_http_info + def delete_custom_forecast(budget_id, opts = {}) + delete_custom_forecast_with_http_info(budget_id, opts) + nil + end + + # Delete a budget's custom forecast. + # + # Delete the custom forecast for a budget. + # + # @param budget_id [String] Budget id. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_custom_forecast_with_http_info(budget_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_custom_forecast".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_custom_forecast") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_custom_forecast")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.delete_custom_forecast ...' + end + # verify the required parameter 'budget_id' is set + if @api_client.config.client_side_validation && budget_id.nil? + fail ArgumentError, "Missing the required parameter 'budget_id' when calling CloudCostManagementAPI.delete_custom_forecast" + end + # resource path + local_var_path = '/api/v2/cost/budget/{budget_id}/custom-forecast'.sub('{budget_id}', CGI.escape(budget_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_custom_forecast, + :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::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CloudCostManagementAPI#delete_custom_forecast\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete tag pipeline ruleset. # # @see #delete_tag_pipelines_ruleset_with_http_info @@ -4570,6 +4641,80 @@ def upsert_cost_tag_description_by_key_with_http_info(tag_key, body, opts = {}) return data, status_code, headers end + # Create or replace a budget's custom forecast. + # + # @see #upsert_custom_forecast_with_http_info + def upsert_custom_forecast(body, opts = {}) + data, _status_code, _headers = upsert_custom_forecast_with_http_info(body, opts) + data + end + + # Create or replace a budget's custom forecast. + # + # Create or replace the custom forecast for an existing budget. + # Pass an empty `entries` list to delete the custom forecast for the budget. + # + # @param body [CustomForecastUpsertRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(CustomForecastResponse, Integer, Hash)>] CustomForecastResponse data, response status code and response headers + def upsert_custom_forecast_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.upsert_custom_forecast".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.upsert_custom_forecast") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.upsert_custom_forecast")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.upsert_custom_forecast ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.upsert_custom_forecast" + end + # resource path + local_var_path = '/api/v2/cost/budget/custom-forecast' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'CustomForecastResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :upsert_custom_forecast, + :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::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CloudCostManagementAPI#upsert_custom_forecast\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Validate budget. # # @see #validate_budget_with_http_info diff --git a/lib/datadog_api_client/v2/models/custom_forecast_entry.rb b/lib/datadog_api_client/v2/models/custom_forecast_entry.rb new file mode 100644 index 000000000000..19937a4496a5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/custom_forecast_entry.rb @@ -0,0 +1,167 @@ +=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 monthly entry of a custom budget forecast. + class CustomForecastEntry + include BaseGenericModel + + # Forecast amount for the month. + attr_reader :amount + + # Month the custom forecast entry applies to, in `YYYYMM` format. + attr_reader :month + + # Tag filters that scope this custom forecast entry to specific resources. + attr_reader :tag_filters + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'amount' => :'amount', + :'month' => :'month', + :'tag_filters' => :'tag_filters' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'amount' => :'Float', + :'month' => :'Integer', + :'tag_filters' => :'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::CustomForecastEntry` 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?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'month') + self.month = attributes[:'month'] + end + + if attributes.key?(:'tag_filters') + if (value = attributes[:'tag_filters']).is_a?(Array) + self.tag_filters = 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 @amount.nil? + return false if @month.nil? + return false if @tag_filters.nil? + true + end + + # Custom attribute writer method with validation + # @param amount [Object] Object to be assigned + # @!visibility private + def amount=(amount) + if amount.nil? + fail ArgumentError, 'invalid value for "amount", amount cannot be nil.' + end + @amount = amount + end + + # Custom attribute writer method with validation + # @param month [Object] Object to be assigned + # @!visibility private + def month=(month) + if month.nil? + fail ArgumentError, 'invalid value for "month", month cannot be nil.' + end + @month = month + end + + # Custom attribute writer method with validation + # @param tag_filters [Object] Object to be assigned + # @!visibility private + def tag_filters=(tag_filters) + if tag_filters.nil? + fail ArgumentError, 'invalid value for "tag_filters", tag_filters cannot be nil.' + end + @tag_filters = tag_filters + 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 && + amount == o.amount && + month == o.month && + tag_filters == o.tag_filters && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [amount, month, tag_filters, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/custom_forecast_entry_tag_filter.rb b/lib/datadog_api_client/v2/models/custom_forecast_entry_tag_filter.rb new file mode 100644 index 000000000000..22aed87de7c7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/custom_forecast_entry_tag_filter.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 tag filter that scopes a custom forecast entry to specific resource tags. + class CustomForecastEntryTagFilter + include BaseGenericModel + + # The tag key to filter on. + attr_reader :tag_key + + # The tag value to filter on. + attr_reader :tag_value + + 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_value' => :'tag_value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'tag_key' => :'String', + :'tag_value' => :'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::CustomForecastEntryTagFilter` 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_value') + self.tag_value = attributes[:'tag_value'] + 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_value.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_value [Object] Object to be assigned + # @!visibility private + def tag_value=(tag_value) + if tag_value.nil? + fail ArgumentError, 'invalid value for "tag_value", tag_value cannot be nil.' + end + @tag_value = tag_value + 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_value == o.tag_value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [tag_key, tag_value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/custom_forecast_response.rb b/lib/datadog_api_client/v2/models/custom_forecast_response.rb new file mode 100644 index 000000000000..be7489467c40 --- /dev/null +++ b/lib/datadog_api_client/v2/models/custom_forecast_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response object containing the custom forecast for a budget. + class CustomForecastResponse + include BaseGenericModel + + # Custom forecast resource wrapper in a response. + 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' => :'CustomForecastResponseData' + } + 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::CustomForecastResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/custom_forecast_response_data.rb b/lib/datadog_api_client/v2/models/custom_forecast_response_data.rb new file mode 100644 index 000000000000..bc7e53925328 --- /dev/null +++ b/lib/datadog_api_client/v2/models/custom_forecast_response_data.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 + # Custom forecast resource wrapper in a response. + class CustomForecastResponseData + include BaseGenericModel + + # Attributes of a custom forecast. + attr_reader :attributes + + # The unique identifier of the custom forecast. + attr_reader :id + + # The type of the custom forecast resource. Must be `custom_forecast`. + 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' => :'CustomForecastResponseDataAttributes', + :'id' => :'String', + :'type' => :'CustomForecastType' + } + 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::CustomForecastResponseData` 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/custom_forecast_response_data_attributes.rb b/lib/datadog_api_client/v2/models/custom_forecast_response_data_attributes.rb new file mode 100644 index 000000000000..82cbb642ac11 --- /dev/null +++ b/lib/datadog_api_client/v2/models/custom_forecast_response_data_attributes.rb @@ -0,0 +1,230 @@ +=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 custom forecast. + class CustomForecastResponseDataAttributes + include BaseGenericModel + + # The UUID of the budget that this custom forecast belongs to. + attr_reader :budget_uid + + # Timestamp the custom forecast was created, in Unix milliseconds. + attr_reader :created_at + + # The id of the user that created the custom forecast. + attr_reader :created_by + + # Monthly custom forecast entries. + attr_reader :entries + + # Timestamp the custom forecast was last updated, in Unix milliseconds. + attr_reader :updated_at + + # The id of the user that last updated the custom forecast. + attr_reader :updated_by + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'budget_uid' => :'budget_uid', + :'created_at' => :'created_at', + :'created_by' => :'created_by', + :'entries' => :'entries', + :'updated_at' => :'updated_at', + :'updated_by' => :'updated_by' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'budget_uid' => :'String', + :'created_at' => :'Integer', + :'created_by' => :'String', + :'entries' => :'Array', + :'updated_at' => :'Integer', + :'updated_by' => :'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::CustomForecastResponseDataAttributes` 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?(:'budget_uid') + self.budget_uid = attributes[:'budget_uid'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'entries') + if (value = attributes[:'entries']).is_a?(Array) + self.entries = value + end + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'updated_by') + self.updated_by = attributes[:'updated_by'] + 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 @budget_uid.nil? + return false if @created_at.nil? + return false if @created_by.nil? + return false if @entries.nil? + return false if @updated_at.nil? + return false if @updated_by.nil? + true + end + + # Custom attribute writer method with validation + # @param budget_uid [Object] Object to be assigned + # @!visibility private + def budget_uid=(budget_uid) + if budget_uid.nil? + fail ArgumentError, 'invalid value for "budget_uid", budget_uid cannot be nil.' + end + @budget_uid = budget_uid + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param created_by [Object] Object to be assigned + # @!visibility private + def created_by=(created_by) + if created_by.nil? + fail ArgumentError, 'invalid value for "created_by", created_by cannot be nil.' + end + @created_by = created_by + end + + # Custom attribute writer method with validation + # @param entries [Object] Object to be assigned + # @!visibility private + def entries=(entries) + if entries.nil? + fail ArgumentError, 'invalid value for "entries", entries cannot be nil.' + end + @entries = entries + end + + # Custom attribute writer method with validation + # @param updated_at [Object] Object to be assigned + # @!visibility private + def updated_at=(updated_at) + if updated_at.nil? + fail ArgumentError, 'invalid value for "updated_at", updated_at cannot be nil.' + end + @updated_at = updated_at + end + + # Custom attribute writer method with validation + # @param updated_by [Object] Object to be assigned + # @!visibility private + def updated_by=(updated_by) + if updated_by.nil? + fail ArgumentError, 'invalid value for "updated_by", updated_by cannot be nil.' + end + @updated_by = updated_by + 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 && + budget_uid == o.budget_uid && + created_at == o.created_at && + created_by == o.created_by && + entries == o.entries && + updated_at == o.updated_at && + updated_by == o.updated_by && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [budget_uid, created_at, created_by, entries, updated_at, updated_by, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/custom_forecast_type.rb b/lib/datadog_api_client/v2/models/custom_forecast_type.rb new file mode 100644 index 000000000000..ec2bd8355c66 --- /dev/null +++ b/lib/datadog_api_client/v2/models/custom_forecast_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of the custom forecast resource. Must be `custom_forecast`. + class CustomForecastType + include BaseEnumModel + + CUSTOM_FORECAST = "custom_forecast".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/custom_forecast_upsert_request.rb b/lib/datadog_api_client/v2/models/custom_forecast_upsert_request.rb new file mode 100644 index 000000000000..9fd34bafb842 --- /dev/null +++ b/lib/datadog_api_client/v2/models/custom_forecast_upsert_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body to upsert (create or replace) the custom forecast for a budget. + class CustomForecastUpsertRequest + include BaseGenericModel + + # Custom forecast resource wrapper in an upsert request. + 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' => :'CustomForecastUpsertRequestData' + } + 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::CustomForecastUpsertRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/custom_forecast_upsert_request_data.rb b/lib/datadog_api_client/v2/models/custom_forecast_upsert_request_data.rb new file mode 100644 index 000000000000..2e2780c7e350 --- /dev/null +++ b/lib/datadog_api_client/v2/models/custom_forecast_upsert_request_data.rb @@ -0,0 +1,154 @@ +=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 + # Custom forecast resource wrapper in an upsert request. + class CustomForecastUpsertRequestData + include BaseGenericModel + + # Attributes of a custom forecast upsert request. + attr_reader :attributes + + # Unused on upsert; the resource is keyed by `budget_uid`. Send an empty string. + attr_accessor :id + + # The type of the custom forecast resource. Must be `custom_forecast`. + 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' => :'CustomForecastUpsertRequestDataAttributes', + :'id' => :'String', + :'type' => :'CustomForecastType' + } + 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::CustomForecastUpsertRequestData` 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 @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + 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/custom_forecast_upsert_request_data_attributes.rb b/lib/datadog_api_client/v2/models/custom_forecast_upsert_request_data_attributes.rb new file mode 100644 index 000000000000..15a6fa52a575 --- /dev/null +++ b/lib/datadog_api_client/v2/models/custom_forecast_upsert_request_data_attributes.rb @@ -0,0 +1,147 @@ +=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 custom forecast upsert request. + class CustomForecastUpsertRequestDataAttributes + include BaseGenericModel + + # The UUID of the budget that this custom forecast belongs to. + attr_reader :budget_uid + + # Monthly custom forecast entries. An empty list deletes any existing + # custom forecast for the budget. + attr_reader :entries + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'budget_uid' => :'budget_uid', + :'entries' => :'entries' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'budget_uid' => :'String', + :'entries' => :'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::CustomForecastUpsertRequestDataAttributes` 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?(:'budget_uid') + self.budget_uid = attributes[:'budget_uid'] + end + + if attributes.key?(:'entries') + if (value = attributes[:'entries']).is_a?(Array) + self.entries = 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 @budget_uid.nil? + return false if @entries.nil? + true + end + + # Custom attribute writer method with validation + # @param budget_uid [Object] Object to be assigned + # @!visibility private + def budget_uid=(budget_uid) + if budget_uid.nil? + fail ArgumentError, 'invalid value for "budget_uid", budget_uid cannot be nil.' + end + @budget_uid = budget_uid + end + + # Custom attribute writer method with validation + # @param entries [Object] Object to be assigned + # @!visibility private + def entries=(entries) + if entries.nil? + fail ArgumentError, 'invalid value for "entries", entries cannot be nil.' + end + @entries = entries + 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 && + budget_uid == o.budget_uid && + entries == o.entries && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [budget_uid, entries, additional_properties].hash + end + end +end From 803fc7ba1f1fadba4db947acec79979c815f8771 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Wed, 24 Jun 2026 16:02:49 +0000 Subject: [PATCH 5/5] Regenerate client from commit 54c0c7c of spec repo (#3457) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 146 +++++++++++++++- .../v2/cloud-cost-management/UpsertBudget.rb | 14 ++ features/scenarios_model_mapping.rb | 4 + features/v2/cloud_cost_management.feature | 20 ++- lib/datadog_api_client/inflector.rb | 3 + .../v2/api/cloud_cost_management_api.rb | 10 +- .../v2/models/budget_attributes.rb | 42 ++++- .../v2/models/budget_attributes_costs.rb | 146 ++++++++++++++++ .../v2/models/budget_attributes_costs_unit.rb | 155 +++++++++++++++++ ...h_entries_data_attributes_entries_items.rb | 12 +- ...ies_data_attributes_entries_items_costs.rb | 157 ++++++++++++++++++ 11 files changed, 702 insertions(+), 7 deletions(-) create mode 100644 lib/datadog_api_client/v2/models/budget_attributes_costs.rb create mode 100644 lib/datadog_api_client/v2/models/budget_attributes_costs_unit.rb create mode 100644 lib/datadog_api_client/v2/models/budget_with_entries_data_attributes_entries_items_costs.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 6c1656eab6c8..052ba0331d32 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -13185,6 +13185,20 @@ components: BudgetAttributes: description: The attributes of a budget. properties: + costs: + $ref: "#/components/schemas/BudgetAttributesCosts" + description: Aggregated cost data for the budget. Present only when `actual=true` or `forecast=true` is requested. + costs_period_end: + description: The end of the period used to compute cost data, in milliseconds since epoch. + format: int64 + type: integer + costs_period_start: + description: The start of the period used to compute cost data, in milliseconds since epoch. + format: int64 + type: integer + costs_unit: + $ref: "#/components/schemas/BudgetAttributesCostsUnit" + description: The unit used for all cost values in the response. created_at: description: The timestamp when the budget was created. example: 1738258683590 @@ -13237,6 +13251,53 @@ components: example: 00000000-0a0a-0a0a-aaa0-00000000000a type: string type: object + BudgetAttributesCosts: + description: Aggregated cost data for the budget over the requested period. + properties: + actual: + description: The total actual cost. Present only when `actual=true` is requested. + format: double + nullable: true + type: number + amount: + description: The total budgeted amount over the requested period. + format: double + nullable: true + type: number + forecast: + description: The total forecast cost, with any custom forecast overrides applied. Present only when `forecast=true` is requested. + format: double + nullable: true + type: number + ootb_forecast: + description: The out-of-the-box ML forecast before custom overrides. Present only when `forecast=true` is requested. + format: double + nullable: true + type: number + type: object + BudgetAttributesCostsUnit: + description: The unit used for all cost values in the response. + properties: + family: + description: The unit family (for example, `currency`). + type: string + id: + description: The unique identifier for the unit. + type: string + name: + description: The full name of the unit. + type: string + plural: + description: The plural form of the unit name. + type: string + scale_factor: + description: The scale factor applied to raw cost values. + format: double + type: number + short_name: + description: The abbreviated unit name. + type: string + type: object BudgetValidationRequest: description: The request object for validating a budget configuration before creating or updating it. example: @@ -13402,6 +13463,9 @@ components: description: The budgeted amount for this entry. format: double type: number + costs: + $ref: "#/components/schemas/BudgetWithEntriesDataAttributesEntriesItemsCosts" + description: Cost data for this entry. Present only when `actual=true` or `forecast=true` is requested. month: description: The month this budget entry applies to, in YYYYMM format. format: int64 @@ -13412,6 +13476,36 @@ components: $ref: "#/components/schemas/BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems" type: array type: object + BudgetWithEntriesDataAttributesEntriesItemsCosts: + description: Cost data for a single budget entry. + properties: + actual: + description: The actual cost for this entry. Present only when `actual=true` is requested. + format: double + nullable: true + type: number + amount: + description: The budgeted amount for this entry. + format: double + nullable: true + type: number + custom_forecast: + description: |- + The custom forecast override for this entry. `null` when `forecast=true` is requested but no custom forecast has been set for this entry's month. A numeric value, including `0`, indicates an explicit custom forecast override. Omitted when `forecast=false` or the feature is not available for the organization. + format: double + nullable: true + type: number + forecast: + description: The final forecast for this entry, with any custom forecast override applied. Present only when `forecast=true` is requested. + format: double + nullable: true + type: number + ootb_forecast: + description: The out-of-the-box ML forecast for this entry, before custom overrides. Present only when `forecast=true` is requested. + format: double + nullable: true + type: number + type: object BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems: description: A tag filter used to scope a budget entry to specific resource tags. properties: @@ -124497,10 +124591,36 @@ paths: tags: - Cloud Cost Management get: - description: Get a budget + description: Get a budget by ID. Pass `actual=true` or `forecast=true` to include cost data in the response. Use `start` and `end` (millisecond epochs, both required) to set the cost window. When `forecast=true`, each entry also includes `ootb_forecast` (the ML forecast before overrides) and `custom_forecast` (`null` if no override is set, a number if one is). operationId: GetBudget parameters: - $ref: "#/components/parameters/BudgetID" + - description: When `true`, includes actual cost data in the response. + in: query + name: actual + required: false + schema: + type: boolean + - description: When `true`, includes forecast cost data in the response, including `ootb_forecast` and `custom_forecast` per entry. + in: query + name: forecast + required: false + schema: + type: boolean + - description: Start of the cost window in milliseconds since epoch. Must be used together with `end`. + in: query + name: start + required: false + schema: + format: int64 + type: integer + - description: End of the cost window in milliseconds since epoch. Must be used together with `start`. + in: query + name: end + required: false + schema: + format: int64 + type: integer responses: "200": content: @@ -124510,11 +124630,31 @@ paths: value: data: attributes: + costs: + actual: 850.25 + amount: 1000.0 + forecast: 1100.5 + ootb_forecast: 1100.5 + costs_period_end: 1740873600000 + costs_period_start: 1738281600000 + costs_unit: + family: currency + id: "1" + name: dollar + plural: dollars + scale_factor: 1.0 + short_name: $ created_at: 1738258683590 created_by: 00000000-0a0a-0a0a-aaa0-00000000000a end_month: 202502 entries: - amount: 500 + costs: + actual: 425.5 + amount: 500.0 + custom_forecast: + forecast: 550.25 + ootb_forecast: 550.25 month: 202501 tag_filters: - tag_key: service @@ -124531,6 +124671,10 @@ paths: schema: $ref: "#/components/schemas/BudgetWithEntries" description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" "429": $ref: "#/components/responses/TooManyRequestsResponse" security: diff --git a/examples/v2/cloud-cost-management/UpsertBudget.rb b/examples/v2/cloud-cost-management/UpsertBudget.rb index 3a8b26b52c74..9b780d27727c 100644 --- a/examples/v2/cloud-cost-management/UpsertBudget.rb +++ b/examples/v2/cloud-cost-management/UpsertBudget.rb @@ -6,11 +6,25 @@ body = DatadogAPIClient::V2::BudgetWithEntries.new({ data: DatadogAPIClient::V2::BudgetWithEntriesData.new({ attributes: DatadogAPIClient::V2::BudgetAttributes.new({ + costs: DatadogAPIClient::V2::BudgetAttributesCosts.new({ + actual: nil, + amount: nil, + forecast: nil, + ootb_forecast: nil, + }), + costs_unit: DatadogAPIClient::V2::BudgetAttributesCostsUnit.new({}), created_at: 1738258683590, created_by: "00000000-0a0a-0a0a-aaa0-00000000000a", end_month: 202502, entries: [ DatadogAPIClient::V2::BudgetWithEntriesDataAttributesEntriesItems.new({ + costs: DatadogAPIClient::V2::BudgetWithEntriesDataAttributesEntriesItemsCosts.new({ + actual: nil, + amount: nil, + custom_forecast: nil, + forecast: nil, + ootb_forecast: nil, + }), tag_filters: [ DatadogAPIClient::V2::BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems.new({}), ], diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index daadeda87205..84fd43510699 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2710,6 +2710,10 @@ }, "v2.GetBudget" => { "budget_id" => "String", + "actual" => "Boolean", + "forecast" => "Boolean", + "start" => "Integer", + "_end" => "Integer", }, "v2.DeleteCustomForecast" => { "budget_id" => "String", diff --git a/features/v2/cloud_cost_management.feature b/features/v2/cloud_cost_management.feature index d9434ef40755..258f3468a9f7 100644 --- a/features/v2/cloud_cost_management.feature +++ b/features/v2/cloud_cost_management.feature @@ -94,21 +94,21 @@ Feature: Cloud Cost Management @generated @skip @team:DataDog/cloud-cost-management Scenario: Create or update a budget returns "Bad Request" response Given new "UpsertBudget" request - And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"tag_filters": [{}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a", "type": ""}} + And body with value {"data": {"attributes": {"costs": {"actual": null, "amount": null, "forecast": null, "ootb_forecast": null}, "costs_unit": {}, "created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"costs": {"actual": null, "amount": null, "custom_forecast": null, "forecast": null, "ootb_forecast": null}, "tag_filters": [{}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a", "type": ""}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/cloud-cost-management Scenario: Create or update a budget returns "Not Found" response Given new "UpsertBudget" request - And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"tag_filters": [{}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a", "type": ""}} + And body with value {"data": {"attributes": {"costs": {"actual": null, "amount": null, "forecast": null, "ootb_forecast": null}, "costs_unit": {}, "created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"costs": {"actual": null, "amount": null, "custom_forecast": null, "forecast": null, "ootb_forecast": null}, "tag_filters": [{}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a", "type": ""}} When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/cloud-cost-management Scenario: Create or update a budget returns "OK" response Given new "UpsertBudget" request - And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"tag_filters": [{}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a", "type": ""}} + And body with value {"data": {"attributes": {"costs": {"actual": null, "amount": null, "forecast": null, "ootb_forecast": null}, "costs_unit": {}, "created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"costs": {"actual": null, "amount": null, "custom_forecast": null, "forecast": null, "ootb_forecast": null}, "tag_filters": [{}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a", "type": ""}} When the request is sent Then the response status is 200 OK @@ -384,6 +384,20 @@ Feature: Cloud Cost Management And the response "data.type" is equal to "ruleset" And the response "data.attributes.name" is equal to "EVP Cost Tags" + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get budget returns "Bad Request" response + Given new "GetBudget" request + And request contains "budget_id" 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 budget returns "Not Found" response + Given new "GetBudget" request + And request contains "budget_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/cloud-cost-management Scenario: Get budget returns "OK" response Given new "GetBudget" request diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 140c5f1bc37f..297ed03c28d9 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1782,6 +1782,8 @@ def overrides "v2.budget" => "Budget", "v2.budget_array" => "BudgetArray", "v2.budget_attributes" => "BudgetAttributes", + "v2.budget_attributes_costs" => "BudgetAttributesCosts", + "v2.budget_attributes_costs_unit" => "BudgetAttributesCostsUnit", "v2.budget_validation_request" => "BudgetValidationRequest", "v2.budget_validation_request_data" => "BudgetValidationRequestData", "v2.budget_validation_response" => "BudgetValidationResponse", @@ -1792,6 +1794,7 @@ def overrides "v2.budget_with_entries_data" => "BudgetWithEntriesData", "v2.budget_with_entries_data_attributes" => "BudgetWithEntriesDataAttributes", "v2.budget_with_entries_data_attributes_entries_items" => "BudgetWithEntriesDataAttributesEntriesItems", + "v2.budget_with_entries_data_attributes_entries_items_costs" => "BudgetWithEntriesDataAttributesEntriesItemsCosts", "v2.budget_with_entries_data_attributes_entries_items_tag_filters_items" => "BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems", "v2.budget_with_entries_data_type" => "BudgetWithEntriesDataType", "v2.bulk_delete_apps_datastore_items_request" => "BulkDeleteAppsDatastoreItemsRequest", 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 3d33df0c58dc..2bd7fc3c2de9 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 @@ -1038,10 +1038,14 @@ def get_budget(budget_id, opts = {}) # Get budget. # - # Get a budget + # Get a budget by ID. Pass `actual=true` or `forecast=true` to include cost data in the response. Use `start` and `end` (millisecond epochs, both required) to set the cost window. When `forecast=true`, each entry also includes `ootb_forecast` (the ML forecast before overrides) and `custom_forecast` (`null` if no override is set, a number if one is). # # @param budget_id [String] Budget id. # @param opts [Hash] the optional parameters + # @option opts [Boolean] :actual When `true`, includes actual cost data in the response. + # @option opts [Boolean] :forecast When `true`, includes forecast cost data in the response, including `ootb_forecast` and `custom_forecast` per entry. + # @option opts [Integer] :start Start of the cost window in milliseconds since epoch. Must be used together with `end`. + # @option opts [Integer] :_end End of the cost window in milliseconds since epoch. Must be used together with `start`. # @return [Array<(BudgetWithEntries, Integer, Hash)>] BudgetWithEntries data, response status code and response headers def get_budget_with_http_info(budget_id, opts = {}) @@ -1057,6 +1061,10 @@ def get_budget_with_http_info(budget_id, opts = {}) # query parameters query_params = opts[:query_params] || {} + query_params[:'actual'] = opts[:'actual'] if !opts[:'actual'].nil? + query_params[:'forecast'] = opts[:'forecast'] if !opts[:'forecast'].nil? + query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil? + query_params[:'end'] = opts[:'_end'] if !opts[:'_end'].nil? # header parameters header_params = opts[:header_params] || {} diff --git a/lib/datadog_api_client/v2/models/budget_attributes.rb b/lib/datadog_api_client/v2/models/budget_attributes.rb index 9c900f3f0fe9..35cd02a34d54 100644 --- a/lib/datadog_api_client/v2/models/budget_attributes.rb +++ b/lib/datadog_api_client/v2/models/budget_attributes.rb @@ -21,6 +21,18 @@ module DatadogAPIClient::V2 class BudgetAttributes include BaseGenericModel + # Aggregated cost data for the budget over the requested period. + attr_accessor :costs + + # The end of the period used to compute cost data, in milliseconds since epoch. + attr_accessor :costs_period_end + + # The start of the period used to compute cost data, in milliseconds since epoch. + attr_accessor :costs_period_start + + # The unit used for all cost values in the response. + attr_accessor :costs_unit + # The timestamp when the budget was created. attr_accessor :created_at @@ -60,6 +72,10 @@ class BudgetAttributes # @!visibility private def self.attribute_map { + :'costs' => :'costs', + :'costs_period_end' => :'costs_period_end', + :'costs_period_start' => :'costs_period_start', + :'costs_unit' => :'costs_unit', :'created_at' => :'created_at', :'created_by' => :'created_by', :'end_month' => :'end_month', @@ -78,6 +94,10 @@ def self.attribute_map # @!visibility private def self.openapi_types { + :'costs' => :'BudgetAttributesCosts', + :'costs_period_end' => :'Integer', + :'costs_period_start' => :'Integer', + :'costs_unit' => :'BudgetAttributesCostsUnit', :'created_at' => :'Integer', :'created_by' => :'String', :'end_month' => :'Integer', @@ -110,6 +130,22 @@ def initialize(attributes = {}) end } + if attributes.key?(:'costs') + self.costs = attributes[:'costs'] + end + + if attributes.key?(:'costs_period_end') + self.costs_period_end = attributes[:'costs_period_end'] + end + + if attributes.key?(:'costs_period_start') + self.costs_period_start = attributes[:'costs_period_start'] + end + + if attributes.key?(:'costs_unit') + self.costs_unit = attributes[:'costs_unit'] + end + if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] end @@ -183,6 +219,10 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && + costs == o.costs && + costs_period_end == o.costs_period_end && + costs_period_start == o.costs_period_start && + costs_unit == o.costs_unit && created_at == o.created_at && created_by == o.created_by && end_month == o.end_month && @@ -201,7 +241,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [created_at, created_by, end_month, entries, metrics_query, name, org_id, start_month, total_amount, updated_at, updated_by, additional_properties].hash + [costs, costs_period_end, costs_period_start, costs_unit, created_at, created_by, end_month, entries, metrics_query, name, org_id, start_month, total_amount, updated_at, updated_by, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/budget_attributes_costs.rb b/lib/datadog_api_client/v2/models/budget_attributes_costs.rb new file mode 100644 index 000000000000..8647145dc216 --- /dev/null +++ b/lib/datadog_api_client/v2/models/budget_attributes_costs.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 + # Aggregated cost data for the budget over the requested period. + class BudgetAttributesCosts + include BaseGenericModel + + # The total actual cost. Present only when `actual=true` is requested. + attr_accessor :actual + + # The total budgeted amount over the requested period. + attr_accessor :amount + + # The total forecast cost, with any custom forecast overrides applied. Present only when `forecast=true` is requested. + attr_accessor :forecast + + # The out-of-the-box ML forecast before custom overrides. Present only when `forecast=true` is requested. + attr_accessor :ootb_forecast + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'actual' => :'actual', + :'amount' => :'amount', + :'forecast' => :'forecast', + :'ootb_forecast' => :'ootb_forecast' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'actual' => :'Float', + :'amount' => :'Float', + :'forecast' => :'Float', + :'ootb_forecast' => :'Float' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'actual', + :'amount', + :'forecast', + :'ootb_forecast', + ]) + 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::BudgetAttributesCosts` 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?(:'actual') + self.actual = attributes[:'actual'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'forecast') + self.forecast = attributes[:'forecast'] + end + + if attributes.key?(:'ootb_forecast') + self.ootb_forecast = attributes[:'ootb_forecast'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + actual == o.actual && + amount == o.amount && + forecast == o.forecast && + ootb_forecast == o.ootb_forecast && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [actual, amount, forecast, ootb_forecast, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/budget_attributes_costs_unit.rb b/lib/datadog_api_client/v2/models/budget_attributes_costs_unit.rb new file mode 100644 index 000000000000..eba47212653a --- /dev/null +++ b/lib/datadog_api_client/v2/models/budget_attributes_costs_unit.rb @@ -0,0 +1,155 @@ +=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 unit used for all cost values in the response. + class BudgetAttributesCostsUnit + include BaseGenericModel + + # The unit family (for example, `currency`). + attr_accessor :family + + # The unique identifier for the unit. + attr_accessor :id + + # The full name of the unit. + attr_accessor :name + + # The plural form of the unit name. + attr_accessor :plural + + # The scale factor applied to raw cost values. + attr_accessor :scale_factor + + # The abbreviated unit name. + attr_accessor :short_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'family' => :'family', + :'id' => :'id', + :'name' => :'name', + :'plural' => :'plural', + :'scale_factor' => :'scale_factor', + :'short_name' => :'short_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'family' => :'String', + :'id' => :'String', + :'name' => :'String', + :'plural' => :'String', + :'scale_factor' => :'Float', + :'short_name' => :'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::BudgetAttributesCostsUnit` 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?(:'family') + self.family = attributes[:'family'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'plural') + self.plural = attributes[:'plural'] + end + + if attributes.key?(:'scale_factor') + self.scale_factor = attributes[:'scale_factor'] + end + + if attributes.key?(:'short_name') + self.short_name = attributes[:'short_name'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + family == o.family && + id == o.id && + name == o.name && + plural == o.plural && + scale_factor == o.scale_factor && + short_name == o.short_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [family, id, name, plural, scale_factor, short_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/budget_with_entries_data_attributes_entries_items.rb b/lib/datadog_api_client/v2/models/budget_with_entries_data_attributes_entries_items.rb index 40f85f31190e..2c2cdbbc17be 100644 --- a/lib/datadog_api_client/v2/models/budget_with_entries_data_attributes_entries_items.rb +++ b/lib/datadog_api_client/v2/models/budget_with_entries_data_attributes_entries_items.rb @@ -24,6 +24,9 @@ class BudgetWithEntriesDataAttributesEntriesItems # The budgeted amount for this entry. attr_accessor :amount + # Cost data for a single budget entry. + attr_accessor :costs + # The month this budget entry applies to, in YYYYMM format. attr_accessor :month @@ -37,6 +40,7 @@ class BudgetWithEntriesDataAttributesEntriesItems def self.attribute_map { :'amount' => :'amount', + :'costs' => :'costs', :'month' => :'month', :'tag_filters' => :'tag_filters' } @@ -47,6 +51,7 @@ def self.attribute_map def self.openapi_types { :'amount' => :'Float', + :'costs' => :'BudgetWithEntriesDataAttributesEntriesItemsCosts', :'month' => :'Integer', :'tag_filters' => :'Array' } @@ -74,6 +79,10 @@ def initialize(attributes = {}) self.amount = attributes[:'amount'] end + if attributes.key?(:'costs') + self.costs = attributes[:'costs'] + end + if attributes.key?(:'month') self.month = attributes[:'month'] end @@ -112,6 +121,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && amount == o.amount && + costs == o.costs && month == o.month && tag_filters == o.tag_filters && additional_properties == o.additional_properties @@ -121,7 +131,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [amount, month, tag_filters, additional_properties].hash + [amount, costs, month, tag_filters, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/budget_with_entries_data_attributes_entries_items_costs.rb b/lib/datadog_api_client/v2/models/budget_with_entries_data_attributes_entries_items_costs.rb new file mode 100644 index 000000000000..8cecd3750c3f --- /dev/null +++ b/lib/datadog_api_client/v2/models/budget_with_entries_data_attributes_entries_items_costs.rb @@ -0,0 +1,157 @@ +=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 + # Cost data for a single budget entry. + class BudgetWithEntriesDataAttributesEntriesItemsCosts + include BaseGenericModel + + # The actual cost for this entry. Present only when `actual=true` is requested. + attr_accessor :actual + + # The budgeted amount for this entry. + attr_accessor :amount + + # The custom forecast override for this entry. `null` when `forecast=true` is requested but no custom forecast has been set for this entry's month. A numeric value, including `0`, indicates an explicit custom forecast override. Omitted when `forecast=false` or the feature is not available for the organization. + attr_accessor :custom_forecast + + # The final forecast for this entry, with any custom forecast override applied. Present only when `forecast=true` is requested. + attr_accessor :forecast + + # The out-of-the-box ML forecast for this entry, before custom overrides. Present only when `forecast=true` is requested. + attr_accessor :ootb_forecast + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'actual' => :'actual', + :'amount' => :'amount', + :'custom_forecast' => :'custom_forecast', + :'forecast' => :'forecast', + :'ootb_forecast' => :'ootb_forecast' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'actual' => :'Float', + :'amount' => :'Float', + :'custom_forecast' => :'Float', + :'forecast' => :'Float', + :'ootb_forecast' => :'Float' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'actual', + :'amount', + :'custom_forecast', + :'forecast', + :'ootb_forecast', + ]) + 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::BudgetWithEntriesDataAttributesEntriesItemsCosts` 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?(:'actual') + self.actual = attributes[:'actual'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'custom_forecast') + self.custom_forecast = attributes[:'custom_forecast'] + end + + if attributes.key?(:'forecast') + self.forecast = attributes[:'forecast'] + end + + if attributes.key?(:'ootb_forecast') + self.ootb_forecast = attributes[:'ootb_forecast'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + actual == o.actual && + amount == o.amount && + custom_forecast == o.custom_forecast && + forecast == o.forecast && + ootb_forecast == o.ootb_forecast && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [actual, amount, custom_forecast, forecast, ootb_forecast, additional_properties].hash + end + end +end