Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
560 changes: 560 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -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")
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Delete user binding returns "No Content" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::MicrosoftTeamsIntegrationAPI.new
api_instance.delete_ms_teams_user_binding("tenant_id")
5 changes: 5 additions & 0 deletions examples/v2/slack-integration/ListSlackUserBindings.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# List Slack user bindings returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::SlackIntegrationAPI.new
p api_instance.list_slack_user_bindings("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")
9 changes: 9 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2917,6 +2917,9 @@
"dashboard_list_id" => "Integer",
"body" => "DashboardListUpdateItemsRequest",
},
"v2.ListSharedDashboardsByDashboardId" => {
"dashboard_id" => "String",
},
"v2.CreateDashboardSecureEmbed" => {
"dashboard_id" => "String",
"body" => "SecureEmbedCreateRequest",
Expand Down Expand Up @@ -3552,6 +3555,9 @@
"handle_id" => "String",
"body" => "MicrosoftTeamsUpdateTenantBasedHandleRequest",
},
"v2.DeleteMSTeamsUserBinding" => {
"tenant_id" => "String",
},
"v2.ListWorkflowsWebhookHandles" => {
"name" => "String",
},
Expand Down Expand Up @@ -3642,6 +3648,9 @@
"v2.ListServiceNowUsers" => {
"instance_id" => "UUID",
},
"v2.ListSlackUserBindings" => {
"user_uuid" => "UUID",
},
"v2.UpdateStatuspageAccount" => {
"body" => "StatuspageAccountUpdateRequest",
},
Expand Down
22 changes: 22 additions & 0 deletions features/v2/dashboard_sharing.feature
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions features/v2/microsoft_teams_integration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,27 @@ Feature: Microsoft Teams Integration
When the request is sent
Then the response status is 204 OK

@generated @skip @team:DataDog/chat-integrations
Scenario: Delete user binding returns "Bad Request" response
Given new "DeleteMSTeamsUserBinding" request
And request contains "tenant_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/chat-integrations
Scenario: Delete user binding returns "Failed Precondition" response
Given new "DeleteMSTeamsUserBinding" request
And request contains "tenant_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 412 Failed Precondition

@generated @skip @team:DataDog/chat-integrations
Scenario: Delete user binding returns "No Content" response
Given new "DeleteMSTeamsUserBinding" request
And request contains "tenant_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 204 No Content

@team:DataDog/chat-integrations
Scenario: Delete workflow webhook handle returns "OK" response
Given there is a valid "workflows_webhook_handle" in the system
Expand Down
23 changes: 23 additions & 0 deletions features/v2/slack_integration.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@endpoint(slack-integration) @endpoint(slack-integration-v2)
Feature: Slack Integration
Configure your [Datadog Slack
integration](https://docs.datadoghq.com/integrations/slack/) directly
through the Datadog API.

Background:
Given a valid "apiKeyAuth" key in the system
And a valid "appKeyAuth" key in the system
And an instance of "SlackIntegration" API
And new "ListSlackUserBindings" request

@generated @skip @team:DataDog/chat-integrations
Scenario: List Slack user bindings returns "Bad Request" response
Given request contains "user_uuid" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/chat-integrations
Scenario: List Slack user bindings returns "OK" response
Given request contains "user_uuid" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK
18 changes: 18 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2165,6 +2165,12 @@
"type": "safe"
}
},
"ListSharedDashboardsByDashboardId": {
"tag": "Dashboard Sharing",
"undo": {
"type": "safe"
}
},
"CreateDashboardSecureEmbed": {
"tag": "Dashboard Secure Embed",
"undo": {
Expand Down Expand Up @@ -3523,6 +3529,12 @@
"type": "idempotent"
}
},
"DeleteMSTeamsUserBinding": {
"tag": "Microsoft Teams Integration",
"undo": {
"type": "idempotent"
}
},
"ListWorkflowsWebhookHandles": {
"tag": "Microsoft Teams Integration",
"undo": {
Expand Down Expand Up @@ -3775,6 +3787,12 @@
"type": "safe"
}
},
"ListSlackUserBindings": {
"tag": "Slack Integration",
"undo": {
"type": "safe"
}
},
"DeleteStatuspageAccount": {
"tag": "Statuspage Integration",
"undo": {
Expand Down
1 change: 1 addition & 0 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,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,
Expand Down
25 changes: 25 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3978,6 +3978,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",
Expand Down Expand Up @@ -6522,6 +6523,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",
Expand Down Expand Up @@ -6552,6 +6572,9 @@ def overrides
"v2.slack_integration_metadata" => "SlackIntegrationMetadata",
"v2.slack_integration_metadata_channel_item" => "SlackIntegrationMetadataChannelItem",
"v2.slack_trigger_wrapper" => "SlackTriggerWrapper",
"v2.slack_user_binding_data" => "SlackUserBindingData",
"v2.slack_user_bindings_response" => "SlackUserBindingsResponse",
"v2.slack_user_binding_type" => "SlackUserBindingType",
"v2.slo_data_source" => "SloDataSource",
"v2.slo_query" => "SloQuery",
"v2.slo_report_create_request" => "SloReportCreateRequest",
Expand Down Expand Up @@ -7620,6 +7643,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",
Expand Down Expand Up @@ -7693,6 +7717,7 @@ def overrides
"v2.service_definition_api" => "ServiceDefinitionAPI",
"v2.service_level_objectives_api" => "ServiceLevelObjectivesAPI",
"v2.service_now_integration_api" => "ServiceNowIntegrationAPI",
"v2.slack_integration_api" => "SlackIntegrationAPI",
"v2.software_catalog_api" => "SoftwareCatalogAPI",
"v2.spa_api" => "SpaAPI",
"v2.spans_api" => "SpansAPI",
Expand Down
97 changes: 97 additions & 0 deletions lib/datadog_api_client/v2/api/dashboard_sharing_api.rb
Original file line number Diff line number Diff line change
@@ -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
Loading
Loading