Class: Yapstone::EvidencesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/yapstone-disputes/api/evidences_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ EvidencesApi

Returns a new instance of EvidencesApi.



19
20
21
# File 'lib/yapstone-disputes/api/evidences_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/yapstone-disputes/api/evidences_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_file(id, evidence_category, evidence_type, file, opts = {}) ⇒ CompositeFileEvidence

Update a dispute evidences

Parameters:

  • id (String)

    Primary key for a single evidence record (assigned by YapStone)

  • evidence_category (String)
  • evidence_type (String)
  • file (File)

    file to upload

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

    the optional parameters

Returns:



29
30
31
32
# File 'lib/yapstone-disputes/api/evidences_api.rb', line 29

def create_file(id, evidence_category, evidence_type, file, opts = {})
  data, _status_code, _headers = create_file_with_http_info(id, evidence_category, evidence_type, file, opts)
  data
end

#create_file_with_http_info(id, evidence_category, evidence_type, file, opts = {}) ⇒ Array<(CompositeFileEvidence, Integer, Hash)>

Update a dispute evidences

Parameters:

  • id (String)

    Primary key for a single evidence record (assigned by YapStone)

  • evidence_category (String)
  • evidence_type (String)
  • file (File)

    file to upload

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

    the optional parameters

Returns:

  • (Array<(CompositeFileEvidence, Integer, Hash)>)

    CompositeFileEvidence data, response status code and response headers



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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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
# File 'lib/yapstone-disputes/api/evidences_api.rb', line 41

def create_file_with_http_info(id, evidence_category, evidence_type, file, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EvidencesApi.create_file ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling EvidencesApi.create_file"
  end
  if @api_client.config.client_side_validation && id.to_s.length > 64
    fail ArgumentError, 'invalid value for "id" when calling EvidencesApi.create_file, the character length must be smaller than or equal to 64.'
  end

  # verify the required parameter 'evidence_category' is set
  if @api_client.config.client_side_validation && evidence_category.nil?
    fail ArgumentError, "Missing the required parameter 'evidence_category' when calling EvidencesApi.create_file"
  end
  # verify enum value
  allowable_values = ["CANCELLATION", "CHARGE", "REFUND", "SHIPPING", "SIGNATURE", "USAGE"]
  if @api_client.config.client_side_validation && !allowable_values.include?(evidence_category)
    fail ArgumentError, "invalid value for \"evidence_category\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'evidence_type' is set
  if @api_client.config.client_side_validation && evidence_type.nil?
    fail ArgumentError, "Missing the required parameter 'evidence_type' when calling EvidencesApi.create_file"
  end
  # verify enum value
  allowable_values = ["ACCESS_LOG", "COMMUNICATION", "DISCLOSURE", "DOCUMENTATION", "EXPLANATION_LETTER", "RECEIPT"]
  if @api_client.config.client_side_validation && !allowable_values.include?(evidence_type)
    fail ArgumentError, "invalid value for \"evidence_type\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'file' is set
  if @api_client.config.client_side_validation && file.nil?
    fail ArgumentError, "Missing the required parameter 'file' when calling EvidencesApi.create_file"
  end
  # resource path
  local_var_path = '/evidences/{id}/files'.sub('{' + 'id' + '}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # 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(['multipart/form-data'])

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['evidenceCategory'] = evidence_category
  form_params['evidenceType'] = evidence_type
  form_params['file'] = file

  # http body (model)
  post_body = opts[:body] 

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

  # auth_names
  auth_names = opts[:auth_names] || ['Bearer']

  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: EvidencesApi#create_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_text(id, composite_text_evidence, opts = {}) ⇒ CompositeTextEvidence

Update a dispute evidences

Parameters:

  • id (String)

    Primary key for a single evidence record (assigned by YapStone)

  • composite_text_evidence (CompositeTextEvidence)

    Text evidence to be created

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

    the optional parameters

Returns:



124
125
126
127
# File 'lib/yapstone-disputes/api/evidences_api.rb', line 124

def create_text(id, composite_text_evidence, opts = {})
  data, _status_code, _headers = create_text_with_http_info(id, composite_text_evidence, opts)
  data
end

#create_text_with_http_info(id, composite_text_evidence, opts = {}) ⇒ Array<(CompositeTextEvidence, Integer, Hash)>

Update a dispute evidences

Parameters:

  • id (String)

    Primary key for a single evidence record (assigned by YapStone)

  • composite_text_evidence (CompositeTextEvidence)

    Text evidence to be created

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

    the optional parameters

Returns:

  • (Array<(CompositeTextEvidence, Integer, Hash)>)

    CompositeTextEvidence data, response status code and response headers



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
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
# File 'lib/yapstone-disputes/api/evidences_api.rb', line 134

def create_text_with_http_info(id, composite_text_evidence, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EvidencesApi.create_text ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling EvidencesApi.create_text"
  end
  if @api_client.config.client_side_validation && id.to_s.length > 64
    fail ArgumentError, 'invalid value for "id" when calling EvidencesApi.create_text, the character length must be smaller than or equal to 64.'
  end

  # verify the required parameter 'composite_text_evidence' is set
  if @api_client.config.client_side_validation && composite_text_evidence.nil?
    fail ArgumentError, "Missing the required parameter 'composite_text_evidence' when calling EvidencesApi.create_text"
  end
  # resource path
  local_var_path = '/evidences/{id}/text'.sub('{' + 'id' + '}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # 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(composite_text_evidence) 

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

  # auth_names
  auth_names = opts[:auth_names] || ['Bearer']

  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: EvidencesApi#create_text\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_file(id, opts = {}) ⇒ nil

Get the evidence by it’s id Get the evidence by it’s id

Parameters:

  • id (String)

    Id of the file

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

    the optional parameters

Returns:

  • (nil)


196
197
198
199
# File 'lib/yapstone-disputes/api/evidences_api.rb', line 196

def delete_file(id, opts = {})
  delete_file_with_http_info(id, opts)
  nil
end

#delete_file_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Get the evidence by it&#39;s id Get the evidence by it&#39;s id

Parameters:

  • id (String)

    Id of the file

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

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
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
# File 'lib/yapstone-disputes/api/evidences_api.rb', line 206

def delete_file_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EvidencesApi.delete_file ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling EvidencesApi.delete_file"
  end
  if @api_client.config.client_side_validation && id.to_s.length > 64
    fail ArgumentError, 'invalid value for "id" when calling EvidencesApi.delete_file, the character length must be smaller than or equal to 64.'
  end

  # resource path
  local_var_path = '/files/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # 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] 

  # auth_names
  auth_names = opts[:auth_names] || ['Bearer']

  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: EvidencesApi#delete_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_text(id, opts = {}) ⇒ nil

Get the evidence by it’s id Get the evidence by it’s id

Parameters:

  • id (String)

    Id of the evidence

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

    the optional parameters

Returns:

  • (nil)


262
263
264
265
# File 'lib/yapstone-disputes/api/evidences_api.rb', line 262

def delete_text(id, opts = {})
  delete_text_with_http_info(id, opts)
  nil
end

#delete_text_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Get the evidence by it&#39;s id Get the evidence by it&#39;s id

Parameters:

  • id (String)

    Id of the evidence

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

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



272
273
274
275
276
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
316
317
318
319
320
321
# File 'lib/yapstone-disputes/api/evidences_api.rb', line 272

def delete_text_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EvidencesApi.delete_text ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling EvidencesApi.delete_text"
  end
  if @api_client.config.client_side_validation && id.to_s.length > 64
    fail ArgumentError, 'invalid value for "id" when calling EvidencesApi.delete_text, the character length must be smaller than or equal to 64.'
  end

  # resource path
  local_var_path = '/text/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # 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] 

  # auth_names
  auth_names = opts[:auth_names] || ['Bearer']

  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: EvidencesApi#delete_text\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_evidence(id, opts = {}) ⇒ CompositeEvidenceResponse

Get the evidence by it’s id Get the evidence by it’s id

Parameters:

  • id (String)

    Id of the evidene

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

    the optional parameters

Returns:



328
329
330
331
# File 'lib/yapstone-disputes/api/evidences_api.rb', line 328

def get_evidence(id, opts = {})
  data, _status_code, _headers = get_evidence_with_http_info(id, opts)
  data
end

#get_evidence_with_http_info(id, opts = {}) ⇒ Array<(CompositeEvidenceResponse, Integer, Hash)>

Get the evidence by it&#39;s id Get the evidence by it&#39;s id

Parameters:

  • id (String)

    Id of the evidene

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

    the optional parameters

Returns:

  • (Array<(CompositeEvidenceResponse, Integer, Hash)>)

    CompositeEvidenceResponse data, response status code and response headers



338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
# File 'lib/yapstone-disputes/api/evidences_api.rb', line 338

def get_evidence_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EvidencesApi.get_evidence ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling EvidencesApi.get_evidence"
  end
  if @api_client.config.client_side_validation && id.to_s.length > 64
    fail ArgumentError, 'invalid value for "id" when calling EvidencesApi.get_evidence, the character length must be smaller than or equal to 64.'
  end

  # resource path
  local_var_path = '/evidences/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # 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] || 'CompositeEvidenceResponse' 

  # auth_names
  auth_names = opts[:auth_names] || ['Bearer']

  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: EvidencesApi#get_evidence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_file_content_by_id(id, opts = {}) ⇒ Object

Get file content by file evidence id Returns a file evidence’s content

Parameters:

  • id (String)

    File evidence id

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

    the optional parameters

Returns:

  • (Object)


394
395
396
397
# File 'lib/yapstone-disputes/api/evidences_api.rb', line 394

def get_file_content_by_id(id, opts = {})
  data, _status_code, _headers = get_file_content_by_id_with_http_info(id, opts)
  data
end

#get_file_content_by_id_with_http_info(id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get file content by file evidence id Returns a file evidence&#39;s content

Parameters:

  • id (String)

    File evidence id

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

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
# File 'lib/yapstone-disputes/api/evidences_api.rb', line 404

def get_file_content_by_id_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: EvidencesApi.get_file_content_by_id ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling EvidencesApi.get_file_content_by_id"
  end
  # resource path
  local_var_path = '/files/{id}/content'.sub('{' + 'id' + '}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # 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/*'])

  # 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] || ['Bearer']

  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: EvidencesApi#get_file_content_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end