class SwaggerClient::WebhookControllerApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/swagger_client/api/webhook_controller_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

preconfigured_webhooks_using_get(opts = {}) click to toggle source

Retrieve a list of preconfigured webhooks in Orca @param [Hash] opts the optional parameters @return [Array<Object>]

# File lib/swagger_client/api/webhook_controller_api.rb, line 25
def preconfigured_webhooks_using_get(opts = {})
  data, _status_code, _headers = preconfigured_webhooks_using_get_with_http_info(opts)
  data
end
preconfigured_webhooks_using_get_with_http_info(opts = {}) click to toggle source

Retrieve a list of preconfigured webhooks in Orca @param [Hash] opts the optional parameters @return [Array<(Array<Object>, Fixnum, Hash)>] Array<Object> data, response status code and response headers

# File lib/swagger_client/api/webhook_controller_api.rb, line 33
def preconfigured_webhooks_using_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.preconfigured_webhooks_using_get ...'
  end
  # resource path
  local_var_path = '/webhooks/preconfigured'

  # query parameters
  query_params = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<Object>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WebhookControllerApi#preconfigured_webhooks_using_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
webhooks_using_post(type, source, opts = {}) click to toggle source

Endpoint for posting webhooks to Spinnaker's webhook service @param type type @param source source @param [Hash] opts the optional parameters @option opts [Object] :event event @option opts [String] :x_hub_signature X-Hub-Signature @option opts [String] :x_event_key X-Event-Key @return [Object]

# File lib/swagger_client/api/webhook_controller_api.rb, line 76
def webhooks_using_post(type, source, opts = {})
  data, _status_code, _headers = webhooks_using_post_with_http_info(type, source, opts)
  data
end
webhooks_using_post_with_http_info(type, source, opts = {}) click to toggle source

Endpoint for posting webhooks to Spinnaker&#39;s webhook service @param type type @param source source @param [Hash] opts the optional parameters @option opts [Object] :event event @option opts [String] :x_hub_signature X-Hub-Signature @option opts [String] :x_event_key X-Event-Key @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers

# File lib/swagger_client/api/webhook_controller_api.rb, line 89
def webhooks_using_post_with_http_info(type, source, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.webhooks_using_post ...'
  end
  # verify the required parameter 'type' is set
  if @api_client.config.client_side_validation && type.nil?
    fail ArgumentError, "Missing the required parameter 'type' when calling WebhookControllerApi.webhooks_using_post"
  end
  # verify the required parameter 'source' is set
  if @api_client.config.client_side_validation && source.nil?
    fail ArgumentError, "Missing the required parameter 'source' when calling WebhookControllerApi.webhooks_using_post"
  end
  # resource path
  local_var_path = '/webhooks/{type}/{source}'.sub('{' + 'type' + '}', type.to_s).sub('{' + 'source' + '}', source.to_s)

  # query parameters
  query_params = {}

  # header parameters
  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'])
  header_params[:'X-Hub-Signature'] = opts[:'x_hub_signature'] if !opts[:'x_hub_signature'].nil?
  header_params[:'X-Event-Key'] = opts[:'x_event_key'] if !opts[:'x_event_key'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'event'])
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Object')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WebhookControllerApi#webhooks_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end