Class: SyncteraRubySdk::PaymentSchedulesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/synctera_ruby_sdk/api/payment_schedules_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PaymentSchedulesApi

Returns a new instance of PaymentSchedulesApi.



19
20
21
# File 'lib/synctera_ruby_sdk/api/payment_schedules_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/synctera_ruby_sdk/api/payment_schedules_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_payment_schedule(payment_schedule, opts = {}) ⇒ PaymentSchedule

Create a payment schedule Create a payment schedule

Parameters:

  • payment_schedule (PaymentSchedule)

    payment schedule to create

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

    the optional parameters

Returns:



27
28
29
30
# File 'lib/synctera_ruby_sdk/api/payment_schedules_api.rb', line 27

def create_payment_schedule(payment_schedule, opts = {})
  data, _status_code, _headers = create_payment_schedule_with_http_info(payment_schedule, opts)
  data
end

#create_payment_schedule_with_http_info(payment_schedule, opts = {}) ⇒ Array<(PaymentSchedule, Integer, Hash)>

Create a payment schedule Create a payment schedule

Parameters:

  • payment_schedule (PaymentSchedule)

    payment schedule to create

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

    the optional parameters

Returns:

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

    PaymentSchedule 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
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/synctera_ruby_sdk/api/payment_schedules_api.rb', line 37

def create_payment_schedule_with_http_info(payment_schedule, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentSchedulesApi.create_payment_schedule ...'
  end
  # verify the required parameter 'payment_schedule' is set
  if @api_client.config.client_side_validation && payment_schedule.nil?
    fail ArgumentError, "Missing the required parameter 'payment_schedule' when calling PaymentSchedulesApi.create_payment_schedule"
  end
  # resource path
  local_var_path = '/payment_schedules'

  # 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', 'application/problem+json'])
  # 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

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PaymentSchedulesApi.create_payment_schedule",
    :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: PaymentSchedulesApi#create_payment_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_payment_schedules(opts = {}) ⇒ PaymentScheduleList

List payment schedules Get paginated list of payment schedules

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer) — default: default to 100
  • :page_token (String)
  • :id (Array<String>)

    IDs. Multiple IDs can be provided as a comma-separated list.

  • :account_id (Array<String>)

    Originating account IDs. Multiple IDs can be provided as a comma-separated list.

  • :customer_id (Array<String>)

    The IDs of customers who created the payment schedules. Multiple IDs can be provided as a comma-separated list.

Returns:



99
100
101
102
# File 'lib/synctera_ruby_sdk/api/payment_schedules_api.rb', line 99

def list_payment_schedules(opts = {})
  data, _status_code, _headers = list_payment_schedules_with_http_info(opts)
  data
end

#list_payment_schedules_with_http_info(opts = {}) ⇒ Array<(PaymentScheduleList, Integer, Hash)>

List payment schedules Get paginated list of payment schedules

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer) — default: default to 100
  • :page_token (String)
  • :id (Array<String>)

    IDs. Multiple IDs can be provided as a comma-separated list.

  • :account_id (Array<String>)

    Originating account IDs. Multiple IDs can be provided as a comma-separated list.

  • :customer_id (Array<String>)

    The IDs of customers who created the payment schedules. Multiple IDs can be provided as a comma-separated list.

Returns:

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

    PaymentScheduleList data, response status code and response headers



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
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
# File 'lib/synctera_ruby_sdk/api/payment_schedules_api.rb', line 113

def list_payment_schedules_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentSchedulesApi.list_payment_schedules ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PaymentSchedulesApi.list_payment_schedules, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/payment_schedules'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page_token'] = opts[:'page_token'] if !opts[:'page_token'].nil?
  query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :csv) if !opts[:'id'].nil?
  query_params[:'account_id'] = @api_client.build_collection_param(opts[:'account_id'], :csv) if !opts[:'account_id'].nil?
  query_params[:'customer_id'] = @api_client.build_collection_param(opts[:'customer_id'], :csv) if !opts[:'customer_id'].nil?

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

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PaymentSchedulesApi.list_payment_schedules",
    :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: PaymentSchedulesApi#list_payment_schedules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_payments(opts = {}) ⇒ PaymentList

List payments Get paginated list of payments

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer) — default: default to 100
  • :page_token (String)
  • :id (Array<String>)

    IDs. Multiple IDs can be provided as a comma-separated list.

  • :schedule_id (Array<String>)

    Payment schedule IDs. Multiple IDs can be provided as a comma-separated list.

  • :account_id (Array<String>)

    Originating account IDs. Multiple IDs can be provided as a comma-separated list.

  • :customer_id (Array<String>)

    The IDs of customers who created the payment schedules. Multiple IDs can be provided as a comma-separated list.

Returns:



176
177
178
179
# File 'lib/synctera_ruby_sdk/api/payment_schedules_api.rb', line 176

def list_payments(opts = {})
  data, _status_code, _headers = list_payments_with_http_info(opts)
  data
end

#list_payments_with_http_info(opts = {}) ⇒ Array<(PaymentList, Integer, Hash)>

List payments Get paginated list of payments

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer) — default: default to 100
  • :page_token (String)
  • :id (Array<String>)

    IDs. Multiple IDs can be provided as a comma-separated list.

  • :schedule_id (Array<String>)

    Payment schedule IDs. Multiple IDs can be provided as a comma-separated list.

  • :account_id (Array<String>)

    Originating account IDs. Multiple IDs can be provided as a comma-separated list.

  • :customer_id (Array<String>)

    The IDs of customers who created the payment schedules. Multiple IDs can be provided as a comma-separated list.

Returns:

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

    PaymentList data, response status code and response headers



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
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
# File 'lib/synctera_ruby_sdk/api/payment_schedules_api.rb', line 191

def list_payments_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentSchedulesApi.list_payments ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PaymentSchedulesApi.list_payments, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/payment_schedules/payments'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page_token'] = opts[:'page_token'] if !opts[:'page_token'].nil?
  query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :csv) if !opts[:'id'].nil?
  query_params[:'schedule_id'] = @api_client.build_collection_param(opts[:'schedule_id'], :csv) if !opts[:'schedule_id'].nil?
  query_params[:'account_id'] = @api_client.build_collection_param(opts[:'account_id'], :csv) if !opts[:'account_id'].nil?
  query_params[:'customer_id'] = @api_client.build_collection_param(opts[:'customer_id'], :csv) if !opts[:'customer_id'].nil?

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

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PaymentSchedulesApi.list_payments",
    :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: PaymentSchedulesApi#list_payments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#patch_payment_schedule(payment_schedule_id, patch_payment_schedule, opts = {}) ⇒ PaymentSchedule

Update a payment schedule Update a payment schedule

Parameters:

  • payment_schedule_id (String)

    Payment schedule ID

  • patch_payment_schedule (PatchPaymentSchedule)

    payment schedule to update

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

    the optional parameters

Returns:



251
252
253
254
# File 'lib/synctera_ruby_sdk/api/payment_schedules_api.rb', line 251

def patch_payment_schedule(payment_schedule_id, patch_payment_schedule, opts = {})
  data, _status_code, _headers = patch_payment_schedule_with_http_info(payment_schedule_id, patch_payment_schedule, opts)
  data
end

#patch_payment_schedule_with_http_info(payment_schedule_id, patch_payment_schedule, opts = {}) ⇒ Array<(PaymentSchedule, Integer, Hash)>

Update a payment schedule Update a payment schedule

Parameters:

  • payment_schedule_id (String)

    Payment schedule ID

  • patch_payment_schedule (PatchPaymentSchedule)

    payment schedule to update

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

    the optional parameters

Returns:

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

    PaymentSchedule data, response status code and response headers



262
263
264
265
266
267
268
269
270
271
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
# File 'lib/synctera_ruby_sdk/api/payment_schedules_api.rb', line 262

def patch_payment_schedule_with_http_info(payment_schedule_id, patch_payment_schedule, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PaymentSchedulesApi.patch_payment_schedule ...'
  end
  # verify the required parameter 'payment_schedule_id' is set
  if @api_client.config.client_side_validation && payment_schedule_id.nil?
    fail ArgumentError, "Missing the required parameter 'payment_schedule_id' when calling PaymentSchedulesApi.patch_payment_schedule"
  end
  # verify the required parameter 'patch_payment_schedule' is set
  if @api_client.config.client_side_validation && patch_payment_schedule.nil?
    fail ArgumentError, "Missing the required parameter 'patch_payment_schedule' when calling PaymentSchedulesApi.patch_payment_schedule"
  end
  # resource path
  local_var_path = '/payment_schedules/{payment_schedule_id}'.sub('{' + 'payment_schedule_id' + '}', CGI.escape(payment_schedule_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', 'application/problem+json'])
  # 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

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"PaymentSchedulesApi.patch_payment_schedule",
    :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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PaymentSchedulesApi#patch_payment_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end