From 5fab6cc57a5b072ac83969570f05ba5227a9b0c0 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 2 Jul 2026 15:27:20 +0000 Subject: [PATCH] Regenerate client from commit 0d20bc7 of spec repo --- .generator/schemas/v2/openapi.yaml | 238 ++++++++++++++++++ .../reporting-and-sharing/CreateSnapshot.rb | 39 +++ features/scenarios_model_mapping.rb | 3 + features/v2/reporting_and_sharing.feature | 27 ++ features/v2/undo.json | 6 + lib/datadog_api_client/configuration.rb | 1 + lib/datadog_api_client/inflector.rb | 12 + .../v2/api/reporting_and_sharing_api.rb | 99 ++++++++ .../create_snapshot_additional_config.rb | 127 ++++++++++ ...create_snapshot_data_attributes_request.rb | 215 ++++++++++++++++ ...reate_snapshot_data_attributes_response.rb | 123 +++++++++ .../v2/models/create_snapshot_data_request.rb | 144 +++++++++++ .../models/create_snapshot_data_response.rb | 165 ++++++++++++ .../v2/models/create_snapshot_request.rb | 123 +++++++++ .../v2/models/create_snapshot_response.rb | 123 +++++++++ .../create_snapshot_template_variable.rb | 167 ++++++++++++ .../create_snapshot_timeseries_legend_type.rb | 28 +++ .../v2/models/create_snapshot_ttl.rb | 31 +++ .../v2/models/create_snapshot_type.rb | 26 ++ 19 files changed, 1697 insertions(+) create mode 100644 examples/v2/reporting-and-sharing/CreateSnapshot.rb create mode 100644 features/v2/reporting_and_sharing.feature create mode 100644 lib/datadog_api_client/v2/api/reporting_and_sharing_api.rb create mode 100644 lib/datadog_api_client/v2/models/create_snapshot_additional_config.rb create mode 100644 lib/datadog_api_client/v2/models/create_snapshot_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/create_snapshot_data_attributes_response.rb create mode 100644 lib/datadog_api_client/v2/models/create_snapshot_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/create_snapshot_data_response.rb create mode 100644 lib/datadog_api_client/v2/models/create_snapshot_request.rb create mode 100644 lib/datadog_api_client/v2/models/create_snapshot_response.rb create mode 100644 lib/datadog_api_client/v2/models/create_snapshot_template_variable.rb create mode 100644 lib/datadog_api_client/v2/models/create_snapshot_timeseries_legend_type.rb create mode 100644 lib/datadog_api_client/v2/models/create_snapshot_ttl.rb create mode 100644 lib/datadog_api_client/v2/models/create_snapshot_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 57fa3374b8d7..50b7ccf9b24d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -24622,6 +24622,184 @@ components: - findings - project type: object + CreateSnapshotAdditionalConfig: + description: Additional configuration options for snapshot creation. + properties: + template_variables: + $ref: "#/components/schemas/CreateSnapshotTemplateVariables" + timeseries_legend_type: + $ref: "#/components/schemas/CreateSnapshotTimeseriesLegendType" + timezone_offset_minutes: + description: Timezone offset in minutes from UTC. Positive values are west of UTC (for example, `300` for UTC-5). Use `0` for UTC. + example: 300 + format: int64 + type: integer + type: object + CreateSnapshotDataAttributesRequest: + description: Attributes for snapshot creation. + properties: + additional_config: + $ref: "#/components/schemas/CreateSnapshotAdditionalConfig" + end: + description: End of the time window for the snapshot, in milliseconds since Unix epoch. + example: 1692464800000 + format: int64 + type: integer + height: + description: The height of the rendered snapshot in pixels. + example: 185 + format: int64 + type: integer + is_authenticated: + description: Whether the snapshot requires authentication to view. Authenticated snapshots are scoped to the creating organization. + example: false + type: boolean + start: + description: Start of the time window for the snapshot, in milliseconds since Unix epoch. + example: 1692464000000 + format: int64 + type: integer + ttl: + $ref: "#/components/schemas/CreateSnapshotTTL" + widget_definition: + additionalProperties: {} + description: The widget definition to render as a snapshot. Must include a valid `type` field and non-empty `requests` array. + example: + requests: + - q: "avg:system.cpu.user{*}" + type: timeseries + type: object + width: + description: The width of the rendered snapshot in pixels. + example: 300 + format: int64 + type: integer + required: + - widget_definition + - start + - end + type: object + CreateSnapshotDataAttributesResponse: + description: Attributes of the created snapshot. + properties: + url: + description: The URL to access the rendered snapshot image. + example: https://app.datadoghq.com/api/v2/snapshot/view/public/60d/00000000-0000-0000-0000-000000000000/1692464400000-12345678-1234-5678-9abc-def123456789.png + type: string + required: + - url + type: object + CreateSnapshotDataRequest: + description: Data envelope for snapshot creation. + properties: + attributes: + $ref: "#/components/schemas/CreateSnapshotDataAttributesRequest" + type: + $ref: "#/components/schemas/CreateSnapshotType" + required: + - type + - attributes + type: object + CreateSnapshotDataResponse: + description: Data envelope for the snapshot creation response. + properties: + attributes: + $ref: "#/components/schemas/CreateSnapshotDataAttributesResponse" + id: + description: The unique identifier of the created snapshot. + example: 12345678-1234-5678-9abc-def123456789 + type: string + type: + $ref: "#/components/schemas/CreateSnapshotType" + required: + - id + - type + - attributes + type: object + CreateSnapshotRequest: + description: Request body for creating a graph snapshot. + properties: + data: + $ref: "#/components/schemas/CreateSnapshotDataRequest" + required: + - data + type: object + CreateSnapshotResponse: + description: Response body for a snapshot creation request. + properties: + data: + $ref: "#/components/schemas/CreateSnapshotDataResponse" + required: + - data + type: object + CreateSnapshotTTL: + description: The time-to-live for the snapshot. This value corresponds to storage lifecycle policies that automatically delete the snapshot after the specified period. + enum: + - 30d + - 60d + - 90d + - 1y + - 2y + - inf + example: 60d + type: string + x-enum-varnames: + - THIRTY_DAYS + - SIXTY_DAYS + - NINETY_DAYS + - ONE_YEAR + - TWO_YEARS + - INFINITE + CreateSnapshotTemplateVariable: + description: A template variable definition for snapshot rendering. + properties: + name: + description: The template variable name. + example: host + type: string + prefix: + description: The tag prefix associated with the template variable. For example, a prefix of `host` with a value of `web-server-1` scopes the snapshot to `host:web-server-1`. + example: host + type: string + values: + description: The list of scoped values for this template variable. + example: + - web-server-1 + - web-server-2 + items: + description: A single scoped value for the template variable. + type: string + type: array + required: + - name + - prefix + - values + type: object + CreateSnapshotTemplateVariables: + description: List of template variable definitions for snapshot rendering. + items: + $ref: "#/components/schemas/CreateSnapshotTemplateVariable" + type: array + CreateSnapshotTimeseriesLegendType: + description: The legend display type for timeseries widgets. A value of `none` hides the legend entirely; omitting the field lets the frontend choose automatically. + enum: + - compact + - expanded + - none + example: expanded + type: string + x-enum-varnames: + - COMPACT + - EXPANDED + - NONE + CreateSnapshotType: + description: The type identifier for snapshot creation resources. + enum: + - create_snapshot + example: create_snapshot + type: string + x-enum-varnames: + - CREATE_SNAPSHOT CreateStatusPageRequest: description: Request object for creating a status page. example: @@ -182778,6 +182956,63 @@ paths: x-unstable: |- **Note**: This endpoint is in public beta and it's subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/snapshot: + post: + description: Create a snapshot of a graph widget. The snapshot is rendered asynchronously; the returned URL can be polled until the image is ready. + operationId: CreateSnapshot + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/CreateSnapshotRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + url: https://app.datadoghq.com/api/v2/snapshot/view/public/60d/00000000-0000-0000-0000-000000000000/1692464400000-12345678-1234-5678-9abc-def123456789.png + id: 12345678-1234-5678-9abc-def123456789 + type: create_snapshot + schema: + $ref: "#/components/schemas/CreateSnapshotResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create a graph snapshot + tags: + - Reporting And Sharing + 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/sourcemaps: delete: description: |- @@ -197051,6 +197286,9 @@ tags: dashboard on a recurring cadence and delivers it to a set of recipients over email, Slack, or Microsoft Teams. name: Report Schedules + - description: |- + The Reporting and Sharing endpoints allow you to create snapshots of graph widgets and other shareable resources. + name: Reporting And Sharing - description: |- A restriction policy defines the access control rules for a resource, mapping a set of relations (such as editor and viewer) to a set of allowed principals (such as roles, teams, or users). diff --git a/examples/v2/reporting-and-sharing/CreateSnapshot.rb b/examples/v2/reporting-and-sharing/CreateSnapshot.rb new file mode 100644 index 000000000000..6da4257cda9f --- /dev/null +++ b/examples/v2/reporting-and-sharing/CreateSnapshot.rb @@ -0,0 +1,39 @@ +# Create a graph snapshot returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_snapshot".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ReportingAndSharingAPI.new + +body = DatadogAPIClient::V2::CreateSnapshotRequest.new({ + data: DatadogAPIClient::V2::CreateSnapshotDataRequest.new({ + attributes: DatadogAPIClient::V2::CreateSnapshotDataAttributesRequest.new({ + additional_config: DatadogAPIClient::V2::CreateSnapshotAdditionalConfig.new({ + template_variables: [ + DatadogAPIClient::V2::CreateSnapshotTemplateVariable.new({ + name: "host", + prefix: "host", + values: [ + "web-server-1", + "web-server-2", + ], + }), + ], + timeseries_legend_type: DatadogAPIClient::V2::CreateSnapshotTimeseriesLegendType::EXPANDED, + timezone_offset_minutes: 300, + }), + _end: 1692464800000, + height: 185, + is_authenticated: false, + start: 1692464000000, + ttl: DatadogAPIClient::V2::CreateSnapshotTTL::SIXTY_DAYS, + widget_definition: { + "requests": "[{'q': 'avg:system.cpu.user{*}'}]", "type": "timeseries", + }, + width: 300, + }), + type: DatadogAPIClient::V2::CreateSnapshotType::CREATE_SNAPSHOT, + }), +}) +p api_instance.create_snapshot(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 2d8697481d3a..045336f70c3d 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -5385,6 +5385,9 @@ "to_ts" => "Integer", "disable_corrections" => "Boolean", }, + "v2.CreateSnapshot" => { + "body" => "CreateSnapshotRequest", + }, "v2.GetSPARecommendations" => { "bypass_cache" => "String", "service" => "String", diff --git a/features/v2/reporting_and_sharing.feature b/features/v2/reporting_and_sharing.feature new file mode 100644 index 000000000000..7859e0360388 --- /dev/null +++ b/features/v2/reporting_and_sharing.feature @@ -0,0 +1,27 @@ +@endpoint(reporting-and-sharing) @endpoint(reporting-and-sharing-v2) +Feature: Reporting And Sharing + The Reporting and Sharing endpoints allow you to create snapshots of graph + widgets and other shareable resources. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "ReportingAndSharing" API + And operation "CreateSnapshot" enabled + And new "CreateSnapshot" request + And body with value {"data": {"attributes": {"additional_config": {"template_variables": [{"name": "host", "prefix": "host", "values": ["web-server-1", "web-server-2"]}], "timeseries_legend_type": "expanded", "timezone_offset_minutes": 300}, "end": 1692464800000, "height": 185, "is_authenticated": false, "start": 1692464000000, "ttl": "60d", "widget_definition": {"requests": [{"q": "avg:system.cpu.user{*}"}], "type": "timeseries"}, "width": 300}, "type": "create_snapshot"}} + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Create a graph snapshot returns "Bad Request" response + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Create a graph snapshot returns "Not Found" response + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Create a graph snapshot returns "OK" response + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index 486933f758d5..37f5bce7a2c8 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -8184,6 +8184,12 @@ "type": "safe" } }, + "CreateSnapshot": { + "tag": "Reporting And Sharing", + "undo": { + "type": "unsafe" + } + }, "GetSPARecommendations": { "tag": "Spa", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 7fdc9bf03046..0c247f9a57bc 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -670,6 +670,7 @@ def initialize "v2.get_slo_report": false, "v2.get_slo_report_job_status": false, "v2.get_slo_status": false, + "v2.create_snapshot": false, "v2.get_spa_recommendations": false, "v2.get_spa_recommendations_with_shard": false, "v2.create_ai_custom_rule": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 32057b3f70e5..50df41aafe1d 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2487,6 +2487,17 @@ def overrides "v2.create_service_now_ticket_request_data" => "CreateServiceNowTicketRequestData", "v2.create_service_now_ticket_request_data_attributes" => "CreateServiceNowTicketRequestDataAttributes", "v2.create_service_now_ticket_request_data_relationships" => "CreateServiceNowTicketRequestDataRelationships", + "v2.create_snapshot_additional_config" => "CreateSnapshotAdditionalConfig", + "v2.create_snapshot_data_attributes_request" => "CreateSnapshotDataAttributesRequest", + "v2.create_snapshot_data_attributes_response" => "CreateSnapshotDataAttributesResponse", + "v2.create_snapshot_data_request" => "CreateSnapshotDataRequest", + "v2.create_snapshot_data_response" => "CreateSnapshotDataResponse", + "v2.create_snapshot_request" => "CreateSnapshotRequest", + "v2.create_snapshot_response" => "CreateSnapshotResponse", + "v2.create_snapshot_template_variable" => "CreateSnapshotTemplateVariable", + "v2.create_snapshot_timeseries_legend_type" => "CreateSnapshotTimeseriesLegendType", + "v2.create_snapshot_ttl" => "CreateSnapshotTTL", + "v2.create_snapshot_type" => "CreateSnapshotType", "v2.create_status_page_request" => "CreateStatusPageRequest", "v2.create_status_page_request_data" => "CreateStatusPageRequestData", "v2.create_status_page_request_data_attributes" => "CreateStatusPageRequestDataAttributes", @@ -7998,6 +8009,7 @@ def overrides "v2.product_analytics_api" => "ProductAnalyticsAPI", "v2.reference_tables_api" => "ReferenceTablesAPI", "v2.report_schedules_api" => "ReportSchedulesAPI", + "v2.reporting_and_sharing_api" => "ReportingAndSharingAPI", "v2.restriction_policies_api" => "RestrictionPoliciesAPI", "v2.roles_api" => "RolesAPI", "v2.rum_api" => "RUMAPI", diff --git a/lib/datadog_api_client/v2/api/reporting_and_sharing_api.rb b/lib/datadog_api_client/v2/api/reporting_and_sharing_api.rb new file mode 100644 index 000000000000..d6e74704215b --- /dev/null +++ b/lib/datadog_api_client/v2/api/reporting_and_sharing_api.rb @@ -0,0 +1,99 @@ +=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 'cgi' + +module DatadogAPIClient::V2 + class ReportingAndSharingAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create a graph snapshot. + # + # @see #create_snapshot_with_http_info + def create_snapshot(body, opts = {}) + data, _status_code, _headers = create_snapshot_with_http_info(body, opts) + data + end + + # Create a graph snapshot. + # + # Create a snapshot of a graph widget. The snapshot is rendered asynchronously; the returned URL can be polled until the image is ready. + # + # @param body [CreateSnapshotRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(CreateSnapshotResponse, Integer, Hash)>] CreateSnapshotResponse data, response status code and response headers + def create_snapshot_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_snapshot".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_snapshot") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_snapshot")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ReportingAndSharingAPI.create_snapshot ...' + 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 ReportingAndSharingAPI.create_snapshot" + end + # resource path + local_var_path = '/api/v2/snapshot' + + # 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] || 'CreateSnapshotResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_snapshot, + :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::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ReportingAndSharingAPI#create_snapshot\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_snapshot_additional_config.rb b/lib/datadog_api_client/v2/models/create_snapshot_additional_config.rb new file mode 100644 index 000000000000..6bdc76db2a1c --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_snapshot_additional_config.rb @@ -0,0 +1,127 @@ +=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 + # Additional configuration options for snapshot creation. + class CreateSnapshotAdditionalConfig + include BaseGenericModel + + # List of template variable definitions for snapshot rendering. + attr_accessor :template_variables + + # The legend display type for timeseries widgets. A value of `none` hides the legend entirely; omitting the field lets the frontend choose automatically. + attr_accessor :timeseries_legend_type + + # Timezone offset in minutes from UTC. Positive values are west of UTC (for example, `300` for UTC-5). Use `0` for UTC. + attr_accessor :timezone_offset_minutes + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'template_variables' => :'template_variables', + :'timeseries_legend_type' => :'timeseries_legend_type', + :'timezone_offset_minutes' => :'timezone_offset_minutes' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'template_variables' => :'Array', + :'timeseries_legend_type' => :'CreateSnapshotTimeseriesLegendType', + :'timezone_offset_minutes' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateSnapshotAdditionalConfig` 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?(:'template_variables') + if (value = attributes[:'template_variables']).is_a?(Array) + self.template_variables = value + end + end + + if attributes.key?(:'timeseries_legend_type') + self.timeseries_legend_type = attributes[:'timeseries_legend_type'] + end + + if attributes.key?(:'timezone_offset_minutes') + self.timezone_offset_minutes = attributes[:'timezone_offset_minutes'] + 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 && + template_variables == o.template_variables && + timeseries_legend_type == o.timeseries_legend_type && + timezone_offset_minutes == o.timezone_offset_minutes && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [template_variables, timeseries_legend_type, timezone_offset_minutes, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_snapshot_data_attributes_request.rb b/lib/datadog_api_client/v2/models/create_snapshot_data_attributes_request.rb new file mode 100644 index 000000000000..c031a0ff03bb --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_snapshot_data_attributes_request.rb @@ -0,0 +1,215 @@ +=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 for snapshot creation. + class CreateSnapshotDataAttributesRequest + include BaseGenericModel + + # Additional configuration options for snapshot creation. + attr_accessor :additional_config + + # End of the time window for the snapshot, in milliseconds since Unix epoch. + attr_reader :_end + + # The height of the rendered snapshot in pixels. + attr_accessor :height + + # Whether the snapshot requires authentication to view. Authenticated snapshots are scoped to the creating organization. + attr_accessor :is_authenticated + + # Start of the time window for the snapshot, in milliseconds since Unix epoch. + attr_reader :start + + # The time-to-live for the snapshot. This value corresponds to storage lifecycle policies that automatically delete the snapshot after the specified period. + attr_accessor :ttl + + # The widget definition to render as a snapshot. Must include a valid `type` field and non-empty `requests` array. + attr_reader :widget_definition + + # The width of the rendered snapshot in pixels. + attr_accessor :width + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'additional_config' => :'additional_config', + :'_end' => :'end', + :'height' => :'height', + :'is_authenticated' => :'is_authenticated', + :'start' => :'start', + :'ttl' => :'ttl', + :'widget_definition' => :'widget_definition', + :'width' => :'width' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'additional_config' => :'CreateSnapshotAdditionalConfig', + :'_end' => :'Integer', + :'height' => :'Integer', + :'is_authenticated' => :'Boolean', + :'start' => :'Integer', + :'ttl' => :'CreateSnapshotTTL', + :'widget_definition' => :'Hash', + :'width' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateSnapshotDataAttributesRequest` 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?(:'additional_config') + self.additional_config = attributes[:'additional_config'] + end + + if attributes.key?(:'_end') + self._end = attributes[:'_end'] + end + + if attributes.key?(:'height') + self.height = attributes[:'height'] + end + + if attributes.key?(:'is_authenticated') + self.is_authenticated = attributes[:'is_authenticated'] + end + + if attributes.key?(:'start') + self.start = attributes[:'start'] + end + + if attributes.key?(:'ttl') + self.ttl = attributes[:'ttl'] + end + + if attributes.key?(:'widget_definition') + self.widget_definition = attributes[:'widget_definition'] + end + + if attributes.key?(:'width') + self.width = attributes[:'width'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @_end.nil? + return false if @start.nil? + return false if @widget_definition.nil? + true + end + + # Custom attribute writer method with validation + # @param _end [Object] Object to be assigned + # @!visibility private + def _end=(_end) + if _end.nil? + fail ArgumentError, 'invalid value for "_end", _end cannot be nil.' + end + @_end = _end + end + + # Custom attribute writer method with validation + # @param start [Object] Object to be assigned + # @!visibility private + def start=(start) + if start.nil? + fail ArgumentError, 'invalid value for "start", start cannot be nil.' + end + @start = start + end + + # Custom attribute writer method with validation + # @param widget_definition [Object] Object to be assigned + # @!visibility private + def widget_definition=(widget_definition) + if widget_definition.nil? + fail ArgumentError, 'invalid value for "widget_definition", widget_definition cannot be nil.' + end + @widget_definition = widget_definition + 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 && + additional_config == o.additional_config && + _end == o._end && + height == o.height && + is_authenticated == o.is_authenticated && + start == o.start && + ttl == o.ttl && + widget_definition == o.widget_definition && + width == o.width && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [additional_config, _end, height, is_authenticated, start, ttl, widget_definition, width, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_snapshot_data_attributes_response.rb b/lib/datadog_api_client/v2/models/create_snapshot_data_attributes_response.rb new file mode 100644 index 000000000000..582914405ad2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_snapshot_data_attributes_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 + # Attributes of the created snapshot. + class CreateSnapshotDataAttributesResponse + include BaseGenericModel + + # The URL to access the rendered snapshot image. + attr_reader :url + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'url' => :'url' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'url' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateSnapshotDataAttributesResponse` 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?(:'url') + self.url = attributes[:'url'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @url.nil? + true + end + + # Custom attribute writer method with validation + # @param url [Object] Object to be assigned + # @!visibility private + def url=(url) + if url.nil? + fail ArgumentError, 'invalid value for "url", url cannot be nil.' + end + @url = url + 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 && + url == o.url && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [url, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_snapshot_data_request.rb b/lib/datadog_api_client/v2/models/create_snapshot_data_request.rb new file mode 100644 index 000000000000..c863750e69c5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_snapshot_data_request.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 + # Data envelope for snapshot creation. + class CreateSnapshotDataRequest + include BaseGenericModel + + # Attributes for snapshot creation. + attr_reader :attributes + + # The type identifier for snapshot creation resources. + 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', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CreateSnapshotDataAttributesRequest', + :'type' => :'CreateSnapshotType' + } + 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::CreateSnapshotDataRequest` 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?(:'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 && + 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, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_snapshot_data_response.rb b/lib/datadog_api_client/v2/models/create_snapshot_data_response.rb new file mode 100644 index 000000000000..26fdd65b1155 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_snapshot_data_response.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 + # Data envelope for the snapshot creation response. + class CreateSnapshotDataResponse + include BaseGenericModel + + # Attributes of the created snapshot. + attr_reader :attributes + + # The unique identifier of the created snapshot. + attr_reader :id + + # The type identifier for snapshot creation resources. + 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' => :'CreateSnapshotDataAttributesResponse', + :'id' => :'String', + :'type' => :'CreateSnapshotType' + } + 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::CreateSnapshotDataResponse` 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/create_snapshot_request.rb b/lib/datadog_api_client/v2/models/create_snapshot_request.rb new file mode 100644 index 000000000000..59652b0a116a --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_snapshot_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 for creating a graph snapshot. + class CreateSnapshotRequest + include BaseGenericModel + + # Data envelope for snapshot creation. + 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' => :'CreateSnapshotDataRequest' + } + 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::CreateSnapshotRequest` 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/create_snapshot_response.rb b/lib/datadog_api_client/v2/models/create_snapshot_response.rb new file mode 100644 index 000000000000..f3d90abc834b --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_snapshot_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 body for a snapshot creation request. + class CreateSnapshotResponse + include BaseGenericModel + + # Data envelope for the snapshot creation 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' => :'CreateSnapshotDataResponse' + } + 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::CreateSnapshotResponse` 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/create_snapshot_template_variable.rb b/lib/datadog_api_client/v2/models/create_snapshot_template_variable.rb new file mode 100644 index 000000000000..304fce38419b --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_snapshot_template_variable.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 template variable definition for snapshot rendering. + class CreateSnapshotTemplateVariable + include BaseGenericModel + + # The template variable name. + attr_reader :name + + # The tag prefix associated with the template variable. For example, a prefix of `host` with a value of `web-server-1` scopes the snapshot to `host:web-server-1`. + attr_reader :prefix + + # The list of scoped values for this template variable. + attr_reader :values + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'prefix' => :'prefix', + :'values' => :'values' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'prefix' => :'String', + :'values' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateSnapshotTemplateVariable` 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?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'prefix') + self.prefix = attributes[:'prefix'] + end + + if attributes.key?(:'values') + if (value = attributes[:'values']).is_a?(Array) + self.values = 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 @name.nil? + return false if @prefix.nil? + return false if @values.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param prefix [Object] Object to be assigned + # @!visibility private + def prefix=(prefix) + if prefix.nil? + fail ArgumentError, 'invalid value for "prefix", prefix cannot be nil.' + end + @prefix = prefix + end + + # Custom attribute writer method with validation + # @param values [Object] Object to be assigned + # @!visibility private + def values=(values) + if values.nil? + fail ArgumentError, 'invalid value for "values", values cannot be nil.' + end + @values = values + 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 && + name == o.name && + prefix == o.prefix && + values == o.values && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, prefix, values, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_snapshot_timeseries_legend_type.rb b/lib/datadog_api_client/v2/models/create_snapshot_timeseries_legend_type.rb new file mode 100644 index 000000000000..82348bc1be60 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_snapshot_timeseries_legend_type.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The legend display type for timeseries widgets. A value of `none` hides the legend entirely; omitting the field lets the frontend choose automatically. + class CreateSnapshotTimeseriesLegendType + include BaseEnumModel + + COMPACT = "compact".freeze + EXPANDED = "expanded".freeze + NONE = "none".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/create_snapshot_ttl.rb b/lib/datadog_api_client/v2/models/create_snapshot_ttl.rb new file mode 100644 index 000000000000..94e538dc97c6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_snapshot_ttl.rb @@ -0,0 +1,31 @@ +=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 time-to-live for the snapshot. This value corresponds to storage lifecycle policies that automatically delete the snapshot after the specified period. + class CreateSnapshotTTL + include BaseEnumModel + + THIRTY_DAYS = "30d".freeze + SIXTY_DAYS = "60d".freeze + NINETY_DAYS = "90d".freeze + ONE_YEAR = "1y".freeze + TWO_YEARS = "2y".freeze + INFINITE = "inf".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/create_snapshot_type.rb b/lib/datadog_api_client/v2/models/create_snapshot_type.rb new file mode 100644 index 000000000000..cef427646163 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_snapshot_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 identifier for snapshot creation resources. + class CreateSnapshotType + include BaseEnumModel + + CREATE_SNAPSHOT = "create_snapshot".freeze + end +end