Class: SamplifyAPIClient::EventsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/samplify_api_client/api/events_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ EventsApi

Returns a new instance of EventsApi.



19
20
21
# File 'lib/samplify_api_client/api/events_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/samplify_api_client/api/events_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#events_accept(event_id, opts = {}) ⇒ Event

accept events Accept event

Parameters:

  • event_id

    Event ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# 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 = {}) ⇒ Array<(Event, Fixnum, Hash)>

accept events Accept event

Parameters:

  • event_id

    Event ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Event, Fixnum, Hash)>)

    Event data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# 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 = {}) ⇒ Event

get events Get event

Parameters:

  • event_id

    Event ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



81
82
83
84
# 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 = {}) ⇒ Array<(Event, Fixnum, Hash)>

get events Get event

Parameters:

  • event_id

    Event ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Event, Fixnum, Hash)>)

    Event data, response status code and response headers



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# 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 = {}) ⇒ Events

list events List events.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :event_type (String)

    Only return events with the given eventType

  • :ext_line_item_id (String)

    Only return events with the given external line item id

  • :ext_project_id (String)

    Only return events with the given external project id

  • :limit (Integer)

    Maximum number of events to return (default to 10)

  • :offset (Integer)

    The first zero-based offset event to return (default to 0)

  • :sort (Array<String>)

    Sort the events by the given key(s)

Returns:



140
141
142
143
# 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 = {}) ⇒ Array<(Events, Fixnum, Hash)>

list events List events.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :event_type (String)

    Only return events with the given eventType

  • :ext_line_item_id (String)

    Only return events with the given external line item id

  • :ext_project_id (String)

    Only return events with the given external project id

  • :limit (Integer)

    Maximum number of events to return

  • :offset (Integer)

    The first zero-based offset event to return

  • :sort (Array<String>)

    Sort the events by the given key(s)

Returns:

  • (Array<(Events, Fixnum, Hash)>)

    Events data, response status code and response headers



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# 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 = {}) ⇒ Event

reject events Reject event

Parameters:

  • event_id

    Event ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



213
214
215
216
# 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 = {}) ⇒ Array<(Event, Fixnum, Hash)>

reject events Reject event

Parameters:

  • event_id

    Event ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Event, Fixnum, Hash)>)

    Event data, response status code and response headers



223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# 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 = {}) ⇒ Reprice

reprice events Line item repricing event.

Parameters:

  • payload
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



267
268
269
270
# 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 = {}) ⇒ Array<(Reprice, Fixnum, Hash)>

reprice events Line item repricing event.

Parameters:

  • payload
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Reprice, Fixnum, Hash)>)

    Reprice data, response status code and response headers



277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
# 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