=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 MicrosoftTeamsIntegrationAPI attr_accessor :api_client def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end # Create handle. # # @see #create_api_handle_with_http_info def create_api_handle(body, opts = {}) data, _status_code, _headers = create_api_handle_with_http_info(body, opts) data end # Create handle. # # Create a handle in the Datadog Microsoft Teams integration. # # @param body [MicrosoftTeamsCreateApiHandleRequest] Handle payload. # @param opts [Hash] the optional parameters # @return [Array<(MicrosoftTeamsCreateApiHandleResponse, Integer, Hash)>] MicrosoftTeamsCreateApiHandleResponse data, response status code and response headers def create_api_handle_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MicrosoftTeamsIntegrationAPI.create_api_handle ...' 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 MicrosoftTeamsIntegrationAPI.create_api_handle" end # resource path local_var_path = '/api/v2/integration/ms-teams/configuration/tenant-based-handles' # 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] || 'MicrosoftTeamsCreateApiHandleResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :create_api_handle, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V2" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MicrosoftTeamsIntegrationAPI#create_api_handle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete handle. # # @see #delete_api_handle_with_http_info def delete_api_handle(handle_id, opts = {}) delete_api_handle_with_http_info(handle_id, opts) nil end # Delete handle. # # Delete a handle from the Datadog Microsoft Teams integration. # # @param handle_id [String] Your handle id. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_api_handle_with_http_info(handle_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MicrosoftTeamsIntegrationAPI.delete_api_handle ...' end # verify the required parameter 'handle_id' is set if @api_client.config.client_side_validation && handle_id.nil? fail ArgumentError, "Missing the required parameter 'handle_id' when calling MicrosoftTeamsIntegrationAPI.delete_api_handle" end # resource path local_var_path = '/api/v2/integration/ms-teams/configuration/tenant-based-handles/{handle_id}'.sub('{handle_id}', CGI.escape(handle_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(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :delete_api_handle, :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::Delete, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MicrosoftTeamsIntegrationAPI#delete_api_handle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get handle information. # # @see #get_api_handle_with_http_info def get_api_handle(handle_id, opts = {}) data, _status_code, _headers = get_api_handle_with_http_info(handle_id, opts) data end # Get handle information. # # Get the tenant, team, and channel information of a handle from the Datadog Microsoft Teams integration. # # @param handle_id [String] Your handle id. # @param opts [Hash] the optional parameters # @return [Array<(MicrosoftTeamsApiHandleInfoResponse, Integer, Hash)>] MicrosoftTeamsApiHandleInfoResponse data, response status code and response headers def get_api_handle_with_http_info(handle_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MicrosoftTeamsIntegrationAPI.get_api_handle ...' end # verify the required parameter 'handle_id' is set if @api_client.config.client_side_validation && handle_id.nil? fail ArgumentError, "Missing the required parameter 'handle_id' when calling MicrosoftTeamsIntegrationAPI.get_api_handle" end # resource path local_var_path = '/api/v2/integration/ms-teams/configuration/tenant-based-handles/{handle_id}'.sub('{handle_id}', CGI.escape(handle_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] || 'MicrosoftTeamsApiHandleInfoResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :get_api_handle, :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: MicrosoftTeamsIntegrationAPI#get_api_handle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get handle information by name. # # @see #get_api_handle_by_name_with_http_info def get_api_handle_by_name(handle_name, opts = {}) data, _status_code, _headers = get_api_handle_by_name_with_http_info(handle_name, opts) data end # Get handle information by name. # # Get the tenant, team, and channel information of a handle by name from the Datadog Microsoft Teams integration. # # @param handle_name [String] Your handle name. # @param opts [Hash] the optional parameters # @return [Array<(MicrosoftTeamsApiHandleInfoResponse, Integer, Hash)>] MicrosoftTeamsApiHandleInfoResponse data, response status code and response headers def get_api_handle_by_name_with_http_info(handle_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MicrosoftTeamsIntegrationAPI.get_api_handle_by_name ...' end # verify the required parameter 'handle_name' is set if @api_client.config.client_side_validation && handle_name.nil? fail ArgumentError, "Missing the required parameter 'handle_name' when calling MicrosoftTeamsIntegrationAPI.get_api_handle_by_name" end # resource path local_var_path = '/api/v2/integration/ms-teams/configuration/tenant-based-handles/name/{handle_name}'.sub('{handle_name}', CGI.escape(handle_name.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] || 'MicrosoftTeamsApiHandleInfoResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :get_api_handle_by_name, :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: MicrosoftTeamsIntegrationAPI#get_api_handle_by_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get channel information by name. # # @see #get_channel_by_name_with_http_info def get_channel_by_name(tenant_name, team_name, channel_name, opts = {}) data, _status_code, _headers = get_channel_by_name_with_http_info(tenant_name, team_name, channel_name, opts) data end # Get channel information by name. # # Get the tenant, team, and channel ID of a channel in the Datadog Microsoft Teams integration. # # @param tenant_name [String] Your tenant name. # @param team_name [String] Your team name. # @param channel_name [String] Your channel name. # @param opts [Hash] the optional parameters # @return [Array<(MicrosoftTeamsGetChannelByNameResponse, Integer, Hash)>] MicrosoftTeamsGetChannelByNameResponse data, response status code and response headers def get_channel_by_name_with_http_info(tenant_name, team_name, channel_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MicrosoftTeamsIntegrationAPI.get_channel_by_name ...' end # verify the required parameter 'tenant_name' is set if @api_client.config.client_side_validation && tenant_name.nil? fail ArgumentError, "Missing the required parameter 'tenant_name' when calling MicrosoftTeamsIntegrationAPI.get_channel_by_name" end # verify the required parameter 'team_name' is set if @api_client.config.client_side_validation && team_name.nil? fail ArgumentError, "Missing the required parameter 'team_name' when calling MicrosoftTeamsIntegrationAPI.get_channel_by_name" end # verify the required parameter 'channel_name' is set if @api_client.config.client_side_validation && channel_name.nil? fail ArgumentError, "Missing the required parameter 'channel_name' when calling MicrosoftTeamsIntegrationAPI.get_channel_by_name" end # resource path local_var_path = '/api/v2/integration/ms-teams/configuration/channel/{tenant_name}/{team_name}/{channel_name}'.sub('{tenant_name}', CGI.escape(tenant_name.to_s).gsub('%2F', '/')).sub('{team_name}', CGI.escape(team_name.to_s).gsub('%2F', '/')).sub('{channel_name}', CGI.escape(channel_name.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] || 'MicrosoftTeamsGetChannelByNameResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :get_channel_by_name, :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: MicrosoftTeamsIntegrationAPI#get_channel_by_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get all handles. # # @see #list_api_handles_with_http_info def list_api_handles(opts = {}) data, _status_code, _headers = list_api_handles_with_http_info(opts) data end # Get all handles. # # Get a list of all handles from the Datadog Microsoft Teams integration. # # @param opts [Hash] the optional parameters # @option opts [String] :tenant_id Your tenant id. # @return [Array<(MicrosoftTeamsApiHandlesResponse, Integer, Hash)>] MicrosoftTeamsApiHandlesResponse data, response status code and response headers def list_api_handles_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MicrosoftTeamsIntegrationAPI.list_api_handles ...' end # resource path local_var_path = '/api/v2/integration/ms-teams/configuration/tenant-based-handles' # query parameters query_params = opts[:query_params] || {} query_params[:'tenant_id'] = opts[:'tenant_id'] if !opts[:'tenant_id'].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] || 'MicrosoftTeamsApiHandlesResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :list_api_handles, :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: MicrosoftTeamsIntegrationAPI#list_api_handles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update handle. # # @see #update_api_handle_with_http_info def update_api_handle(handle_id, body, opts = {}) data, _status_code, _headers = update_api_handle_with_http_info(handle_id, body, opts) data end # Update handle. # # Update a handle from the Datadog Microsoft Teams integration. # # @param handle_id [String] Your handle id. # @param body [MicrosoftTeamsUpdateApiHandleRequest] Opsgenie service payload. # @param opts [Hash] the optional parameters # @return [Array<(MicrosoftTeamsApiHandleInfoResponse, Integer, Hash)>] MicrosoftTeamsApiHandleInfoResponse data, response status code and response headers def update_api_handle_with_http_info(handle_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MicrosoftTeamsIntegrationAPI.update_api_handle ...' end # verify the required parameter 'handle_id' is set if @api_client.config.client_side_validation && handle_id.nil? fail ArgumentError, "Missing the required parameter 'handle_id' when calling MicrosoftTeamsIntegrationAPI.update_api_handle" 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 MicrosoftTeamsIntegrationAPI.update_api_handle" end # resource path local_var_path = '/api/v2/integration/ms-teams/configuration/tenant-based-handles/{handle_id}'.sub('{handle_id}', CGI.escape(handle_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] || 'MicrosoftTeamsApiHandleInfoResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :update_api_handle, :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::Patch, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: MicrosoftTeamsIntegrationAPI#update_api_handle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end