diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index f870fed54e26..51ea971a3e80 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -3448,9 +3448,10 @@ components: $ref: '#/components/schemas/WidgetCustomLink' type: array requests: - description: 'Array of one request object to display in the widget. The - request must contain a `group-by` tag whose value is a country ISO code. - + description: 'Array of request objects to display in the widget. May include + an optional request for the region layer and/or an optional request for + the points layer. Region layer requests must contain a `group-by` tag + whose value is a country ISO code. See the [Request JSON schema documentation](https://docs.datadoghq.com/dashboards/graphing_json/request_json) @@ -3461,7 +3462,7 @@ components: query: {} items: $ref: '#/components/schemas/GeomapWidgetRequest' - maxItems: 1 + maxItems: 2 minItems: 1 type: array style: @@ -3519,8 +3520,9 @@ components: focus: WORLD properties: focus: - description: The 2-letter ISO code of a country to focus the map on. Or - `WORLD`. + description: The 2-letter ISO code of a country to focus the map on, or + `WORLD` for global view, or a region (`EMEA`, `APAC`, `LATAM`), or a continent + (`NORTH_AMERICA`, `SOUTH_AMERICA`, `EUROPE`, `AFRICA`, `ASIA`, `OCEANIA`). example: WORLD type: string required: @@ -3539,6 +3541,12 @@ components: items: $ref: '#/components/schemas/ListStreamColumn' type: array + conditional_formats: + description: Threshold (numeric) conditional formatting rules may be used + by a regions layer. + items: + $ref: '#/components/schemas/WidgetConditionalFormat' + type: array formulas: description: List of formulas that operate on queries. items: @@ -3564,6 +3572,23 @@ components: $ref: '#/components/schemas/LogQueryDefinition' sort: $ref: '#/components/schemas/WidgetSortBy' + style: + $ref: '#/components/schemas/GeomapWidgetRequestStyle' + text_formats: + description: Text formatting rules may be used by a points layer. + items: + $ref: '#/components/schemas/TableWidgetTextFormatRule' + type: array + type: object + GeomapWidgetRequestStyle: + description: The style to apply to the request for points layer. + example: + color_by: status + properties: + color_by: + description: The category to color the points by. + example: status + type: string type: object GraphSnapshot: description: Object representing a graph snapshot. diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 52a93c634edc..7c9668ae4282 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -15837,6 +15837,15 @@ components: type: object DORAListDeploymentsRequest: description: Request to get a list of deployments. + example: + data: + attributes: + from: '2025-01-01T00:00:00Z' + limit: 100 + query: service:(shopist OR api-service) env:production team:backend + sort: -started_at + to: '2025-01-31T23:59:59Z' + type: dora_deployments_list_request properties: data: $ref: '#/components/schemas/DORAListDeploymentsRequestData' @@ -15845,6 +15854,13 @@ components: type: object DORAListDeploymentsRequestAttributes: description: Attributes to get a list of deployments. + example: + from: '2025-01-01T00:00:00Z' + limit: 500 + query: service:(shopist OR api-service OR payment-service) env:(production + OR staging) team:(backend OR platform) + sort: -started_at + to: '2025-01-31T23:59:59Z' properties: from: description: Minimum timestamp for requested events. @@ -15869,6 +15885,14 @@ components: type: object DORAListDeploymentsRequestData: description: The JSON:API data. + example: + attributes: + from: '2025-01-15T08:00:00Z' + limit: 200 + query: env:production service:payment-service version:*v2* + sort: -finished_at + to: '2025-01-15T18:00:00Z' + type: dora_deployments_list_request properties: attributes: $ref: '#/components/schemas/DORAListDeploymentsRequestAttributes' @@ -15886,6 +15910,15 @@ components: - DORA_DEPLOYMENTS_LIST_REQUEST DORAListFailuresRequest: description: Request to get a list of failures. + example: + data: + attributes: + from: '2025-01-01T00:00:00Z' + limit: 100 + query: severity:(SEV-1 OR SEV-2) env:production team:backend + sort: -started_at + to: '2025-01-31T23:59:59Z' + type: dora_failures_list_request properties: data: $ref: '#/components/schemas/DORAListFailuresRequestData' @@ -15894,6 +15927,13 @@ components: type: object DORAListFailuresRequestAttributes: description: Attributes to get a list of failures. + example: + from: '2025-01-01T00:00:00Z' + limit: 500 + query: severity:(SEV-1 OR SEV-2) env:(production OR staging) service:(shopist + OR api-service OR payment-service) team:(backend OR platform OR payments) + sort: -started_at + to: '2025-01-31T23:59:59Z' properties: from: description: Minimum timestamp for requested events. @@ -15918,6 +15958,14 @@ components: type: object DORAListFailuresRequestData: description: The JSON:API data. + example: + attributes: + from: '2025-01-15T00:00:00Z' + limit: 200 + query: severity:SEV-1 service:(api-service OR payment-service) env:production + sort: -finished_at + to: '2025-01-15T23:59:59Z' + type: dora_failures_list_request properties: attributes: $ref: '#/components/schemas/DORAListFailuresRequestAttributes' @@ -15935,6 +15983,39 @@ components: - DORA_FAILURES_LIST_REQUEST DORAListResponse: description: Response for the DORA list endpoints. + example: + data: + - attributes: + custom_tags: + - language:java + - department:engineering + - region:us-east-1 + env: production + finished_at: 1693491984000000000 + git: + commit_sha: 66adc9350f2cc9b250b69abddab733dd55e1a588 + repository_url: https://github.com/organization/example-repository + service: shopist + started_at: 1693491974000000000 + team: backend + version: v1.12.07 + id: 4242fcdd31586083 + type: dora_deployment + - attributes: + custom_tags: + - language:go + - department:platform + env: production + finished_at: 1693492084000000000 + git: + commit_sha: 77bdc9350f2cc9b250b69abddab733dd55e1a599 + repository_url: https://github.com/organization/api-service + service: api-service + started_at: 1693492074000000000 + team: backend + version: v2.1.0 + id: 4242fcdd31586084 + type: dora_deployment properties: data: description: The list of DORA events. @@ -66871,6 +66952,24 @@ paths: '200': content: application/json: + example: + data: + attributes: + custom_tags: + - language:java + - department:engineering + - region:us-east-1 + env: staging + finished_at: 1693491984000000000 + git: + commit_sha: 66adc9350f2cc9b250b69abddab733dd55e1a588 + repository_url: https://github.com/organization/example-repository + service: shopist + started_at: 1693491974000000000 + team: backend + version: v1.12.07 + id: 4242fcdd31586083 + type: dora_deployment schema: $ref: '#/components/schemas/DORAFetchResponse' description: OK @@ -66989,6 +67088,64 @@ paths: '200': content: application/json: + example: + data: + - attributes: + custom_tags: + - language:java + - department:engineering + - region:us-east-1 + env: production + finished_at: 1693491984000000000 + git: + commit_sha: 66adc9350f2cc9b250b69abddab733dd55e1a588 + repository_url: https://github.com/organization/example-repository + name: Web server is down; all requests are failing. + services: + - shopist + severity: SEV-1 + started_at: 1693491974000000000 + team: backend + id: 4242fcdd31586085 + type: dora_failure + - attributes: + custom_tags: + - language:go + - department:platform + env: production + finished_at: 1693492084000000000 + git: + commit_sha: 77bdc9350f2cc9b250b69abddab733dd55e1a599 + repository_url: https://github.com/organization/api-service + name: Database connection timeout + services: + - api-service + - payment-service + severity: SEV-1 + started_at: 1693492074000000000 + team: platform + version: v2.1.0 + id: 4242fcdd31586086 + type: dora_failure + - attributes: + custom_tags: + - language:python + - department:payments + - region:eu-west-1 + env: staging + finished_at: 1693492204000000000 + git: + commit_sha: 99edc9350f2cc9b250b69abddab733dd55e1a601 + repository_url: https://github.com/organization/payment-service + name: Payment gateway API rate limit exceeded + services: + - payment-service + severity: SEV-2 + started_at: 1693492174000000000 + team: payments + version: v1.8.3 + id: 4242fcdd31586087 + type: dora_failure schema: $ref: '#/components/schemas/DORAListResponse' description: OK @@ -67028,6 +67185,26 @@ paths: '200': content: application/json: + example: + data: + attributes: + custom_tags: + - language:java + - department:engineering + - region:us-east-1 + env: staging + finished_at: 1693491984000000000 + git: + commit_sha: 66adc9350f2cc9b250b69abddab733dd55e1a588 + repository_url: https://github.com/organization/example-repository + name: Web server is down; all requests are failing. + services: + - shopist + severity: High + started_at: 1693491974000000000 + team: backend + id: 4242fcdd31586085 + type: dora_failure schema: $ref: '#/components/schemas/DORAFetchResponse' description: OK diff --git a/cassettes/features/v1/dashboards/Create-a-geomap-widget-with-conditional-formats-and-text-formats.frozen b/cassettes/features/v1/dashboards/Create-a-geomap-widget-with-conditional-formats-and-text-formats.frozen new file mode 100644 index 000000000000..b42d25287e38 --- /dev/null +++ b/cassettes/features/v1/dashboards/Create-a-geomap-widget-with-conditional-formats-and-text-formats.frozen @@ -0,0 +1 @@ +2025-12-08T10:46:15.353Z \ No newline at end of file diff --git a/cassettes/features/v1/dashboards/Create-a-geomap-widget-with-conditional-formats-and-text-formats.yml b/cassettes/features/v1/dashboards/Create-a-geomap-widget-with-conditional-formats-and-text-formats.yml new file mode 100644 index 000000000000..eaf20cd91645 --- /dev/null +++ b/cassettes/features/v1/dashboards/Create-a-geomap-widget-with-conditional-formats-and-text-formats.yml @@ -0,0 +1,45 @@ +http_interactions: +- recorded_at: Mon, 08 Dec 2025 10:46:15 GMT + request: + body: + encoding: UTF-8 + string: '{"description":"Test-Create_a_geomap_widget_with_conditional_formats_and_text_formats-1765190775","layout_type":"ordered","notify_list":[],"reflow_type":"fixed","tags":[],"template_variables":[],"title":"Test-Create_a_geomap_widget_with_conditional_formats_and_text_formats-1765190775","widgets":[{"definition":{"requests":[{"conditional_formats":[{"comparator":">","palette":"white_on_green","value":1000}],"formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count"},"data_source":"rum","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"@type:session"}}],"response_format":"scalar","sort":{"count":250,"order_by":[{"index":0,"order":"desc","type":"formula"}]}},{"columns":[{"field":"@network.client.geoip.location.latitude","width":"auto"},{"field":"@network.client.geoip.location.longitude","width":"auto"},{"field":"@network.client.geoip.country.iso_code","width":"auto"},{"field":"@network.client.geoip.subdivision.name","width":"auto"}],"query":{"data_source":"logs_stream","indexes":[],"query_string":"","storage":"hot"},"response_format":"event_list","style":{"color_by":"status"},"text_formats":[{"match":{"type":"is","value":"error"},"palette":"white_on_red"}]}],"style":{"palette":"hostmap_blues","palette_flip":false},"title":"Log + Count by Service and Source","type":"geomap","view":{"focus":"NORTH_AMERICA"}},"layout":{"height":6,"width":12,"x":0,"y":0}}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/dashboard + response: + body: + encoding: UTF-8 + string: '{"id":"n2i-h6d-x6a","title":"Test-Create_a_geomap_widget_with_conditional_formats_and_text_formats-1765190775","description":"Test-Create_a_geomap_widget_with_conditional_formats_and_text_formats-1765190775","author_handle":"shishi.liu@datadoghq.com","author_name":"Shishi + Liu","layout_type":"ordered","url":"/dashboard/n2i-h6d-x6a/test-createageomapwidgetwithconditionalformatsandtextformats-1765190775","template_variables":[],"widgets":[{"definition":{"requests":[{"conditional_formats":[{"comparator":">","palette":"white_on_green","value":1000}],"formulas":[{"formula":"query1"}],"queries":[{"compute":{"aggregation":"count"},"data_source":"rum","group_by":[],"indexes":["*"],"name":"query1","search":{"query":"@type:session"}}],"response_format":"scalar","sort":{"count":250,"order_by":[{"index":0,"order":"desc","type":"formula"}]}},{"columns":[{"field":"@network.client.geoip.location.latitude","width":"auto"},{"field":"@network.client.geoip.location.longitude","width":"auto"},{"field":"@network.client.geoip.country.iso_code","width":"auto"},{"field":"@network.client.geoip.subdivision.name","width":"auto"}],"query":{"data_source":"logs_stream","indexes":[],"query_string":"","storage":"hot"},"response_format":"event_list","style":{"color_by":"status"},"text_formats":[{"match":{"type":"is","value":"error"},"palette":"white_on_red"}]}],"style":{"palette":"hostmap_blues","palette_flip":false},"title":"Log + Count by Service and Source","type":"geomap","view":{"focus":"NORTH_AMERICA"}},"layout":{"height":6,"width":12,"x":0,"y":0},"id":4916490421180340}],"notify_list":[],"created_at":"2025-12-08T10:46:15.791396+00:00","modified_at":"2025-12-08T10:46:15.791396+00:00","reflow_type":"fixed","tags":[],"restricted_roles":[]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Mon, 08 Dec 2025 10:46:15 GMT + request: + body: null + headers: + Accept: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v1/dashboard/n2i-h6d-x6a + response: + body: + encoding: UTF-8 + string: '{"deleted_dashboard_id":"n2i-h6d-x6a"}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v1/dashboards/CreateDashboard_9836563.rb b/examples/v1/dashboards/CreateDashboard_9836563.rb new file mode 100644 index 000000000000..058c5666a050 --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_9836563.rb @@ -0,0 +1,118 @@ +# Create a geomap widget with conditional formats and text formats + +require "datadog_api_client" +api_instance = DatadogAPIClient::V1::DashboardsAPI.new + +body = DatadogAPIClient::V1::Dashboard.new({ + title: "Example-Dashboard", + description: "Example-Dashboard", + widgets: [ + DatadogAPIClient::V1::Widget.new({ + definition: DatadogAPIClient::V1::GeomapWidgetDefinition.new({ + title: "Log Count by Service and Source", + type: DatadogAPIClient::V1::GeomapWidgetDefinitionType::GEOMAP, + requests: [ + DatadogAPIClient::V1::GeomapWidgetRequest.new({ + response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::SCALAR, + queries: [ + DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinition.new({ + data_source: DatadogAPIClient::V1::FormulaAndFunctionEventsDataSource::RUM, + name: "query1", + search: DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinitionSearch.new({ + query: "@type:session", + }), + indexes: [ + "*", + ], + compute: DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinitionCompute.new({ + aggregation: DatadogAPIClient::V1::FormulaAndFunctionEventAggregation::COUNT, + }), + group_by: [], + }), + ], + conditional_formats: [ + DatadogAPIClient::V1::WidgetConditionalFormat.new({ + comparator: DatadogAPIClient::V1::WidgetComparator::GREATER_THAN, + value: 1000, + palette: DatadogAPIClient::V1::WidgetPalette::WHITE_ON_GREEN, + }), + ], + formulas: [ + DatadogAPIClient::V1::WidgetFormula.new({ + formula: "query1", + }), + ], + sort: DatadogAPIClient::V1::WidgetSortBy.new({ + count: 250, + order_by: [ + DatadogAPIClient::V1::WidgetFormulaSort.new({ + type: DatadogAPIClient::V1::FormulaType::FORMULA, + index: 0, + order: DatadogAPIClient::V1::WidgetSort::DESCENDING, + }), + ], + }), + }), + DatadogAPIClient::V1::GeomapWidgetRequest.new({ + response_format: DatadogAPIClient::V1::FormulaAndFunctionResponseFormat::EVENT_LIST, + query: DatadogAPIClient::V1::ListStreamQuery.new({ + data_source: DatadogAPIClient::V1::ListStreamSource::LOGS_STREAM, + query_string: "", + indexes: [], + storage: "hot", + }), + columns: [ + DatadogAPIClient::V1::ListStreamColumn.new({ + field: "@network.client.geoip.location.latitude", + width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO, + }), + DatadogAPIClient::V1::ListStreamColumn.new({ + field: "@network.client.geoip.location.longitude", + width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO, + }), + DatadogAPIClient::V1::ListStreamColumn.new({ + field: "@network.client.geoip.country.iso_code", + width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO, + }), + DatadogAPIClient::V1::ListStreamColumn.new({ + field: "@network.client.geoip.subdivision.name", + width: DatadogAPIClient::V1::ListStreamColumnWidth::AUTO, + }), + ], + style: DatadogAPIClient::V1::GeomapWidgetRequestStyle.new({ + color_by: "status", + }), + text_formats: [ + DatadogAPIClient::V1::TableWidgetTextFormatRule.new({ + match: DatadogAPIClient::V1::TableWidgetTextFormatMatch.new({ + type: DatadogAPIClient::V1::TableWidgetTextFormatMatchType::IS, + value: "error", + }), + palette: DatadogAPIClient::V1::TableWidgetTextFormatPalette::WHITE_ON_RED, + }), + ], + }), + ], + style: DatadogAPIClient::V1::GeomapWidgetDefinitionStyle.new({ + palette: "hostmap_blues", + palette_flip: false, + }), + view: DatadogAPIClient::V1::GeomapWidgetDefinitionView.new({ + focus: "NORTH_AMERICA", + }), + }), + layout: DatadogAPIClient::V1::WidgetLayout.new({ + x: 0, + y: 0, + width: 12, + height: 6, + }), + }), + ], + template_variables: [], + layout_type: DatadogAPIClient::V1::DashboardLayoutType::ORDERED, + notify_list: [], + reflow_type: DatadogAPIClient::V1::DashboardReflowType::FIXED, + tags: [], +}) +p api_instance.create_dashboard(body) diff --git a/features/v1/dashboards.feature b/features/v1/dashboards.feature index 3eeebebdc24c..588c609ceddb 100644 --- a/features/v1/dashboards.feature +++ b/features/v1/dashboards.feature @@ -72,6 +72,22 @@ Feature: Dashboards And the response "widgets[0].definition.requests[0].response_format" is equal to "event_list" And the response "widgets[0].definition.requests[0].query.data_source" is equal to "logs_stream" + @team:DataDog/dashboards-backend + Scenario: Create a geomap widget with conditional formats and text formats + Given new "CreateDashboard" request + And body with value {"title": "{{ unique }}","description": "{{ unique }}","widgets":[{"definition":{"title":"Log Count by Service and Source","type":"geomap","requests":[{"response_format":"scalar","queries":[{"data_source":"rum","name":"query1","search":{"query":"@type:session"},"indexes":["*"],"compute":{"aggregation":"count"},"group_by":[]}],"conditional_formats":[{"comparator":">","value":1000,"palette":"white_on_green"}],"formulas":[{"formula":"query1"}],"sort":{"count":250,"order_by":[{"type":"formula","index":0,"order":"desc"}]}},{"response_format":"event_list","query":{"data_source":"logs_stream","query_string":"","indexes":[],"storage":"hot"},"columns":[{"field":"@network.client.geoip.location.latitude","width":"auto"},{"field":"@network.client.geoip.location.longitude","width":"auto"},{"field":"@network.client.geoip.country.iso_code","width":"auto"},{"field":"@network.client.geoip.subdivision.name","width":"auto"}],"style":{"color_by":"status"},"text_formats":[{"match":{"type":"is","value":"error"},"palette":"white_on_red"}]}],"style":{"palette":"hostmap_blues","palette_flip":false},"view":{"focus":"NORTH_AMERICA"}},"layout":{"x":0,"y":0,"width":12,"height":6}}],"template_variables":[],"layout_type":"ordered","notify_list":[],"reflow_type":"fixed","tags":[]} + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.type" is equal to "geomap" + And the response "widgets[0].definition.title" is equal to "Log Count by Service and Source" + And the response "widgets[0].definition.requests[0].conditional_formats[0].comparator" is equal to ">" + And the response "widgets[0].definition.requests[0].conditional_formats[0].palette" is equal to "white_on_green" + And the response "widgets[0].definition.requests[0].conditional_formats[0].value" is equal to 1000 + And the response "widgets[0].definition.requests[1].text_formats[0].match.type" is equal to "is" + And the response "widgets[0].definition.requests[1].text_formats[0].match.value" is equal to "error" + And the response "widgets[0].definition.requests[1].text_formats[0].palette" is equal to "white_on_red" + And the response "widgets[0].definition.view.focus" is equal to "NORTH_AMERICA" + @generated @skip @team:DataDog/dashboards-backend Scenario: Create a new dashboard returns "Bad Request" response Given new "CreateDashboard" request diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 424f3e51d6cf..1d65dc8de946 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -162,6 +162,7 @@ def overrides "v1.geomap_widget_definition_type" => "GeomapWidgetDefinitionType", "v1.geomap_widget_definition_view" => "GeomapWidgetDefinitionView", "v1.geomap_widget_request" => "GeomapWidgetRequest", + "v1.geomap_widget_request_style" => "GeomapWidgetRequestStyle", "v1.graph_snapshot" => "GraphSnapshot", "v1.group_type" => "GroupType", "v1.group_widget_definition" => "GroupWidgetDefinition", diff --git a/lib/datadog_api_client/v1/models/geomap_widget_definition.rb b/lib/datadog_api_client/v1/models/geomap_widget_definition.rb index 47ea4a694f75..dce5e690fcde 100644 --- a/lib/datadog_api_client/v1/models/geomap_widget_definition.rb +++ b/lib/datadog_api_client/v1/models/geomap_widget_definition.rb @@ -24,8 +24,7 @@ class GeomapWidgetDefinition # A list of custom links. attr_accessor :custom_links - # Array of one request object to display in the widget. The request must contain a `group-by` tag whose value is a country ISO code. - # + # Array of request objects to display in the widget. May include an optional request for the region layer and/or an optional request for the points layer. Region layer requests must contain a `group-by` tag whose value is a country ISO code. # See the [Request JSON schema documentation](https://docs.datadoghq.com/dashboards/graphing_json/request_json) # for information about building the `REQUEST_SCHEMA`. attr_reader :requests @@ -149,7 +148,7 @@ def initialize(attributes = {}) # @!visibility private def valid? return false if @requests.nil? - return false if @requests.length > 1 + return false if @requests.length > 2 return false if @requests.length < 1 return false if @style.nil? return false if @type.nil? @@ -164,8 +163,8 @@ def requests=(requests) if requests.nil? fail ArgumentError, 'invalid value for "requests", requests cannot be nil.' end - if requests.length > 1 - fail ArgumentError, 'invalid value for "requests", number of items must be less than or equal to 1.' + if requests.length > 2 + fail ArgumentError, 'invalid value for "requests", number of items must be less than or equal to 2.' end if requests.length < 1 fail ArgumentError, 'invalid value for "requests", number of items must be greater than or equal to 1.' diff --git a/lib/datadog_api_client/v1/models/geomap_widget_definition_view.rb b/lib/datadog_api_client/v1/models/geomap_widget_definition_view.rb index 8f2b0676c7b0..aaaa42618e62 100644 --- a/lib/datadog_api_client/v1/models/geomap_widget_definition_view.rb +++ b/lib/datadog_api_client/v1/models/geomap_widget_definition_view.rb @@ -21,7 +21,7 @@ module DatadogAPIClient::V1 class GeomapWidgetDefinitionView include BaseGenericModel - # The 2-letter ISO code of a country to focus the map on. Or `WORLD`. + # The 2-letter ISO code of a country to focus the map on, or `WORLD` for global view, or a region (`EMEA`, `APAC`, `LATAM`), or a continent (`NORTH_AMERICA`, `SOUTH_AMERICA`, `EUROPE`, `AFRICA`, `ASIA`, `OCEANIA`). attr_reader :focus attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v1/models/geomap_widget_request.rb b/lib/datadog_api_client/v1/models/geomap_widget_request.rb index bacd929c6478..f9b79f5a9da1 100644 --- a/lib/datadog_api_client/v1/models/geomap_widget_request.rb +++ b/lib/datadog_api_client/v1/models/geomap_widget_request.rb @@ -24,6 +24,9 @@ class GeomapWidgetRequest # Widget columns. attr_accessor :columns + # Threshold (numeric) conditional formatting rules may be used by a regions layer. + attr_accessor :conditional_formats + # List of formulas that operate on queries. attr_accessor :formulas @@ -51,6 +54,12 @@ class GeomapWidgetRequest # The controls for sorting the widget. attr_accessor :sort + # The style to apply to the request for points layer. + attr_accessor :style + + # Text formatting rules may be used by a points layer. + attr_accessor :text_formats + attr_accessor :additional_properties # Attribute mapping from ruby-style variable name to JSON key. @@ -58,6 +67,7 @@ class GeomapWidgetRequest def self.attribute_map { :'columns' => :'columns', + :'conditional_formats' => :'conditional_formats', :'formulas' => :'formulas', :'log_query' => :'log_query', :'q' => :'q', @@ -66,7 +76,9 @@ def self.attribute_map :'response_format' => :'response_format', :'rum_query' => :'rum_query', :'security_query' => :'security_query', - :'sort' => :'sort' + :'sort' => :'sort', + :'style' => :'style', + :'text_formats' => :'text_formats' } end @@ -75,6 +87,7 @@ def self.attribute_map def self.openapi_types { :'columns' => :'Array', + :'conditional_formats' => :'Array', :'formulas' => :'Array', :'log_query' => :'LogQueryDefinition', :'q' => :'String', @@ -83,7 +96,9 @@ def self.openapi_types :'response_format' => :'FormulaAndFunctionResponseFormat', :'rum_query' => :'LogQueryDefinition', :'security_query' => :'LogQueryDefinition', - :'sort' => :'WidgetSortBy' + :'sort' => :'WidgetSortBy', + :'style' => :'GeomapWidgetRequestStyle', + :'text_formats' => :'Array' } end @@ -111,6 +126,12 @@ def initialize(attributes = {}) end end + if attributes.key?(:'conditional_formats') + if (value = attributes[:'conditional_formats']).is_a?(Array) + self.conditional_formats = value + end + end + if attributes.key?(:'formulas') if (value = attributes[:'formulas']).is_a?(Array) self.formulas = value @@ -150,6 +171,16 @@ def initialize(attributes = {}) if attributes.key?(:'sort') self.sort = attributes[:'sort'] end + + if attributes.key?(:'style') + self.style = attributes[:'style'] + end + + if attributes.key?(:'text_formats') + if (value = attributes[:'text_formats']).is_a?(Array) + self.text_formats = value + end + end end # Returns the object in the form of hash, with additionalProperties support. @@ -179,6 +210,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && columns == o.columns && + conditional_formats == o.conditional_formats && formulas == o.formulas && log_query == o.log_query && q == o.q && @@ -188,6 +220,8 @@ def ==(o) rum_query == o.rum_query && security_query == o.security_query && sort == o.sort && + style == o.style && + text_formats == o.text_formats && additional_properties == o.additional_properties end @@ -195,7 +229,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [columns, formulas, log_query, q, queries, query, response_format, rum_query, security_query, sort, additional_properties].hash + [columns, conditional_formats, formulas, log_query, q, queries, query, response_format, rum_query, security_query, sort, style, text_formats, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v1/models/geomap_widget_request_style.rb b/lib/datadog_api_client/v1/models/geomap_widget_request_style.rb new file mode 100644 index 000000000000..e30f577ad349 --- /dev/null +++ b/lib/datadog_api_client/v1/models/geomap_widget_request_style.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V1 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::V1 + # The style to apply to the request for points layer. + class GeomapWidgetRequestStyle + include BaseGenericModel + + # The category to color the points by. + attr_accessor :color_by + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'color_by' => :'color_by' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'color_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::V1::GeomapWidgetRequestStyle` 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?(:'color_by') + self.color_by = attributes[:'color_by'] + 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 && + color_by == o.color_by && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [color_by, additional_properties].hash + end + end +end