class SunshineConversationsClient::WebhooksApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/sunshine-conversations-client/api/webhooks_api.rb, line 16
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

create_webhook(app_id, integration_id, webhook_create_body, opts = {}) click to toggle source

Create Webhook Creates a new webhook associated with a Sunshine Conversations Connect integration or a custom integration. @param app_id [String] Identifies the app. @param integration_id [String] The id of the integration. @param webhook_create_body [WebhookCreateBody] @param [Hash] opts the optional parameters @return [WebhookResponse]

# File lib/sunshine-conversations-client/api/webhooks_api.rb, line 26
def create_webhook(app_id, integration_id, webhook_create_body, opts = {})
  data, _status_code, _headers = create_webhook_with_http_info(app_id, integration_id, webhook_create_body, opts)
  data
end
create_webhook_with_http_info(app_id, integration_id, webhook_create_body, opts = {}) click to toggle source

Create Webhook Creates a new webhook associated with a Sunshine Conversations Connect integration or a custom integration. @param app_id [String] Identifies the app. @param integration_id [String] The id of the integration. @param webhook_create_body [WebhookCreateBody] @param [Hash] opts the optional parameters @return [Array<(WebhookResponse, Integer, Hash)>] WebhookResponse data, response status code and response headers

# File lib/sunshine-conversations-client/api/webhooks_api.rb, line 38
def create_webhook_with_http_info(app_id, integration_id, webhook_create_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.create_webhook ...'
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling WebhooksApi.create_webhook"
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling WebhooksApi.create_webhook"
  end
  # verify the required parameter 'webhook_create_body' is set
  if @api_client.config.client_side_validation && webhook_create_body.nil?
    fail ArgumentError, "Missing the required parameter 'webhook_create_body' when calling WebhooksApi.create_webhook"
  end
  # resource path
  local_var_path = '/v2/apps/{appId}/integrations/{integrationId}/webhooks'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'integrationId' + '}', CGI.escape(integration_id.to_s))

  # 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[:body] || @api_client.object_to_http_body(webhook_create_body) 

  # return_type
  return_type = opts[:return_type] || 'WebhookResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth', 'bearerAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WebhooksApi#create_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_webhook(app_id, integration_id, webhook_id, opts = {}) click to toggle source

Delete Webhook Deletes the specified webhook associated with a Sunshine Conversations Connect integration or a custom integration. @param app_id [String] Identifies the app. @param integration_id [String] The id of the integration. @param webhook_id [String] The id of the webhook. @param [Hash] opts the optional parameters @return [Object]

# File lib/sunshine-conversations-client/api/webhooks_api.rb, line 102
def delete_webhook(app_id, integration_id, webhook_id, opts = {})
  data, _status_code, _headers = delete_webhook_with_http_info(app_id, integration_id, webhook_id, opts)
  data
end
delete_webhook_with_http_info(app_id, integration_id, webhook_id, opts = {}) click to toggle source

Delete Webhook Deletes the specified webhook associated with a Sunshine Conversations Connect integration or a custom integration. @param app_id [String] Identifies the app. @param integration_id [String] The id of the integration. @param webhook_id [String] The id of the webhook. @param [Hash] opts the optional parameters @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers

# File lib/sunshine-conversations-client/api/webhooks_api.rb, line 114
def delete_webhook_with_http_info(app_id, integration_id, webhook_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.delete_webhook ...'
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling WebhooksApi.delete_webhook"
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling WebhooksApi.delete_webhook"
  end
  # verify the required parameter 'webhook_id' is set
  if @api_client.config.client_side_validation && webhook_id.nil?
    fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhooksApi.delete_webhook"
  end
  # resource path
  local_var_path = '/v2/apps/{appId}/integrations/{integrationId}/webhooks/{webhookId}'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'integrationId' + '}', CGI.escape(integration_id.to_s)).sub('{' + 'webhookId' + '}', CGI.escape(webhook_id.to_s))

  # 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[:body] 

  # return_type
  return_type = opts[:return_type] || 'Object' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth', 'bearerAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WebhooksApi#delete_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_webhook(app_id, integration_id, webhook_id, opts = {}) click to toggle source

Get Webhook Gets the specified webhook associated with a Sunshine Conversations Connect integration or a custom integration. @param app_id [String] Identifies the app. @param integration_id [String] The id of the integration. @param webhook_id [String] The id of the webhook. @param [Hash] opts the optional parameters @return [WebhookResponse]

# File lib/sunshine-conversations-client/api/webhooks_api.rb, line 176
def get_webhook(app_id, integration_id, webhook_id, opts = {})
  data, _status_code, _headers = get_webhook_with_http_info(app_id, integration_id, webhook_id, opts)
  data
end
get_webhook_with_http_info(app_id, integration_id, webhook_id, opts = {}) click to toggle source

Get Webhook Gets the specified webhook associated with a Sunshine Conversations Connect integration or a custom integration. @param app_id [String] Identifies the app. @param integration_id [String] The id of the integration. @param webhook_id [String] The id of the webhook. @param [Hash] opts the optional parameters @return [Array<(WebhookResponse, Integer, Hash)>] WebhookResponse data, response status code and response headers

# File lib/sunshine-conversations-client/api/webhooks_api.rb, line 188
def get_webhook_with_http_info(app_id, integration_id, webhook_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.get_webhook ...'
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling WebhooksApi.get_webhook"
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling WebhooksApi.get_webhook"
  end
  # verify the required parameter 'webhook_id' is set
  if @api_client.config.client_side_validation && webhook_id.nil?
    fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhooksApi.get_webhook"
  end
  # resource path
  local_var_path = '/v2/apps/{appId}/integrations/{integrationId}/webhooks/{webhookId}'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'integrationId' + '}', CGI.escape(integration_id.to_s)).sub('{' + 'webhookId' + '}', CGI.escape(webhook_id.to_s))

  # 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[:body] 

  # return_type
  return_type = opts[:return_type] || 'WebhookResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth', 'bearerAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WebhooksApi#get_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_webhooks(app_id, integration_id, opts = {}) click to toggle source

List Webhooks Lists all webhooks for a given Sunshine Conversations Connect integration or custom integration. @param app_id [String] Identifies the app. @param integration_id [String] The id of the integration. @param [Hash] opts the optional parameters @return [WebhookListResponse]

# File lib/sunshine-conversations-client/api/webhooks_api.rb, line 249
def list_webhooks(app_id, integration_id, opts = {})
  data, _status_code, _headers = list_webhooks_with_http_info(app_id, integration_id, opts)
  data
end
list_webhooks_with_http_info(app_id, integration_id, opts = {}) click to toggle source

List Webhooks Lists all webhooks for a given Sunshine Conversations Connect integration or custom integration. @param app_id [String] Identifies the app. @param integration_id [String] The id of the integration. @param [Hash] opts the optional parameters @return [Array<(WebhookListResponse, Integer, Hash)>] WebhookListResponse data, response status code and response headers

# File lib/sunshine-conversations-client/api/webhooks_api.rb, line 260
def list_webhooks_with_http_info(app_id, integration_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.list_webhooks ...'
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling WebhooksApi.list_webhooks"
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling WebhooksApi.list_webhooks"
  end
  # resource path
  local_var_path = '/v2/apps/{appId}/integrations/{integrationId}/webhooks'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'integrationId' + '}', CGI.escape(integration_id.to_s))

  # 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[:body] 

  # return_type
  return_type = opts[:return_type] || 'WebhookListResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth', 'bearerAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WebhooksApi#list_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_webhook(app_id, integration_id, webhook_id, webhook_body, opts = {}) click to toggle source

Update Webhook Updates the specified webhook associated with a Sunshine Conversations Connect integration or a custom integration. @param app_id [String] Identifies the app. @param integration_id [String] The id of the integration. @param webhook_id [String] The id of the webhook. @param webhook_body [WebhookBody] @param [Hash] opts the optional parameters @return [WebhookResponse]

# File lib/sunshine-conversations-client/api/webhooks_api.rb, line 319
def update_webhook(app_id, integration_id, webhook_id, webhook_body, opts = {})
  data, _status_code, _headers = update_webhook_with_http_info(app_id, integration_id, webhook_id, webhook_body, opts)
  data
end
update_webhook_with_http_info(app_id, integration_id, webhook_id, webhook_body, opts = {}) click to toggle source

Update Webhook Updates the specified webhook associated with a Sunshine Conversations Connect integration or a custom integration. @param app_id [String] Identifies the app. @param integration_id [String] The id of the integration. @param webhook_id [String] The id of the webhook. @param webhook_body [WebhookBody] @param [Hash] opts the optional parameters @return [Array<(WebhookResponse, Integer, Hash)>] WebhookResponse data, response status code and response headers

# File lib/sunshine-conversations-client/api/webhooks_api.rb, line 332
def update_webhook_with_http_info(app_id, integration_id, webhook_id, webhook_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.update_webhook ...'
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling WebhooksApi.update_webhook"
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling WebhooksApi.update_webhook"
  end
  # verify the required parameter 'webhook_id' is set
  if @api_client.config.client_side_validation && webhook_id.nil?
    fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhooksApi.update_webhook"
  end
  # verify the required parameter 'webhook_body' is set
  if @api_client.config.client_side_validation && webhook_body.nil?
    fail ArgumentError, "Missing the required parameter 'webhook_body' when calling WebhooksApi.update_webhook"
  end
  # resource path
  local_var_path = '/v2/apps/{appId}/integrations/{integrationId}/webhooks/{webhookId}'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'integrationId' + '}', CGI.escape(integration_id.to_s)).sub('{' + 'webhookId' + '}', CGI.escape(webhook_id.to_s))

  # 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[:body] || @api_client.object_to_http_body(webhook_body) 

  # return_type
  return_type = opts[:return_type] || 'WebhookResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['basicAuth', 'bearerAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WebhooksApi#update_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end