Class: PostfinancecheckoutRubySdk::DunningFlowsService

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ DunningFlowsService

Returns a new instance of DunningFlowsService.



30
31
32
# File 'lib/postfinancecheckout-ruby-sdk/service/dunning_flows_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/dunning_flows_service.rb', line 27

def api_client
  @api_client
end

Instance Method Details

#get_payment_dunning_flows(space, opts = {}) ⇒ DunningFlowListResponse

List all dunning flows

Parameters:

  • 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's ID to retrieve the page of objects coming immediately after the named object.

  • :before (Integer)

    Set to an object'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:



42
43
44
45
# File 'lib/postfinancecheckout-ruby-sdk/service/dunning_flows_service.rb', line 42

def get_payment_dunning_flows(space, opts = {})
  data, _status_code, _headers = get_payment_dunning_flows_with_http_info(space, opts)
  data
end

#get_payment_dunning_flows_id(id, space, opts = {}) ⇒ DunningFlow

Retrieve a dunning flow

Parameters:

  • 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:



133
134
135
136
# File 'lib/postfinancecheckout-ruby-sdk/service/dunning_flows_service.rb', line 133

def get_payment_dunning_flows_id(id, space, opts = {})
  data, _status_code, _headers = get_payment_dunning_flows_id_with_http_info(id, space, opts)
  data
end

#get_payment_dunning_flows_id_with_http_info(id, space, opts = {}) ⇒ Array<(DunningFlow, Integer, Hash)>

Returns DunningFlow data, response status code and response headers.

Parameters:

  • 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<(DunningFlow, Integer, Hash)>)

    DunningFlow data, response status code and response headers



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

def get_payment_dunning_flows_id_with_http_info(id, space, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DunningFlowsService.get_payment_dunning_flows_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 DunningFlowsService.get_payment_dunning_flows_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 DunningFlowsService.get_payment_dunning_flows_id"
  end
  # resource path
  local_var_path = '/payment/dunning-flows/{id}'.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] || 'DunningFlow'

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

#get_payment_dunning_flows_search(space, opts = {}) ⇒ DunningFlowSearchResponse

Search dunning flows

Parameters:

  • 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:



208
209
210
211
# File 'lib/postfinancecheckout-ruby-sdk/service/dunning_flows_service.rb', line 208

def get_payment_dunning_flows_search(space, opts = {})
  data, _status_code, _headers = get_payment_dunning_flows_search_with_http_info(space, opts)
  data
end

#get_payment_dunning_flows_search_with_http_info(space, opts = {}) ⇒ Array<(DunningFlowSearchResponse, Integer, Hash)>

Returns DunningFlowSearchResponse data, response status code and response headers.

Parameters:

  • 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:

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

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

def get_payment_dunning_flows_search_with_http_info(space, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DunningFlowsService.get_payment_dunning_flows_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 DunningFlowsService.get_payment_dunning_flows_search"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DunningFlowsService.get_payment_dunning_flows_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 DunningFlowsService.get_payment_dunning_flows_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 DunningFlowsService.get_payment_dunning_flows_search, must be smaller than or equal to 10000.'
  end

  # resource path
  local_var_path = '/payment/dunning-flows/search'

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

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

#get_payment_dunning_flows_with_http_info(space, opts = {}) ⇒ Array<(DunningFlowListResponse, Integer, Hash)>

Returns DunningFlowListResponse data, response status code and response headers.

Parameters:

  • 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<(DunningFlowListResponse, Integer, Hash)>)

    DunningFlowListResponse data, response status code and response headers



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
118
119
120
121
122
123
124
# File 'lib/postfinancecheckout-ruby-sdk/service/dunning_flows_service.rb', line 57

def get_payment_dunning_flows_with_http_info(space, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DunningFlowsService.get_payment_dunning_flows ...'
  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 DunningFlowsService.get_payment_dunning_flows"
  end
  if @api_client.config.client_side_validation && !opts[:'after'].nil? && opts[:'after'] < 1
    fail ArgumentError, 'invalid value for "opts[:"after"]" when calling DunningFlowsService.get_payment_dunning_flows, 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 DunningFlowsService.get_payment_dunning_flows, 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 DunningFlowsService.get_payment_dunning_flows, 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 DunningFlowsService.get_payment_dunning_flows, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/payment/dunning-flows'

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

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