diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e694506b53cd..f217c44a2b17 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1758,6 +1758,14 @@ components: schema: example: "my-service" type: string + SharedDashboardDashboardIDPathParameter: + description: ID of the dashboard. + in: path + name: dashboard_id + required: true + schema: + example: abc-def-ghi + type: string SignalID: description: The ID of the signal. in: path @@ -53289,6 +53297,23 @@ components: meta: $ref: "#/components/schemas/ServiceAccessTokenResponseMeta" type: object + ListSharedDashboardsResponse: + description: Response containing shared dashboards for a dashboard. + properties: + data: + description: Shared dashboards for the dashboard. + items: + $ref: "#/components/schemas/SharedDashboardResponse" + type: array + included: + description: Users and dashboards related to the shared dashboards. + items: + $ref: "#/components/schemas/SharedDashboardIncluded" + type: array + required: + - data + - included + type: object ListSourcemapsResponse: description: Response containing a paginated list of source maps. properties: @@ -87277,6 +87302,347 @@ components: required: - type type: object + SharedDashboardGlobalTime: + additionalProperties: {} + description: Default time range configuration for the shared dashboard. + example: + live_span: 1h + nullable: true + type: object + SharedDashboardIncluded: + description: Resource included with a shared dashboard. + oneOf: + - $ref: "#/components/schemas/SharedDashboardIncludedDashboard" + - $ref: "#/components/schemas/SharedDashboardIncludedUser" + SharedDashboardIncludedDashboard: + description: Included dashboard resource. + properties: + attributes: + $ref: "#/components/schemas/SharedDashboardIncludedDashboardAttributes" + id: + description: ID of the dashboard. + example: abc-def-ghi + type: string + type: + $ref: "#/components/schemas/SharedDashboardIncludedDashboardType" + required: + - id + - type + - attributes + type: object + SharedDashboardIncludedDashboardAttributes: + description: Attributes of the included dashboard. + properties: + title: + description: Dashboard title. + example: Q1 Metrics Dashboard + type: string + required: + - title + type: object + SharedDashboardIncludedDashboardType: + default: dashboard + description: Included dashboard resource type. + enum: + - dashboard + example: dashboard + type: string + x-enum-varnames: + - DASHBOARD + SharedDashboardIncludedUser: + description: Included user resource. + properties: + attributes: + $ref: "#/components/schemas/SharedDashboardIncludedUserAttributes" + id: + description: ID of the user. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + $ref: "#/components/schemas/UserResourceType" + required: + - id + - type + - attributes + type: object + SharedDashboardIncludedUserAttributes: + description: Attributes of the included user. + properties: + handle: + description: User handle. + example: jane.doe@example.com + type: string + name: + description: User display name. + example: Jane Doe + type: string + required: + - handle + - name + type: object + SharedDashboardInvitee: + description: Invitee that can access an invite-only shared dashboard. + properties: + access_expiration: + description: Time when the invitee's access expires. + example: "2026-01-15T09:30:00.000Z" + format: date-time + nullable: true + type: string + created_at: + description: Time when the invitee was added. + example: "2026-01-01T00:00:00.000Z" + format: date-time + type: string + email: + description: Email address of the invitee. + example: jane.doe@example.com + type: string + required: + - email + - access_expiration + - created_at + type: object + SharedDashboardRelationshipDashboard: + description: Dashboard associated with the shared dashboard. + properties: + data: + $ref: "#/components/schemas/SharedDashboardRelationshipDashboardData" + required: + - data + type: object + SharedDashboardRelationshipDashboardData: + description: Dashboard relationship data. + properties: + id: + description: ID of the dashboard. + example: abc-def-ghi + type: string + type: + $ref: "#/components/schemas/SharedDashboardIncludedDashboardType" + required: + - id + - type + type: object + SharedDashboardRelationshipSharer: + description: User who shared the dashboard. + properties: + data: + $ref: "#/components/schemas/UserRelationshipData" + required: + - data + type: object + SharedDashboardRelationships: + description: Relationships of a shared dashboard. + properties: + dashboard: + $ref: "#/components/schemas/SharedDashboardRelationshipDashboard" + sharer: + $ref: "#/components/schemas/SharedDashboardRelationshipSharer" + required: + - dashboard + - sharer + type: object + SharedDashboardResponse: + description: A shared dashboard response resource. + properties: + attributes: + $ref: "#/components/schemas/SharedDashboardResponseAttributes" + id: + description: ID of the shared dashboard. + example: "12345" + type: string + relationships: + $ref: "#/components/schemas/SharedDashboardRelationships" + type: + $ref: "#/components/schemas/SharedDashboardType" + required: + - id + - type + - attributes + - relationships + type: object + SharedDashboardResponseAttributes: + description: Attributes of a shared dashboard response. + properties: + created_at: + description: Time when the shared dashboard was created. + example: "2026-01-01T00:00:00.000Z" + format: date-time + type: string + embeddable_domains: + description: Domains where embed-type shared dashboards can be embedded. + example: ["https://example.com"] + items: + description: An embeddable domain. + type: string + type: array + expiration: + description: Time when the shared dashboard expires. + example: "2026-02-01T00:00:00.000Z" + format: date-time + nullable: true + type: string + global_time: + $ref: "#/components/schemas/SharedDashboardGlobalTime" + global_time_selectable: + description: Whether viewers can select a different global time setting. + example: false + type: boolean + invitees: + description: Invitees for invite-only shared dashboards. + items: + $ref: "#/components/schemas/SharedDashboardInvitee" + type: array + last_accessed: + description: Time when the shared dashboard was last accessed. + example: "2026-01-15T09:30:00.000Z" + format: date-time + nullable: true + type: string + selectable_template_vars: + description: Template variables that viewers can modify. + items: + $ref: "#/components/schemas/SharedDashboardSelectableTemplateVariable" + type: array + share_type: + $ref: "#/components/schemas/SharedDashboardShareType" + sharer_disabled: + description: Whether the user who shared the dashboard is disabled. + example: false + type: boolean + status: + $ref: "#/components/schemas/SharedDashboardStatus" + title: + description: Display title for the shared dashboard. + example: Q1 Metrics Dashboard + type: string + token: + description: Token assigned to the shared dashboard. + example: abc-123-token + type: string + url: + description: URL for the shared dashboard. + example: https://p.datadoghq.com/sb/abc-123-token + type: string + viewing_preferences: + $ref: "#/components/schemas/SharedDashboardViewingPreferences" + required: + - token + - title + - url + - viewing_preferences + - global_time_selectable + - global_time + - selectable_template_vars + - created_at + - last_accessed + - status + - share_type + - invitees + - embeddable_domains + - expiration + - sharer_disabled + type: object + SharedDashboardSelectableTemplateVariable: + description: A template variable that viewers can modify on the shared dashboard. + properties: + allow_any_value: + description: Whether viewers can see all tag values for the template variable and specify any value. + example: false + type: boolean + default_values: + description: Default selected values for the variable. + example: ["prod"] + items: + description: A default value for the template variable. + type: string + type: array + name: + description: Name of the template variable. + example: environment + type: string + prefix: + description: Tag prefix for the variable. + example: env + type: string + type: + description: Type of the template variable. + example: group + type: string + visible_tags: + description: Restricts which tag values are visible to the viewer. + example: ["prod"] + items: + description: A visible tag value for the template variable. + type: string + type: array + required: + - name + - prefix + - type + - allow_any_value + - default_values + - visible_tags + type: object + SharedDashboardShareType: + description: Type of dashboard sharing. + enum: + - open + - invite + - embed + - secure-embed + example: invite + type: string + x-enum-varnames: + - OPEN + - INVITE + - EMBED + - SECURE_EMBED + SharedDashboardStatus: + description: Status of the shared dashboard. + enum: + - active + - paused + example: active + type: string + x-enum-varnames: + - ACTIVE + - PAUSED + SharedDashboardType: + default: shared_dashboard + description: Shared dashboard resource type. + enum: + - shared_dashboard + example: shared_dashboard + type: string + x-enum-varnames: + - SHARED_DASHBOARD + SharedDashboardViewingPreferences: + description: Display settings for the shared dashboard. + properties: + high_density: + description: Whether widgets are displayed in high-density mode. + example: false + type: boolean + theme: + $ref: "#/components/schemas/SharedDashboardViewingPreferencesTheme" + required: + - high_density + - theme + type: object + SharedDashboardViewingPreferencesTheme: + description: The theme of the shared dashboard view. `system` follows the viewer's system default. + enum: + - system + - light + - dark + example: system + type: string + x-enum-varnames: + - SYSTEM + - LIGHT + - DARK Shift: description: An on-call shift with its associated data and relationships. example: @@ -122522,6 +122888,95 @@ paths: tags: - Dashboard Lists x-codegen-request-body-name: body + /api/v2/dashboard/{dashboard_id}/shared: + get: + description: Retrieve shared dashboards associated with the specified dashboard. + operationId: ListSharedDashboardsByDashboardId + parameters: + - $ref: "#/components/parameters/SharedDashboardDashboardIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2026-01-01T00:00:00.000Z" + embeddable_domains: [] + expiration: + global_time: + live_span: 1h + global_time_selectable: false + invitees: + - access_expiration: + created_at: "2026-01-01T00:00:00.000Z" + email: jane.doe@example.com + last_accessed: + selectable_template_vars: [] + share_type: invite + sharer_disabled: false + status: active + title: Q1 Metrics Dashboard + token: abc-123-token + url: https://p.datadoghq.com/sb/abc-123-token + viewing_preferences: + high_density: false + theme: system + id: "12345" + relationships: + dashboard: + data: + id: abc-def-ghi + type: dashboard + sharer: + data: + id: 00000000-0000-0000-0000-000000000000 + type: user + type: shared_dashboard + included: + - attributes: + title: Q1 Metrics Dashboard + id: abc-def-ghi + type: dashboard + - attributes: + handle: jane.doe@example.com + name: Jane Doe + id: 00000000-0000-0000-0000-000000000000 + type: user + schema: + $ref: "#/components/schemas/ListSharedDashboardsResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Dashboard Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - dashboards_read + summary: List shared dashboards for a dashboard + tags: + - Dashboard Sharing + "x-permission": + operator: OR + permissions: + - dashboards_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/dashboard/{dashboard_id}/shared/secure-embed: post: description: >- @@ -183558,6 +184013,8 @@ tags: - **Embed** sharing must be enabled under **Organization Settings** > **Public Sharing** > **Shared Dashboards**. - You need [an API key and an application key](https://docs.datadoghq.com/account_management/api-app-keys/) to interact with these endpoints. name: Dashboard Secure Embed + - description: Manage dashboard sharing configurations. + name: Dashboard Sharing - description: |- Get usage statistics for the dashboards in your organization, including view counts, last-edit times, widget counts, and quality scores. See the diff --git a/examples/v2/dashboard-sharing/ListSharedDashboardsByDashboardId.rb b/examples/v2/dashboard-sharing/ListSharedDashboardsByDashboardId.rb new file mode 100644 index 000000000000..ffa29d52a732 --- /dev/null +++ b/examples/v2/dashboard-sharing/ListSharedDashboardsByDashboardId.rb @@ -0,0 +1,8 @@ +# List shared dashboards for a dashboard returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_shared_dashboards_by_dashboard_id".to_sym] = true +end +api_instance = DatadogAPIClient::V2::DashboardSharingAPI.new +p api_instance.list_shared_dashboards_by_dashboard_id("abc-def-ghi") diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 9707cb7577db..17e5468e9f40 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2908,6 +2908,9 @@ "dashboard_list_id" => "Integer", "body" => "DashboardListUpdateItemsRequest", }, + "v2.ListSharedDashboardsByDashboardId" => { + "dashboard_id" => "String", + }, "v2.CreateDashboardSecureEmbed" => { "dashboard_id" => "String", "body" => "SecureEmbedCreateRequest", diff --git a/features/v2/dashboard_sharing.feature b/features/v2/dashboard_sharing.feature new file mode 100644 index 000000000000..45257252d39e --- /dev/null +++ b/features/v2/dashboard_sharing.feature @@ -0,0 +1,22 @@ +@endpoint(dashboard-sharing) @endpoint(dashboard-sharing-v2) +Feature: Dashboard Sharing + Manage dashboard sharing configurations. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "DashboardSharing" API + And operation "ListSharedDashboardsByDashboardId" enabled + And new "ListSharedDashboardsByDashboardId" request + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: List shared dashboards for a dashboard returns "Dashboard Not Found" response + Given request contains "dashboard_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Dashboard Not Found + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: List shared dashboards for a dashboard returns "OK" response + Given request contains "dashboard_id" parameter from "REPLACE.ME" + 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 811e650c25b9..50dc60a97d38 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2165,6 +2165,12 @@ "type": "safe" } }, + "ListSharedDashboardsByDashboardId": { + "tag": "Dashboard Sharing", + "undo": { + "type": "safe" + } + }, "CreateDashboardSecureEmbed": { "tag": "Dashboard Secure Embed", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 1323e5b92ec1..446ec8109d65 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -416,6 +416,7 @@ def initialize "v2.list_csm_agentless_hosts": false, "v2.list_csm_unified_host_facets": false, "v2.list_csm_unified_hosts": false, + "v2.list_shared_dashboards_by_dashboard_id": false, "v2.create_dashboard_secure_embed": false, "v2.delete_dashboard_secure_embed": false, "v2.get_dashboard_secure_embed": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 93b0106d173c..943454d83289 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3967,6 +3967,7 @@ def overrides "v2.list_scorecards_response" => "ListScorecardsResponse", "v2.list_security_findings_response" => "ListSecurityFindingsResponse", "v2.list_service_access_tokens_response" => "ListServiceAccessTokensResponse", + "v2.list_shared_dashboards_response" => "ListSharedDashboardsResponse", "v2.list_sourcemaps_response" => "ListSourcemapsResponse", "v2.list_tags_response" => "ListTagsResponse", "v2.list_tags_response_data" => "ListTagsResponseData", @@ -6471,6 +6472,25 @@ def overrides "v2.service_repository_info_status" => "ServiceRepositoryInfoStatus", "v2.session_id_array" => "SessionIdArray", "v2.session_id_data" => "SessionIdData", + "v2.shared_dashboard_included" => "SharedDashboardIncluded", + "v2.shared_dashboard_included_dashboard" => "SharedDashboardIncludedDashboard", + "v2.shared_dashboard_included_dashboard_attributes" => "SharedDashboardIncludedDashboardAttributes", + "v2.shared_dashboard_included_dashboard_type" => "SharedDashboardIncludedDashboardType", + "v2.shared_dashboard_included_user" => "SharedDashboardIncludedUser", + "v2.shared_dashboard_included_user_attributes" => "SharedDashboardIncludedUserAttributes", + "v2.shared_dashboard_invitee" => "SharedDashboardInvitee", + "v2.shared_dashboard_relationship_dashboard" => "SharedDashboardRelationshipDashboard", + "v2.shared_dashboard_relationship_dashboard_data" => "SharedDashboardRelationshipDashboardData", + "v2.shared_dashboard_relationships" => "SharedDashboardRelationships", + "v2.shared_dashboard_relationship_sharer" => "SharedDashboardRelationshipSharer", + "v2.shared_dashboard_response" => "SharedDashboardResponse", + "v2.shared_dashboard_response_attributes" => "SharedDashboardResponseAttributes", + "v2.shared_dashboard_selectable_template_variable" => "SharedDashboardSelectableTemplateVariable", + "v2.shared_dashboard_share_type" => "SharedDashboardShareType", + "v2.shared_dashboard_status" => "SharedDashboardStatus", + "v2.shared_dashboard_type" => "SharedDashboardType", + "v2.shared_dashboard_viewing_preferences" => "SharedDashboardViewingPreferences", + "v2.shared_dashboard_viewing_preferences_theme" => "SharedDashboardViewingPreferencesTheme", "v2.shift" => "Shift", "v2.shift_data" => "ShiftData", "v2.shift_data_attributes" => "ShiftDataAttributes", @@ -7557,6 +7577,7 @@ def overrides "v2.customer_org_api" => "CustomerOrgAPI", "v2.dashboard_lists_api" => "DashboardListsAPI", "v2.dashboard_secure_embed_api" => "DashboardSecureEmbedAPI", + "v2.dashboard_sharing_api" => "DashboardSharingAPI", "v2.dashboards_api" => "DashboardsAPI", "v2.data_deletion_api" => "DataDeletionAPI", "v2.datasets_api" => "DatasetsAPI", diff --git a/lib/datadog_api_client/v2/api/dashboard_sharing_api.rb b/lib/datadog_api_client/v2/api/dashboard_sharing_api.rb new file mode 100644 index 000000000000..b7c34682bc63 --- /dev/null +++ b/lib/datadog_api_client/v2/api/dashboard_sharing_api.rb @@ -0,0 +1,97 @@ +=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 DashboardSharingAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # List shared dashboards for a dashboard. + # + # @see #list_shared_dashboards_by_dashboard_id_with_http_info + def list_shared_dashboards_by_dashboard_id(dashboard_id, opts = {}) + data, _status_code, _headers = list_shared_dashboards_by_dashboard_id_with_http_info(dashboard_id, opts) + data + end + + # List shared dashboards for a dashboard. + # + # Retrieve shared dashboards associated with the specified dashboard. + # + # @param dashboard_id [String] ID of the dashboard. + # @param opts [Hash] the optional parameters + # @return [Array<(ListSharedDashboardsResponse, Integer, Hash)>] ListSharedDashboardsResponse data, response status code and response headers + def list_shared_dashboards_by_dashboard_id_with_http_info(dashboard_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_shared_dashboards_by_dashboard_id".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_shared_dashboards_by_dashboard_id") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_shared_dashboards_by_dashboard_id")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DashboardSharingAPI.list_shared_dashboards_by_dashboard_id ...' + end + # verify the required parameter 'dashboard_id' is set + if @api_client.config.client_side_validation && dashboard_id.nil? + fail ArgumentError, "Missing the required parameter 'dashboard_id' when calling DashboardSharingAPI.list_shared_dashboards_by_dashboard_id" + end + # resource path + local_var_path = '/api/v2/dashboard/{dashboard_id}/shared'.sub('{dashboard_id}', CGI.escape(dashboard_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(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListSharedDashboardsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_shared_dashboards_by_dashboard_id, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DashboardSharingAPI#list_shared_dashboards_by_dashboard_id\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/list_shared_dashboards_response.rb b/lib/datadog_api_client/v2/models/list_shared_dashboards_response.rb new file mode 100644 index 000000000000..8f48721b723c --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_shared_dashboards_response.rb @@ -0,0 +1,148 @@ +=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 containing shared dashboards for a dashboard. + class ListSharedDashboardsResponse + include BaseGenericModel + + # Shared dashboards for the dashboard. + attr_reader :data + + # Users and dashboards related to the shared dashboards. + attr_reader :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'included' => :'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::ListSharedDashboardsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + return false if @included.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 + + # Custom attribute writer method with validation + # @param included [Object] Object to be assigned + # @!visibility private + def included=(included) + if included.nil? + fail ArgumentError, 'invalid value for "included", included cannot be nil.' + end + @included = included + 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 && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/shared_dashboard_included.rb b/lib/datadog_api_client/v2/models/shared_dashboard_included.rb new file mode 100644 index 000000000000..7cc0e06695d7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/shared_dashboard_included.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 + # Resource included with a shared dashboard. + module SharedDashboardIncluded + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'SharedDashboardIncludedDashboard', + :'SharedDashboardIncludedUser' + ] + 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/shared_dashboard_included_dashboard.rb b/lib/datadog_api_client/v2/models/shared_dashboard_included_dashboard.rb new file mode 100644 index 000000000000..9cbca0f5a69e --- /dev/null +++ b/lib/datadog_api_client/v2/models/shared_dashboard_included_dashboard.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 + # Included dashboard resource. + class SharedDashboardIncludedDashboard + include BaseGenericModel + + # Attributes of the included dashboard. + attr_reader :attributes + + # ID of the dashboard. + attr_reader :id + + # Included dashboard resource type. + 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' => :'SharedDashboardIncludedDashboardAttributes', + :'id' => :'String', + :'type' => :'SharedDashboardIncludedDashboardType' + } + 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::SharedDashboardIncludedDashboard` 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/shared_dashboard_included_dashboard_attributes.rb b/lib/datadog_api_client/v2/models/shared_dashboard_included_dashboard_attributes.rb new file mode 100644 index 000000000000..88b71ba75766 --- /dev/null +++ b/lib/datadog_api_client/v2/models/shared_dashboard_included_dashboard_attributes.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 included dashboard. + class SharedDashboardIncludedDashboardAttributes + include BaseGenericModel + + # Dashboard title. + attr_reader :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'title' => :'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::SharedDashboardIncludedDashboardAttributes` 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?(:'title') + self.title = attributes[:'title'] + 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 @title.nil? + true + end + + # Custom attribute writer method with validation + # @param title [Object] Object to be assigned + # @!visibility private + def title=(title) + if title.nil? + fail ArgumentError, 'invalid value for "title", title cannot be nil.' + end + @title = title + 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 && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/shared_dashboard_included_dashboard_type.rb b/lib/datadog_api_client/v2/models/shared_dashboard_included_dashboard_type.rb new file mode 100644 index 000000000000..01d63a2c851f --- /dev/null +++ b/lib/datadog_api_client/v2/models/shared_dashboard_included_dashboard_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 + # Included dashboard resource type. + class SharedDashboardIncludedDashboardType + include BaseEnumModel + + DASHBOARD = "dashboard".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/shared_dashboard_included_user.rb b/lib/datadog_api_client/v2/models/shared_dashboard_included_user.rb new file mode 100644 index 000000000000..5554c19da977 --- /dev/null +++ b/lib/datadog_api_client/v2/models/shared_dashboard_included_user.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 + # Included user resource. + class SharedDashboardIncludedUser + include BaseGenericModel + + # Attributes of the included user. + attr_reader :attributes + + # ID of the user. + attr_reader :id + + # User resource type. + 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' => :'SharedDashboardIncludedUserAttributes', + :'id' => :'String', + :'type' => :'UserResourceType' + } + 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::SharedDashboardIncludedUser` 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/shared_dashboard_included_user_attributes.rb b/lib/datadog_api_client/v2/models/shared_dashboard_included_user_attributes.rb new file mode 100644 index 000000000000..415c92d6b211 --- /dev/null +++ b/lib/datadog_api_client/v2/models/shared_dashboard_included_user_attributes.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 + # Attributes of the included user. + class SharedDashboardIncludedUserAttributes + include BaseGenericModel + + # User handle. + attr_reader :handle + + # User display name. + attr_reader :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'handle' => :'handle', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'handle' => :'String', + :'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::SharedDashboardIncludedUserAttributes` 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?(:'handle') + self.handle = attributes[:'handle'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + 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 @handle.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param handle [Object] Object to be assigned + # @!visibility private + def handle=(handle) + if handle.nil? + fail ArgumentError, 'invalid value for "handle", handle cannot be nil.' + end + @handle = handle + 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 + + # 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 && + handle == o.handle && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [handle, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/shared_dashboard_invitee.rb b/lib/datadog_api_client/v2/models/shared_dashboard_invitee.rb new file mode 100644 index 000000000000..f62b025caee9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/shared_dashboard_invitee.rb @@ -0,0 +1,162 @@ +=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 + # Invitee that can access an invite-only shared dashboard. + class SharedDashboardInvitee + include BaseGenericModel + + # Time when the invitee's access expires. + attr_accessor :access_expiration + + # Time when the invitee was added. + attr_reader :created_at + + # Email address of the invitee. + attr_reader :email + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'access_expiration' => :'access_expiration', + :'created_at' => :'created_at', + :'email' => :'email' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'access_expiration' => :'Time', + :'created_at' => :'Time', + :'email' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'access_expiration', + ]) + 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::SharedDashboardInvitee` 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?(:'access_expiration') + self.access_expiration = attributes[:'access_expiration'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + 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 @created_at.nil? + return false if @email.nil? + true + 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 email [Object] Object to be assigned + # @!visibility private + def email=(email) + if email.nil? + fail ArgumentError, 'invalid value for "email", email cannot be nil.' + end + @email = email + 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 && + access_expiration == o.access_expiration && + created_at == o.created_at && + email == o.email && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [access_expiration, created_at, email, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/shared_dashboard_relationship_dashboard.rb b/lib/datadog_api_client/v2/models/shared_dashboard_relationship_dashboard.rb new file mode 100644 index 000000000000..e5e3fceb5f07 --- /dev/null +++ b/lib/datadog_api_client/v2/models/shared_dashboard_relationship_dashboard.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 + # Dashboard associated with the shared dashboard. + class SharedDashboardRelationshipDashboard + include BaseGenericModel + + # Dashboard relationship data. + 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' => :'SharedDashboardRelationshipDashboardData' + } + 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::SharedDashboardRelationshipDashboard` 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/shared_dashboard_relationship_dashboard_data.rb b/lib/datadog_api_client/v2/models/shared_dashboard_relationship_dashboard_data.rb new file mode 100644 index 000000000000..ede82395ac4a --- /dev/null +++ b/lib/datadog_api_client/v2/models/shared_dashboard_relationship_dashboard_data.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 + # Dashboard relationship data. + class SharedDashboardRelationshipDashboardData + include BaseGenericModel + + # ID of the dashboard. + attr_reader :id + + # Included dashboard resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'SharedDashboardIncludedDashboardType' + } + 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::SharedDashboardRelationshipDashboardData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/shared_dashboard_relationship_sharer.rb b/lib/datadog_api_client/v2/models/shared_dashboard_relationship_sharer.rb new file mode 100644 index 000000000000..21d9b0d41e96 --- /dev/null +++ b/lib/datadog_api_client/v2/models/shared_dashboard_relationship_sharer.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 + # User who shared the dashboard. + class SharedDashboardRelationshipSharer + include BaseGenericModel + + # Relationship to user object. + 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' => :'UserRelationshipData' + } + 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::SharedDashboardRelationshipSharer` 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/shared_dashboard_relationships.rb b/lib/datadog_api_client/v2/models/shared_dashboard_relationships.rb new file mode 100644 index 000000000000..d55b153a0fb1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/shared_dashboard_relationships.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 + # Relationships of a shared dashboard. + class SharedDashboardRelationships + include BaseGenericModel + + # Dashboard associated with the shared dashboard. + attr_reader :dashboard + + # User who shared the dashboard. + attr_reader :sharer + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'dashboard' => :'dashboard', + :'sharer' => :'sharer' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'dashboard' => :'SharedDashboardRelationshipDashboard', + :'sharer' => :'SharedDashboardRelationshipSharer' + } + 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::SharedDashboardRelationships` 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?(:'dashboard') + self.dashboard = attributes[:'dashboard'] + end + + if attributes.key?(:'sharer') + self.sharer = attributes[:'sharer'] + 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 @dashboard.nil? + return false if @sharer.nil? + true + end + + # Custom attribute writer method with validation + # @param dashboard [Object] Object to be assigned + # @!visibility private + def dashboard=(dashboard) + if dashboard.nil? + fail ArgumentError, 'invalid value for "dashboard", dashboard cannot be nil.' + end + @dashboard = dashboard + end + + # Custom attribute writer method with validation + # @param sharer [Object] Object to be assigned + # @!visibility private + def sharer=(sharer) + if sharer.nil? + fail ArgumentError, 'invalid value for "sharer", sharer cannot be nil.' + end + @sharer = sharer + 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 && + dashboard == o.dashboard && + sharer == o.sharer && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [dashboard, sharer, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/shared_dashboard_response.rb b/lib/datadog_api_client/v2/models/shared_dashboard_response.rb new file mode 100644 index 000000000000..bb7600fd9fbf --- /dev/null +++ b/lib/datadog_api_client/v2/models/shared_dashboard_response.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A shared dashboard response resource. + class SharedDashboardResponse + include BaseGenericModel + + # Attributes of a shared dashboard response. + attr_reader :attributes + + # ID of the shared dashboard. + attr_reader :id + + # Relationships of a shared dashboard. + attr_reader :relationships + + # Shared dashboard resource type. + 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', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SharedDashboardResponseAttributes', + :'id' => :'String', + :'relationships' => :'SharedDashboardRelationships', + :'type' => :'SharedDashboardType' + } + 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::SharedDashboardResponse` 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?(:'relationships') + self.relationships = attributes[:'relationships'] + 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 @relationships.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 relationships [Object] Object to be assigned + # @!visibility private + def relationships=(relationships) + if relationships.nil? + fail ArgumentError, 'invalid value for "relationships", relationships cannot be nil.' + end + @relationships = relationships + 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 && + relationships == o.relationships && + 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, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/shared_dashboard_response_attributes.rb b/lib/datadog_api_client/v2/models/shared_dashboard_response_attributes.rb new file mode 100644 index 000000000000..c9d6a457c8c3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/shared_dashboard_response_attributes.rb @@ -0,0 +1,400 @@ +=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 shared dashboard response. + class SharedDashboardResponseAttributes + include BaseGenericModel + + # Time when the shared dashboard was created. + attr_reader :created_at + + # Domains where embed-type shared dashboards can be embedded. + attr_reader :embeddable_domains + + # Time when the shared dashboard expires. + attr_accessor :expiration + + # Default time range configuration for the shared dashboard. + attr_accessor :global_time + + # Whether viewers can select a different global time setting. + attr_reader :global_time_selectable + + # Invitees for invite-only shared dashboards. + attr_reader :invitees + + # Time when the shared dashboard was last accessed. + attr_accessor :last_accessed + + # Template variables that viewers can modify. + attr_reader :selectable_template_vars + + # Type of dashboard sharing. + attr_reader :share_type + + # Whether the user who shared the dashboard is disabled. + attr_reader :sharer_disabled + + # Status of the shared dashboard. + attr_reader :status + + # Display title for the shared dashboard. + attr_reader :title + + # Token assigned to the shared dashboard. + attr_reader :token + + # URL for the shared dashboard. + attr_reader :url + + # Display settings for the shared dashboard. + attr_reader :viewing_preferences + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'embeddable_domains' => :'embeddable_domains', + :'expiration' => :'expiration', + :'global_time' => :'global_time', + :'global_time_selectable' => :'global_time_selectable', + :'invitees' => :'invitees', + :'last_accessed' => :'last_accessed', + :'selectable_template_vars' => :'selectable_template_vars', + :'share_type' => :'share_type', + :'sharer_disabled' => :'sharer_disabled', + :'status' => :'status', + :'title' => :'title', + :'token' => :'token', + :'url' => :'url', + :'viewing_preferences' => :'viewing_preferences' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'embeddable_domains' => :'Array', + :'expiration' => :'Time', + :'global_time' => :'Hash', + :'global_time_selectable' => :'Boolean', + :'invitees' => :'Array', + :'last_accessed' => :'Time', + :'selectable_template_vars' => :'Array', + :'share_type' => :'SharedDashboardShareType', + :'sharer_disabled' => :'Boolean', + :'status' => :'SharedDashboardStatus', + :'title' => :'String', + :'token' => :'String', + :'url' => :'String', + :'viewing_preferences' => :'SharedDashboardViewingPreferences' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'expiration', + :'global_time', + :'last_accessed', + ]) + 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::SharedDashboardResponseAttributes` 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?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'embeddable_domains') + if (value = attributes[:'embeddable_domains']).is_a?(Array) + self.embeddable_domains = value + end + end + + if attributes.key?(:'expiration') + self.expiration = attributes[:'expiration'] + end + + if attributes.key?(:'global_time') + self.global_time = attributes[:'global_time'] + end + + if attributes.key?(:'global_time_selectable') + self.global_time_selectable = attributes[:'global_time_selectable'] + end + + if attributes.key?(:'invitees') + if (value = attributes[:'invitees']).is_a?(Array) + self.invitees = value + end + end + + if attributes.key?(:'last_accessed') + self.last_accessed = attributes[:'last_accessed'] + end + + if attributes.key?(:'selectable_template_vars') + if (value = attributes[:'selectable_template_vars']).is_a?(Array) + self.selectable_template_vars = value + end + end + + if attributes.key?(:'share_type') + self.share_type = attributes[:'share_type'] + end + + if attributes.key?(:'sharer_disabled') + self.sharer_disabled = attributes[:'sharer_disabled'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'token') + self.token = attributes[:'token'] + end + + if attributes.key?(:'url') + self.url = attributes[:'url'] + end + + if attributes.key?(:'viewing_preferences') + self.viewing_preferences = attributes[:'viewing_preferences'] + 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 @created_at.nil? + return false if @embeddable_domains.nil? + return false if @global_time_selectable.nil? + return false if @invitees.nil? + return false if @selectable_template_vars.nil? + return false if @share_type.nil? + return false if @sharer_disabled.nil? + return false if @status.nil? + return false if @title.nil? + return false if @token.nil? + return false if @url.nil? + return false if @viewing_preferences.nil? + true + 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 embeddable_domains [Object] Object to be assigned + # @!visibility private + def embeddable_domains=(embeddable_domains) + if embeddable_domains.nil? + fail ArgumentError, 'invalid value for "embeddable_domains", embeddable_domains cannot be nil.' + end + @embeddable_domains = embeddable_domains + end + + # Custom attribute writer method with validation + # @param global_time_selectable [Object] Object to be assigned + # @!visibility private + def global_time_selectable=(global_time_selectable) + if global_time_selectable.nil? + fail ArgumentError, 'invalid value for "global_time_selectable", global_time_selectable cannot be nil.' + end + @global_time_selectable = global_time_selectable + end + + # Custom attribute writer method with validation + # @param invitees [Object] Object to be assigned + # @!visibility private + def invitees=(invitees) + if invitees.nil? + fail ArgumentError, 'invalid value for "invitees", invitees cannot be nil.' + end + @invitees = invitees + end + + # Custom attribute writer method with validation + # @param selectable_template_vars [Object] Object to be assigned + # @!visibility private + def selectable_template_vars=(selectable_template_vars) + if selectable_template_vars.nil? + fail ArgumentError, 'invalid value for "selectable_template_vars", selectable_template_vars cannot be nil.' + end + @selectable_template_vars = selectable_template_vars + end + + # Custom attribute writer method with validation + # @param share_type [Object] Object to be assigned + # @!visibility private + def share_type=(share_type) + if share_type.nil? + fail ArgumentError, 'invalid value for "share_type", share_type cannot be nil.' + end + @share_type = share_type + end + + # Custom attribute writer method with validation + # @param sharer_disabled [Object] Object to be assigned + # @!visibility private + def sharer_disabled=(sharer_disabled) + if sharer_disabled.nil? + fail ArgumentError, 'invalid value for "sharer_disabled", sharer_disabled cannot be nil.' + end + @sharer_disabled = sharer_disabled + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Custom attribute writer method with validation + # @param title [Object] Object to be assigned + # @!visibility private + def title=(title) + if title.nil? + fail ArgumentError, 'invalid value for "title", title cannot be nil.' + end + @title = title + end + + # Custom attribute writer method with validation + # @param token [Object] Object to be assigned + # @!visibility private + def token=(token) + if token.nil? + fail ArgumentError, 'invalid value for "token", token cannot be nil.' + end + @token = token + 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 + + # Custom attribute writer method with validation + # @param viewing_preferences [Object] Object to be assigned + # @!visibility private + def viewing_preferences=(viewing_preferences) + if viewing_preferences.nil? + fail ArgumentError, 'invalid value for "viewing_preferences", viewing_preferences cannot be nil.' + end + @viewing_preferences = viewing_preferences + 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 && + created_at == o.created_at && + embeddable_domains == o.embeddable_domains && + expiration == o.expiration && + global_time == o.global_time && + global_time_selectable == o.global_time_selectable && + invitees == o.invitees && + last_accessed == o.last_accessed && + selectable_template_vars == o.selectable_template_vars && + share_type == o.share_type && + sharer_disabled == o.sharer_disabled && + status == o.status && + title == o.title && + token == o.token && + url == o.url && + viewing_preferences == o.viewing_preferences && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, embeddable_domains, expiration, global_time, global_time_selectable, invitees, last_accessed, selectable_template_vars, share_type, sharer_disabled, status, title, token, url, viewing_preferences, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/shared_dashboard_selectable_template_variable.rb b/lib/datadog_api_client/v2/models/shared_dashboard_selectable_template_variable.rb new file mode 100644 index 000000000000..1c3b9df1954a --- /dev/null +++ b/lib/datadog_api_client/v2/models/shared_dashboard_selectable_template_variable.rb @@ -0,0 +1,232 @@ +=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 that viewers can modify on the shared dashboard. + class SharedDashboardSelectableTemplateVariable + include BaseGenericModel + + # Whether viewers can see all tag values for the template variable and specify any value. + attr_reader :allow_any_value + + # Default selected values for the variable. + attr_reader :default_values + + # Name of the template variable. + attr_reader :name + + # Tag prefix for the variable. + attr_reader :prefix + + # Type of the template variable. + attr_reader :type + + # Restricts which tag values are visible to the viewer. + attr_reader :visible_tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'allow_any_value' => :'allow_any_value', + :'default_values' => :'default_values', + :'name' => :'name', + :'prefix' => :'prefix', + :'type' => :'type', + :'visible_tags' => :'visible_tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'allow_any_value' => :'Boolean', + :'default_values' => :'Array', + :'name' => :'String', + :'prefix' => :'String', + :'type' => :'String', + :'visible_tags' => :'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::SharedDashboardSelectableTemplateVariable` 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?(:'allow_any_value') + self.allow_any_value = attributes[:'allow_any_value'] + end + + if attributes.key?(:'default_values') + if (value = attributes[:'default_values']).is_a?(Array) + self.default_values = value + end + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'prefix') + self.prefix = attributes[:'prefix'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'visible_tags') + if (value = attributes[:'visible_tags']).is_a?(Array) + self.visible_tags = 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 @allow_any_value.nil? + return false if @default_values.nil? + return false if @name.nil? + return false if @prefix.nil? + return false if @type.nil? + return false if @visible_tags.nil? + true + end + + # Custom attribute writer method with validation + # @param allow_any_value [Object] Object to be assigned + # @!visibility private + def allow_any_value=(allow_any_value) + if allow_any_value.nil? + fail ArgumentError, 'invalid value for "allow_any_value", allow_any_value cannot be nil.' + end + @allow_any_value = allow_any_value + end + + # Custom attribute writer method with validation + # @param default_values [Object] Object to be assigned + # @!visibility private + def default_values=(default_values) + if default_values.nil? + fail ArgumentError, 'invalid value for "default_values", default_values cannot be nil.' + end + @default_values = default_values + 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 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 + + # Custom attribute writer method with validation + # @param visible_tags [Object] Object to be assigned + # @!visibility private + def visible_tags=(visible_tags) + if visible_tags.nil? + fail ArgumentError, 'invalid value for "visible_tags", visible_tags cannot be nil.' + end + @visible_tags = visible_tags + 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 && + allow_any_value == o.allow_any_value && + default_values == o.default_values && + name == o.name && + prefix == o.prefix && + type == o.type && + visible_tags == o.visible_tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [allow_any_value, default_values, name, prefix, type, visible_tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/shared_dashboard_share_type.rb b/lib/datadog_api_client/v2/models/shared_dashboard_share_type.rb new file mode 100644 index 000000000000..19ddd44e2910 --- /dev/null +++ b/lib/datadog_api_client/v2/models/shared_dashboard_share_type.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 + # Type of dashboard sharing. + class SharedDashboardShareType + include BaseEnumModel + + OPEN = "open".freeze + INVITE = "invite".freeze + EMBED = "embed".freeze + SECURE_EMBED = "secure-embed".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/shared_dashboard_status.rb b/lib/datadog_api_client/v2/models/shared_dashboard_status.rb new file mode 100644 index 000000000000..435fcfc93832 --- /dev/null +++ b/lib/datadog_api_client/v2/models/shared_dashboard_status.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Status of the shared dashboard. + class SharedDashboardStatus + include BaseEnumModel + + ACTIVE = "active".freeze + PAUSED = "paused".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/shared_dashboard_type.rb b/lib/datadog_api_client/v2/models/shared_dashboard_type.rb new file mode 100644 index 000000000000..d0b5382bde14 --- /dev/null +++ b/lib/datadog_api_client/v2/models/shared_dashboard_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 + # Shared dashboard resource type. + class SharedDashboardType + include BaseEnumModel + + SHARED_DASHBOARD = "shared_dashboard".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/shared_dashboard_viewing_preferences.rb b/lib/datadog_api_client/v2/models/shared_dashboard_viewing_preferences.rb new file mode 100644 index 000000000000..5ba6fd9e3ab2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/shared_dashboard_viewing_preferences.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 + # Display settings for the shared dashboard. + class SharedDashboardViewingPreferences + include BaseGenericModel + + # Whether widgets are displayed in high-density mode. + attr_reader :high_density + + # The theme of the shared dashboard view. `system` follows the viewer's system default. + attr_reader :theme + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'high_density' => :'high_density', + :'theme' => :'theme' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'high_density' => :'Boolean', + :'theme' => :'SharedDashboardViewingPreferencesTheme' + } + 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::SharedDashboardViewingPreferences` 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?(:'high_density') + self.high_density = attributes[:'high_density'] + end + + if attributes.key?(:'theme') + self.theme = attributes[:'theme'] + 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 @high_density.nil? + return false if @theme.nil? + true + end + + # Custom attribute writer method with validation + # @param high_density [Object] Object to be assigned + # @!visibility private + def high_density=(high_density) + if high_density.nil? + fail ArgumentError, 'invalid value for "high_density", high_density cannot be nil.' + end + @high_density = high_density + end + + # Custom attribute writer method with validation + # @param theme [Object] Object to be assigned + # @!visibility private + def theme=(theme) + if theme.nil? + fail ArgumentError, 'invalid value for "theme", theme cannot be nil.' + end + @theme = theme + 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 && + high_density == o.high_density && + theme == o.theme && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [high_density, theme, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/shared_dashboard_viewing_preferences_theme.rb b/lib/datadog_api_client/v2/models/shared_dashboard_viewing_preferences_theme.rb new file mode 100644 index 000000000000..9bcaff206967 --- /dev/null +++ b/lib/datadog_api_client/v2/models/shared_dashboard_viewing_preferences_theme.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 theme of the shared dashboard view. `system` follows the viewer's system default. + class SharedDashboardViewingPreferencesTheme + include BaseEnumModel + + SYSTEM = "system".freeze + LIGHT = "light".freeze + DARK = "dark".freeze + end +end