|
| 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 SlackIntegrationAPI |
| 20 | + attr_accessor :api_client |
| 21 | + |
| 22 | + def initialize(api_client = DatadogAPIClient::APIClient.default) |
| 23 | + @api_client = api_client |
| 24 | + end |
| 25 | + |
| 26 | + # List Slack user bindings. |
| 27 | + # |
| 28 | + # @see #list_slack_user_bindings_with_http_info |
| 29 | + def list_slack_user_bindings(user_uuid, opts = {}) |
| 30 | + data, _status_code, _headers = list_slack_user_bindings_with_http_info(user_uuid, opts) |
| 31 | + data |
| 32 | + end |
| 33 | + |
| 34 | + # List Slack user bindings. |
| 35 | + # |
| 36 | + # List all Slack user bindings for a given Datadog user from the Datadog Slack integration. |
| 37 | + # |
| 38 | + # @param user_uuid [UUID] The UUID of the Datadog user to list Slack bindings for. |
| 39 | + # @param opts [Hash] the optional parameters |
| 40 | + # @return [Array<(SlackUserBindingsResponse, Integer, Hash)>] SlackUserBindingsResponse data, response status code and response headers |
| 41 | + def list_slack_user_bindings_with_http_info(user_uuid, opts = {}) |
| 42 | + |
| 43 | + if @api_client.config.debugging |
| 44 | + @api_client.config.logger.debug 'Calling API: SlackIntegrationAPI.list_slack_user_bindings ...' |
| 45 | + end |
| 46 | + # verify the required parameter 'user_uuid' is set |
| 47 | + if @api_client.config.client_side_validation && user_uuid.nil? |
| 48 | + fail ArgumentError, "Missing the required parameter 'user_uuid' when calling SlackIntegrationAPI.list_slack_user_bindings" |
| 49 | + end |
| 50 | + # resource path |
| 51 | + local_var_path = '/api/v2/integration/slack/user-bindings' |
| 52 | + |
| 53 | + # query parameters |
| 54 | + query_params = opts[:query_params] || {} |
| 55 | + query_params[:'user_uuid'] = user_uuid |
| 56 | + |
| 57 | + # header parameters |
| 58 | + header_params = opts[:header_params] || {} |
| 59 | + # HTTP header 'Accept' (if needed) |
| 60 | + header_params['Accept'] = @api_client.select_header_accept(['application/json']) |
| 61 | + |
| 62 | + # form parameters |
| 63 | + form_params = opts[:form_params] || {} |
| 64 | + |
| 65 | + # http body (model) |
| 66 | + post_body = opts[:debug_body] |
| 67 | + |
| 68 | + # return_type |
| 69 | + return_type = opts[:debug_return_type] || 'SlackUserBindingsResponse' |
| 70 | + |
| 71 | + # auth_names |
| 72 | + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] |
| 73 | + |
| 74 | + new_options = opts.merge( |
| 75 | + :operation => :list_slack_user_bindings, |
| 76 | + :header_params => header_params, |
| 77 | + :query_params => query_params, |
| 78 | + :form_params => form_params, |
| 79 | + :body => post_body, |
| 80 | + :auth_names => auth_names, |
| 81 | + :return_type => return_type, |
| 82 | + :api_version => "V2" |
| 83 | + ) |
| 84 | + |
| 85 | + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) |
| 86 | + if @api_client.config.debugging |
| 87 | + @api_client.config.logger.debug "API called: SlackIntegrationAPI#list_slack_user_bindings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" |
| 88 | + end |
| 89 | + return data, status_code, headers |
| 90 | + end |
| 91 | + end |
| 92 | +end |
0 commit comments