Class: PostfinancecheckoutRubySdk::CustomerCommentsService

Inherits:
Object
  • Object
show all
Defined in:
lib/postfinancecheckout-ruby-sdk/service/customer_comments_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ CustomerCommentsService

Returns a new instance of CustomerCommentsService.



30
31
32
# File 'lib/postfinancecheckout-ruby-sdk/service/customer_comments_service.rb', line 30

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



27
28
29
# File 'lib/postfinancecheckout-ruby-sdk/service/customer_comments_service.rb', line 27

def api_client
  @api_client
end

Instance Method Details

#delete_customers_customer_id_comments_id(customer_id, id, space, opts = {}) ⇒ nil

Delete a customer comment

Parameters:

  • customer_id (Integer)
  • id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Returns:

  • (nil)


39
40
41
42
# File 'lib/postfinancecheckout-ruby-sdk/service/customer_comments_service.rb', line 39

def delete_customers_customer_id_comments_id(customer_id, id, space, opts = {})
  delete_customers_customer_id_comments_id_with_http_info(customer_id, id, space, opts)
  nil
end

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

Returns nil, response status code and response headers.

Parameters:

  • customer_id (Integer)
  • id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
# File 'lib/postfinancecheckout-ruby-sdk/service/customer_comments_service.rb', line 51

def delete_customers_customer_id_comments_id_with_http_info(customer_id, id, space, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerCommentsService.delete_customers_customer_id_comments_id ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomerCommentsService.delete_customers_customer_id_comments_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 CustomerCommentsService.delete_customers_customer_id_comments_id"
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling CustomerCommentsService.delete_customers_customer_id_comments_id"
  end
  # resource path
  local_var_path = '/customers/{customerId}/comments/{id}'.sub('{' + 'customerId' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'id' + '}', CGI.escape(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']) unless header_params['Accept']
  header_params[:'Space'] = space

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

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

  # return_type
  return_type = opts[:debug_return_type]

  new_options = opts.merge(
    :operation => :"CustomerCommentsService.delete_customers_customer_id_comments_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerCommentsService#delete_customers_customer_id_comments_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end

#get_customers_customer_id_comments(customer_id, space, opts = {}) ⇒ CustomerCommentListResponse

List all customer comments

Parameters:

  • customer_id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :after (Integer)

    Set to an object&#39;s ID to retrieve the page of objects coming immediately after the named object.

  • :before (Integer)

    Set to an object&#39;s ID to retrieve the page of objects coming immediately before the named object.

  • :expand (Array<String>)
  • :limit (Integer)

    A limit on the number of objects to be returned, between 1 and 100. Default is 10.

  • :order (SortingOrder)

    Specify to retrieve objects in chronological (ASC) or reverse chronological (DESC) order.

Returns:



118
119
120
121
# File 'lib/postfinancecheckout-ruby-sdk/service/customer_comments_service.rb', line 118

def get_customers_customer_id_comments(customer_id, space, opts = {})
  data, _status_code, _headers = get_customers_customer_id_comments_with_http_info(customer_id, space, opts)
  data
end

#get_customers_customer_id_comments_id(customer_id, id, space, opts = {}) ⇒ CustomerComment

Retrieve a customer comment

Parameters:

  • customer_id (Integer)
  • id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

Returns:



215
216
217
218
# File 'lib/postfinancecheckout-ruby-sdk/service/customer_comments_service.rb', line 215

def get_customers_customer_id_comments_id(customer_id, id, space, opts = {})
  data, _status_code, _headers = get_customers_customer_id_comments_id_with_http_info(customer_id, id, space, opts)
  data
end

#get_customers_customer_id_comments_id_with_http_info(customer_id, id, space, opts = {}) ⇒ Array<(CustomerComment, Integer, Hash)>

Returns CustomerComment data, response status code and response headers.

Parameters:

  • customer_id (Integer)
  • id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

Returns:

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

    CustomerComment data, response status code and response headers



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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/postfinancecheckout-ruby-sdk/service/customer_comments_service.rb', line 228

def get_customers_customer_id_comments_id_with_http_info(customer_id, id, space, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerCommentsService.get_customers_customer_id_comments_id ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomerCommentsService.get_customers_customer_id_comments_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 CustomerCommentsService.get_customers_customer_id_comments_id"
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling CustomerCommentsService.get_customers_customer_id_comments_id"
  end
  # resource path
  local_var_path = '/customers/{customerId}/comments/{id}'.sub('{' + 'customerId' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'Space'] = space

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

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

  # return_type
  return_type = opts[:debug_return_type] || 'CustomerComment'

  new_options = opts.merge(
    :operation => :"CustomerCommentsService.get_customers_customer_id_comments_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerCommentsService#get_customers_customer_id_comments_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end

#get_customers_customer_id_comments_search(customer_id, space, opts = {}) ⇒ CustomerCommentSearchResponse

Search customer comments

Parameters:

  • customer_id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)
  • :limit (Integer)

    A limit on the number of objects to be returned, between 1 and 100. Default is 10.

  • :offset (Integer)

    A cursor for pagination, specifies the number of objects to skip.

  • :order (String)

    The fields and order to sort the objects by.

  • :query (String)

    The search query to filter the objects by.

Returns:



296
297
298
299
# File 'lib/postfinancecheckout-ruby-sdk/service/customer_comments_service.rb', line 296

def get_customers_customer_id_comments_search(customer_id, space, opts = {})
  data, _status_code, _headers = get_customers_customer_id_comments_search_with_http_info(customer_id, space, opts)
  data
end

#get_customers_customer_id_comments_search_with_http_info(customer_id, space, opts = {}) ⇒ Array<(CustomerCommentSearchResponse, Integer, Hash)>

Returns CustomerCommentSearchResponse data, response status code and response headers.

Parameters:

  • customer_id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)
  • :limit (Integer)

    A limit on the number of objects to be returned, between 1 and 100. Default is 10.

  • :offset (Integer)

    A cursor for pagination, specifies the number of objects to skip.

  • :order (String)

    The fields and order to sort the objects by.

  • :query (String)

    The search query to filter the objects by.

Returns:



312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
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
# File 'lib/postfinancecheckout-ruby-sdk/service/customer_comments_service.rb', line 312

def get_customers_customer_id_comments_search_with_http_info(customer_id, space, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerCommentsService.get_customers_customer_id_comments_search ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomerCommentsService.get_customers_customer_id_comments_search"
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling CustomerCommentsService.get_customers_customer_id_comments_search"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CustomerCommentsService.get_customers_customer_id_comments_search, 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 CustomerCommentsService.get_customers_customer_id_comments_search, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] > 10000
    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling CustomerCommentsService.get_customers_customer_id_comments_search, must be smaller than or equal to 10000.'
  end

  # resource path
  local_var_path = '/customers/{customerId}/comments/search'.sub('{' + 'customerId' + '}', CGI.escape(customer_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'Space'] = space

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

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

  # return_type
  return_type = opts[:debug_return_type] || 'CustomerCommentSearchResponse'

  new_options = opts.merge(
    :operation => :"CustomerCommentsService.get_customers_customer_id_comments_search",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerCommentsService#get_customers_customer_id_comments_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end

#get_customers_customer_id_comments_with_http_info(customer_id, space, opts = {}) ⇒ Array<(CustomerCommentListResponse, Integer, Hash)>

Returns CustomerCommentListResponse data, response status code and response headers.

Parameters:

  • customer_id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :after (Integer)

    Set to an object&#39;s ID to retrieve the page of objects coming immediately after the named object.

  • :before (Integer)

    Set to an object&#39;s ID to retrieve the page of objects coming immediately before the named object.

  • :expand (Array<String>)
  • :limit (Integer)

    A limit on the number of objects to be returned, between 1 and 100. Default is 10.

  • :order (SortingOrder)

    Specify to retrieve objects in chronological (ASC) or reverse chronological (DESC) order.

Returns:

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

    CustomerCommentListResponse 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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# File 'lib/postfinancecheckout-ruby-sdk/service/customer_comments_service.rb', line 134

def get_customers_customer_id_comments_with_http_info(customer_id, space, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerCommentsService.get_customers_customer_id_comments ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomerCommentsService.get_customers_customer_id_comments"
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling CustomerCommentsService.get_customers_customer_id_comments"
  end
  if @api_client.config.client_side_validation && !opts[:'after'].nil? && opts[:'after'] < 1
    fail ArgumentError, 'invalid value for "opts[:"after"]" when calling CustomerCommentsService.get_customers_customer_id_comments, must be greater than or equal to 1.'
  end

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

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CustomerCommentsService.get_customers_customer_id_comments, 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 CustomerCommentsService.get_customers_customer_id_comments, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/customers/{customerId}/comments'.sub('{' + 'customerId' + '}', CGI.escape(customer_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'Space'] = space

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

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

  # return_type
  return_type = opts[:debug_return_type] || 'CustomerCommentListResponse'

  new_options = opts.merge(
    :operation => :"CustomerCommentsService.get_customers_customer_id_comments",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerCommentsService#get_customers_customer_id_comments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end

#patch_customers_customer_id_comments_id(customer_id, id, space, customer_comment_active, opts = {}) ⇒ CustomerComment

Update a customer comment

Parameters:

  • customer_id (Integer)
  • id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

Returns:



390
391
392
393
# File 'lib/postfinancecheckout-ruby-sdk/service/customer_comments_service.rb', line 390

def patch_customers_customer_id_comments_id(customer_id, id, space, customer_comment_active, opts = {})
  data, _status_code, _headers = patch_customers_customer_id_comments_id_with_http_info(customer_id, id, space, customer_comment_active, opts)
  data
end

#patch_customers_customer_id_comments_id_with_http_info(customer_id, id, space, customer_comment_active, opts = {}) ⇒ Array<(CustomerComment, Integer, Hash)>

Returns CustomerComment data, response status code and response headers.

Parameters:

  • customer_id (Integer)
  • id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

Returns:

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

    CustomerComment 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
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
# File 'lib/postfinancecheckout-ruby-sdk/service/customer_comments_service.rb', line 404

def patch_customers_customer_id_comments_id_with_http_info(customer_id, id, space, customer_comment_active, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerCommentsService.patch_customers_customer_id_comments_id ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomerCommentsService.patch_customers_customer_id_comments_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 CustomerCommentsService.patch_customers_customer_id_comments_id"
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling CustomerCommentsService.patch_customers_customer_id_comments_id"
  end
  # verify the required parameter 'customer_comment_active' is set
  if @api_client.config.client_side_validation && customer_comment_active.nil?
    fail ArgumentError, "Missing the required parameter 'customer_comment_active' when calling CustomerCommentsService.patch_customers_customer_id_comments_id"
  end
  # resource path
  local_var_path = '/customers/{customerId}/comments/{id}'.sub('{' + 'customerId' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'Space'] = space

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(customer_comment_active)

  # return_type
  return_type = opts[:debug_return_type] || 'CustomerComment'

  new_options = opts.merge(
    :operation => :"CustomerCommentsService.patch_customers_customer_id_comments_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerCommentsService#patch_customers_customer_id_comments_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end

#post_customers_customer_id_comments(customer_id, space, customer_comment_create, opts = {}) ⇒ CustomerComment

Create a customer comment

Parameters:

  • customer_id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

Returns:



478
479
480
481
# File 'lib/postfinancecheckout-ruby-sdk/service/customer_comments_service.rb', line 478

def post_customers_customer_id_comments(customer_id, space, customer_comment_create, opts = {})
  data, _status_code, _headers = post_customers_customer_id_comments_with_http_info(customer_id, space, customer_comment_create, opts)
  data
end

#post_customers_customer_id_comments_id_pin(customer_id, id, space, opts = {}) ⇒ nil

Pin a comment to the top

Parameters:

  • customer_id (Integer)
  • id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Returns:

  • (nil)


560
561
562
563
# File 'lib/postfinancecheckout-ruby-sdk/service/customer_comments_service.rb', line 560

def post_customers_customer_id_comments_id_pin(customer_id, id, space, opts = {})
  post_customers_customer_id_comments_id_pin_with_http_info(customer_id, id, space, opts)
  nil
end

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

Returns nil, response status code and response headers.

Parameters:

  • customer_id (Integer)
  • id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
# File 'lib/postfinancecheckout-ruby-sdk/service/customer_comments_service.rb', line 572

def post_customers_customer_id_comments_id_pin_with_http_info(customer_id, id, space, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerCommentsService.post_customers_customer_id_comments_id_pin ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomerCommentsService.post_customers_customer_id_comments_id_pin"
  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 CustomerCommentsService.post_customers_customer_id_comments_id_pin"
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling CustomerCommentsService.post_customers_customer_id_comments_id_pin"
  end
  # resource path
  local_var_path = '/customers/{customerId}/comments/{id}/pin'.sub('{' + 'customerId' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'id' + '}', CGI.escape(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']) unless header_params['Accept']
  header_params[:'Space'] = space

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

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

  # return_type
  return_type = opts[:debug_return_type]

  new_options = opts.merge(
    :operation => :"CustomerCommentsService.post_customers_customer_id_comments_id_pin",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerCommentsService#post_customers_customer_id_comments_id_pin\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end

#post_customers_customer_id_comments_id_unpin(customer_id, id, space, opts = {}) ⇒ nil

Remove a pinned comment from the top

Parameters:

  • customer_id (Integer)
  • id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Returns:

  • (nil)


635
636
637
638
# File 'lib/postfinancecheckout-ruby-sdk/service/customer_comments_service.rb', line 635

def post_customers_customer_id_comments_id_unpin(customer_id, id, space, opts = {})
  post_customers_customer_id_comments_id_unpin_with_http_info(customer_id, id, space, opts)
  nil
end

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

Returns nil, response status code and response headers.

Parameters:

  • customer_id (Integer)
  • id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
# File 'lib/postfinancecheckout-ruby-sdk/service/customer_comments_service.rb', line 647

def post_customers_customer_id_comments_id_unpin_with_http_info(customer_id, id, space, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerCommentsService.post_customers_customer_id_comments_id_unpin ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomerCommentsService.post_customers_customer_id_comments_id_unpin"
  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 CustomerCommentsService.post_customers_customer_id_comments_id_unpin"
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling CustomerCommentsService.post_customers_customer_id_comments_id_unpin"
  end
  # resource path
  local_var_path = '/customers/{customerId}/comments/{id}/unpin'.sub('{' + 'customerId' + '}', CGI.escape(customer_id.to_s)).sub('{' + 'id' + '}', CGI.escape(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']) unless header_params['Accept']
  header_params[:'Space'] = space

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

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

  # return_type
  return_type = opts[:debug_return_type]

  new_options = opts.merge(
    :operation => :"CustomerCommentsService.post_customers_customer_id_comments_id_unpin",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerCommentsService#post_customers_customer_id_comments_id_unpin\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end

#post_customers_customer_id_comments_with_http_info(customer_id, space, customer_comment_create, opts = {}) ⇒ Array<(CustomerComment, Integer, Hash)>

Returns CustomerComment data, response status code and response headers.

Parameters:

  • customer_id (Integer)
  • space (Integer)

    Specifies the ID of the space the operation should be executed in.

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

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

Returns:

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

    CustomerComment data, response status code and response headers



491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
# File 'lib/postfinancecheckout-ruby-sdk/service/customer_comments_service.rb', line 491

def post_customers_customer_id_comments_with_http_info(customer_id, space, customer_comment_create, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerCommentsService.post_customers_customer_id_comments ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomerCommentsService.post_customers_customer_id_comments"
  end
  # verify the required parameter 'space' is set
  if @api_client.config.client_side_validation && space.nil?
    fail ArgumentError, "Missing the required parameter 'space' when calling CustomerCommentsService.post_customers_customer_id_comments"
  end
  # verify the required parameter 'customer_comment_create' is set
  if @api_client.config.client_side_validation && customer_comment_create.nil?
    fail ArgumentError, "Missing the required parameter 'customer_comment_create' when calling CustomerCommentsService.post_customers_customer_id_comments"
  end
  # resource path
  local_var_path = '/customers/{customerId}/comments'.sub('{' + 'customerId' + '}', CGI.escape(customer_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'Space'] = space

  # form parameters
  form_params = opts[:form_params] || {}

  # connection timeout
  connection_timeout = @api_client.config.timeout

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(customer_comment_create)

  # return_type
  return_type = opts[:debug_return_type] || 'CustomerComment'

  new_options = opts.merge(
    :operation => :"CustomerCommentsService.post_customers_customer_id_comments",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST.to_sym.downcase, local_var_path, new_options, connection_timeout)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerCommentsService#post_customers_customer_id_comments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
  end
  return data, status_code, headers
end