mundi_api 0.9.1 → 0.13.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1755 -698
  3. data/lib/mundi_api.rb +75 -35
  4. data/lib/mundi_api/api_helper.rb +59 -7
  5. data/lib/mundi_api/controllers/charges_controller.rb +136 -97
  6. data/lib/mundi_api/controllers/customers_controller.rb +264 -253
  7. data/lib/mundi_api/controllers/invoices_controller.rb +97 -23
  8. data/lib/mundi_api/controllers/orders_controller.rb +247 -30
  9. data/lib/mundi_api/controllers/plans_controller.rb +108 -106
  10. data/lib/mundi_api/controllers/recipients_controller.rb +571 -0
  11. data/lib/mundi_api/controllers/sellers_controller.rb +244 -0
  12. data/lib/mundi_api/controllers/subscriptions_controller.rb +298 -108
  13. data/lib/mundi_api/models/create_access_token_request.rb +7 -9
  14. data/lib/mundi_api/models/create_address_request.rb +30 -14
  15. data/lib/mundi_api/models/create_anticipation_request.rb +53 -0
  16. data/lib/mundi_api/models/create_bank_account_request.rb +114 -0
  17. data/lib/mundi_api/models/create_bank_transfer_payment_request.rb +3 -5
  18. data/lib/mundi_api/models/create_boleto_payment_request.rb +18 -11
  19. data/lib/mundi_api/models/create_cancel_charge_request.rb +2 -4
  20. data/lib/mundi_api/models/create_cancel_subscription_request.rb +2 -4
  21. data/lib/mundi_api/models/create_capture_charge_request.rb +3 -5
  22. data/lib/mundi_api/models/create_card_options_request.rb +2 -4
  23. data/lib/mundi_api/models/create_card_request.rb +24 -17
  24. data/lib/mundi_api/models/create_card_token_request.rb +7 -9
  25. data/lib/mundi_api/models/create_charge_request.rb +8 -10
  26. data/lib/mundi_api/models/create_checkout_boleto_payment_request.rb +4 -6
  27. data/lib/mundi_api/models/create_checkout_card_installment_option_request.rb +3 -5
  28. data/lib/mundi_api/models/create_checkout_card_payment_request.rb +3 -5
  29. data/lib/mundi_api/models/create_checkout_payment_request.rb +55 -11
  30. data/lib/mundi_api/models/create_credit_card_payment_request.rb +28 -12
  31. data/lib/mundi_api/models/create_customer_request.rb +10 -12
  32. data/lib/mundi_api/models/create_device_request.rb +33 -0
  33. data/lib/mundi_api/models/create_discount_request.rb +5 -7
  34. data/lib/mundi_api/models/create_location_request.rb +42 -0
  35. data/lib/mundi_api/models/create_order_item_request.rb +15 -8
  36. data/lib/mundi_api/models/create_order_request.rb +57 -13
  37. data/lib/mundi_api/models/create_payment_request.rb +46 -13
  38. data/lib/mundi_api/models/create_phone_request.rb +4 -6
  39. data/lib/mundi_api/models/create_phones_request.rb +3 -5
  40. data/lib/mundi_api/models/create_plan_item_request.rb +7 -9
  41. data/lib/mundi_api/models/create_plan_request.rb +19 -21
  42. data/lib/mundi_api/models/create_price_bracket_request.rb +5 -7
  43. data/lib/mundi_api/models/create_pricing_scheme_request.rb +5 -7
  44. data/lib/mundi_api/models/create_recipient_request.rb +88 -0
  45. data/lib/mundi_api/models/create_seller_request.rb +21 -23
  46. data/lib/mundi_api/models/create_setup_request.rb +4 -6
  47. data/lib/mundi_api/models/create_shipping_request.rb +7 -9
  48. data/lib/mundi_api/models/create_split_request.rb +51 -0
  49. data/lib/mundi_api/models/create_subscription_item_request.rb +18 -11
  50. data/lib/mundi_api/models/create_subscription_request.rb +46 -30
  51. data/lib/mundi_api/models/create_token_request.rb +3 -5
  52. data/lib/mundi_api/models/create_transfer_request.rb +42 -0
  53. data/lib/mundi_api/models/create_usage_request.rb +4 -6
  54. data/lib/mundi_api/models/create_voucher_payment_request.rb +6 -8
  55. data/lib/mundi_api/models/get_access_token_response.rb +6 -8
  56. data/lib/mundi_api/models/get_address_response.rb +35 -19
  57. data/lib/mundi_api/models/get_anticipation_limit_response.rb +42 -0
  58. data/lib/mundi_api/models/get_anticipation_limits_response.rb +42 -0
  59. data/lib/mundi_api/models/get_anticipation_response.rb +117 -0
  60. data/lib/mundi_api/models/get_balance_response.rb +52 -0
  61. data/lib/mundi_api/models/get_bank_account_response.rb +161 -0
  62. data/lib/mundi_api/models/get_bank_transfer_transaction_response.rb +22 -9
  63. data/lib/mundi_api/models/get_billing_address_response.rb +29 -13
  64. data/lib/mundi_api/models/get_boleto_transaction_response.rb +96 -11
  65. data/lib/mundi_api/models/get_card_response.rb +16 -18
  66. data/lib/mundi_api/models/get_card_token_response.rb +8 -10
  67. data/lib/mundi_api/models/get_charge_response.rb +18 -20
  68. data/lib/mundi_api/models/get_checkout_boleto_payment_response.rb +43 -0
  69. data/lib/mundi_api/models/get_checkout_card_installment_options_response.rb +42 -0
  70. data/lib/mundi_api/models/get_checkout_card_payment_response.rb +49 -0
  71. data/lib/mundi_api/models/get_checkout_payment_response.rb +238 -0
  72. data/lib/mundi_api/models/get_checkout_payment_settings_response.rb +9 -11
  73. data/lib/mundi_api/models/get_credit_card_transaction_response.rb +36 -14
  74. data/lib/mundi_api/models/get_customer_response.rb +24 -17
  75. data/lib/mundi_api/models/get_device_response.rb +33 -0
  76. data/lib/mundi_api/models/get_discount_response.rb +9 -11
  77. data/lib/mundi_api/models/get_gateway_recipient_response.rb +69 -0
  78. data/lib/mundi_api/models/get_invoice_item_response.rb +27 -11
  79. data/lib/mundi_api/models/get_invoice_response.rb +29 -22
  80. data/lib/mundi_api/models/get_location_response.rb +42 -0
  81. data/lib/mundi_api/models/get_order_item_response.rb +28 -12
  82. data/lib/mundi_api/models/get_order_response.rb +64 -20
  83. data/lib/mundi_api/models/get_period_response.rb +6 -8
  84. data/lib/mundi_api/models/get_phone_response.rb +4 -6
  85. data/lib/mundi_api/models/get_phones_response.rb +3 -5
  86. data/lib/mundi_api/models/get_plan_item_response.rb +12 -14
  87. data/lib/mundi_api/models/get_plan_response.rb +22 -24
  88. data/lib/mundi_api/models/get_price_bracket_response.rb +5 -7
  89. data/lib/mundi_api/models/get_pricing_scheme_response.rb +5 -7
  90. data/lib/mundi_api/models/get_recipient_response.rb +150 -0
  91. data/lib/mundi_api/models/get_safety_pay_transaction_response.rb +21 -8
  92. data/lib/mundi_api/models/get_seller_response.rb +13 -15
  93. data/lib/mundi_api/models/get_sellers_request.rb +87 -0
  94. data/lib/mundi_api/models/get_setup_response.rb +5 -7
  95. data/lib/mundi_api/models/get_shipping_response.rb +6 -8
  96. data/lib/mundi_api/models/get_split_response.rb +52 -0
  97. data/lib/mundi_api/models/get_subscription_item_response.rb +24 -17
  98. data/lib/mundi_api/models/get_subscription_response.rb +44 -37
  99. data/lib/mundi_api/models/get_token_response.rb +6 -8
  100. data/lib/mundi_api/models/get_transaction_response.rb +37 -14
  101. data/lib/mundi_api/models/get_transfer_response.rb +89 -0
  102. data/lib/mundi_api/models/get_usage_response.rb +27 -11
  103. data/lib/mundi_api/models/get_voucher_transaction_response.rb +27 -14
  104. data/lib/mundi_api/models/list_access_tokens_response.rb +3 -5
  105. data/lib/mundi_api/models/list_addresses_response.rb +3 -5
  106. data/lib/mundi_api/models/list_anticipation_response.rb +49 -0
  107. data/lib/mundi_api/models/list_cards_response.rb +3 -5
  108. data/lib/mundi_api/models/list_charges_response.rb +3 -5
  109. data/lib/mundi_api/models/list_customers_response.rb +3 -5
  110. data/lib/mundi_api/models/list_invoices_response.rb +3 -5
  111. data/lib/mundi_api/models/list_order_response.rb +3 -5
  112. data/lib/mundi_api/models/list_plans_response.rb +3 -5
  113. data/lib/mundi_api/models/list_recipient_response.rb +49 -0
  114. data/lib/mundi_api/models/list_seller_response.rb +49 -0
  115. data/lib/mundi_api/models/list_subscription_items_response.rb +3 -5
  116. data/lib/mundi_api/models/list_subscriptions_response.rb +3 -5
  117. data/lib/mundi_api/models/list_transactions_response.rb +3 -5
  118. data/lib/mundi_api/models/list_transfer_response.rb +49 -0
  119. data/lib/mundi_api/models/list_usages_response.rb +3 -5
  120. data/lib/mundi_api/models/paging_response.rb +4 -6
  121. data/lib/mundi_api/models/update_address_request.rb +15 -8
  122. data/lib/mundi_api/models/update_card_request.rb +7 -9
  123. data/lib/mundi_api/models/update_charge_card_request.rb +5 -7
  124. data/lib/mundi_api/models/update_charge_due_date_request.rb +2 -4
  125. data/lib/mundi_api/models/update_charge_payment_method_request.rb +6 -8
  126. data/lib/mundi_api/models/update_customer_request.rb +23 -16
  127. data/lib/mundi_api/models/update_invoice_status_request.rb +33 -0
  128. data/lib/mundi_api/models/update_metadata_request.rb +2 -4
  129. data/lib/mundi_api/models/update_order_item_request.rb +60 -0
  130. data/lib/mundi_api/models/update_order_status_request.rb +33 -0
  131. data/lib/mundi_api/models/update_plan_item_request.rb +7 -9
  132. data/lib/mundi_api/models/update_plan_request.rb +16 -18
  133. data/lib/mundi_api/models/update_price_bracket_request.rb +5 -7
  134. data/lib/mundi_api/models/update_pricing_scheme_request.rb +5 -7
  135. data/lib/mundi_api/models/update_recipient_bank_account_request.rb +34 -0
  136. data/lib/mundi_api/models/update_recipient_request.rb +78 -0
  137. data/lib/mundi_api/models/update_seller_request.rb +97 -0
  138. data/lib/mundi_api/models/update_subscription_affiliation_id_request.rb +33 -0
  139. data/lib/mundi_api/models/update_subscription_billing_date_request.rb +2 -4
  140. data/lib/mundi_api/models/update_subscription_card_request.rb +3 -5
  141. data/lib/mundi_api/models/update_subscription_item_request.rb +16 -9
  142. data/lib/mundi_api/models/update_subscription_payment_method_request.rb +4 -6
  143. data/lib/mundi_api/mundi_api_client.rb +32 -20
  144. metadata +39 -3
@@ -14,14 +14,23 @@ module MundiApi
14
14
  self.class.instance
15
15
  end
16
16
 
17
- # Creates a new customer
18
- # @param [CreateCustomerRequest] request Required parameter: Request for
19
- # creating a customer
20
- # @return GetCustomerResponse response from the API call
21
- def create_customer(request)
17
+ # Updates a card
18
+ # @param [String] customer_id Required parameter: Customer Id
19
+ # @param [String] card_id Required parameter: Card id
20
+ # @param [UpdateCardRequest] request Required parameter: Request for
21
+ # updating a card
22
+ # @return GetCardResponse response from the API call
23
+ def update_card(customer_id,
24
+ card_id,
25
+ request)
22
26
  # Prepare query url.
23
27
  _query_builder = Configuration.base_uri.dup
24
- _query_builder << '/customers'
28
+ _query_builder << '/customers/{customer_id}/cards/{card_id}'
29
+ _query_builder = APIHelper.append_url_with_template_parameters(
30
+ _query_builder,
31
+ 'customer_id' => customer_id,
32
+ 'card_id' => card_id
33
+ )
25
34
  _query_url = APIHelper.clean_url _query_builder
26
35
 
27
36
  # Prepare headers.
@@ -31,7 +40,7 @@ module MundiApi
31
40
  }
32
41
 
33
42
  # Prepare and execute HttpRequest.
34
- _request = @http_client.post(
43
+ _request = @http_client.put(
35
44
  _query_url,
36
45
  headers: _headers,
37
46
  parameters: request.to_json
@@ -42,31 +51,39 @@ module MundiApi
42
51
 
43
52
  # Return appropriate response type.
44
53
  decoded = APIHelper.json_deserialize(_context.response.raw_body)
45
- GetCustomerResponse.from_hash(decoded)
54
+ GetCardResponse.from_hash(decoded)
46
55
  end
47
56
 
48
- # Get a customer
57
+ # Updates an address
49
58
  # @param [String] customer_id Required parameter: Customer Id
50
- # @return GetCustomerResponse response from the API call
51
- def get_customer(customer_id)
59
+ # @param [String] address_id Required parameter: Address Id
60
+ # @param [UpdateAddressRequest] request Required parameter: Request for
61
+ # updating an address
62
+ # @return GetAddressResponse response from the API call
63
+ def update_address(customer_id,
64
+ address_id,
65
+ request)
52
66
  # Prepare query url.
53
67
  _query_builder = Configuration.base_uri.dup
54
- _query_builder << '/customers/{customer_id}'
68
+ _query_builder << '/customers/{customer_id}/addresses/{address_id}'
55
69
  _query_builder = APIHelper.append_url_with_template_parameters(
56
70
  _query_builder,
57
- 'customer_id' => customer_id
71
+ 'customer_id' => customer_id,
72
+ 'address_id' => address_id
58
73
  )
59
74
  _query_url = APIHelper.clean_url _query_builder
60
75
 
61
76
  # Prepare headers.
62
77
  _headers = {
63
- 'accept' => 'application/json'
78
+ 'accept' => 'application/json',
79
+ 'content-type' => 'application/json; charset=utf-8'
64
80
  }
65
81
 
66
82
  # Prepare and execute HttpRequest.
67
- _request = @http_client.get(
83
+ _request = @http_client.put(
68
84
  _query_url,
69
- headers: _headers
85
+ headers: _headers,
86
+ parameters: request.to_json
70
87
  )
71
88
  BasicAuth.apply(_request)
72
89
  _context = execute_request(_request)
@@ -74,26 +91,17 @@ module MundiApi
74
91
 
75
92
  # Return appropriate response type.
76
93
  decoded = APIHelper.json_deserialize(_context.response.raw_body)
77
- GetCustomerResponse.from_hash(decoded)
94
+ GetAddressResponse.from_hash(decoded)
78
95
  end
79
96
 
80
- # Updates a card
81
- # @param [String] customer_id Required parameter: Customer Id
82
- # @param [String] card_id Required parameter: Card id
83
- # @param [UpdateCardRequest] request Required parameter: Request for
84
- # updating a card
85
- # @return GetCardResponse response from the API call
86
- def update_card(customer_id,
87
- card_id,
88
- request)
97
+ # Creates a new customer
98
+ # @param [CreateCustomerRequest] request Required parameter: Request for
99
+ # creating a customer
100
+ # @return GetCustomerResponse response from the API call
101
+ def create_customer(request)
89
102
  # Prepare query url.
90
103
  _query_builder = Configuration.base_uri.dup
91
- _query_builder << '/customers/{customer_id}/cards/{card_id}'
92
- _query_builder = APIHelper.append_url_with_template_parameters(
93
- _query_builder,
94
- 'customer_id' => customer_id,
95
- 'card_id' => card_id
96
- )
104
+ _query_builder << '/customers'
97
105
  _query_url = APIHelper.clean_url _query_builder
98
106
 
99
107
  # Prepare headers.
@@ -103,7 +111,7 @@ module MundiApi
103
111
  }
104
112
 
105
113
  # Prepare and execute HttpRequest.
106
- _request = @http_client.put(
114
+ _request = @http_client.post(
107
115
  _query_url,
108
116
  headers: _headers,
109
117
  parameters: request.to_json
@@ -114,39 +122,31 @@ module MundiApi
114
122
 
115
123
  # Return appropriate response type.
116
124
  decoded = APIHelper.json_deserialize(_context.response.raw_body)
117
- GetCardResponse.from_hash(decoded)
125
+ GetCustomerResponse.from_hash(decoded)
118
126
  end
119
127
 
120
- # Updates an address
128
+ # Get a customer
121
129
  # @param [String] customer_id Required parameter: Customer Id
122
- # @param [String] address_id Required parameter: Address Id
123
- # @param [UpdateAddressRequest] request Required parameter: Request for
124
- # updating an address
125
- # @return GetAddressResponse response from the API call
126
- def update_address(customer_id,
127
- address_id,
128
- request)
130
+ # @return GetCustomerResponse response from the API call
131
+ def get_customer(customer_id)
129
132
  # Prepare query url.
130
133
  _query_builder = Configuration.base_uri.dup
131
- _query_builder << '/customers/{customer_id}/addresses/{address_id}'
134
+ _query_builder << '/customers/{customer_id}'
132
135
  _query_builder = APIHelper.append_url_with_template_parameters(
133
136
  _query_builder,
134
- 'customer_id' => customer_id,
135
- 'address_id' => address_id
137
+ 'customer_id' => customer_id
136
138
  )
137
139
  _query_url = APIHelper.clean_url _query_builder
138
140
 
139
141
  # Prepare headers.
140
142
  _headers = {
141
- 'accept' => 'application/json',
142
- 'content-type' => 'application/json; charset=utf-8'
143
+ 'accept' => 'application/json'
143
144
  }
144
145
 
145
146
  # Prepare and execute HttpRequest.
146
- _request = @http_client.put(
147
+ _request = @http_client.get(
147
148
  _query_url,
148
- headers: _headers,
149
- parameters: request.to_json
149
+ headers: _headers
150
150
  )
151
151
  BasicAuth.apply(_request)
152
152
  _context = execute_request(_request)
@@ -154,22 +154,31 @@ module MundiApi
154
154
 
155
155
  # Return appropriate response type.
156
156
  decoded = APIHelper.json_deserialize(_context.response.raw_body)
157
- GetAddressResponse.from_hash(decoded)
157
+ GetCustomerResponse.from_hash(decoded)
158
158
  end
159
159
 
160
- # Get a customer's address
161
- # @param [String] customer_id Required parameter: Customer id
162
- # @param [String] address_id Required parameter: Address Id
163
- # @return GetAddressResponse response from the API call
164
- def get_address(customer_id,
165
- address_id)
160
+ # Get all access tokens from a customer
161
+ # @param [String] customer_id Required parameter: Customer Id
162
+ # @param [Integer] page Optional parameter: Page number
163
+ # @param [Integer] size Optional parameter: Page size
164
+ # @return ListAccessTokensResponse response from the API call
165
+ def get_access_tokens(customer_id,
166
+ page = nil,
167
+ size = nil)
166
168
  # Prepare query url.
167
169
  _query_builder = Configuration.base_uri.dup
168
- _query_builder << '/customers/{customer_id}/addresses/{address_id}'
170
+ _query_builder << '/customers/{customer_id}/access-tokens'
169
171
  _query_builder = APIHelper.append_url_with_template_parameters(
170
172
  _query_builder,
171
- 'customer_id' => customer_id,
172
- 'address_id' => address_id
173
+ 'customer_id' => customer_id
174
+ )
175
+ _query_builder = APIHelper.append_url_with_query_parameters(
176
+ _query_builder,
177
+ {
178
+ 'page' => page,
179
+ 'size' => size
180
+ },
181
+ array_serialization: Configuration.array_serialization
173
182
  )
174
183
  _query_url = APIHelper.clean_url _query_builder
175
184
 
@@ -189,22 +198,31 @@ module MundiApi
189
198
 
190
199
  # Return appropriate response type.
191
200
  decoded = APIHelper.json_deserialize(_context.response.raw_body)
192
- GetAddressResponse.from_hash(decoded)
201
+ ListAccessTokensResponse.from_hash(decoded)
193
202
  end
194
203
 
195
- # Delete a Customer's address
196
- # @param [String] customer_id Required parameter: Customer Id
197
- # @param [String] address_id Required parameter: Address Id
198
- # @return GetAddressResponse response from the API call
199
- def delete_address(customer_id,
200
- address_id)
204
+ # Gets all adressess from a customer
205
+ # @param [String] customer_id Required parameter: Customer id
206
+ # @param [Integer] page Optional parameter: Page number
207
+ # @param [Integer] size Optional parameter: Page size
208
+ # @return ListAddressesResponse response from the API call
209
+ def get_addresses(customer_id,
210
+ page = nil,
211
+ size = nil)
201
212
  # Prepare query url.
202
213
  _query_builder = Configuration.base_uri.dup
203
- _query_builder << '/customers/{customer_id}/addresses/{address_id}'
214
+ _query_builder << '/customers/{customer_id}/addresses'
204
215
  _query_builder = APIHelper.append_url_with_template_parameters(
205
216
  _query_builder,
206
- 'customer_id' => customer_id,
207
- 'address_id' => address_id
217
+ 'customer_id' => customer_id
218
+ )
219
+ _query_builder = APIHelper.append_url_with_query_parameters(
220
+ _query_builder,
221
+ {
222
+ 'page' => page,
223
+ 'size' => size
224
+ },
225
+ array_serialization: Configuration.array_serialization
208
226
  )
209
227
  _query_url = APIHelper.clean_url _query_builder
210
228
 
@@ -214,7 +232,7 @@ module MundiApi
214
232
  }
215
233
 
216
234
  # Prepare and execute HttpRequest.
217
- _request = @http_client.delete(
235
+ _request = @http_client.get(
218
236
  _query_url,
219
237
  headers: _headers
220
238
  )
@@ -224,22 +242,31 @@ module MundiApi
224
242
 
225
243
  # Return appropriate response type.
226
244
  decoded = APIHelper.json_deserialize(_context.response.raw_body)
227
- GetAddressResponse.from_hash(decoded)
245
+ ListAddressesResponse.from_hash(decoded)
228
246
  end
229
247
 
230
- # Delete a customer's card
248
+ # Get all cards from a customer
231
249
  # @param [String] customer_id Required parameter: Customer Id
232
- # @param [String] card_id Required parameter: Card Id
233
- # @return GetCardResponse response from the API call
234
- def delete_card(customer_id,
235
- card_id)
250
+ # @param [Integer] page Optional parameter: Page number
251
+ # @param [Integer] size Optional parameter: Page size
252
+ # @return ListCardsResponse response from the API call
253
+ def get_cards(customer_id,
254
+ page = nil,
255
+ size = nil)
236
256
  # Prepare query url.
237
257
  _query_builder = Configuration.base_uri.dup
238
- _query_builder << '/customers/{customer_id}/cards/{card_id}'
258
+ _query_builder << '/customers/{customer_id}/cards'
239
259
  _query_builder = APIHelper.append_url_with_template_parameters(
240
260
  _query_builder,
241
- 'customer_id' => customer_id,
242
- 'card_id' => card_id
261
+ 'customer_id' => customer_id
262
+ )
263
+ _query_builder = APIHelper.append_url_with_query_parameters(
264
+ _query_builder,
265
+ {
266
+ 'page' => page,
267
+ 'size' => size
268
+ },
269
+ array_serialization: Configuration.array_serialization
243
270
  )
244
271
  _query_url = APIHelper.clean_url _query_builder
245
272
 
@@ -249,7 +276,7 @@ module MundiApi
249
276
  }
250
277
 
251
278
  # Prepare and execute HttpRequest.
252
- _request = @http_client.delete(
279
+ _request = @http_client.get(
253
280
  _query_url,
254
281
  headers: _headers
255
282
  )
@@ -259,19 +286,16 @@ module MundiApi
259
286
 
260
287
  # Return appropriate response type.
261
288
  decoded = APIHelper.json_deserialize(_context.response.raw_body)
262
- GetCardResponse.from_hash(decoded)
289
+ ListCardsResponse.from_hash(decoded)
263
290
  end
264
291
 
265
- # Creates a new address for a customer
292
+ # Delete a Customer's access tokens
266
293
  # @param [String] customer_id Required parameter: Customer Id
267
- # @param [CreateAddressRequest] request Required parameter: Request for
268
- # creating an address
269
- # @return GetAddressResponse response from the API call
270
- def create_address(customer_id,
271
- request)
294
+ # @return ListAccessTokensResponse response from the API call
295
+ def delete_access_tokens(customer_id)
272
296
  # Prepare query url.
273
297
  _query_builder = Configuration.base_uri.dup
274
- _query_builder << '/customers/{customer_id}/addresses'
298
+ _query_builder << '/customers/{customer_id}/access-tokens/'
275
299
  _query_builder = APIHelper.append_url_with_template_parameters(
276
300
  _query_builder,
277
301
  'customer_id' => customer_id
@@ -280,15 +304,13 @@ module MundiApi
280
304
 
281
305
  # Prepare headers.
282
306
  _headers = {
283
- 'accept' => 'application/json',
284
- 'content-type' => 'application/json; charset=utf-8'
307
+ 'accept' => 'application/json'
285
308
  }
286
309
 
287
310
  # Prepare and execute HttpRequest.
288
- _request = @http_client.post(
311
+ _request = @http_client.get(
289
312
  _query_url,
290
- headers: _headers,
291
- parameters: request.to_json
313
+ headers: _headers
292
314
  )
293
315
  BasicAuth.apply(_request)
294
316
  _context = execute_request(_request)
@@ -296,22 +318,22 @@ module MundiApi
296
318
 
297
319
  # Return appropriate response type.
298
320
  decoded = APIHelper.json_deserialize(_context.response.raw_body)
299
- GetAddressResponse.from_hash(decoded)
321
+ ListAccessTokensResponse.from_hash(decoded)
300
322
  end
301
323
 
302
- # Get a customer's card
303
- # @param [String] customer_id Required parameter: Customer id
304
- # @param [String] card_id Required parameter: Card id
305
- # @return GetCardResponse response from the API call
306
- def get_card(customer_id,
307
- card_id)
324
+ # Get a Customer's access token
325
+ # @param [String] customer_id Required parameter: Customer Id
326
+ # @param [String] token_id Required parameter: Token Id
327
+ # @return GetAccessTokenResponse response from the API call
328
+ def get_access_token(customer_id,
329
+ token_id)
308
330
  # Prepare query url.
309
331
  _query_builder = Configuration.base_uri.dup
310
- _query_builder << '/customers/{customer_id}/cards/{card_id}'
332
+ _query_builder << '/customers/{customer_id}/access-tokens/{token_id}'
311
333
  _query_builder = APIHelper.append_url_with_template_parameters(
312
334
  _query_builder,
313
335
  'customer_id' => customer_id,
314
- 'card_id' => card_id
336
+ 'token_id' => token_id
315
337
  )
316
338
  _query_url = APIHelper.clean_url _query_builder
317
339
 
@@ -331,19 +353,19 @@ module MundiApi
331
353
 
332
354
  # Return appropriate response type.
333
355
  decoded = APIHelper.json_deserialize(_context.response.raw_body)
334
- GetCardResponse.from_hash(decoded)
356
+ GetAccessTokenResponse.from_hash(decoded)
335
357
  end
336
358
 
337
- # Creates a new card for a customer
338
- # @param [String] customer_id Required parameter: Customer id
339
- # @param [CreateCardRequest] request Required parameter: Request for
340
- # creating a card
341
- # @return GetCardResponse response from the API call
342
- def create_card(customer_id,
343
- request)
359
+ # Creates a access token for a customer
360
+ # @param [String] customer_id Required parameter: Customer Id
361
+ # @param [CreateAccessTokenRequest] request Required parameter: Request for
362
+ # creating a access token
363
+ # @return GetAccessTokenResponse response from the API call
364
+ def create_access_token(customer_id,
365
+ request)
344
366
  # Prepare query url.
345
367
  _query_builder = Configuration.base_uri.dup
346
- _query_builder << '/customers/{customer_id}/cards'
368
+ _query_builder << '/customers/{customer_id}/access-tokens'
347
369
  _query_builder = APIHelper.append_url_with_template_parameters(
348
370
  _query_builder,
349
371
  'customer_id' => customer_id
@@ -368,36 +390,34 @@ module MundiApi
368
390
 
369
391
  # Return appropriate response type.
370
392
  decoded = APIHelper.json_deserialize(_context.response.raw_body)
371
- GetCardResponse.from_hash(decoded)
393
+ GetAccessTokenResponse.from_hash(decoded)
372
394
  end
373
395
 
374
- # Updates a customer
375
- # @param [String] customer_id Required parameter: Customer id
376
- # @param [UpdateCustomerRequest] request Required parameter: Request for
377
- # updating a customer
378
- # @return GetCustomerResponse response from the API call
379
- def update_customer(customer_id,
380
- request)
396
+ # Delete a customer's access token
397
+ # @param [String] customer_id Required parameter: Customer Id
398
+ # @param [String] token_id Required parameter: Token Id
399
+ # @return GetAccessTokenResponse response from the API call
400
+ def delete_access_token(customer_id,
401
+ token_id)
381
402
  # Prepare query url.
382
403
  _query_builder = Configuration.base_uri.dup
383
- _query_builder << '/customers/{customer_id}'
404
+ _query_builder << '/customers/{customer_id}/access-tokens/{token_id}'
384
405
  _query_builder = APIHelper.append_url_with_template_parameters(
385
406
  _query_builder,
386
- 'customer_id' => customer_id
407
+ 'customer_id' => customer_id,
408
+ 'token_id' => token_id
387
409
  )
388
410
  _query_url = APIHelper.clean_url _query_builder
389
411
 
390
412
  # Prepare headers.
391
413
  _headers = {
392
- 'accept' => 'application/json',
393
- 'content-type' => 'application/json; charset=utf-8'
414
+ 'accept' => 'application/json'
394
415
  }
395
416
 
396
417
  # Prepare and execute HttpRequest.
397
- _request = @http_client.put(
418
+ _request = @http_client.delete(
398
419
  _query_url,
399
- headers: _headers,
400
- parameters: request.to_json
420
+ headers: _headers
401
421
  )
402
422
  BasicAuth.apply(_request)
403
423
  _context = execute_request(_request)
@@ -405,16 +425,19 @@ module MundiApi
405
425
 
406
426
  # Return appropriate response type.
407
427
  decoded = APIHelper.json_deserialize(_context.response.raw_body)
408
- GetCustomerResponse.from_hash(decoded)
428
+ GetAccessTokenResponse.from_hash(decoded)
409
429
  end
410
430
 
411
- # Delete a Customer's access tokens
412
- # @param [String] customer_id Required parameter: Customer Id
413
- # @return ListAccessTokensResponse response from the API call
414
- def delete_access_tokens(customer_id)
431
+ # Updates the metadata a customer
432
+ # @param [String] customer_id Required parameter: The customer id
433
+ # @param [UpdateMetadataRequest] request Required parameter: Request for
434
+ # updating the customer metadata
435
+ # @return GetCustomerResponse response from the API call
436
+ def update_customer_metadata(customer_id,
437
+ request)
415
438
  # Prepare query url.
416
439
  _query_builder = Configuration.base_uri.dup
417
- _query_builder << '/customers/{customer_id}/access-tokens/'
440
+ _query_builder << '/Customers/{customer_id}/metadata'
418
441
  _query_builder = APIHelper.append_url_with_template_parameters(
419
442
  _query_builder,
420
443
  'customer_id' => customer_id
@@ -423,13 +446,15 @@ module MundiApi
423
446
 
424
447
  # Prepare headers.
425
448
  _headers = {
426
- 'accept' => 'application/json'
449
+ 'accept' => 'application/json',
450
+ 'content-type' => 'application/json; charset=utf-8'
427
451
  }
428
452
 
429
453
  # Prepare and execute HttpRequest.
430
- _request = @http_client.get(
454
+ _request = @http_client.patch(
431
455
  _query_url,
432
- headers: _headers
456
+ headers: _headers,
457
+ parameters: request.to_json
433
458
  )
434
459
  BasicAuth.apply(_request)
435
460
  _context = execute_request(_request)
@@ -437,44 +462,36 @@ module MundiApi
437
462
 
438
463
  # Return appropriate response type.
439
464
  decoded = APIHelper.json_deserialize(_context.response.raw_body)
440
- ListAccessTokensResponse.from_hash(decoded)
465
+ GetCustomerResponse.from_hash(decoded)
441
466
  end
442
467
 
443
- # Get all Customers
444
- # @param [String] name Optional parameter: Name of the Customer
445
- # @param [String] document Optional parameter: Document of the Customer
446
- # @param [Integer] page Optional parameter: Current page the the search
447
- # @param [Integer] size Optional parameter: Quantity pages of the search
448
- # @param [String] email Optional parameter: Customer's email
449
- # @return ListCustomersResponse response from the API call
450
- def get_customers(name = nil,
451
- document = nil,
452
- page = 1,
453
- size = 10,
454
- email = nil)
468
+ # Updates a customer
469
+ # @param [String] customer_id Required parameter: Customer id
470
+ # @param [UpdateCustomerRequest] request Required parameter: Request for
471
+ # updating a customer
472
+ # @return GetCustomerResponse response from the API call
473
+ def update_customer(customer_id,
474
+ request)
455
475
  # Prepare query url.
456
476
  _query_builder = Configuration.base_uri.dup
457
- _query_builder << '/customers'
458
- _query_builder = APIHelper.append_url_with_query_parameters(
477
+ _query_builder << '/customers/{customer_id}'
478
+ _query_builder = APIHelper.append_url_with_template_parameters(
459
479
  _query_builder,
460
- 'name' => name,
461
- 'document' => document,
462
- 'page' => page,
463
- 'size' => size,
464
- 'email' => email,
465
- array_serialization: Configuration.array_serialization
480
+ 'customer_id' => customer_id
466
481
  )
467
482
  _query_url = APIHelper.clean_url _query_builder
468
483
 
469
484
  # Prepare headers.
470
485
  _headers = {
471
- 'accept' => 'application/json'
486
+ 'accept' => 'application/json',
487
+ 'content-type' => 'application/json; charset=utf-8'
472
488
  }
473
489
 
474
490
  # Prepare and execute HttpRequest.
475
- _request = @http_client.get(
491
+ _request = @http_client.put(
476
492
  _query_url,
477
- headers: _headers
493
+ headers: _headers,
494
+ parameters: request.to_json
478
495
  )
479
496
  BasicAuth.apply(_request)
480
497
  _context = execute_request(_request)
@@ -482,22 +499,22 @@ module MundiApi
482
499
 
483
500
  # Return appropriate response type.
484
501
  decoded = APIHelper.json_deserialize(_context.response.raw_body)
485
- ListCustomersResponse.from_hash(decoded)
502
+ GetCustomerResponse.from_hash(decoded)
486
503
  end
487
504
 
488
- # Get a Customer's access token
489
- # @param [String] customer_id Required parameter: Customer Id
490
- # @param [String] token_id Required parameter: Token Id
491
- # @return GetAccessTokenResponse response from the API call
492
- def get_access_token(customer_id,
493
- token_id)
505
+ # Get a customer's address
506
+ # @param [String] customer_id Required parameter: Customer id
507
+ # @param [String] address_id Required parameter: Address Id
508
+ # @return GetAddressResponse response from the API call
509
+ def get_address(customer_id,
510
+ address_id)
494
511
  # Prepare query url.
495
512
  _query_builder = Configuration.base_uri.dup
496
- _query_builder << '/customers/{customer_id}/access-tokens/{token_id}'
513
+ _query_builder << '/customers/{customer_id}/addresses/{address_id}'
497
514
  _query_builder = APIHelper.append_url_with_template_parameters(
498
515
  _query_builder,
499
516
  'customer_id' => customer_id,
500
- 'token_id' => token_id
517
+ 'address_id' => address_id
501
518
  )
502
519
  _query_url = APIHelper.clean_url _query_builder
503
520
 
@@ -517,36 +534,34 @@ module MundiApi
517
534
 
518
535
  # Return appropriate response type.
519
536
  decoded = APIHelper.json_deserialize(_context.response.raw_body)
520
- GetAccessTokenResponse.from_hash(decoded)
537
+ GetAddressResponse.from_hash(decoded)
521
538
  end
522
539
 
523
- # Creates a access token for a customer
540
+ # Delete a Customer's address
524
541
  # @param [String] customer_id Required parameter: Customer Id
525
- # @param [CreateAccessTokenRequest] request Required parameter: Request for
526
- # creating a access token
527
- # @return GetAccessTokenResponse response from the API call
528
- def create_access_token(customer_id,
529
- request)
542
+ # @param [String] address_id Required parameter: Address Id
543
+ # @return GetAddressResponse response from the API call
544
+ def delete_address(customer_id,
545
+ address_id)
530
546
  # Prepare query url.
531
547
  _query_builder = Configuration.base_uri.dup
532
- _query_builder << '/customers/{customer_id}/access-tokens'
548
+ _query_builder << '/customers/{customer_id}/addresses/{address_id}'
533
549
  _query_builder = APIHelper.append_url_with_template_parameters(
534
550
  _query_builder,
535
- 'customer_id' => customer_id
551
+ 'customer_id' => customer_id,
552
+ 'address_id' => address_id
536
553
  )
537
554
  _query_url = APIHelper.clean_url _query_builder
538
555
 
539
556
  # Prepare headers.
540
557
  _headers = {
541
- 'accept' => 'application/json',
542
- 'content-type' => 'application/json; charset=utf-8'
558
+ 'accept' => 'application/json'
543
559
  }
544
560
 
545
561
  # Prepare and execute HttpRequest.
546
- _request = @http_client.post(
562
+ _request = @http_client.delete(
547
563
  _query_url,
548
- headers: _headers,
549
- parameters: request.to_json
564
+ headers: _headers
550
565
  )
551
566
  BasicAuth.apply(_request)
552
567
  _context = execute_request(_request)
@@ -554,22 +569,22 @@ module MundiApi
554
569
 
555
570
  # Return appropriate response type.
556
571
  decoded = APIHelper.json_deserialize(_context.response.raw_body)
557
- GetAccessTokenResponse.from_hash(decoded)
572
+ GetAddressResponse.from_hash(decoded)
558
573
  end
559
574
 
560
- # Delete a customer's access token
575
+ # Delete a customer's card
561
576
  # @param [String] customer_id Required parameter: Customer Id
562
- # @param [String] token_id Required parameter: Token Id
563
- # @return GetAccessTokenResponse response from the API call
564
- def delete_access_token(customer_id,
565
- token_id)
577
+ # @param [String] card_id Required parameter: Card Id
578
+ # @return GetCardResponse response from the API call
579
+ def delete_card(customer_id,
580
+ card_id)
566
581
  # Prepare query url.
567
582
  _query_builder = Configuration.base_uri.dup
568
- _query_builder << '/customers/{customer_id}/access-tokens/{token_id}'
583
+ _query_builder << '/customers/{customer_id}/cards/{card_id}'
569
584
  _query_builder = APIHelper.append_url_with_template_parameters(
570
585
  _query_builder,
571
586
  'customer_id' => customer_id,
572
- 'token_id' => token_id
587
+ 'card_id' => card_id
573
588
  )
574
589
  _query_url = APIHelper.clean_url _query_builder
575
590
 
@@ -589,19 +604,19 @@ module MundiApi
589
604
 
590
605
  # Return appropriate response type.
591
606
  decoded = APIHelper.json_deserialize(_context.response.raw_body)
592
- GetAccessTokenResponse.from_hash(decoded)
607
+ GetCardResponse.from_hash(decoded)
593
608
  end
594
609
 
595
- # Updates the metadata a customer
596
- # @param [String] customer_id Required parameter: The customer id
597
- # @param [UpdateMetadataRequest] request Required parameter: Request for
598
- # updating the customer metadata
599
- # @return GetCustomerResponse response from the API call
600
- def update_customer_metadata(customer_id,
601
- request)
610
+ # Creates a new address for a customer
611
+ # @param [String] customer_id Required parameter: Customer Id
612
+ # @param [CreateAddressRequest] request Required parameter: Request for
613
+ # creating an address
614
+ # @return GetAddressResponse response from the API call
615
+ def create_address(customer_id,
616
+ request)
602
617
  # Prepare query url.
603
618
  _query_builder = Configuration.base_uri.dup
604
- _query_builder << '/Customers/{customer_id}/metadata'
619
+ _query_builder << '/customers/{customer_id}/addresses'
605
620
  _query_builder = APIHelper.append_url_with_template_parameters(
606
621
  _query_builder,
607
622
  'customer_id' => customer_id
@@ -615,7 +630,7 @@ module MundiApi
615
630
  }
616
631
 
617
632
  # Prepare and execute HttpRequest.
618
- _request = @http_client.patch(
633
+ _request = @http_client.post(
619
634
  _query_url,
620
635
  headers: _headers,
621
636
  parameters: request.to_json
@@ -626,29 +641,22 @@ module MundiApi
626
641
 
627
642
  # Return appropriate response type.
628
643
  decoded = APIHelper.json_deserialize(_context.response.raw_body)
629
- GetCustomerResponse.from_hash(decoded)
644
+ GetAddressResponse.from_hash(decoded)
630
645
  end
631
646
 
632
- # Get all access tokens from a customer
633
- # @param [String] customer_id Required parameter: Customer Id
634
- # @param [Integer] page Optional parameter: Page number
635
- # @param [Integer] size Optional parameter: Page size
636
- # @return ListAccessTokensResponse response from the API call
637
- def get_access_tokens(customer_id,
638
- page = nil,
639
- size = nil)
647
+ # Get a customer's card
648
+ # @param [String] customer_id Required parameter: Customer id
649
+ # @param [String] card_id Required parameter: Card id
650
+ # @return GetCardResponse response from the API call
651
+ def get_card(customer_id,
652
+ card_id)
640
653
  # Prepare query url.
641
654
  _query_builder = Configuration.base_uri.dup
642
- _query_builder << '/customers/{customer_id}/access-tokens'
655
+ _query_builder << '/customers/{customer_id}/cards/{card_id}'
643
656
  _query_builder = APIHelper.append_url_with_template_parameters(
644
657
  _query_builder,
645
- 'customer_id' => customer_id
646
- )
647
- _query_builder = APIHelper.append_url_with_query_parameters(
648
- _query_builder,
649
- 'page' => page,
650
- 'size' => size,
651
- array_serialization: Configuration.array_serialization
658
+ 'customer_id' => customer_id,
659
+ 'card_id' => card_id
652
660
  )
653
661
  _query_url = APIHelper.clean_url _query_builder
654
662
 
@@ -668,41 +676,36 @@ module MundiApi
668
676
 
669
677
  # Return appropriate response type.
670
678
  decoded = APIHelper.json_deserialize(_context.response.raw_body)
671
- ListAccessTokensResponse.from_hash(decoded)
679
+ GetCardResponse.from_hash(decoded)
672
680
  end
673
681
 
674
- # Gets all adressess from a customer
682
+ # Creates a new card for a customer
675
683
  # @param [String] customer_id Required parameter: Customer id
676
- # @param [Integer] page Optional parameter: Page number
677
- # @param [Integer] size Optional parameter: Page size
678
- # @return ListAddressesResponse response from the API call
679
- def get_addresses(customer_id,
680
- page = nil,
681
- size = nil)
684
+ # @param [CreateCardRequest] request Required parameter: Request for
685
+ # creating a card
686
+ # @return GetCardResponse response from the API call
687
+ def create_card(customer_id,
688
+ request)
682
689
  # Prepare query url.
683
690
  _query_builder = Configuration.base_uri.dup
684
- _query_builder << '/customers/{customer_id}/addresses'
691
+ _query_builder << '/customers/{customer_id}/cards'
685
692
  _query_builder = APIHelper.append_url_with_template_parameters(
686
693
  _query_builder,
687
694
  'customer_id' => customer_id
688
695
  )
689
- _query_builder = APIHelper.append_url_with_query_parameters(
690
- _query_builder,
691
- 'page' => page,
692
- 'size' => size,
693
- array_serialization: Configuration.array_serialization
694
- )
695
696
  _query_url = APIHelper.clean_url _query_builder
696
697
 
697
698
  # Prepare headers.
698
699
  _headers = {
699
- 'accept' => 'application/json'
700
+ 'accept' => 'application/json',
701
+ 'content-type' => 'application/json; charset=utf-8'
700
702
  }
701
703
 
702
704
  # Prepare and execute HttpRequest.
703
- _request = @http_client.get(
705
+ _request = @http_client.post(
704
706
  _query_url,
705
- headers: _headers
707
+ headers: _headers,
708
+ parameters: request.to_json
706
709
  )
707
710
  BasicAuth.apply(_request)
708
711
  _context = execute_request(_request)
@@ -710,28 +713,36 @@ module MundiApi
710
713
 
711
714
  # Return appropriate response type.
712
715
  decoded = APIHelper.json_deserialize(_context.response.raw_body)
713
- ListAddressesResponse.from_hash(decoded)
716
+ GetCardResponse.from_hash(decoded)
714
717
  end
715
718
 
716
- # Get all cards from a customer
717
- # @param [String] customer_id Required parameter: Customer Id
718
- # @param [Integer] page Optional parameter: Page number
719
- # @param [Integer] size Optional parameter: Page size
720
- # @return ListCardsResponse response from the API call
721
- def get_cards(customer_id,
722
- page = nil,
723
- size = nil)
719
+ # Get all Customers
720
+ # @param [String] code Required parameter: Customer's code
721
+ # @param [String] name Optional parameter: Name of the Customer
722
+ # @param [String] document Optional parameter: Document of the Customer
723
+ # @param [Integer] page Optional parameter: Current page the the search
724
+ # @param [Integer] size Optional parameter: Quantity pages of the search
725
+ # @param [String] email Optional parameter: Customer's email
726
+ # @return ListCustomersResponse response from the API call
727
+ def get_customers(code,
728
+ name = nil,
729
+ document = nil,
730
+ page = 1,
731
+ size = 10,
732
+ email = nil)
724
733
  # Prepare query url.
725
734
  _query_builder = Configuration.base_uri.dup
726
- _query_builder << '/customers/{customer_id}/cards'
727
- _query_builder = APIHelper.append_url_with_template_parameters(
728
- _query_builder,
729
- 'customer_id' => customer_id
730
- )
735
+ _query_builder << '/customers'
731
736
  _query_builder = APIHelper.append_url_with_query_parameters(
732
737
  _query_builder,
733
- 'page' => page,
734
- 'size' => size,
738
+ {
739
+ 'Code' => code,
740
+ 'name' => name,
741
+ 'document' => document,
742
+ 'page' => page,
743
+ 'size' => size,
744
+ 'email' => email
745
+ },
735
746
  array_serialization: Configuration.array_serialization
736
747
  )
737
748
  _query_url = APIHelper.clean_url _query_builder
@@ -752,7 +763,7 @@ module MundiApi
752
763
 
753
764
  # Return appropriate response type.
754
765
  decoded = APIHelper.json_deserialize(_context.response.raw_body)
755
- ListCardsResponse.from_hash(decoded)
766
+ ListCustomersResponse.from_hash(decoded)
756
767
  end
757
768
  end
758
769
  end