class SamplifyAPIClient::EventsApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

events_accept(event_id, opts = {}) click to toggle source

accept events Accept event @param event_id Event ID @param [Hash] opts the optional parameters @return [Event]

# File lib/samplify_api_client/api/events_api.rb, line 27
def events_accept(event_id, opts = {})
  data, _status_code, _headers = events_accept_with_http_info(event_id, opts)
  data
end
events_accept_with_http_info(event_id, opts = {}) click to toggle source

accept events Accept event @param event_id Event ID @param [Hash] opts the optional parameters @return [Array<(Event, Fixnum, Hash)>] Event data, response status code and response headers

# File lib/samplify_api_client/api/events_api.rb, line 37
def events_accept_with_http_info(event_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EventsApi.events_accept ...'
  end
  # verify the required parameter 'event_id' is set
  if @api_client.config.client_side_validation && event_id.nil?
    fail ArgumentError, "Missing the required parameter 'event_id' when calling EventsApi.events_accept"
  end
  # resource path
  local_var_path = '/sample/v1/events/{eventId}/accept'.sub('{' + 'eventId' + '}', event_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.event+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['jwt']
  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 => 'Event')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EventsApi#events_accept\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
events_get(event_id, opts = {}) click to toggle source

get events Get event @param event_id Event ID @param [Hash] opts the optional parameters @return [Event]

# File lib/samplify_api_client/api/events_api.rb, line 81
def events_get(event_id, opts = {})
  data, _status_code, _headers = events_get_with_http_info(event_id, opts)
  data
end
events_get_with_http_info(event_id, opts = {}) click to toggle source

get events Get event @param event_id Event ID @param [Hash] opts the optional parameters @return [Array<(Event, Fixnum, Hash)>] Event data, response status code and response headers

# File lib/samplify_api_client/api/events_api.rb, line 91
def events_get_with_http_info(event_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EventsApi.events_get ...'
  end
  # verify the required parameter 'event_id' is set
  if @api_client.config.client_side_validation && event_id.nil?
    fail ArgumentError, "Missing the required parameter 'event_id' when calling EventsApi.events_get"
  end
  # resource path
  local_var_path = '/sample/v1/events/{eventId}'.sub('{' + 'eventId' + '}', event_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.event+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['jwt']
  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 => 'Event')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EventsApi#events_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
events_list(opts = {}) click to toggle source

list events List events. @param [Hash] opts the optional parameters @option opts [String] :event_type Only return events with the given eventType @option opts [String] :ext_line_item_id Only return events with the given external line item id @option opts [String] :ext_project_id Only return events with the given external project id @option opts [Integer] :limit Maximum number of events to return (default to 10) @option opts [Integer] :offset The first zero-based offset event to return (default to 0) @option opts [Array<String>] :sort Sort the events by the given key(s) @return [Events]

# File lib/samplify_api_client/api/events_api.rb, line 140
def events_list(opts = {})
  data, _status_code, _headers = events_list_with_http_info(opts)
  data
end
events_list_with_http_info(opts = {}) click to toggle source

list events List events. @param [Hash] opts the optional parameters @option opts [String] :event_type Only return events with the given eventType @option opts [String] :ext_line_item_id Only return events with the given external line item id @option opts [String] :ext_project_id Only return events with the given external project id @option opts [Integer] :limit Maximum number of events to return @option opts [Integer] :offset The first zero-based offset event to return @option opts [Array<String>] :sort Sort the events by the given key(s) @return [Array<(Events, Fixnum, Hash)>] Events data, response status code and response headers

# File lib/samplify_api_client/api/events_api.rb, line 155
def events_list_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EventsApi.events_list ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling EventsApi.events_list, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling EventsApi.events_list, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling EventsApi.events_list, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/sample/v1/events'

  # query parameters
  query_params = {}
  query_params[:'eventType'] = opts[:'event_type'] if !opts[:'event_type'].nil?
  query_params[:'extLineItemId'] = opts[:'ext_line_item_id'] if !opts[:'ext_line_item_id'].nil?
  query_params[:'extProjectId'] = opts[:'ext_project_id'] if !opts[:'ext_project_id'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'sort'] = @api_client.build_collection_param(opts[:'sort'], :multi) if !opts[:'sort'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.events+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['jwt']
  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 => 'Events')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EventsApi#events_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
events_reject(event_id, opts = {}) click to toggle source

reject events Reject event @param event_id Event ID @param [Hash] opts the optional parameters @return [Event]

# File lib/samplify_api_client/api/events_api.rb, line 213
def events_reject(event_id, opts = {})
  data, _status_code, _headers = events_reject_with_http_info(event_id, opts)
  data
end
events_reject_with_http_info(event_id, opts = {}) click to toggle source

reject events Reject event @param event_id Event ID @param [Hash] opts the optional parameters @return [Array<(Event, Fixnum, Hash)>] Event data, response status code and response headers

# File lib/samplify_api_client/api/events_api.rb, line 223
def events_reject_with_http_info(event_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EventsApi.events_reject ...'
  end
  # verify the required parameter 'event_id' is set
  if @api_client.config.client_side_validation && event_id.nil?
    fail ArgumentError, "Missing the required parameter 'event_id' when calling EventsApi.events_reject"
  end
  # resource path
  local_var_path = '/sample/v1/events/{eventId}/reject'.sub('{' + 'eventId' + '}', event_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.event+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['jwt']
  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 => 'Event')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EventsApi#events_reject\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
events_reprice(payload, opts = {}) click to toggle source

reprice events Line item repricing event. @param payload @param [Hash] opts the optional parameters @return [Reprice]

# File lib/samplify_api_client/api/events_api.rb, line 267
def events_reprice(payload, opts = {})
  data, _status_code, _headers = events_reprice_with_http_info(payload, opts)
  data
end
events_reprice_with_http_info(payload, opts = {}) click to toggle source

reprice events Line item repricing event. @param payload @param [Hash] opts the optional parameters @return [Array<(Reprice, Fixnum, Hash)>] Reprice data, response status code and response headers

# File lib/samplify_api_client/api/events_api.rb, line 277
def events_reprice_with_http_info(payload, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EventsApi.events_reprice ...'
  end
  # verify the required parameter 'payload' is set
  if @api_client.config.client_side_validation && payload.nil?
    fail ArgumentError, "Missing the required parameter 'payload' when calling EventsApi.events_reprice"
  end
  # resource path
  local_var_path = '/sample/v1/events/lineItems/reprice'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.reprice+json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml', 'application/gob', 'application/x-gob'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(payload)
  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 => 'Reprice')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: EventsApi#events_reprice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end