gpd_debtposition_api 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +141 -0
  4. data/Rakefile +10 -0
  5. data/docs/AppInfo.md +22 -0
  6. data/docs/DebtPositionActionsAPIApi.md +165 -0
  7. data/docs/DebtPositionsAPIApi.md +424 -0
  8. data/docs/HomeApi.md +82 -0
  9. data/docs/MultipleIUPDModel.md +18 -0
  10. data/docs/MultiplePaymentPositionModel.md +18 -0
  11. data/docs/PageInfo.md +24 -0
  12. data/docs/PaymentOptionMetadataModel.md +20 -0
  13. data/docs/PaymentOptionMetadataModelResponse.md +20 -0
  14. data/docs/PaymentOptionModel.md +38 -0
  15. data/docs/PaymentOptionModelResponse.md +58 -0
  16. data/docs/PaymentPositionModel.md +60 -0
  17. data/docs/PaymentPositionModelBaseResponse.md +44 -0
  18. data/docs/PaymentPositionsInfo.md +20 -0
  19. data/docs/ProblemJson.md +22 -0
  20. data/docs/Stamp.md +22 -0
  21. data/docs/TransferMetadataModel.md +20 -0
  22. data/docs/TransferMetadataModelResponse.md +20 -0
  23. data/docs/TransferModel.md +34 -0
  24. data/docs/TransferModelResponse.md +40 -0
  25. data/git_push.sh +57 -0
  26. data/gpd_debtposition_api.gemspec +39 -0
  27. data/lib/gpd_debtposition_api/api/debt_position_actions_api_api.rb +162 -0
  28. data/lib/gpd_debtposition_api/api/debt_positions_api_api.rb +439 -0
  29. data/lib/gpd_debtposition_api/api/home_api.rb +80 -0
  30. data/lib/gpd_debtposition_api/api_client.rb +394 -0
  31. data/lib/gpd_debtposition_api/api_error.rb +58 -0
  32. data/lib/gpd_debtposition_api/configuration.rb +320 -0
  33. data/lib/gpd_debtposition_api/models/app_info.rb +232 -0
  34. data/lib/gpd_debtposition_api/models/multiple_iupd_model.rb +251 -0
  35. data/lib/gpd_debtposition_api/models/multiple_payment_position_model.rb +223 -0
  36. data/lib/gpd_debtposition_api/models/page_info.rb +273 -0
  37. data/lib/gpd_debtposition_api/models/payment_option_metadata_model.rb +231 -0
  38. data/lib/gpd_debtposition_api/models/payment_option_metadata_model_response.rb +223 -0
  39. data/lib/gpd_debtposition_api/models/payment_option_model.rb +396 -0
  40. data/lib/gpd_debtposition_api/models/payment_option_model_response.rb +432 -0
  41. data/lib/gpd_debtposition_api/models/payment_position_model.rb +568 -0
  42. data/lib/gpd_debtposition_api/models/payment_position_model_base_response.rb +383 -0
  43. data/lib/gpd_debtposition_api/models/payment_positions_info.rb +239 -0
  44. data/lib/gpd_debtposition_api/models/problem_json.rb +259 -0
  45. data/lib/gpd_debtposition_api/models/stamp.rb +305 -0
  46. data/lib/gpd_debtposition_api/models/transfer_metadata_model.rb +231 -0
  47. data/lib/gpd_debtposition_api/models/transfer_metadata_model_response.rb +223 -0
  48. data/lib/gpd_debtposition_api/models/transfer_model.rb +378 -0
  49. data/lib/gpd_debtposition_api/models/transfer_model_response.rb +349 -0
  50. data/lib/gpd_debtposition_api/version.rb +15 -0
  51. data/lib/gpd_debtposition_api.rb +59 -0
  52. data/spec/api/debt_position_actions_api_api_spec.rb +61 -0
  53. data/spec/api/debt_positions_api_api_spec.rb +111 -0
  54. data/spec/api/home_api_spec.rb +46 -0
  55. data/spec/models/app_info_spec.rb +48 -0
  56. data/spec/models/multiple_iupd_model_spec.rb +36 -0
  57. data/spec/models/multiple_payment_position_model_spec.rb +36 -0
  58. data/spec/models/page_info_spec.rb +54 -0
  59. data/spec/models/payment_option_metadata_model_response_spec.rb +42 -0
  60. data/spec/models/payment_option_metadata_model_spec.rb +42 -0
  61. data/spec/models/payment_option_model_response_spec.rb +160 -0
  62. data/spec/models/payment_option_model_spec.rb +96 -0
  63. data/spec/models/payment_position_model_base_response_spec.rb +122 -0
  64. data/spec/models/payment_position_model_spec.rb +170 -0
  65. data/spec/models/payment_positions_info_spec.rb +42 -0
  66. data/spec/models/problem_json_spec.rb +48 -0
  67. data/spec/models/stamp_spec.rb +48 -0
  68. data/spec/models/transfer_metadata_model_response_spec.rb +42 -0
  69. data/spec/models/transfer_metadata_model_spec.rb +42 -0
  70. data/spec/models/transfer_model_response_spec.rb +106 -0
  71. data/spec/models/transfer_model_spec.rb +88 -0
  72. data/spec/spec_helper.rb +111 -0
  73. metadata +175 -0
@@ -0,0 +1,439 @@
1
+ =begin
2
+ #PagoPA API Debt Position
3
+
4
+ #Progetto Gestione Posizioni Debitorie
5
+
6
+ The version of the OpenAPI document: 0.11.18
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module GPDDebtPositions
16
+ class DebtPositionsAPIApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # The Organization creates a debt Position.
23
+ # @param organizationfiscalcode [String] Organization fiscal code, the fiscal code of the Organization.
24
+ # @param payment_position_model [PaymentPositionModel]
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [String] :x_request_id This header identifies the call, if not passed it is self-generated. This ID is returned in the response.
27
+ # @option opts [Boolean] :to_publish (default to false)
28
+ # @return [PaymentPositionModel]
29
+ def create_position(organizationfiscalcode, payment_position_model, opts = {})
30
+ data, _status_code, _headers = create_position_with_http_info(organizationfiscalcode, payment_position_model, opts)
31
+ data
32
+ end
33
+
34
+ # The Organization creates a debt Position.
35
+ # @param organizationfiscalcode [String] Organization fiscal code, the fiscal code of the Organization.
36
+ # @param payment_position_model [PaymentPositionModel]
37
+ # @param [Hash] opts the optional parameters
38
+ # @option opts [String] :x_request_id This header identifies the call, if not passed it is self-generated. This ID is returned in the response.
39
+ # @option opts [Boolean] :to_publish (default to false)
40
+ # @return [Array<(PaymentPositionModel, Integer, Hash)>] PaymentPositionModel data, response status code and response headers
41
+ def create_position_with_http_info(organizationfiscalcode, payment_position_model, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: DebtPositionsAPIApi.create_position ...'
44
+ end
45
+ # verify the required parameter 'organizationfiscalcode' is set
46
+ if @api_client.config.client_side_validation && organizationfiscalcode.nil?
47
+ fail ArgumentError, "Missing the required parameter 'organizationfiscalcode' when calling DebtPositionsAPIApi.create_position"
48
+ end
49
+ # verify the required parameter 'payment_position_model' is set
50
+ if @api_client.config.client_side_validation && payment_position_model.nil?
51
+ fail ArgumentError, "Missing the required parameter 'payment_position_model' when calling DebtPositionsAPIApi.create_position"
52
+ end
53
+ # resource path
54
+ local_var_path = '/organizations/{organizationfiscalcode}/debtpositions'.sub('{' + 'organizationfiscalcode' + '}', CGI.escape(organizationfiscalcode.to_s))
55
+
56
+ # query parameters
57
+ query_params = opts[:query_params] || {}
58
+ query_params[:'toPublish'] = opts[:'to_publish'] if !opts[:'to_publish'].nil?
59
+
60
+ # header parameters
61
+ header_params = opts[:header_params] || {}
62
+ # HTTP header 'Accept' (if needed)
63
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
64
+ # HTTP header 'Content-Type'
65
+ content_type = @api_client.select_header_content_type(['application/json'])
66
+ if !content_type.nil?
67
+ header_params['Content-Type'] = content_type
68
+ end
69
+ header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
70
+
71
+ # form parameters
72
+ form_params = opts[:form_params] || {}
73
+
74
+ # http body (model)
75
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(payment_position_model)
76
+
77
+ # return_type
78
+ return_type = opts[:debug_return_type] || 'PaymentPositionModel'
79
+
80
+ # auth_names
81
+ auth_names = opts[:debug_auth_names] || ['Authorization', 'ApiKey']
82
+
83
+ new_options = opts.merge(
84
+ :operation => :"DebtPositionsAPIApi.create_position",
85
+ :header_params => header_params,
86
+ :query_params => query_params,
87
+ :form_params => form_params,
88
+ :body => post_body,
89
+ :auth_names => auth_names,
90
+ :return_type => return_type
91
+ )
92
+
93
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
94
+ if @api_client.config.debugging
95
+ @api_client.config.logger.debug "API called: DebtPositionsAPIApi#create_position\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
96
+ end
97
+ return data, status_code, headers
98
+ end
99
+
100
+ # The Organization deletes a debt position
101
+ # @param organizationfiscalcode [String] Organization fiscal code, the fiscal code of the Organization.
102
+ # @param iupd [String] IUPD (Unique identifier of the debt position). Format could be &#x60;&lt;Organization fiscal code + UUID&gt;&#x60; this would make it unique within the new PD management system. It&#39;s the responsibility of the EC to guarantee uniqueness. The pagoPa system shall verify that this is &#x60;true&#x60; and if not, notify the EC.
103
+ # @param [Hash] opts the optional parameters
104
+ # @option opts [String] :x_request_id This header identifies the call, if not passed it is self-generated. This ID is returned in the response.
105
+ # @return [String]
106
+ def delete_position(organizationfiscalcode, iupd, opts = {})
107
+ data, _status_code, _headers = delete_position_with_http_info(organizationfiscalcode, iupd, opts)
108
+ data
109
+ end
110
+
111
+ # The Organization deletes a debt position
112
+ # @param organizationfiscalcode [String] Organization fiscal code, the fiscal code of the Organization.
113
+ # @param iupd [String] IUPD (Unique identifier of the debt position). Format could be &#x60;&lt;Organization fiscal code + UUID&gt;&#x60; this would make it unique within the new PD management system. It&#39;s the responsibility of the EC to guarantee uniqueness. The pagoPa system shall verify that this is &#x60;true&#x60; and if not, notify the EC.
114
+ # @param [Hash] opts the optional parameters
115
+ # @option opts [String] :x_request_id This header identifies the call, if not passed it is self-generated. This ID is returned in the response.
116
+ # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
117
+ def delete_position_with_http_info(organizationfiscalcode, iupd, opts = {})
118
+ if @api_client.config.debugging
119
+ @api_client.config.logger.debug 'Calling API: DebtPositionsAPIApi.delete_position ...'
120
+ end
121
+ # verify the required parameter 'organizationfiscalcode' is set
122
+ if @api_client.config.client_side_validation && organizationfiscalcode.nil?
123
+ fail ArgumentError, "Missing the required parameter 'organizationfiscalcode' when calling DebtPositionsAPIApi.delete_position"
124
+ end
125
+ # verify the required parameter 'iupd' is set
126
+ if @api_client.config.client_side_validation && iupd.nil?
127
+ fail ArgumentError, "Missing the required parameter 'iupd' when calling DebtPositionsAPIApi.delete_position"
128
+ end
129
+ # resource path
130
+ local_var_path = '/organizations/{organizationfiscalcode}/debtpositions/{iupd}'.sub('{' + 'organizationfiscalcode' + '}', CGI.escape(organizationfiscalcode.to_s)).sub('{' + 'iupd' + '}', CGI.escape(iupd.to_s))
131
+
132
+ # query parameters
133
+ query_params = opts[:query_params] || {}
134
+
135
+ # header parameters
136
+ header_params = opts[:header_params] || {}
137
+ # HTTP header 'Accept' (if needed)
138
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
139
+ header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
140
+
141
+ # form parameters
142
+ form_params = opts[:form_params] || {}
143
+
144
+ # http body (model)
145
+ post_body = opts[:debug_body]
146
+
147
+ # return_type
148
+ return_type = opts[:debug_return_type] || 'String'
149
+
150
+ # auth_names
151
+ auth_names = opts[:debug_auth_names] || ['Authorization', 'ApiKey']
152
+
153
+ new_options = opts.merge(
154
+ :operation => :"DebtPositionsAPIApi.delete_position",
155
+ :header_params => header_params,
156
+ :query_params => query_params,
157
+ :form_params => form_params,
158
+ :body => post_body,
159
+ :auth_names => auth_names,
160
+ :return_type => return_type
161
+ )
162
+
163
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
164
+ if @api_client.config.debugging
165
+ @api_client.config.logger.debug "API called: DebtPositionsAPIApi#delete_position\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
166
+ end
167
+ return data, status_code, headers
168
+ end
169
+
170
+ # Return the details of a specific debt position.
171
+ # @param organizationfiscalcode [String] Organization fiscal code, the fiscal code of the Organization.
172
+ # @param iupd [String] IUPD (Unique identifier of the debt position). Format could be &#x60;&lt;Organization fiscal code + UUID&gt;&#x60; this would make it unique within the new PD management system. It&#39;s the responsibility of the EC to guarantee uniqueness. The pagoPa system shall verify that this is &#x60;true&#x60; and if not, notify the EC.
173
+ # @param [Hash] opts the optional parameters
174
+ # @option opts [String] :x_request_id This header identifies the call, if not passed it is self-generated. This ID is returned in the response.
175
+ # @return [PaymentPositionModelBaseResponse]
176
+ def get_organization_debt_position_by_iupd(organizationfiscalcode, iupd, opts = {})
177
+ data, _status_code, _headers = get_organization_debt_position_by_iupd_with_http_info(organizationfiscalcode, iupd, opts)
178
+ data
179
+ end
180
+
181
+ # Return the details of a specific debt position.
182
+ # @param organizationfiscalcode [String] Organization fiscal code, the fiscal code of the Organization.
183
+ # @param iupd [String] IUPD (Unique identifier of the debt position). Format could be &#x60;&lt;Organization fiscal code + UUID&gt;&#x60; this would make it unique within the new PD management system. It&#39;s the responsibility of the EC to guarantee uniqueness. The pagoPa system shall verify that this is &#x60;true&#x60; and if not, notify the EC.
184
+ # @param [Hash] opts the optional parameters
185
+ # @option opts [String] :x_request_id This header identifies the call, if not passed it is self-generated. This ID is returned in the response.
186
+ # @return [Array<(PaymentPositionModelBaseResponse, Integer, Hash)>] PaymentPositionModelBaseResponse data, response status code and response headers
187
+ def get_organization_debt_position_by_iupd_with_http_info(organizationfiscalcode, iupd, opts = {})
188
+ if @api_client.config.debugging
189
+ @api_client.config.logger.debug 'Calling API: DebtPositionsAPIApi.get_organization_debt_position_by_iupd ...'
190
+ end
191
+ # verify the required parameter 'organizationfiscalcode' is set
192
+ if @api_client.config.client_side_validation && organizationfiscalcode.nil?
193
+ fail ArgumentError, "Missing the required parameter 'organizationfiscalcode' when calling DebtPositionsAPIApi.get_organization_debt_position_by_iupd"
194
+ end
195
+ # verify the required parameter 'iupd' is set
196
+ if @api_client.config.client_side_validation && iupd.nil?
197
+ fail ArgumentError, "Missing the required parameter 'iupd' when calling DebtPositionsAPIApi.get_organization_debt_position_by_iupd"
198
+ end
199
+ # resource path
200
+ local_var_path = '/organizations/{organizationfiscalcode}/debtpositions/{iupd}'.sub('{' + 'organizationfiscalcode' + '}', CGI.escape(organizationfiscalcode.to_s)).sub('{' + 'iupd' + '}', CGI.escape(iupd.to_s))
201
+
202
+ # query parameters
203
+ query_params = opts[:query_params] || {}
204
+
205
+ # header parameters
206
+ header_params = opts[:header_params] || {}
207
+ # HTTP header 'Accept' (if needed)
208
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
209
+ header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
210
+
211
+ # form parameters
212
+ form_params = opts[:form_params] || {}
213
+
214
+ # http body (model)
215
+ post_body = opts[:debug_body]
216
+
217
+ # return_type
218
+ return_type = opts[:debug_return_type] || 'PaymentPositionModelBaseResponse'
219
+
220
+ # auth_names
221
+ auth_names = opts[:debug_auth_names] || ['Authorization', 'ApiKey']
222
+
223
+ new_options = opts.merge(
224
+ :operation => :"DebtPositionsAPIApi.get_organization_debt_position_by_iupd",
225
+ :header_params => header_params,
226
+ :query_params => query_params,
227
+ :form_params => form_params,
228
+ :body => post_body,
229
+ :auth_names => auth_names,
230
+ :return_type => return_type
231
+ )
232
+
233
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
234
+ if @api_client.config.debugging
235
+ @api_client.config.logger.debug "API called: DebtPositionsAPIApi#get_organization_debt_position_by_iupd\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
236
+ end
237
+ return data, status_code, headers
238
+ end
239
+
240
+ # Return the list of the organization debt positions. The due dates interval is mutually exclusive with the payment dates interval.
241
+ # @param organizationfiscalcode [String] Organization fiscal code, the fiscal code of the Organization.
242
+ # @param page [Integer] Page number. Page value starts from 0
243
+ # @param [Hash] opts the optional parameters
244
+ # @option opts [String] :x_request_id This header identifies the call, if not passed it is self-generated. This ID is returned in the response.
245
+ # @option opts [Integer] :limit Number of elements on one page. Default &#x3D; 50 (default to 50)
246
+ # @option opts [Date] :due_date_from Filter from due_date (if provided use the format yyyy-MM-dd). If not provided will be set to 30 days before the due_date_to.
247
+ # @option opts [Date] :due_date_to Filter to due_date (if provided use the format yyyy-MM-dd). If not provided will be set to 30 days after the due_date_from.
248
+ # @option opts [Date] :payment_date_from Filter from payment_date (if provided use the format yyyy-MM-dd). If not provided will be set to 30 days before the payment_date_to.
249
+ # @option opts [Date] :payment_date_to Filter to payment_date (if provided use the format yyyy-MM-dd). If not provided will be set to 30 days after the payment_date_from
250
+ # @option opts [String] :status Filter by debt position status
251
+ # @option opts [String] :orderby Order by INSERTED_DATE, COMPANY_NAME, IUPD or STATUS (default to 'INSERTED_DATE')
252
+ # @option opts [String] :ordering Direction of ordering (default to 'DESC')
253
+ # @return [PaymentPositionsInfo]
254
+ def get_organization_debt_positions(organizationfiscalcode, page, opts = {})
255
+ data, _status_code, _headers = get_organization_debt_positions_with_http_info(organizationfiscalcode, page, opts)
256
+ data
257
+ end
258
+
259
+ # Return the list of the organization debt positions. The due dates interval is mutually exclusive with the payment dates interval.
260
+ # @param organizationfiscalcode [String] Organization fiscal code, the fiscal code of the Organization.
261
+ # @param page [Integer] Page number. Page value starts from 0
262
+ # @param [Hash] opts the optional parameters
263
+ # @option opts [String] :x_request_id This header identifies the call, if not passed it is self-generated. This ID is returned in the response.
264
+ # @option opts [Integer] :limit Number of elements on one page. Default &#x3D; 50 (default to 50)
265
+ # @option opts [Date] :due_date_from Filter from due_date (if provided use the format yyyy-MM-dd). If not provided will be set to 30 days before the due_date_to.
266
+ # @option opts [Date] :due_date_to Filter to due_date (if provided use the format yyyy-MM-dd). If not provided will be set to 30 days after the due_date_from.
267
+ # @option opts [Date] :payment_date_from Filter from payment_date (if provided use the format yyyy-MM-dd). If not provided will be set to 30 days before the payment_date_to.
268
+ # @option opts [Date] :payment_date_to Filter to payment_date (if provided use the format yyyy-MM-dd). If not provided will be set to 30 days after the payment_date_from
269
+ # @option opts [String] :status Filter by debt position status
270
+ # @option opts [String] :orderby Order by INSERTED_DATE, COMPANY_NAME, IUPD or STATUS (default to 'INSERTED_DATE')
271
+ # @option opts [String] :ordering Direction of ordering (default to 'DESC')
272
+ # @return [Array<(PaymentPositionsInfo, Integer, Hash)>] PaymentPositionsInfo data, response status code and response headers
273
+ def get_organization_debt_positions_with_http_info(organizationfiscalcode, page, opts = {})
274
+ if @api_client.config.debugging
275
+ @api_client.config.logger.debug 'Calling API: DebtPositionsAPIApi.get_organization_debt_positions ...'
276
+ end
277
+ # verify the required parameter 'organizationfiscalcode' is set
278
+ if @api_client.config.client_side_validation && organizationfiscalcode.nil?
279
+ fail ArgumentError, "Missing the required parameter 'organizationfiscalcode' when calling DebtPositionsAPIApi.get_organization_debt_positions"
280
+ end
281
+ # verify the required parameter 'page' is set
282
+ if @api_client.config.client_side_validation && page.nil?
283
+ fail ArgumentError, "Missing the required parameter 'page' when calling DebtPositionsAPIApi.get_organization_debt_positions"
284
+ end
285
+ if @api_client.config.client_side_validation && page < 0
286
+ fail ArgumentError, 'invalid value for "page" when calling DebtPositionsAPIApi.get_organization_debt_positions, must be greater than or equal to 0.'
287
+ end
288
+
289
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
290
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DebtPositionsAPIApi.get_organization_debt_positions, must be smaller than or equal to 100.'
291
+ end
292
+
293
+ allowable_values = ["DRAFT", "PUBLISHED", "VALID", "INVALID", "EXPIRED", "PARTIALLY_PAID", "PAID", "REPORTED"]
294
+ if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
295
+ fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
296
+ end
297
+ allowable_values = ["INSERTED_DATE", "IUPD", "STATUS", "COMPANY_NAME"]
298
+ if @api_client.config.client_side_validation && opts[:'orderby'] && !allowable_values.include?(opts[:'orderby'])
299
+ fail ArgumentError, "invalid value for \"orderby\", must be one of #{allowable_values}"
300
+ end
301
+ allowable_values = ["ASC", "DESC"]
302
+ if @api_client.config.client_side_validation && opts[:'ordering'] && !allowable_values.include?(opts[:'ordering'])
303
+ fail ArgumentError, "invalid value for \"ordering\", must be one of #{allowable_values}"
304
+ end
305
+ # resource path
306
+ local_var_path = '/organizations/{organizationfiscalcode}/debtpositions'.sub('{' + 'organizationfiscalcode' + '}', CGI.escape(organizationfiscalcode.to_s))
307
+
308
+ # query parameters
309
+ query_params = opts[:query_params] || {}
310
+ query_params[:'page'] = page
311
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
312
+ query_params[:'due_date_from'] = opts[:'due_date_from'] if !opts[:'due_date_from'].nil?
313
+ query_params[:'due_date_to'] = opts[:'due_date_to'] if !opts[:'due_date_to'].nil?
314
+ query_params[:'payment_date_from'] = opts[:'payment_date_from'] if !opts[:'payment_date_from'].nil?
315
+ query_params[:'payment_date_to'] = opts[:'payment_date_to'] if !opts[:'payment_date_to'].nil?
316
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
317
+ query_params[:'orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?
318
+ query_params[:'ordering'] = opts[:'ordering'] if !opts[:'ordering'].nil?
319
+
320
+ # header parameters
321
+ header_params = opts[:header_params] || {}
322
+ # HTTP header 'Accept' (if needed)
323
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
324
+ header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
325
+
326
+ # form parameters
327
+ form_params = opts[:form_params] || {}
328
+
329
+ # http body (model)
330
+ post_body = opts[:debug_body]
331
+
332
+ # return_type
333
+ return_type = opts[:debug_return_type] || 'PaymentPositionsInfo'
334
+
335
+ # auth_names
336
+ auth_names = opts[:debug_auth_names] || ['Authorization', 'ApiKey']
337
+
338
+ new_options = opts.merge(
339
+ :operation => :"DebtPositionsAPIApi.get_organization_debt_positions",
340
+ :header_params => header_params,
341
+ :query_params => query_params,
342
+ :form_params => form_params,
343
+ :body => post_body,
344
+ :auth_names => auth_names,
345
+ :return_type => return_type
346
+ )
347
+
348
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
349
+ if @api_client.config.debugging
350
+ @api_client.config.logger.debug "API called: DebtPositionsAPIApi#get_organization_debt_positions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
351
+ end
352
+ return data, status_code, headers
353
+ end
354
+
355
+ # The Organization updates a debt position
356
+ # @param organizationfiscalcode [String] Organization fiscal code, the fiscal code of the Organization.
357
+ # @param iupd [String] IUPD (Unique identifier of the debt position). Format could be &#x60;&lt;Organization fiscal code + UUID&gt;&#x60; this would make it unique within the new PD management system. It&#39;s the responsibility of the EC to guarantee uniqueness. The pagoPa system shall verify that this is &#x60;true&#x60; and if not, notify the EC.
358
+ # @param payment_position_model [PaymentPositionModel]
359
+ # @param [Hash] opts the optional parameters
360
+ # @option opts [String] :x_request_id This header identifies the call, if not passed it is self-generated. This ID is returned in the response.
361
+ # @option opts [Boolean] :to_publish (default to false)
362
+ # @return [PaymentPositionModel]
363
+ def update_position(organizationfiscalcode, iupd, payment_position_model, opts = {})
364
+ data, _status_code, _headers = update_position_with_http_info(organizationfiscalcode, iupd, payment_position_model, opts)
365
+ data
366
+ end
367
+
368
+ # The Organization updates a debt position
369
+ # @param organizationfiscalcode [String] Organization fiscal code, the fiscal code of the Organization.
370
+ # @param iupd [String] IUPD (Unique identifier of the debt position). Format could be &#x60;&lt;Organization fiscal code + UUID&gt;&#x60; this would make it unique within the new PD management system. It&#39;s the responsibility of the EC to guarantee uniqueness. The pagoPa system shall verify that this is &#x60;true&#x60; and if not, notify the EC.
371
+ # @param payment_position_model [PaymentPositionModel]
372
+ # @param [Hash] opts the optional parameters
373
+ # @option opts [String] :x_request_id This header identifies the call, if not passed it is self-generated. This ID is returned in the response.
374
+ # @option opts [Boolean] :to_publish (default to false)
375
+ # @return [Array<(PaymentPositionModel, Integer, Hash)>] PaymentPositionModel data, response status code and response headers
376
+ def update_position_with_http_info(organizationfiscalcode, iupd, payment_position_model, opts = {})
377
+ if @api_client.config.debugging
378
+ @api_client.config.logger.debug 'Calling API: DebtPositionsAPIApi.update_position ...'
379
+ end
380
+ # verify the required parameter 'organizationfiscalcode' is set
381
+ if @api_client.config.client_side_validation && organizationfiscalcode.nil?
382
+ fail ArgumentError, "Missing the required parameter 'organizationfiscalcode' when calling DebtPositionsAPIApi.update_position"
383
+ end
384
+ # verify the required parameter 'iupd' is set
385
+ if @api_client.config.client_side_validation && iupd.nil?
386
+ fail ArgumentError, "Missing the required parameter 'iupd' when calling DebtPositionsAPIApi.update_position"
387
+ end
388
+ # verify the required parameter 'payment_position_model' is set
389
+ if @api_client.config.client_side_validation && payment_position_model.nil?
390
+ fail ArgumentError, "Missing the required parameter 'payment_position_model' when calling DebtPositionsAPIApi.update_position"
391
+ end
392
+ # resource path
393
+ local_var_path = '/organizations/{organizationfiscalcode}/debtpositions/{iupd}'.sub('{' + 'organizationfiscalcode' + '}', CGI.escape(organizationfiscalcode.to_s)).sub('{' + 'iupd' + '}', CGI.escape(iupd.to_s))
394
+
395
+ # query parameters
396
+ query_params = opts[:query_params] || {}
397
+ query_params[:'toPublish'] = opts[:'to_publish'] if !opts[:'to_publish'].nil?
398
+
399
+ # header parameters
400
+ header_params = opts[:header_params] || {}
401
+ # HTTP header 'Accept' (if needed)
402
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
403
+ # HTTP header 'Content-Type'
404
+ content_type = @api_client.select_header_content_type(['application/json'])
405
+ if !content_type.nil?
406
+ header_params['Content-Type'] = content_type
407
+ end
408
+ header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
409
+
410
+ # form parameters
411
+ form_params = opts[:form_params] || {}
412
+
413
+ # http body (model)
414
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(payment_position_model)
415
+
416
+ # return_type
417
+ return_type = opts[:debug_return_type] || 'PaymentPositionModel'
418
+
419
+ # auth_names
420
+ auth_names = opts[:debug_auth_names] || ['Authorization', 'ApiKey']
421
+
422
+ new_options = opts.merge(
423
+ :operation => :"DebtPositionsAPIApi.update_position",
424
+ :header_params => header_params,
425
+ :query_params => query_params,
426
+ :form_params => form_params,
427
+ :body => post_body,
428
+ :auth_names => auth_names,
429
+ :return_type => return_type
430
+ )
431
+
432
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
433
+ if @api_client.config.debugging
434
+ @api_client.config.logger.debug "API called: DebtPositionsAPIApi#update_position\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
435
+ end
436
+ return data, status_code, headers
437
+ end
438
+ end
439
+ end
@@ -0,0 +1,80 @@
1
+ =begin
2
+ #PagoPA API Debt Position
3
+
4
+ #Progetto Gestione Posizioni Debitorie
5
+
6
+ The version of the OpenAPI document: 0.11.18
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module GPDDebtPositions
16
+ class HomeApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Return OK if application is started
23
+ # @param [Hash] opts the optional parameters
24
+ # @option opts [String] :x_request_id This header identifies the call, if not passed it is self-generated. This ID is returned in the response.
25
+ # @return [AppInfo]
26
+ def health_check(opts = {})
27
+ data, _status_code, _headers = health_check_with_http_info(opts)
28
+ data
29
+ end
30
+
31
+ # Return OK if application is started
32
+ # @param [Hash] opts the optional parameters
33
+ # @option opts [String] :x_request_id This header identifies the call, if not passed it is self-generated. This ID is returned in the response.
34
+ # @return [Array<(AppInfo, Integer, Hash)>] AppInfo data, response status code and response headers
35
+ def health_check_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: HomeApi.health_check ...'
38
+ end
39
+ # resource path
40
+ local_var_path = '/info'
41
+
42
+ # query parameters
43
+ query_params = opts[:query_params] || {}
44
+
45
+ # header parameters
46
+ header_params = opts[:header_params] || {}
47
+ # HTTP header 'Accept' (if needed)
48
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
49
+ header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
50
+
51
+ # form parameters
52
+ form_params = opts[:form_params] || {}
53
+
54
+ # http body (model)
55
+ post_body = opts[:debug_body]
56
+
57
+ # return_type
58
+ return_type = opts[:debug_return_type] || 'AppInfo'
59
+
60
+ # auth_names
61
+ auth_names = opts[:debug_auth_names] || ['Authorization', 'ApiKey']
62
+
63
+ new_options = opts.merge(
64
+ :operation => :"HomeApi.health_check",
65
+ :header_params => header_params,
66
+ :query_params => query_params,
67
+ :form_params => form_params,
68
+ :body => post_body,
69
+ :auth_names => auth_names,
70
+ :return_type => return_type
71
+ )
72
+
73
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
74
+ if @api_client.config.debugging
75
+ @api_client.config.logger.debug "API called: HomeApi#health_check\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
76
+ end
77
+ return data, status_code, headers
78
+ end
79
+ end
80
+ end