Skip to content

Commit 6dcd39f

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit a6b6583 of spec repo
1 parent 7a520a2 commit 6dcd39f

28 files changed

Lines changed: 3217 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 457 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# List shared dashboards for a dashboard returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.list_shared_dashboards_by_dashboard_id".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::DashboardSharingAPI.new
8+
p api_instance.list_shared_dashboards_by_dashboard_id("abc-def-ghi")

features/scenarios_model_mapping.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2908,6 +2908,9 @@
29082908
"dashboard_list_id" => "Integer",
29092909
"body" => "DashboardListUpdateItemsRequest",
29102910
},
2911+
"v2.ListSharedDashboardsByDashboardId" => {
2912+
"dashboard_id" => "String",
2913+
},
29112914
"v2.CreateDashboardSecureEmbed" => {
29122915
"dashboard_id" => "String",
29132916
"body" => "SecureEmbedCreateRequest",
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
@endpoint(dashboard-sharing) @endpoint(dashboard-sharing-v2)
2+
Feature: Dashboard Sharing
3+
Manage dashboard sharing configurations.
4+
5+
Background:
6+
Given a valid "apiKeyAuth" key in the system
7+
And a valid "appKeyAuth" key in the system
8+
And an instance of "DashboardSharing" API
9+
And operation "ListSharedDashboardsByDashboardId" enabled
10+
And new "ListSharedDashboardsByDashboardId" request
11+
12+
@generated @skip @team:DataDog/reporting-and-sharing
13+
Scenario: List shared dashboards for a dashboard returns "Dashboard Not Found" response
14+
Given request contains "dashboard_id" parameter from "REPLACE.ME"
15+
When the request is sent
16+
Then the response status is 404 Dashboard Not Found
17+
18+
@generated @skip @team:DataDog/reporting-and-sharing
19+
Scenario: List shared dashboards for a dashboard returns "OK" response
20+
Given request contains "dashboard_id" parameter from "REPLACE.ME"
21+
When the request is sent
22+
Then the response status is 200 OK

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2165,6 +2165,12 @@
21652165
"type": "safe"
21662166
}
21672167
},
2168+
"ListSharedDashboardsByDashboardId": {
2169+
"tag": "Dashboard Sharing",
2170+
"undo": {
2171+
"type": "safe"
2172+
}
2173+
},
21682174
"CreateDashboardSecureEmbed": {
21692175
"tag": "Dashboard Secure Embed",
21702176
"undo": {

lib/datadog_api_client/configuration.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ def initialize
416416
"v2.list_csm_agentless_hosts": false,
417417
"v2.list_csm_unified_host_facets": false,
418418
"v2.list_csm_unified_hosts": false,
419+
"v2.list_shared_dashboards_by_dashboard_id": false,
419420
"v2.create_dashboard_secure_embed": false,
420421
"v2.delete_dashboard_secure_embed": false,
421422
"v2.get_dashboard_secure_embed": false,

lib/datadog_api_client/inflector.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3967,6 +3967,7 @@ def overrides
39673967
"v2.list_scorecards_response" => "ListScorecardsResponse",
39683968
"v2.list_security_findings_response" => "ListSecurityFindingsResponse",
39693969
"v2.list_service_access_tokens_response" => "ListServiceAccessTokensResponse",
3970+
"v2.list_shared_dashboards_response" => "ListSharedDashboardsResponse",
39703971
"v2.list_sourcemaps_response" => "ListSourcemapsResponse",
39713972
"v2.list_tags_response" => "ListTagsResponse",
39723973
"v2.list_tags_response_data" => "ListTagsResponseData",
@@ -6471,6 +6472,25 @@ def overrides
64716472
"v2.service_repository_info_status" => "ServiceRepositoryInfoStatus",
64726473
"v2.session_id_array" => "SessionIdArray",
64736474
"v2.session_id_data" => "SessionIdData",
6475+
"v2.shared_dashboard_included" => "SharedDashboardIncluded",
6476+
"v2.shared_dashboard_included_dashboard" => "SharedDashboardIncludedDashboard",
6477+
"v2.shared_dashboard_included_dashboard_attributes" => "SharedDashboardIncludedDashboardAttributes",
6478+
"v2.shared_dashboard_included_dashboard_type" => "SharedDashboardIncludedDashboardType",
6479+
"v2.shared_dashboard_included_user" => "SharedDashboardIncludedUser",
6480+
"v2.shared_dashboard_included_user_attributes" => "SharedDashboardIncludedUserAttributes",
6481+
"v2.shared_dashboard_invitee" => "SharedDashboardInvitee",
6482+
"v2.shared_dashboard_relationship_dashboard" => "SharedDashboardRelationshipDashboard",
6483+
"v2.shared_dashboard_relationship_dashboard_data" => "SharedDashboardRelationshipDashboardData",
6484+
"v2.shared_dashboard_relationships" => "SharedDashboardRelationships",
6485+
"v2.shared_dashboard_relationship_sharer" => "SharedDashboardRelationshipSharer",
6486+
"v2.shared_dashboard_response" => "SharedDashboardResponse",
6487+
"v2.shared_dashboard_response_attributes" => "SharedDashboardResponseAttributes",
6488+
"v2.shared_dashboard_selectable_template_variable" => "SharedDashboardSelectableTemplateVariable",
6489+
"v2.shared_dashboard_share_type" => "SharedDashboardShareType",
6490+
"v2.shared_dashboard_status" => "SharedDashboardStatus",
6491+
"v2.shared_dashboard_type" => "SharedDashboardType",
6492+
"v2.shared_dashboard_viewing_preferences" => "SharedDashboardViewingPreferences",
6493+
"v2.shared_dashboard_viewing_preferences_theme" => "SharedDashboardViewingPreferencesTheme",
64746494
"v2.shift" => "Shift",
64756495
"v2.shift_data" => "ShiftData",
64766496
"v2.shift_data_attributes" => "ShiftDataAttributes",
@@ -7557,6 +7577,7 @@ def overrides
75577577
"v2.customer_org_api" => "CustomerOrgAPI",
75587578
"v2.dashboard_lists_api" => "DashboardListsAPI",
75597579
"v2.dashboard_secure_embed_api" => "DashboardSecureEmbedAPI",
7580+
"v2.dashboard_sharing_api" => "DashboardSharingAPI",
75607581
"v2.dashboards_api" => "DashboardsAPI",
75617582
"v2.data_deletion_api" => "DataDeletionAPI",
75627583
"v2.datasets_api" => "DatasetsAPI",
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
Contact: support@datadoghq.com
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'cgi'
17+
18+
module DatadogAPIClient::V2
19+
class DashboardSharingAPI
20+
attr_accessor :api_client
21+
22+
def initialize(api_client = DatadogAPIClient::APIClient.default)
23+
@api_client = api_client
24+
end
25+
26+
# List shared dashboards for a dashboard.
27+
#
28+
# @see #list_shared_dashboards_by_dashboard_id_with_http_info
29+
def list_shared_dashboards_by_dashboard_id(dashboard_id, opts = {})
30+
data, _status_code, _headers = list_shared_dashboards_by_dashboard_id_with_http_info(dashboard_id, opts)
31+
data
32+
end
33+
34+
# List shared dashboards for a dashboard.
35+
#
36+
# Retrieve shared dashboards associated with the specified dashboard.
37+
#
38+
# @param dashboard_id [String] ID of the dashboard.
39+
# @param opts [Hash] the optional parameters
40+
# @return [Array<(ListSharedDashboardsResponse, Integer, Hash)>] ListSharedDashboardsResponse data, response status code and response headers
41+
def list_shared_dashboards_by_dashboard_id_with_http_info(dashboard_id, opts = {})
42+
unstable_enabled = @api_client.config.unstable_operations["v2.list_shared_dashboards_by_dashboard_id".to_sym]
43+
if unstable_enabled
44+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_shared_dashboards_by_dashboard_id")
45+
else
46+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_shared_dashboards_by_dashboard_id"))
47+
end
48+
49+
if @api_client.config.debugging
50+
@api_client.config.logger.debug 'Calling API: DashboardSharingAPI.list_shared_dashboards_by_dashboard_id ...'
51+
end
52+
# verify the required parameter 'dashboard_id' is set
53+
if @api_client.config.client_side_validation && dashboard_id.nil?
54+
fail ArgumentError, "Missing the required parameter 'dashboard_id' when calling DashboardSharingAPI.list_shared_dashboards_by_dashboard_id"
55+
end
56+
# resource path
57+
local_var_path = '/api/v2/dashboard/{dashboard_id}/shared'.sub('{dashboard_id}', CGI.escape(dashboard_id.to_s).gsub('%2F', '/'))
58+
59+
# query parameters
60+
query_params = opts[:query_params] || {}
61+
62+
# header parameters
63+
header_params = opts[:header_params] || {}
64+
# HTTP header 'Accept' (if needed)
65+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
66+
67+
# form parameters
68+
form_params = opts[:form_params] || {}
69+
70+
# http body (model)
71+
post_body = opts[:debug_body]
72+
73+
# return_type
74+
return_type = opts[:debug_return_type] || 'ListSharedDashboardsResponse'
75+
76+
# auth_names
77+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
78+
79+
new_options = opts.merge(
80+
:operation => :list_shared_dashboards_by_dashboard_id,
81+
:header_params => header_params,
82+
:query_params => query_params,
83+
:form_params => form_params,
84+
:body => post_body,
85+
:auth_names => auth_names,
86+
:return_type => return_type,
87+
:api_version => "V2"
88+
)
89+
90+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
91+
if @api_client.config.debugging
92+
@api_client.config.logger.debug "API called: DashboardSharingAPI#list_shared_dashboards_by_dashboard_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
93+
end
94+
return data, status_code, headers
95+
end
96+
end
97+
end
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
Contact: support@datadoghq.com
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V2
20+
# Response containing shared dashboards for a dashboard.
21+
class ListSharedDashboardsResponse
22+
include BaseGenericModel
23+
24+
# Shared dashboards for the dashboard.
25+
attr_reader :data
26+
27+
# Users and dashboards related to the shared dashboards.
28+
attr_reader :included
29+
30+
attr_accessor :additional_properties
31+
32+
# Attribute mapping from ruby-style variable name to JSON key.
33+
# @!visibility private
34+
def self.attribute_map
35+
{
36+
:'data' => :'data',
37+
:'included' => :'included'
38+
}
39+
end
40+
41+
# Attribute type mapping.
42+
# @!visibility private
43+
def self.openapi_types
44+
{
45+
:'data' => :'Array<SharedDashboardResponse>',
46+
:'included' => :'Array<SharedDashboardIncluded>'
47+
}
48+
end
49+
50+
# Initializes the object
51+
# @param attributes [Hash] Model attributes in the form of hash
52+
# @!visibility private
53+
def initialize(attributes = {})
54+
if (!attributes.is_a?(Hash))
55+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ListSharedDashboardsResponse` initialize method"
56+
end
57+
58+
self.additional_properties = {}
59+
# check to see if the attribute exists and convert string to symbol for hash key
60+
attributes = attributes.each_with_object({}) { |(k, v), h|
61+
if (!self.class.attribute_map.key?(k.to_sym))
62+
self.additional_properties[k.to_sym] = v
63+
else
64+
h[k.to_sym] = v
65+
end
66+
}
67+
68+
if attributes.key?(:'data')
69+
if (value = attributes[:'data']).is_a?(Array)
70+
self.data = value
71+
end
72+
end
73+
74+
if attributes.key?(:'included')
75+
if (value = attributes[:'included']).is_a?(Array)
76+
self.included = value
77+
end
78+
end
79+
end
80+
81+
# Check to see if the all the properties in the model are valid
82+
# @return true if the model is valid
83+
# @!visibility private
84+
def valid?
85+
return false if @data.nil?
86+
return false if @included.nil?
87+
true
88+
end
89+
90+
# Custom attribute writer method with validation
91+
# @param data [Object] Object to be assigned
92+
# @!visibility private
93+
def data=(data)
94+
if data.nil?
95+
fail ArgumentError, 'invalid value for "data", data cannot be nil.'
96+
end
97+
@data = data
98+
end
99+
100+
# Custom attribute writer method with validation
101+
# @param included [Object] Object to be assigned
102+
# @!visibility private
103+
def included=(included)
104+
if included.nil?
105+
fail ArgumentError, 'invalid value for "included", included cannot be nil.'
106+
end
107+
@included = included
108+
end
109+
110+
# Returns the object in the form of hash, with additionalProperties support.
111+
# @return [Hash] Returns the object in the form of hash
112+
# @!visibility private
113+
def to_hash
114+
hash = {}
115+
self.class.attribute_map.each_pair do |attr, param|
116+
value = self.send(attr)
117+
if value.nil?
118+
is_nullable = self.class.openapi_nullable.include?(attr)
119+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
120+
end
121+
122+
hash[param] = _to_hash(value)
123+
end
124+
self.additional_properties.each_pair do |attr, value|
125+
hash[attr] = value
126+
end
127+
hash
128+
end
129+
130+
# Checks equality by comparing each attribute.
131+
# @param o [Object] Object to be compared
132+
# @!visibility private
133+
def ==(o)
134+
return true if self.equal?(o)
135+
self.class == o.class &&
136+
data == o.data &&
137+
included == o.included &&
138+
additional_properties == o.additional_properties
139+
end
140+
141+
# Calculates hash code according to all attributes.
142+
# @return [Integer] Hash code
143+
# @!visibility private
144+
def hash
145+
[data, included, additional_properties].hash
146+
end
147+
end
148+
end

0 commit comments

Comments
 (0)