=begin #Datadog API V1 Collection #Collection of all Datadog Public endpoints. The version of the OpenAPI document: 1.0 Contact: support@datadoghq.com Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2020-Present Datadog, Inc. =end require 'cgi' module DatadogAPIClient::V1 class DashboardsAPI attr_accessor :api_client def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end # Create a new dashboard. # # @see #create_dashboard_with_http_info def create_dashboard(body, opts = {}) data, _status_code, _headers = create_dashboard_with_http_info(body, opts) data end # Create a new dashboard. # # Create a dashboard using the specified options. When defining queries in your widgets, take note of which queries should have the `as_count()` or `as_rate()` modifiers appended. # Refer to the following [documentation](https://docs.datadoghq.com/developers/metrics/type_modifiers/?tab=count#in-application-modifiers) for more information on these modifiers. # # @param body [Dashboard] Create a dashboard request body. # @param opts [Hash] the optional parameters # @return [Array<(Dashboard, Integer, Hash)>] Dashboard data, response status code and response headers def create_dashboard_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DashboardsAPI.create_dashboard ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling DashboardsAPI.create_dashboard" end # resource path local_var_path = '/api/v1/dashboard' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'Dashboard' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :create_dashboard, :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 => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DashboardsAPI#create_dashboard\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a shared dashboard. # # @see #create_public_dashboard_with_http_info def create_public_dashboard(body, opts = {}) data, _status_code, _headers = create_public_dashboard_with_http_info(body, opts) data end # Create a shared dashboard. # # Share a specified private dashboard, generating a URL at which it can be publicly viewed. # # @param body [SharedDashboard] Create a shared dashboard request body. # @param opts [Hash] the optional parameters # @return [Array<(SharedDashboard, Integer, Hash)>] SharedDashboard data, response status code and response headers def create_public_dashboard_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DashboardsAPI.create_public_dashboard ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling DashboardsAPI.create_public_dashboard" end # resource path local_var_path = '/api/v1/dashboard/public' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'SharedDashboard' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :create_public_dashboard, :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 => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DashboardsAPI#create_public_dashboard\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a dashboard. # # @see #delete_dashboard_with_http_info def delete_dashboard(dashboard_id, opts = {}) data, _status_code, _headers = delete_dashboard_with_http_info(dashboard_id, opts) data end # Delete a dashboard. # # Delete a dashboard using the specified ID. # # @param dashboard_id [String] The ID of the dashboard. # @param opts [Hash] the optional parameters # @return [Array<(DashboardDeleteResponse, Integer, Hash)>] DashboardDeleteResponse data, response status code and response headers def delete_dashboard_with_http_info(dashboard_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DashboardsAPI.delete_dashboard ...' 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 DashboardsAPI.delete_dashboard" end # resource path local_var_path = '/api/v1/dashboard/{dashboard_id}'.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] || 'DashboardDeleteResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :delete_dashboard, :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 => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DashboardsAPI#delete_dashboard\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete dashboards. # # @see #delete_dashboards_with_http_info def delete_dashboards(body, opts = {}) delete_dashboards_with_http_info(body, opts) nil end # Delete dashboards. # # Delete dashboards using the specified IDs. If there are any failures, no dashboards will be deleted (partial success is not allowed). # # @param body [DashboardBulkDeleteRequest] Delete dashboards request body. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_dashboards_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DashboardsAPI.delete_dashboards ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling DashboardsAPI.delete_dashboards" end # resource path local_var_path = '/api/v1/dashboard' # 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(['*/*']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :delete_dashboards, :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 => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DashboardsAPI#delete_dashboards\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Revoke a shared dashboard URL. # # @see #delete_public_dashboard_with_http_info def delete_public_dashboard(token, opts = {}) data, _status_code, _headers = delete_public_dashboard_with_http_info(token, opts) data end # Revoke a shared dashboard URL. # # Revoke the public URL for a dashboard (rendering it private) associated with the specified token. # # @param token [String] The token of the shared dashboard. # @param opts [Hash] the optional parameters # @return [Array<(DeleteSharedDashboardResponse, Integer, Hash)>] DeleteSharedDashboardResponse data, response status code and response headers def delete_public_dashboard_with_http_info(token, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DashboardsAPI.delete_public_dashboard ...' end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling DashboardsAPI.delete_public_dashboard" end # resource path local_var_path = '/api/v1/dashboard/public/{token}'.sub('{token}', CGI.escape(token.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] || 'DeleteSharedDashboardResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :delete_public_dashboard, :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 => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DashboardsAPI#delete_public_dashboard\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Revoke shared dashboard invitations. # # @see #delete_public_dashboard_invitation_with_http_info def delete_public_dashboard_invitation(token, body, opts = {}) delete_public_dashboard_invitation_with_http_info(token, body, opts) nil end # Revoke shared dashboard invitations. # # Revoke previously sent invitation emails and active sessions used to access a given shared dashboard for specific email addresses. # # @param token [String] The token of the shared dashboard. # @param body [SharedDashboardInvites] Shared Dashboard Invitation deletion request body. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_public_dashboard_invitation_with_http_info(token, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DashboardsAPI.delete_public_dashboard_invitation ...' end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling DashboardsAPI.delete_public_dashboard_invitation" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling DashboardsAPI.delete_public_dashboard_invitation" end # resource path local_var_path = '/api/v1/dashboard/public/{token}/invitation'.sub('{token}', CGI.escape(token.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(['*/*']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :delete_public_dashboard_invitation, :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 => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DashboardsAPI#delete_public_dashboard_invitation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a dashboard. # # @see #get_dashboard_with_http_info def get_dashboard(dashboard_id, opts = {}) data, _status_code, _headers = get_dashboard_with_http_info(dashboard_id, opts) data end # Get a dashboard. # # Get a dashboard using the specified ID. # # @param dashboard_id [String] The ID of the dashboard. # @param opts [Hash] the optional parameters # @return [Array<(Dashboard, Integer, Hash)>] Dashboard data, response status code and response headers def get_dashboard_with_http_info(dashboard_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DashboardsAPI.get_dashboard ...' 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 DashboardsAPI.get_dashboard" end # resource path local_var_path = '/api/v1/dashboard/{dashboard_id}'.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] || 'Dashboard' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :get_dashboard, :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 => "V1" ) 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: DashboardsAPI#get_dashboard\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a shared dashboard. # # @see #get_public_dashboard_with_http_info def get_public_dashboard(token, opts = {}) data, _status_code, _headers = get_public_dashboard_with_http_info(token, opts) data end # Get a shared dashboard. # # Fetch an existing shared dashboard's sharing metadata associated with the specified token. # # @param token [String] The token of the shared dashboard. Generated when a dashboard is shared. # @param opts [Hash] the optional parameters # @return [Array<(SharedDashboard, Integer, Hash)>] SharedDashboard data, response status code and response headers def get_public_dashboard_with_http_info(token, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DashboardsAPI.get_public_dashboard ...' end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling DashboardsAPI.get_public_dashboard" end # resource path local_var_path = '/api/v1/dashboard/public/{token}'.sub('{token}', CGI.escape(token.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] || 'SharedDashboard' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :get_public_dashboard, :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 => "V1" ) 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: DashboardsAPI#get_public_dashboard\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get all invitations for a shared dashboard. # # @see #get_public_dashboard_invitations_with_http_info def get_public_dashboard_invitations(token, opts = {}) data, _status_code, _headers = get_public_dashboard_invitations_with_http_info(token, opts) data end # Get all invitations for a shared dashboard. # # Describe the invitations that exist for the given shared dashboard (paginated). # # @param token [String] Token of the shared dashboard for which to fetch invitations. # @param opts [Hash] the optional parameters # @option opts [Integer] :page_size The number of records to return in a single request. # @option opts [Integer] :page_number The page to access (base 0). # @return [Array<(SharedDashboardInvites, Integer, Hash)>] SharedDashboardInvites data, response status code and response headers def get_public_dashboard_invitations_with_http_info(token, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DashboardsAPI.get_public_dashboard_invitations ...' end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling DashboardsAPI.get_public_dashboard_invitations" end # resource path local_var_path = '/api/v1/dashboard/public/{token}/invitation'.sub('{token}', CGI.escape(token.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'page_number'] = opts[:'page_number'] if !opts[:'page_number'].nil? # 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] || 'SharedDashboardInvites' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :get_public_dashboard_invitations, :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 => "V1" ) 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: DashboardsAPI#get_public_dashboard_invitations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get all dashboards. # # @see #list_dashboards_with_http_info def list_dashboards(opts = {}) data, _status_code, _headers = list_dashboards_with_http_info(opts) data end # Get all dashboards. # # Get all dashboards. # # **Note**: This query will only return custom created or cloned dashboards. # This query will not return preset dashboards. # # @param opts [Hash] the optional parameters # @option opts [Boolean] :filter_shared When `true`, this query only returns shared custom created or cloned dashboards. # @option opts [Boolean] :filter_deleted When `true`, this query returns only deleted custom-created or cloned dashboards. This parameter is incompatible with `filter[shared]`. # @return [Array<(DashboardSummary, Integer, Hash)>] DashboardSummary data, response status code and response headers def list_dashboards_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DashboardsAPI.list_dashboards ...' end # resource path local_var_path = '/api/v1/dashboard' # query parameters query_params = opts[:query_params] || {} query_params[:'filter[shared]'] = opts[:'filter_shared'] if !opts[:'filter_shared'].nil? query_params[:'filter[deleted]'] = opts[:'filter_deleted'] if !opts[:'filter_deleted'].nil? # 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] || 'DashboardSummary' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :list_dashboards, :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 => "V1" ) 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: DashboardsAPI#list_dashboards\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Restore deleted dashboards. # # @see #restore_dashboards_with_http_info def restore_dashboards(body, opts = {}) restore_dashboards_with_http_info(body, opts) nil end # Restore deleted dashboards. # # Restore dashboards using the specified IDs. If there are any failures, no dashboards will be restored (partial success is not allowed). # # @param body [DashboardRestoreRequest] Restore dashboards request body. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def restore_dashboards_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DashboardsAPI.restore_dashboards ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling DashboardsAPI.restore_dashboards" end # resource path local_var_path = '/api/v1/dashboard' # 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(['*/*']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :restore_dashboards, :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 => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DashboardsAPI#restore_dashboards\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Send shared dashboard invitation email. # # @see #send_public_dashboard_invitation_with_http_info def send_public_dashboard_invitation(token, body, opts = {}) data, _status_code, _headers = send_public_dashboard_invitation_with_http_info(token, body, opts) data end # Send shared dashboard invitation email. # # Send emails to specified email addresses containing links to access a given authenticated shared dashboard. Email addresses must already belong to the authenticated shared dashboard's share_list. # # @param token [String] The token of the shared dashboard. # @param body [SharedDashboardInvites] Shared Dashboard Invitation request body. # @param opts [Hash] the optional parameters # @return [Array<(SharedDashboardInvites, Integer, Hash)>] SharedDashboardInvites data, response status code and response headers def send_public_dashboard_invitation_with_http_info(token, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DashboardsAPI.send_public_dashboard_invitation ...' end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling DashboardsAPI.send_public_dashboard_invitation" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling DashboardsAPI.send_public_dashboard_invitation" end # resource path local_var_path = '/api/v1/dashboard/public/{token}/invitation'.sub('{token}', CGI.escape(token.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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'SharedDashboardInvites' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :send_public_dashboard_invitation, :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 => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DashboardsAPI#send_public_dashboard_invitation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a dashboard. # # @see #update_dashboard_with_http_info def update_dashboard(dashboard_id, body, opts = {}) data, _status_code, _headers = update_dashboard_with_http_info(dashboard_id, body, opts) data end # Update a dashboard. # # Update a dashboard using the specified ID. # # @param dashboard_id [String] The ID of the dashboard. # @param body [Dashboard] Update Dashboard request body. # @param opts [Hash] the optional parameters # @return [Array<(Dashboard, Integer, Hash)>] Dashboard data, response status code and response headers def update_dashboard_with_http_info(dashboard_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DashboardsAPI.update_dashboard ...' 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 DashboardsAPI.update_dashboard" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling DashboardsAPI.update_dashboard" end # resource path local_var_path = '/api/v1/dashboard/{dashboard_id}'.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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'Dashboard' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :update_dashboard, :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 => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DashboardsAPI#update_dashboard\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a shared dashboard. # # @see #update_public_dashboard_with_http_info def update_public_dashboard(token, body, opts = {}) data, _status_code, _headers = update_public_dashboard_with_http_info(token, body, opts) data end # Update a shared dashboard. # # Update a shared dashboard associated with the specified token. # # @param token [String] The token of the shared dashboard. # @param body [SharedDashboardUpdateRequest] Update Dashboard request body. # @param opts [Hash] the optional parameters # @return [Array<(SharedDashboard, Integer, Hash)>] SharedDashboard data, response status code and response headers def update_public_dashboard_with_http_info(token, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DashboardsAPI.update_public_dashboard ...' end # verify the required parameter 'token' is set if @api_client.config.client_side_validation && token.nil? fail ArgumentError, "Missing the required parameter 'token' when calling DashboardsAPI.update_public_dashboard" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling DashboardsAPI.update_public_dashboard" end # resource path local_var_path = '/api/v1/dashboard/public/{token}'.sub('{token}', CGI.escape(token.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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'SharedDashboard' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :update_public_dashboard, :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 => "V1" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DashboardsAPI#update_public_dashboard\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end