diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 1c0cee2..5c46af3 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -11,7 +11,7 @@ jobs: test: strategy: matrix: - sdk: [2.18.0, 2.19.6, 3.0.7, 3.1.5, 3.2.6] + sdk: [2.18.0, 2.19.6, 3.0.7, 3.1.5, 3.2.6, 3.3.4] os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 4fe265e..6df14a1 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -140,6 +140,14 @@ doc/PaymentMethodResponse.md doc/PaymentMethodSpeiRecurrent.md doc/PaymentMethodSpeiRequest.md doc/PaymentMethodsApi.md +doc/Payout.md +doc/PayoutMethod.md +doc/PayoutOrder.md +doc/PayoutOrderPayoutsItem.md +doc/PayoutOrderResponse.md +doc/PayoutOrderResponseCustomerInfo.md +doc/PayoutOrdersApi.md +doc/PayoutOrdersResponse.md doc/PlanRequest.md doc/PlanResponse.md doc/PlanUpdateRequest.md @@ -209,6 +217,7 @@ lib/src/api/logs_api.dart lib/src/api/orders_api.dart lib/src/api/payment_link_api.dart lib/src/api/payment_methods_api.dart +lib/src/api/payout_orders_api.dart lib/src/api/plans_api.dart lib/src/api/products_api.dart lib/src/api/shipping_contacts_api.dart @@ -350,6 +359,13 @@ lib/src/model/payment_method_cash_response.dart lib/src/model/payment_method_response.dart lib/src/model/payment_method_spei_recurrent.dart lib/src/model/payment_method_spei_request.dart +lib/src/model/payout.dart +lib/src/model/payout_method.dart +lib/src/model/payout_order.dart +lib/src/model/payout_order_payouts_item.dart +lib/src/model/payout_order_response.dart +lib/src/model/payout_order_response_customer_info.dart +lib/src/model/payout_orders_response.dart lib/src/model/plan_request.dart lib/src/model/plan_response.dart lib/src/model/plan_update_request.dart diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 8b23b8d..18bb418 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -7.3.0 \ No newline at end of file +7.5.0 diff --git a/Makefile b/Makefile index c627906..bb16c68 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ dart: rm -rf ../conekta-dart/doc && \ rm -rf ../conekta-dart/lib/src/model && \ docker run --rm \ - -v ${PWD}:/local openapitools/openapi-generator-cli:v7.3.0 generate \ + -v ${PWD}:/local openapitools/openapi-generator-cli:v7.5.0 generate \ -i https://raw.githubusercontent.com/conekta/openapi/main/_build/api.yaml \ -g dart-dio \ -o /local \ diff --git a/README.md b/README.md index 2703bd9..e2dcec1 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ For more information, please visit [https://github.com/conekta/openapi/issues](h To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml ```yaml dependencies: - conekta: 6.0.4 + conekta: 6.0.5 ``` ### Github @@ -120,6 +120,9 @@ Class | Method | HTTP request | Description [*PaymentMethodsApi*](doc/PaymentMethodsApi.md) | [**deleteCustomerPaymentMethods**](doc/PaymentMethodsApi.md#deletecustomerpaymentmethods) | **DELETE** /customers/{id}/payment_sources/{payment_method_id} | Delete Payment Method [*PaymentMethodsApi*](doc/PaymentMethodsApi.md) | [**getCustomerPaymentMethods**](doc/PaymentMethodsApi.md#getcustomerpaymentmethods) | **GET** /customers/{id}/payment_sources | Get Payment Methods [*PaymentMethodsApi*](doc/PaymentMethodsApi.md) | [**updateCustomerPaymentMethods**](doc/PaymentMethodsApi.md#updatecustomerpaymentmethods) | **PUT** /customers/{id}/payment_sources/{payment_method_id} | Update Payment Method +[*PayoutOrdersApi*](doc/PayoutOrdersApi.md) | [**createPayoutOrder**](doc/PayoutOrdersApi.md#createpayoutorder) | **POST** /payout_orders | Create payout order +[*PayoutOrdersApi*](doc/PayoutOrdersApi.md) | [**getPayoutOrderById**](doc/PayoutOrdersApi.md#getpayoutorderbyid) | **GET** /payout_orders/{id} | Get Payout Order +[*PayoutOrdersApi*](doc/PayoutOrdersApi.md) | [**getPayoutOrders**](doc/PayoutOrdersApi.md#getpayoutorders) | **GET** /payout_orders | Get a list of Payout Orders [*PlansApi*](doc/PlansApi.md) | [**createPlan**](doc/PlansApi.md#createplan) | **POST** /plans | Create Plan [*PlansApi*](doc/PlansApi.md) | [**deletePlan**](doc/PlansApi.md#deleteplan) | **DELETE** /plans/{id} | Delete Plan [*PlansApi*](doc/PlansApi.md) | [**getPlan**](doc/PlansApi.md#getplan) | **GET** /plans/{id} | Get Plan @@ -286,6 +289,13 @@ Class | Method | HTTP request | Description - [PaymentMethodResponse](doc/PaymentMethodResponse.md) - [PaymentMethodSpeiRecurrent](doc/PaymentMethodSpeiRecurrent.md) - [PaymentMethodSpeiRequest](doc/PaymentMethodSpeiRequest.md) + - [Payout](doc/Payout.md) + - [PayoutMethod](doc/PayoutMethod.md) + - [PayoutOrder](doc/PayoutOrder.md) + - [PayoutOrderPayoutsItem](doc/PayoutOrderPayoutsItem.md) + - [PayoutOrderResponse](doc/PayoutOrderResponse.md) + - [PayoutOrderResponseCustomerInfo](doc/PayoutOrderResponseCustomerInfo.md) + - [PayoutOrdersResponse](doc/PayoutOrdersResponse.md) - [PlanRequest](doc/PlanRequest.md) - [PlanResponse](doc/PlanResponse.md) - [PlanUpdateRequest](doc/PlanUpdateRequest.md) diff --git a/VERSION b/VERSION index 1aa5e41..288b2cd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.0.4 +6.0.5 diff --git a/config-dart.json b/config-dart.json index 685ea55..cbb1c2b 100644 --- a/config-dart.json +++ b/config-dart.json @@ -2,7 +2,7 @@ "useEnumExtension": true, "pubAuthor": "conekta", "pubLibrary": "conekta", - "pubVersion": "6.0.4", + "pubVersion": "6.0.5", "pubName": "conekta", "pubRepository": "https://www.github.com/conekta/conekta-dart", "pubHomepage" : "https://www.github.com/conekta/conekta-dart", diff --git a/doc/OrderResponseCheckout.md b/doc/OrderResponseCheckout.md index 7b4cfc4..9850d47 100644 --- a/doc/OrderResponseCheckout.md +++ b/doc/OrderResponseCheckout.md @@ -27,6 +27,7 @@ Name | Type | Description | Notes **onDemandEnabled** | **bool** | | [optional] **paidPaymentsCount** | **int** | | [optional] **recurrent** | **bool** | | [optional] +**redirectionTime** | **int** | number of seconds to wait before redirecting to the success_url | [optional] **slug** | **String** | | [optional] **smsSent** | **int** | | [optional] **successUrl** | **String** | | [optional] diff --git a/doc/OrdersApi.md b/doc/OrdersApi.md index b237c53..357691c 100644 --- a/doc/OrdersApi.md +++ b/doc/OrdersApi.md @@ -161,7 +161,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **getOrders** -> GetOrdersResponse getOrders(acceptLanguage, xChildCompanyId, limit, search, next, previous) +> GetOrdersResponse getOrders(acceptLanguage, xChildCompanyId, limit, search, next, previous, paymentStatus, lastPaymentInfoPeriodStatus, createdAt, createdAtPeriodGte, createdAtPeriodLte, updatedAtPeriodGte, updatedAtPeriodLte) Get a list of Orders @@ -178,9 +178,16 @@ final int limit = 56; // int | The numbers of items to return, the maximum value final String search = search_example; // String | General order search, e.g. by mail, reference etc. final String next = next_example; // String | next page final String previous = previous_example; // String | previous page +final String paymentStatus = paid; // String | Filters by order status +final String lastPaymentInfoPeriodStatus = pending_payment; // String | Filters by last payment info status +final int createdAt = 1612137600; // int | created equal to +final int createdAtPeriodGte = 1612137600; // int | created at greater than or equal to +final int createdAtPeriodLte = 1612137600; // int | created at less than or equal to +final int updatedAtPeriodGte = 1612137600; // int | updated at greater than or equal to +final int updatedAtPeriodLte = 1612137600; // int | updated at less than or equal to try { - final response = api.getOrders(acceptLanguage, xChildCompanyId, limit, search, next, previous); + final response = api.getOrders(acceptLanguage, xChildCompanyId, limit, search, next, previous, paymentStatus, lastPaymentInfoPeriodStatus, createdAt, createdAtPeriodGte, createdAtPeriodLte, updatedAtPeriodGte, updatedAtPeriodLte); print(response); } catch on DioException (e) { print('Exception when calling OrdersApi->getOrders: $e\n'); @@ -197,6 +204,13 @@ Name | Type | Description | Notes **search** | **String**| General order search, e.g. by mail, reference etc. | [optional] **next** | **String**| next page | [optional] **previous** | **String**| previous page | [optional] + **paymentStatus** | **String**| Filters by order status | [optional] + **lastPaymentInfoPeriodStatus** | **String**| Filters by last payment info status | [optional] + **createdAt** | **int**| created equal to | [optional] + **createdAtPeriodGte** | **int**| created at greater than or equal to | [optional] + **createdAtPeriodLte** | **int**| created at less than or equal to | [optional] + **updatedAtPeriodGte** | **int**| updated at greater than or equal to | [optional] + **updatedAtPeriodLte** | **int**| updated at less than or equal to | [optional] ### Return type diff --git a/doc/Payout.md b/doc/Payout.md new file mode 100644 index 0000000..33cb0ec --- /dev/null +++ b/doc/Payout.md @@ -0,0 +1,15 @@ +# conekta.model.Payout + +## Load the model package +```dart +import 'package:conekta/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payoutMethod** | [**PayoutMethod**](PayoutMethod.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/doc/PayoutMethod.md b/doc/PayoutMethod.md new file mode 100644 index 0000000..0979ec6 --- /dev/null +++ b/doc/PayoutMethod.md @@ -0,0 +1,15 @@ +# conekta.model.PayoutMethod + +## Load the model package +```dart +import 'package:conekta/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | The type of the payout method. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/doc/PayoutOrder.md b/doc/PayoutOrder.md new file mode 100644 index 0000000..209b10c --- /dev/null +++ b/doc/PayoutOrder.md @@ -0,0 +1,21 @@ +# conekta.model.PayoutOrder + +## Load the model package +```dart +import 'package:conekta/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allowedPayoutMethods** | **BuiltList<String>** | The payout methods that are allowed for the payout order. | +**amount** | **int** | The amount of the payout order. | +**currency** | **String** | The currency in which the payout order is made. | [default to 'MXN'] +**customerInfo** | [**CustomerInfoJustCustomerId**](CustomerInfoJustCustomerId.md) | | +**metadata** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | The metadata of the payout order. | [optional] +**payout** | [**Payout**](Payout.md) | | +**reason** | **String** | The reason for the payout order. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/doc/PayoutOrderPayoutsItem.md b/doc/PayoutOrderPayoutsItem.md new file mode 100644 index 0000000..e6f81e2 --- /dev/null +++ b/doc/PayoutOrderPayoutsItem.md @@ -0,0 +1,22 @@ +# conekta.model.PayoutOrderPayoutsItem + +## Load the model package +```dart +import 'package:conekta/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **int** | The amount of the payout. | +**currency** | **String** | The currency in which the payout is made. | +**expiresAt** | **int** | The expiration date of the payout. | [optional] +**id** | **String** | The id of the payout. | +**livemode** | **bool** | The live mode of the payout. | +**object** | **String** | The object of the payout. | +**payoutOrderId** | **String** | The id of the payout order. | [optional] +**status** | **String** | The status of the payout. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/doc/PayoutOrderResponse.md b/doc/PayoutOrderResponse.md new file mode 100644 index 0000000..1621b50 --- /dev/null +++ b/doc/PayoutOrderResponse.md @@ -0,0 +1,28 @@ +# conekta.model.PayoutOrderResponse + +## Load the model package +```dart +import 'package:conekta/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allowedPayoutMethods** | **BuiltList<String>** | The payout methods that are allowed for the payout order. | +**amount** | **int** | The amount of the payout order. | +**createdAt** | **int** | The creation date of the payout order. | +**currency** | **String** | The currency in which the payout order is made. | [default to 'MXN'] +**customerInfo** | [**PayoutOrderResponseCustomerInfo**](PayoutOrderResponseCustomerInfo.md) | | +**expiresAt** | **int** | The expiration date of the payout order. | [optional] +**id** | **String** | The id of the payout order. | +**livemode** | **bool** | The live mode of the payout order. | +**object** | **String** | The object of the payout order. | +**metadata** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | The metadata of the payout order. | [optional] +**payouts** | [**BuiltList<PayoutOrderPayoutsItem>**](PayoutOrderPayoutsItem.md) | The payout information of the payout order. | +**reason** | **String** | The reason for the payout order. | +**status** | **String** | The status of the payout order. | [optional] +**updatedAt** | **int** | The update date of the payout order. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/doc/PayoutOrderResponseCustomerInfo.md b/doc/PayoutOrderResponseCustomerInfo.md new file mode 100644 index 0000000..bb625c6 --- /dev/null +++ b/doc/PayoutOrderResponseCustomerInfo.md @@ -0,0 +1,21 @@ +# conekta.model.PayoutOrderResponseCustomerInfo + +## Load the model package +```dart +import 'package:conekta/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**customerCustomReference** | **String** | Custom reference | [optional] +**name** | **String** | | [optional] +**email** | **String** | | [optional] +**phone** | **String** | | [optional] +**corporate** | **bool** | | [optional] [default to false] +**object** | **String** | | [optional] +**id** | **String** | The id of the customer. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/doc/PayoutOrdersApi.md b/doc/PayoutOrdersApi.md new file mode 100644 index 0000000..499f4bc --- /dev/null +++ b/doc/PayoutOrdersApi.md @@ -0,0 +1,157 @@ +# conekta.api.PayoutOrdersApi + +## Load the API package +```dart +import 'package:conekta/api.dart'; +``` + +All URIs are relative to *https://api.conekta.io* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createPayoutOrder**](PayoutOrdersApi.md#createpayoutorder) | **POST** /payout_orders | Create payout order +[**getPayoutOrderById**](PayoutOrdersApi.md#getpayoutorderbyid) | **GET** /payout_orders/{id} | Get Payout Order +[**getPayoutOrders**](PayoutOrdersApi.md#getpayoutorders) | **GET** /payout_orders | Get a list of Payout Orders + + +# **createPayoutOrder** +> PayoutOrderResponse createPayoutOrder(payoutOrder, acceptLanguage) + +Create payout order + +Create a new payout order. + +### Example +```dart +import 'package:conekta/api.dart'; + +final api = Conekta().getPayoutOrdersApi(); +final PayoutOrder payoutOrder = ; // PayoutOrder | requested field for payout order +final String acceptLanguage = es; // String | Use for knowing which language to use + +try { + final response = api.createPayoutOrder(payoutOrder, acceptLanguage); + print(response); +} catch on DioException (e) { + print('Exception when calling PayoutOrdersApi->createPayoutOrder: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **payoutOrder** | [**PayoutOrder**](PayoutOrder.md)| requested field for payout order | + **acceptLanguage** | **String**| Use for knowing which language to use | [optional] [default to 'es'] + +### Return type + +[**PayoutOrderResponse**](PayoutOrderResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/vnd.conekta-v2.1.0+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getPayoutOrderById** +> PayoutOrderResponse getPayoutOrderById(id, acceptLanguage) + +Get Payout Order + +Gets a payout Order resource that corresponds to a payout order ID. + +### Example +```dart +import 'package:conekta/api.dart'; + +final api = Conekta().getPayoutOrdersApi(); +final String id = 6307a60c41de27127515a575; // String | Identifier of the resource +final String acceptLanguage = es; // String | Use for knowing which language to use + +try { + final response = api.getPayoutOrderById(id, acceptLanguage); + print(response); +} catch on DioException (e) { + print('Exception when calling PayoutOrdersApi->getPayoutOrderById: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| Identifier of the resource | + **acceptLanguage** | **String**| Use for knowing which language to use | [optional] [default to 'es'] + +### Return type + +[**PayoutOrderResponse**](PayoutOrderResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.conekta-v2.1.0+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getPayoutOrders** +> PayoutOrdersResponse getPayoutOrders(acceptLanguage, limit, search, next, previous) + +Get a list of Payout Orders + +Get Payout order details in the form of a list + +### Example +```dart +import 'package:conekta/api.dart'; + +final api = Conekta().getPayoutOrdersApi(); +final String acceptLanguage = es; // String | Use for knowing which language to use +final int limit = 56; // int | The numbers of items to return, the maximum value is 250 +final String search = search_example; // String | General order search, e.g. by mail, reference etc. +final String next = next_example; // String | next page +final String previous = previous_example; // String | previous page + +try { + final response = api.getPayoutOrders(acceptLanguage, limit, search, next, previous); + print(response); +} catch on DioException (e) { + print('Exception when calling PayoutOrdersApi->getPayoutOrders: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **acceptLanguage** | **String**| Use for knowing which language to use | [optional] [default to 'es'] + **limit** | **int**| The numbers of items to return, the maximum value is 250 | [optional] [default to 20] + **search** | **String**| General order search, e.g. by mail, reference etc. | [optional] + **next** | **String**| next page | [optional] + **previous** | **String**| previous page | [optional] + +### Return type + +[**PayoutOrdersResponse**](PayoutOrdersResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.conekta-v2.1.0+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/doc/PayoutOrdersResponse.md b/doc/PayoutOrdersResponse.md new file mode 100644 index 0000000..3e9315f --- /dev/null +++ b/doc/PayoutOrdersResponse.md @@ -0,0 +1,19 @@ +# conekta.model.PayoutOrdersResponse + +## Load the model package +```dart +import 'package:conekta/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hasMore** | **bool** | Indicates if there are more pages to be requested | +**object** | **String** | Object type, in this case is list | +**nextPageUrl** | **String** | URL of the next page. | [optional] +**previousPageUrl** | **String** | Url of the previous page. | [optional] +**data** | [**BuiltList<PayoutOrderResponse>**](PayoutOrderResponse.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/doc/Product.md b/doc/Product.md index c44c971..dd490eb 100644 --- a/doc/Product.md +++ b/doc/Product.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **antifraudInfo** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] **brand** | **String** | The brand of the item. | [optional] **description** | **String** | Short description of the item | [optional] -**metadata** | **BuiltMap<String, String>** | It is a key/value hash that can hold custom fields. Maximum 100 elements and allows special characters. | [optional] +**metadata** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | It is a key/value hash that can hold custom fields. Maximum 100 elements and allows special characters. | [optional] [default to MapBuilder()] **name** | **String** | The name of the item. It will be displayed in the order. | **quantity** | **int** | The quantity of the item in the order. | **sku** | **String** | The stock keeping unit for the item. It is used to identify the item in the order. | [optional] diff --git a/doc/ProductDataResponse.md b/doc/ProductDataResponse.md index 2529d1a..1112aab 100644 --- a/doc/ProductDataResponse.md +++ b/doc/ProductDataResponse.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **antifraudInfo** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] **brand** | **String** | The brand of the item. | [optional] **description** | **String** | Short description of the item | [optional] -**metadata** | **BuiltMap<String, String>** | It is a key/value hash that can hold custom fields. Maximum 100 elements and allows special characters. | [optional] +**metadata** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | It is a key/value hash that can hold custom fields. Maximum 100 elements and allows special characters. | [optional] [default to MapBuilder()] **name** | **String** | The name of the item. It will be displayed in the order. | **quantity** | **int** | The quantity of the item in the order. | **sku** | **String** | The stock keeping unit for the item. It is used to identify the item in the order. | [optional] diff --git a/doc/ProductOrderResponse.md b/doc/ProductOrderResponse.md index 6af6615..1acf6fd 100644 --- a/doc/ProductOrderResponse.md +++ b/doc/ProductOrderResponse.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **antifraudInfo** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] **brand** | **String** | The brand of the item. | [optional] **description** | **String** | Short description of the item | [optional] -**metadata** | **BuiltMap<String, String>** | It is a key/value hash that can hold custom fields. Maximum 100 elements and allows special characters. | [optional] +**metadata** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | It is a key/value hash that can hold custom fields. Maximum 100 elements and allows special characters. | [optional] [default to MapBuilder()] **name** | **String** | The name of the item. It will be displayed in the order. | **quantity** | **int** | The quantity of the item in the order. | **sku** | **String** | The stock keeping unit for the item. It is used to identify the item in the order. | [optional] diff --git a/doc/WebhooksApi.md b/doc/WebhooksApi.md index 97655b8..7429b5a 100644 --- a/doc/WebhooksApi.md +++ b/doc/WebhooksApi.md @@ -151,7 +151,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **getWebhooks** -> GetWebhooksResponse getWebhooks(acceptLanguage, xChildCompanyId, limit, search, next, previous) +> GetWebhooksResponse getWebhooks(acceptLanguage, xChildCompanyId, limit, search, url, next, previous) Get List of Webhooks @@ -166,11 +166,12 @@ final String acceptLanguage = es; // String | Use for knowing which language to final String xChildCompanyId = 6441b6376b60c3a638da80af; // String | In the case of a holding company, the company id of the child company to which will process the request. final int limit = 56; // int | The numbers of items to return, the maximum value is 250 final String search = search_example; // String | General order search, e.g. by mail, reference etc. +final String url = url_example; // String | url for webhook filter final String next = next_example; // String | next page final String previous = previous_example; // String | previous page try { - final response = api.getWebhooks(acceptLanguage, xChildCompanyId, limit, search, next, previous); + final response = api.getWebhooks(acceptLanguage, xChildCompanyId, limit, search, url, next, previous); print(response); } catch on DioException (e) { print('Exception when calling WebhooksApi->getWebhooks: $e\n'); @@ -185,6 +186,7 @@ Name | Type | Description | Notes **xChildCompanyId** | **String**| In the case of a holding company, the company id of the child company to which will process the request. | [optional] **limit** | **int**| The numbers of items to return, the maximum value is 250 | [optional] [default to 20] **search** | **String**| General order search, e.g. by mail, reference etc. | [optional] + **url** | **String**| url for webhook filter | [optional] **next** | **String**| next page | [optional] **previous** | **String**| previous page | [optional] diff --git a/example/token.dart b/example/token.dart new file mode 100644 index 0000000..005a282 --- /dev/null +++ b/example/token.dart @@ -0,0 +1,24 @@ +import 'package:conekta/conekta.dart'; +import 'package:dio/dio.dart'; + +Future main() async { + var instance = Conekta(); + instance.setBearerAuth("bearerAuth", "key_0HATKNkopS0O42pOp1Ilpcc"); + final api = instance.getTokensApi(); + TokenCard cardToken = TokenCard((c) => c + ..cvc = '123' + ..expMonth = '2342432342' + ..expYear = '' + ..name = '' + ..number = ''); + + + try { + var token = Token((b) => b..card.replace(cardToken)); + final response = await api.createToken(token: token); + print(response); + } on DioException catch (exception) { + print(' $exception'); + return null; + } +} diff --git a/lib/conekta.dart b/lib/conekta.dart index f5c5b18..d0e3a55 100644 --- a/lib/conekta.dart +++ b/lib/conekta.dart @@ -21,6 +21,7 @@ export 'package:conekta/src/api/logs_api.dart'; export 'package:conekta/src/api/orders_api.dart'; export 'package:conekta/src/api/payment_link_api.dart'; export 'package:conekta/src/api/payment_methods_api.dart'; +export 'package:conekta/src/api/payout_orders_api.dart'; export 'package:conekta/src/api/plans_api.dart'; export 'package:conekta/src/api/products_api.dart'; export 'package:conekta/src/api/shipping_contacts_api.dart'; @@ -155,6 +156,13 @@ export 'package:conekta/src/model/payment_method_cash_response.dart'; export 'package:conekta/src/model/payment_method_response.dart'; export 'package:conekta/src/model/payment_method_spei_recurrent.dart'; export 'package:conekta/src/model/payment_method_spei_request.dart'; +export 'package:conekta/src/model/payout.dart'; +export 'package:conekta/src/model/payout_method.dart'; +export 'package:conekta/src/model/payout_order.dart'; +export 'package:conekta/src/model/payout_order_payouts_item.dart'; +export 'package:conekta/src/model/payout_order_response.dart'; +export 'package:conekta/src/model/payout_order_response_customer_info.dart'; +export 'package:conekta/src/model/payout_orders_response.dart'; export 'package:conekta/src/model/plan_request.dart'; export 'package:conekta/src/model/plan_response.dart'; export 'package:conekta/src/model/plan_update_request.dart'; diff --git a/lib/src/api.dart b/lib/src/api.dart index ab11431..a0bc628 100644 --- a/lib/src/api.dart +++ b/lib/src/api.dart @@ -21,6 +21,7 @@ import 'package:conekta/src/api/logs_api.dart'; import 'package:conekta/src/api/orders_api.dart'; import 'package:conekta/src/api/payment_link_api.dart'; import 'package:conekta/src/api/payment_methods_api.dart'; +import 'package:conekta/src/api/payout_orders_api.dart'; import 'package:conekta/src/api/plans_api.dart'; import 'package:conekta/src/api/products_api.dart'; import 'package:conekta/src/api/shipping_contacts_api.dart'; @@ -159,6 +160,12 @@ class Conekta { return PaymentMethodsApi(dio, serializers); } + /// Get PayoutOrdersApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + PayoutOrdersApi getPayoutOrdersApi() { + return PayoutOrdersApi(dio, serializers); + } + /// Get PlansApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed PlansApi getPlansApi() { diff --git a/lib/src/api/antifraud_api.dart b/lib/src/api/antifraud_api.dart index 0e4ca99..4c48ae0 100644 --- a/lib/src/api/antifraud_api.dart +++ b/lib/src/api/antifraud_api.dart @@ -65,7 +65,7 @@ class AntifraudApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -184,7 +184,7 @@ class AntifraudApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -304,7 +304,7 @@ class AntifraudApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -405,7 +405,7 @@ class AntifraudApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -502,7 +502,7 @@ class AntifraudApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -598,7 +598,7 @@ class AntifraudApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, diff --git a/lib/src/api/api_keys_api.dart b/lib/src/api/api_keys_api.dart index 4edb747..0008e87 100644 --- a/lib/src/api/api_keys_api.dart +++ b/lib/src/api/api_keys_api.dart @@ -67,7 +67,7 @@ class ApiKeysApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -186,7 +186,7 @@ class ApiKeysApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -286,7 +286,7 @@ class ApiKeysApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -393,7 +393,7 @@ class ApiKeysApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -503,7 +503,7 @@ class ApiKeysApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, diff --git a/lib/src/api/balances_api.dart b/lib/src/api/balances_api.dart index 1e6614c..f3dc85a 100644 --- a/lib/src/api/balances_api.dart +++ b/lib/src/api/balances_api.dart @@ -56,7 +56,7 @@ class BalancesApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, diff --git a/lib/src/api/charges_api.dart b/lib/src/api/charges_api.dart index f1c475d..a63c810 100644 --- a/lib/src/api/charges_api.dart +++ b/lib/src/api/charges_api.dart @@ -71,7 +71,7 @@ class ChargesApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -183,7 +183,7 @@ class ChargesApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -307,7 +307,7 @@ class ChargesApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/companies_api.dart b/lib/src/api/companies_api.dart index 34dd910..1e7cca4 100644 --- a/lib/src/api/companies_api.dart +++ b/lib/src/api/companies_api.dart @@ -66,7 +66,7 @@ class CompaniesApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -172,7 +172,7 @@ class CompaniesApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, diff --git a/lib/src/api/customers_api.dart b/lib/src/api/customers_api.dart index 4ce0a9e..b9bc1cf 100644 --- a/lib/src/api/customers_api.dart +++ b/lib/src/api/customers_api.dart @@ -69,7 +69,7 @@ class CustomersApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -193,7 +193,7 @@ class CustomersApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -314,7 +314,7 @@ class CustomersApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -415,7 +415,7 @@ class CustomersApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -522,7 +522,7 @@ class CustomersApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -634,7 +634,7 @@ class CustomersApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -760,7 +760,7 @@ class CustomersApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/discounts_api.dart b/lib/src/api/discounts_api.dart index 7dbda40..d4d3811 100644 --- a/lib/src/api/discounts_api.dart +++ b/lib/src/api/discounts_api.dart @@ -67,7 +67,7 @@ class DiscountsApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -190,7 +190,7 @@ class DiscountsApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -293,7 +293,7 @@ class DiscountsApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -402,7 +402,7 @@ class DiscountsApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -516,7 +516,7 @@ class DiscountsApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/events_api.dart b/lib/src/api/events_api.dart index 1200a09..161abbc 100644 --- a/lib/src/api/events_api.dart +++ b/lib/src/api/events_api.dart @@ -63,7 +63,7 @@ class EventsApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -170,7 +170,7 @@ class EventsApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -279,7 +279,7 @@ class EventsApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, diff --git a/lib/src/api/logs_api.dart b/lib/src/api/logs_api.dart index feceeab..b62ae2c 100644 --- a/lib/src/api/logs_api.dart +++ b/lib/src/api/logs_api.dart @@ -62,7 +62,7 @@ class LogsApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -169,7 +169,7 @@ class LogsApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/orders_api.dart b/lib/src/api/orders_api.dart index 67aa2da..3409850 100644 --- a/lib/src/api/orders_api.dart +++ b/lib/src/api/orders_api.dart @@ -66,7 +66,7 @@ class OrdersApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -168,7 +168,7 @@ class OrdersApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -289,7 +289,7 @@ class OrdersApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -359,6 +359,13 @@ class OrdersApi { /// * [search] - General order search, e.g. by mail, reference etc. /// * [next] - next page /// * [previous] - previous page + /// * [paymentStatus] - Filters by order status + /// * [lastPaymentInfoPeriodStatus] - Filters by last payment info status + /// * [createdAt] - created equal to + /// * [createdAtPeriodGte] - created at greater than or equal to + /// * [createdAtPeriodLte] - created at less than or equal to + /// * [updatedAtPeriodGte] - updated at greater than or equal to + /// * [updatedAtPeriodLte] - updated at less than or equal to /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation /// * [headers] - Can be used to add additional headers to the request /// * [extras] - Can be used to add flags to the request @@ -375,6 +382,13 @@ class OrdersApi { String? search, String? next, String? previous, + String? paymentStatus, + String? lastPaymentInfoPeriodStatus, + int? createdAt, + int? createdAtPeriodGte, + int? createdAtPeriodLte, + int? updatedAtPeriodGte, + int? updatedAtPeriodLte, CancelToken? cancelToken, Map? headers, Map? extra, @@ -396,7 +410,7 @@ class OrdersApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -422,6 +436,13 @@ class OrdersApi { if (search != null) r'search': encodeQueryParameter(_serializers, search, const FullType(String)), if (next != null) r'next': encodeQueryParameter(_serializers, next, const FullType(String)), if (previous != null) r'previous': encodeQueryParameter(_serializers, previous, const FullType(String)), + if (paymentStatus != null) r'payment_status': encodeQueryParameter(_serializers, paymentStatus, const FullType(String)), + if (lastPaymentInfoPeriodStatus != null) r'last_payment_info.status': encodeQueryParameter(_serializers, lastPaymentInfoPeriodStatus, const FullType(String)), + if (createdAt != null) r'created_at': encodeQueryParameter(_serializers, createdAt, const FullType(int)), + if (createdAtPeriodGte != null) r'created_at.gte': encodeQueryParameter(_serializers, createdAtPeriodGte, const FullType(int)), + if (createdAtPeriodLte != null) r'created_at.lte': encodeQueryParameter(_serializers, createdAtPeriodLte, const FullType(int)), + if (updatedAtPeriodGte != null) r'updated_at.gte': encodeQueryParameter(_serializers, updatedAtPeriodGte, const FullType(int)), + if (updatedAtPeriodLte != null) r'updated_at.lte': encodeQueryParameter(_serializers, updatedAtPeriodLte, const FullType(int)), }; final _response = await _dio.request( @@ -507,7 +528,7 @@ class OrdersApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -611,7 +632,7 @@ class OrdersApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -735,7 +756,7 @@ class OrdersApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -857,7 +878,7 @@ class OrdersApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, diff --git a/lib/src/api/payment_link_api.dart b/lib/src/api/payment_link_api.dart index a785770..a710981 100644 --- a/lib/src/api/payment_link_api.dart +++ b/lib/src/api/payment_link_api.dart @@ -65,7 +65,7 @@ class PaymentLinkApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -167,7 +167,7 @@ class PaymentLinkApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -291,7 +291,7 @@ class PaymentLinkApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -412,7 +412,7 @@ class PaymentLinkApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -519,7 +519,7 @@ class PaymentLinkApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -631,7 +631,7 @@ class PaymentLinkApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/payment_methods_api.dart b/lib/src/api/payment_methods_api.dart index f046b07..fbd20d6 100644 --- a/lib/src/api/payment_methods_api.dart +++ b/lib/src/api/payment_methods_api.dart @@ -68,7 +68,7 @@ class PaymentMethodsApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -191,7 +191,7 @@ class PaymentMethodsApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -300,7 +300,7 @@ class PaymentMethodsApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -414,7 +414,7 @@ class PaymentMethodsApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/payout_orders_api.dart b/lib/src/api/payout_orders_api.dart new file mode 100644 index 0000000..938b6f6 --- /dev/null +++ b/lib/src/api/payout_orders_api.dart @@ -0,0 +1,354 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +import 'package:built_value/serializer.dart'; +import 'package:dio/dio.dart'; + +import 'package:conekta/src/api_util.dart'; +import 'package:conekta/src/model/error.dart'; +import 'package:conekta/src/model/payout_order.dart'; +import 'package:conekta/src/model/payout_order_response.dart'; +import 'package:conekta/src/model/payout_orders_response.dart'; +import 'package:conekta/src/utils/utils.dart'; + +class PayoutOrdersApi { + + final Dio _dio; + + final Serializers _serializers; + + const PayoutOrdersApi(this._dio, this._serializers); + + /// Create payout order + /// Create a new payout order. + /// + /// Parameters: + /// * [payoutOrder] - requested field for payout order + /// * [acceptLanguage] - Use for knowing which language to use + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [PayoutOrderResponse] as data + /// Throws [DioException] if API call or serialization fails + Future> createPayoutOrder({ + required PayoutOrder payoutOrder, + String? acceptLanguage = 'es', + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/payout_orders'; + // to determine the Accept header + List _contentTypes = [ + "application/json" + ]; + var localVarContentType = selectHeaderContentType(_contentTypes); + + // to determine the Accept header + List _accepts = [ + "application/vnd.conekta-v2.1.0+json" + ]; + final localVarAccept = selectHeaderAccept(_accepts); + final _options = Options( + method: r'POST', + headers: { + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + if (acceptLanguage != null) r'Accept-Language': acceptLanguage, + if (localVarAccept != null) r'Accept': localVarAccept, + if (localVarContentType != null) r'Content-Type': localVarContentType, + r'X-Conekta-Client-User-Agent' : getConektaClientUserAgent(), + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'bearerAuth', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + const _type = FullType(PayoutOrder); + _bodyData = _serializers.serialize(payoutOrder, specifiedType: _type); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + PayoutOrderResponse? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(PayoutOrderResponse), + ) as PayoutOrderResponse; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Get Payout Order + /// Gets a payout Order resource that corresponds to a payout order ID. + /// + /// Parameters: + /// * [id] - Identifier of the resource + /// * [acceptLanguage] - Use for knowing which language to use + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [PayoutOrderResponse] as data + /// Throws [DioException] if API call or serialization fails + Future> getPayoutOrderById({ + required String id, + String? acceptLanguage = 'es', + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/payout_orders/{id}'.replaceAll('{' r'id' '}', encodeQueryParameter(_serializers, id, const FullType(String)).toString()); + // to determine the Accept header + List _contentTypes = [ + ]; + var localVarContentType = selectHeaderContentType(_contentTypes); + + // to determine the Accept header + List _accepts = [ + "application/vnd.conekta-v2.1.0+json" + ]; + final localVarAccept = selectHeaderAccept(_accepts); + final _options = Options( + method: r'GET', + headers: { + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + if (acceptLanguage != null) r'Accept-Language': acceptLanguage, + if (localVarAccept != null) r'Accept': localVarAccept, + if (localVarContentType != null) r'Content-Type': localVarContentType, + r'X-Conekta-Client-User-Agent' : getConektaClientUserAgent(), + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'bearerAuth', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + PayoutOrderResponse? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(PayoutOrderResponse), + ) as PayoutOrderResponse; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Get a list of Payout Orders + /// Get Payout order details in the form of a list + /// + /// Parameters: + /// * [acceptLanguage] - Use for knowing which language to use + /// * [limit] - The numbers of items to return, the maximum value is 250 + /// * [search] - General order search, e.g. by mail, reference etc. + /// * [next] - next page + /// * [previous] - previous page + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [PayoutOrdersResponse] as data + /// Throws [DioException] if API call or serialization fails + Future> getPayoutOrders({ + String? acceptLanguage = 'es', + int? limit = 20, + String? search, + String? next, + String? previous, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/payout_orders'; + // to determine the Accept header + List _contentTypes = [ + ]; + var localVarContentType = selectHeaderContentType(_contentTypes); + + // to determine the Accept header + List _accepts = [ + "application/vnd.conekta-v2.1.0+json" + ]; + final localVarAccept = selectHeaderAccept(_accepts); + final _options = Options( + method: r'GET', + headers: { + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', + if (acceptLanguage != null) r'Accept-Language': acceptLanguage, + if (localVarAccept != null) r'Accept': localVarAccept, + if (localVarContentType != null) r'Content-Type': localVarContentType, + r'X-Conekta-Client-User-Agent' : getConektaClientUserAgent(), + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'bearerAuth', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (limit != null) r'limit': encodeQueryParameter(_serializers, limit, const FullType(int)), + if (search != null) r'search': encodeQueryParameter(_serializers, search, const FullType(String)), + if (next != null) r'next': encodeQueryParameter(_serializers, next, const FullType(String)), + if (previous != null) r'previous': encodeQueryParameter(_serializers, previous, const FullType(String)), + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + PayoutOrdersResponse? _responseData; + + try { + final rawResponse = _response.data; + _responseData = rawResponse == null ? null : _serializers.deserialize( + rawResponse, + specifiedType: const FullType(PayoutOrdersResponse), + ) as PayoutOrdersResponse; + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/lib/src/api/plans_api.dart b/lib/src/api/plans_api.dart index 93eac47..e105ab8 100644 --- a/lib/src/api/plans_api.dart +++ b/lib/src/api/plans_api.dart @@ -65,7 +65,7 @@ class PlansApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -184,7 +184,7 @@ class PlansApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -284,7 +284,7 @@ class PlansApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -391,7 +391,7 @@ class PlansApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -503,7 +503,7 @@ class PlansApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/products_api.dart b/lib/src/api/products_api.dart index 9997ace..5e9e8d8 100644 --- a/lib/src/api/products_api.dart +++ b/lib/src/api/products_api.dart @@ -66,7 +66,7 @@ class ProductsApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -189,7 +189,7 @@ class ProductsApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -295,7 +295,7 @@ class ProductsApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/shipping_contacts_api.dart b/lib/src/api/shipping_contacts_api.dart index 932d030..16645a0 100644 --- a/lib/src/api/shipping_contacts_api.dart +++ b/lib/src/api/shipping_contacts_api.dart @@ -66,7 +66,7 @@ class ShippingContactsApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -189,7 +189,7 @@ class ShippingContactsApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -295,7 +295,7 @@ class ShippingContactsApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/shippings_api.dart b/lib/src/api/shippings_api.dart index f19945d..e9e50a1 100644 --- a/lib/src/api/shippings_api.dart +++ b/lib/src/api/shippings_api.dart @@ -65,7 +65,7 @@ class ShippingsApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -188,7 +188,7 @@ class ShippingsApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -294,7 +294,7 @@ class ShippingsApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/subscriptions_api.dart b/lib/src/api/subscriptions_api.dart index 1f3ff38..367364b 100644 --- a/lib/src/api/subscriptions_api.dart +++ b/lib/src/api/subscriptions_api.dart @@ -64,7 +64,7 @@ class SubscriptionsApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -168,7 +168,7 @@ class SubscriptionsApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -289,7 +289,7 @@ class SubscriptionsApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -388,7 +388,7 @@ class SubscriptionsApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -488,7 +488,7 @@ class SubscriptionsApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -589,7 +589,7 @@ class SubscriptionsApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -693,7 +693,7 @@ class SubscriptionsApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/taxes_api.dart b/lib/src/api/taxes_api.dart index e61e162..ddc77f1 100644 --- a/lib/src/api/taxes_api.dart +++ b/lib/src/api/taxes_api.dart @@ -66,7 +66,7 @@ class TaxesApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -189,7 +189,7 @@ class TaxesApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -295,7 +295,7 @@ class TaxesApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/tokens_api.dart b/lib/src/api/tokens_api.dart index 31f0324..16c1865 100644 --- a/lib/src/api/tokens_api.dart +++ b/lib/src/api/tokens_api.dart @@ -60,7 +60,7 @@ class TokensApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, diff --git a/lib/src/api/transactions_api.dart b/lib/src/api/transactions_api.dart index 16eae4e..2bc0023 100644 --- a/lib/src/api/transactions_api.dart +++ b/lib/src/api/transactions_api.dart @@ -62,7 +62,7 @@ class TransactionsApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -175,7 +175,7 @@ class TransactionsApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/transfers_api.dart b/lib/src/api/transfers_api.dart index daecfcf..313ee15 100644 --- a/lib/src/api/transfers_api.dart +++ b/lib/src/api/transfers_api.dart @@ -62,7 +62,7 @@ class TransfersApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -169,7 +169,7 @@ class TransfersApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/api/webhook_keys_api.dart b/lib/src/api/webhook_keys_api.dart index 455da1e..cbfbcd8 100644 --- a/lib/src/api/webhook_keys_api.dart +++ b/lib/src/api/webhook_keys_api.dart @@ -65,7 +65,7 @@ class WebhookKeysApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -183,7 +183,7 @@ class WebhookKeysApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -283,7 +283,7 @@ class WebhookKeysApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -390,7 +390,7 @@ class WebhookKeysApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -500,7 +500,7 @@ class WebhookKeysApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, diff --git a/lib/src/api/webhooks_api.dart b/lib/src/api/webhooks_api.dart index 9308fb1..8cdc6f0 100644 --- a/lib/src/api/webhooks_api.dart +++ b/lib/src/api/webhooks_api.dart @@ -63,7 +63,7 @@ class WebhooksApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -181,7 +181,7 @@ class WebhooksApi { final _options = Options( method: r'DELETE', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -281,7 +281,7 @@ class WebhooksApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -349,6 +349,7 @@ class WebhooksApi { /// * [xChildCompanyId] - In the case of a holding company, the company id of the child company to which will process the request. /// * [limit] - The numbers of items to return, the maximum value is 250 /// * [search] - General order search, e.g. by mail, reference etc. + /// * [url] - url for webhook filter /// * [next] - next page /// * [previous] - previous page /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -365,6 +366,7 @@ class WebhooksApi { String? xChildCompanyId, int? limit = 20, String? search, + String? url, String? next, String? previous, CancelToken? cancelToken, @@ -388,7 +390,7 @@ class WebhooksApi { final _options = Options( method: r'GET', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, @@ -412,6 +414,7 @@ class WebhooksApi { final _queryParameters = { if (limit != null) r'limit': encodeQueryParameter(_serializers, limit, const FullType(int)), if (search != null) r'search': encodeQueryParameter(_serializers, search, const FullType(String)), + if (url != null) r'url': encodeQueryParameter(_serializers, url, const FullType(String)), if (next != null) r'next': encodeQueryParameter(_serializers, next, const FullType(String)), if (previous != null) r'previous': encodeQueryParameter(_serializers, previous, const FullType(String)), }; @@ -495,7 +498,7 @@ class WebhooksApi { final _options = Options( method: r'POST', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (localVarAccept != null) r'Accept': localVarAccept, if (localVarContentType != null) r'Content-Type': localVarContentType, @@ -598,7 +601,7 @@ class WebhooksApi { final _options = Options( method: r'PUT', headers: { - r'User-Agent': r'Conekta/v2 DartBindings/6.0.4', + r'User-Agent': r'Conekta/v2 DartBindings/6.0.5', if (acceptLanguage != null) r'Accept-Language': acceptLanguage, if (xChildCompanyId != null) r'X-Child-Company-Id': xChildCompanyId, if (localVarAccept != null) r'Accept': localVarAccept, diff --git a/lib/src/auth/basic_auth.dart b/lib/src/auth/basic_auth.dart index 9e5485f..69f688e 100644 --- a/lib/src/auth/basic_auth.dart +++ b/lib/src/auth/basic_auth.dart @@ -22,7 +22,7 @@ class BasicAuthInterceptor extends AuthInterceptor { RequestOptions options, RequestInterceptorHandler handler, ) { - final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme'] == 'basic') || secure['type'] == 'basic'); + final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme']?.toLowerCase() == 'basic') || secure['type'] == 'basic'); for (final info in metadataAuthInfo) { final authName = info['name'] as String; final basicAuthInfo = authInfo[authName]; diff --git a/lib/src/auth/bearer_auth.dart b/lib/src/auth/bearer_auth.dart index ae174d9..5a450db 100644 --- a/lib/src/auth/bearer_auth.dart +++ b/lib/src/auth/bearer_auth.dart @@ -13,7 +13,7 @@ class BearerAuthInterceptor extends AuthInterceptor { RequestOptions options, RequestInterceptorHandler handler, ) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); + final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme']?.toLowerCase() == 'bearer'); for (final info in authInfo) { final token = tokens[info['name']]; if (token != null) { diff --git a/lib/src/model/order_response_checkout.dart b/lib/src/model/order_response_checkout.dart index 9c3792e..0d2a842 100644 --- a/lib/src/model/order_response_checkout.dart +++ b/lib/src/model/order_response_checkout.dart @@ -32,6 +32,7 @@ part 'order_response_checkout.g.dart'; /// * [onDemandEnabled] /// * [paidPaymentsCount] /// * [recurrent] +/// * [redirectionTime] - number of seconds to wait before redirecting to the success_url /// * [slug] /// * [smsSent] /// * [successUrl] @@ -98,6 +99,10 @@ abstract class OrderResponseCheckout implements Built _$this._recurrent; set recurrent(bool? recurrent) => _$this._recurrent = recurrent; + int? _redirectionTime; + int? get redirectionTime => _$this._redirectionTime; + set redirectionTime(int? redirectionTime) => + _$this._redirectionTime = redirectionTime; + String? _slug; String? get slug => _$this._slug; set slug(String? slug) => _$this._slug = slug; @@ -348,6 +359,7 @@ class OrderResponseCheckoutBuilder _onDemandEnabled = $v.onDemandEnabled; _paidPaymentsCount = $v.paidPaymentsCount; _recurrent = $v.recurrent; + _redirectionTime = $v.redirectionTime; _slug = $v.slug; _smsSent = $v.smsSent; _successUrl = $v.successUrl; @@ -398,6 +410,7 @@ class OrderResponseCheckoutBuilder onDemandEnabled: onDemandEnabled, paidPaymentsCount: paidPaymentsCount, recurrent: recurrent, + redirectionTime: redirectionTime, slug: slug, smsSent: smsSent, successUrl: successUrl, diff --git a/lib/src/model/payout.dart b/lib/src/model/payout.dart new file mode 100644 index 0000000..695681c --- /dev/null +++ b/lib/src/model/payout.dart @@ -0,0 +1,107 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:conekta/src/model/payout_method.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'payout.g.dart'; + +/// The payout information of the payout order. +/// +/// Properties: +/// * [payoutMethod] +@BuiltValue() +abstract class Payout implements Built { + @BuiltValueField(wireName: r'payout_method') + PayoutMethod get payoutMethod; + + Payout._(); + + factory Payout([void updates(PayoutBuilder b)]) = _$Payout; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PayoutBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PayoutSerializer(); +} + +class _$PayoutSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [Payout, _$Payout]; + + @override + final String wireName = r'Payout'; + + Iterable _serializeProperties( + Serializers serializers, + Payout object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'payout_method'; + yield serializers.serialize( + object.payoutMethod, + specifiedType: const FullType(PayoutMethod), + ); + } + + @override + Object serialize( + Serializers serializers, + Payout object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PayoutBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'payout_method': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(PayoutMethod), + ) as PayoutMethod; + result.payoutMethod.replace(valueDes); + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + Payout deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = PayoutBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/lib/src/model/payout.g.dart b/lib/src/model/payout.g.dart new file mode 100644 index 0000000..beb190e --- /dev/null +++ b/lib/src/model/payout.g.dart @@ -0,0 +1,106 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'payout.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$Payout extends Payout { + @override + final PayoutMethod payoutMethod; + + factory _$Payout([void Function(PayoutBuilder)? updates]) => + (new PayoutBuilder()..update(updates))._build(); + + _$Payout._({required this.payoutMethod}) : super._() { + BuiltValueNullFieldError.checkNotNull( + payoutMethod, r'Payout', 'payoutMethod'); + } + + @override + Payout rebuild(void Function(PayoutBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + PayoutBuilder toBuilder() => new PayoutBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is Payout && payoutMethod == other.payoutMethod; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, payoutMethod.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'Payout') + ..add('payoutMethod', payoutMethod)) + .toString(); + } +} + +class PayoutBuilder implements Builder { + _$Payout? _$v; + + PayoutMethodBuilder? _payoutMethod; + PayoutMethodBuilder get payoutMethod => + _$this._payoutMethod ??= new PayoutMethodBuilder(); + set payoutMethod(PayoutMethodBuilder? payoutMethod) => + _$this._payoutMethod = payoutMethod; + + PayoutBuilder() { + Payout._defaults(this); + } + + PayoutBuilder get _$this { + final $v = _$v; + if ($v != null) { + _payoutMethod = $v.payoutMethod.toBuilder(); + _$v = null; + } + return this; + } + + @override + void replace(Payout other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$Payout; + } + + @override + void update(void Function(PayoutBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + Payout build() => _build(); + + _$Payout _build() { + _$Payout _$result; + try { + _$result = _$v ?? new _$Payout._(payoutMethod: payoutMethod.build()); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'payoutMethod'; + payoutMethod.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'Payout', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/lib/src/model/payout_method.dart b/lib/src/model/payout_method.dart new file mode 100644 index 0000000..ef408e9 --- /dev/null +++ b/lib/src/model/payout_method.dart @@ -0,0 +1,107 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'payout_method.g.dart'; + +/// The payout method of the payout order. +/// +/// Properties: +/// * [type] - The type of the payout method. +@BuiltValue() +abstract class PayoutMethod implements Built { + /// The type of the payout method. + @BuiltValueField(wireName: r'type') + String get type; + + PayoutMethod._(); + + factory PayoutMethod([void updates(PayoutMethodBuilder b)]) = _$PayoutMethod; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PayoutMethodBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PayoutMethodSerializer(); +} + +class _$PayoutMethodSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [PayoutMethod, _$PayoutMethod]; + + @override + final String wireName = r'PayoutMethod'; + + Iterable _serializeProperties( + Serializers serializers, + PayoutMethod object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'type'; + yield serializers.serialize( + object.type, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + PayoutMethod object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PayoutMethodBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'type': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.type = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + PayoutMethod deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = PayoutMethodBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/lib/src/model/payout_method.g.dart b/lib/src/model/payout_method.g.dart new file mode 100644 index 0000000..6f37e0d --- /dev/null +++ b/lib/src/model/payout_method.g.dart @@ -0,0 +1,93 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'payout_method.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$PayoutMethod extends PayoutMethod { + @override + final String type; + + factory _$PayoutMethod([void Function(PayoutMethodBuilder)? updates]) => + (new PayoutMethodBuilder()..update(updates))._build(); + + _$PayoutMethod._({required this.type}) : super._() { + BuiltValueNullFieldError.checkNotNull(type, r'PayoutMethod', 'type'); + } + + @override + PayoutMethod rebuild(void Function(PayoutMethodBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + PayoutMethodBuilder toBuilder() => new PayoutMethodBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is PayoutMethod && type == other.type; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, type.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'PayoutMethod')..add('type', type)) + .toString(); + } +} + +class PayoutMethodBuilder + implements Builder { + _$PayoutMethod? _$v; + + String? _type; + String? get type => _$this._type; + set type(String? type) => _$this._type = type; + + PayoutMethodBuilder() { + PayoutMethod._defaults(this); + } + + PayoutMethodBuilder get _$this { + final $v = _$v; + if ($v != null) { + _type = $v.type; + _$v = null; + } + return this; + } + + @override + void replace(PayoutMethod other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$PayoutMethod; + } + + @override + void update(void Function(PayoutMethodBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + PayoutMethod build() => _build(); + + _$PayoutMethod _build() { + final _$result = _$v ?? + new _$PayoutMethod._( + type: BuiltValueNullFieldError.checkNotNull( + type, r'PayoutMethod', 'type')); + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/lib/src/model/payout_order.dart b/lib/src/model/payout_order.dart new file mode 100644 index 0000000..e9482c4 --- /dev/null +++ b/lib/src/model/payout_order.dart @@ -0,0 +1,214 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:conekta/src/model/customer_info_just_customer_id.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:conekta/src/model/payout.dart'; +import 'package:built_value/json_object.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'payout_order.g.dart'; + +/// a payout order +/// +/// Properties: +/// * [allowedPayoutMethods] - The payout methods that are allowed for the payout order. +/// * [amount] - The amount of the payout order. +/// * [currency] - The currency in which the payout order is made. +/// * [customerInfo] +/// * [metadata] - The metadata of the payout order. +/// * [payout] +/// * [reason] - The reason for the payout order. +@BuiltValue() +abstract class PayoutOrder implements Built { + /// The payout methods that are allowed for the payout order. + @BuiltValueField(wireName: r'allowed_payout_methods') + BuiltList get allowedPayoutMethods; + + /// The amount of the payout order. + @BuiltValueField(wireName: r'amount') + int get amount; + + /// The currency in which the payout order is made. + @BuiltValueField(wireName: r'currency') + String get currency; + + @BuiltValueField(wireName: r'customer_info') + CustomerInfoJustCustomerId get customerInfo; + + /// The metadata of the payout order. + @BuiltValueField(wireName: r'metadata') + BuiltMap? get metadata; + + @BuiltValueField(wireName: r'payout') + Payout get payout; + + /// The reason for the payout order. + @BuiltValueField(wireName: r'reason') + String get reason; + + PayoutOrder._(); + + factory PayoutOrder([void updates(PayoutOrderBuilder b)]) = _$PayoutOrder; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PayoutOrderBuilder b) => b + ..currency = 'MXN'; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PayoutOrderSerializer(); +} + +class _$PayoutOrderSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [PayoutOrder, _$PayoutOrder]; + + @override + final String wireName = r'PayoutOrder'; + + Iterable _serializeProperties( + Serializers serializers, + PayoutOrder object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'allowed_payout_methods'; + yield serializers.serialize( + object.allowedPayoutMethods, + specifiedType: const FullType(BuiltList, [FullType(String)]), + ); + yield r'amount'; + yield serializers.serialize( + object.amount, + specifiedType: const FullType(int), + ); + yield r'currency'; + yield serializers.serialize( + object.currency, + specifiedType: const FullType(String), + ); + yield r'customer_info'; + yield serializers.serialize( + object.customerInfo, + specifiedType: const FullType(CustomerInfoJustCustomerId), + ); + if (object.metadata != null) { + yield r'metadata'; + yield serializers.serialize( + object.metadata, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ); + } + yield r'payout'; + yield serializers.serialize( + object.payout, + specifiedType: const FullType(Payout), + ); + yield r'reason'; + yield serializers.serialize( + object.reason, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + PayoutOrder object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PayoutOrderBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'allowed_payout_methods': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(String)]), + ) as BuiltList; + result.allowedPayoutMethods.replace(valueDes); + break; + case r'amount': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.amount = valueDes; + break; + case r'currency': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.currency = valueDes; + break; + case r'customer_info': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(CustomerInfoJustCustomerId), + ) as CustomerInfoJustCustomerId; + result.customerInfo.replace(valueDes); + break; + case r'metadata': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ) as BuiltMap; + result.metadata.replace(valueDes); + break; + case r'payout': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(Payout), + ) as Payout; + result.payout.replace(valueDes); + break; + case r'reason': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.reason = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + PayoutOrder deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = PayoutOrderBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/lib/src/model/payout_order.g.dart b/lib/src/model/payout_order.g.dart new file mode 100644 index 0000000..0f0eeb3 --- /dev/null +++ b/lib/src/model/payout_order.g.dart @@ -0,0 +1,203 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'payout_order.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$PayoutOrder extends PayoutOrder { + @override + final BuiltList allowedPayoutMethods; + @override + final int amount; + @override + final String currency; + @override + final CustomerInfoJustCustomerId customerInfo; + @override + final BuiltMap? metadata; + @override + final Payout payout; + @override + final String reason; + + factory _$PayoutOrder([void Function(PayoutOrderBuilder)? updates]) => + (new PayoutOrderBuilder()..update(updates))._build(); + + _$PayoutOrder._( + {required this.allowedPayoutMethods, + required this.amount, + required this.currency, + required this.customerInfo, + this.metadata, + required this.payout, + required this.reason}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + allowedPayoutMethods, r'PayoutOrder', 'allowedPayoutMethods'); + BuiltValueNullFieldError.checkNotNull(amount, r'PayoutOrder', 'amount'); + BuiltValueNullFieldError.checkNotNull(currency, r'PayoutOrder', 'currency'); + BuiltValueNullFieldError.checkNotNull( + customerInfo, r'PayoutOrder', 'customerInfo'); + BuiltValueNullFieldError.checkNotNull(payout, r'PayoutOrder', 'payout'); + BuiltValueNullFieldError.checkNotNull(reason, r'PayoutOrder', 'reason'); + } + + @override + PayoutOrder rebuild(void Function(PayoutOrderBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + PayoutOrderBuilder toBuilder() => new PayoutOrderBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is PayoutOrder && + allowedPayoutMethods == other.allowedPayoutMethods && + amount == other.amount && + currency == other.currency && + customerInfo == other.customerInfo && + metadata == other.metadata && + payout == other.payout && + reason == other.reason; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, allowedPayoutMethods.hashCode); + _$hash = $jc(_$hash, amount.hashCode); + _$hash = $jc(_$hash, currency.hashCode); + _$hash = $jc(_$hash, customerInfo.hashCode); + _$hash = $jc(_$hash, metadata.hashCode); + _$hash = $jc(_$hash, payout.hashCode); + _$hash = $jc(_$hash, reason.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'PayoutOrder') + ..add('allowedPayoutMethods', allowedPayoutMethods) + ..add('amount', amount) + ..add('currency', currency) + ..add('customerInfo', customerInfo) + ..add('metadata', metadata) + ..add('payout', payout) + ..add('reason', reason)) + .toString(); + } +} + +class PayoutOrderBuilder implements Builder { + _$PayoutOrder? _$v; + + ListBuilder? _allowedPayoutMethods; + ListBuilder get allowedPayoutMethods => + _$this._allowedPayoutMethods ??= new ListBuilder(); + set allowedPayoutMethods(ListBuilder? allowedPayoutMethods) => + _$this._allowedPayoutMethods = allowedPayoutMethods; + + int? _amount; + int? get amount => _$this._amount; + set amount(int? amount) => _$this._amount = amount; + + String? _currency; + String? get currency => _$this._currency; + set currency(String? currency) => _$this._currency = currency; + + CustomerInfoJustCustomerIdBuilder? _customerInfo; + CustomerInfoJustCustomerIdBuilder get customerInfo => + _$this._customerInfo ??= new CustomerInfoJustCustomerIdBuilder(); + set customerInfo(CustomerInfoJustCustomerIdBuilder? customerInfo) => + _$this._customerInfo = customerInfo; + + MapBuilder? _metadata; + MapBuilder get metadata => + _$this._metadata ??= new MapBuilder(); + set metadata(MapBuilder? metadata) => + _$this._metadata = metadata; + + PayoutBuilder? _payout; + PayoutBuilder get payout => _$this._payout ??= new PayoutBuilder(); + set payout(PayoutBuilder? payout) => _$this._payout = payout; + + String? _reason; + String? get reason => _$this._reason; + set reason(String? reason) => _$this._reason = reason; + + PayoutOrderBuilder() { + PayoutOrder._defaults(this); + } + + PayoutOrderBuilder get _$this { + final $v = _$v; + if ($v != null) { + _allowedPayoutMethods = $v.allowedPayoutMethods.toBuilder(); + _amount = $v.amount; + _currency = $v.currency; + _customerInfo = $v.customerInfo.toBuilder(); + _metadata = $v.metadata?.toBuilder(); + _payout = $v.payout.toBuilder(); + _reason = $v.reason; + _$v = null; + } + return this; + } + + @override + void replace(PayoutOrder other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$PayoutOrder; + } + + @override + void update(void Function(PayoutOrderBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + PayoutOrder build() => _build(); + + _$PayoutOrder _build() { + _$PayoutOrder _$result; + try { + _$result = _$v ?? + new _$PayoutOrder._( + allowedPayoutMethods: allowedPayoutMethods.build(), + amount: BuiltValueNullFieldError.checkNotNull( + amount, r'PayoutOrder', 'amount'), + currency: BuiltValueNullFieldError.checkNotNull( + currency, r'PayoutOrder', 'currency'), + customerInfo: customerInfo.build(), + metadata: _metadata?.build(), + payout: payout.build(), + reason: BuiltValueNullFieldError.checkNotNull( + reason, r'PayoutOrder', 'reason')); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'allowedPayoutMethods'; + allowedPayoutMethods.build(); + + _$failedField = 'customerInfo'; + customerInfo.build(); + _$failedField = 'metadata'; + _metadata?.build(); + _$failedField = 'payout'; + payout.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'PayoutOrder', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/lib/src/model/payout_order_payouts_item.dart b/lib/src/model/payout_order_payouts_item.dart new file mode 100644 index 0000000..6368bd6 --- /dev/null +++ b/lib/src/model/payout_order_payouts_item.dart @@ -0,0 +1,232 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'payout_order_payouts_item.g.dart'; + +/// PayoutOrderPayoutsItem +/// +/// Properties: +/// * [amount] - The amount of the payout. +/// * [currency] - The currency in which the payout is made. +/// * [expiresAt] - The expiration date of the payout. +/// * [id] - The id of the payout. +/// * [livemode] - The live mode of the payout. +/// * [object] - The object of the payout. +/// * [payoutOrderId] - The id of the payout order. +/// * [status] - The status of the payout. +@BuiltValue() +abstract class PayoutOrderPayoutsItem implements Built { + /// The amount of the payout. + @BuiltValueField(wireName: r'amount') + int get amount; + + /// The currency in which the payout is made. + @BuiltValueField(wireName: r'currency') + String get currency; + + /// The expiration date of the payout. + @BuiltValueField(wireName: r'expires_at') + int? get expiresAt; + + /// The id of the payout. + @BuiltValueField(wireName: r'id') + String get id; + + /// The live mode of the payout. + @BuiltValueField(wireName: r'livemode') + bool get livemode; + + /// The object of the payout. + @BuiltValueField(wireName: r'object') + String get object; + + /// The id of the payout order. + @BuiltValueField(wireName: r'payout_order_id') + String? get payoutOrderId; + + /// The status of the payout. + @BuiltValueField(wireName: r'status') + String? get status; + + PayoutOrderPayoutsItem._(); + + factory PayoutOrderPayoutsItem([void updates(PayoutOrderPayoutsItemBuilder b)]) = _$PayoutOrderPayoutsItem; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PayoutOrderPayoutsItemBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PayoutOrderPayoutsItemSerializer(); +} + +class _$PayoutOrderPayoutsItemSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [PayoutOrderPayoutsItem, _$PayoutOrderPayoutsItem]; + + @override + final String wireName = r'PayoutOrderPayoutsItem'; + + Iterable _serializeProperties( + Serializers serializers, + PayoutOrderPayoutsItem object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'amount'; + yield serializers.serialize( + object.amount, + specifiedType: const FullType(int), + ); + yield r'currency'; + yield serializers.serialize( + object.currency, + specifiedType: const FullType(String), + ); + if (object.expiresAt != null) { + yield r'expires_at'; + yield serializers.serialize( + object.expiresAt, + specifiedType: const FullType(int), + ); + } + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + yield r'livemode'; + yield serializers.serialize( + object.livemode, + specifiedType: const FullType(bool), + ); + yield r'object'; + yield serializers.serialize( + object.object, + specifiedType: const FullType(String), + ); + if (object.payoutOrderId != null) { + yield r'payout_order_id'; + yield serializers.serialize( + object.payoutOrderId, + specifiedType: const FullType(String), + ); + } + if (object.status != null) { + yield r'status'; + yield serializers.serialize( + object.status, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + PayoutOrderPayoutsItem object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PayoutOrderPayoutsItemBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'amount': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.amount = valueDes; + break; + case r'currency': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.currency = valueDes; + break; + case r'expires_at': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.expiresAt = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'livemode': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(bool), + ) as bool; + result.livemode = valueDes; + break; + case r'object': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.object = valueDes; + break; + case r'payout_order_id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.payoutOrderId = valueDes; + break; + case r'status': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.status = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + PayoutOrderPayoutsItem deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = PayoutOrderPayoutsItemBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/lib/src/model/payout_order_payouts_item.g.dart b/lib/src/model/payout_order_payouts_item.g.dart new file mode 100644 index 0000000..4697a69 --- /dev/null +++ b/lib/src/model/payout_order_payouts_item.g.dart @@ -0,0 +1,197 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'payout_order_payouts_item.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$PayoutOrderPayoutsItem extends PayoutOrderPayoutsItem { + @override + final int amount; + @override + final String currency; + @override + final int? expiresAt; + @override + final String id; + @override + final bool livemode; + @override + final String object; + @override + final String? payoutOrderId; + @override + final String? status; + + factory _$PayoutOrderPayoutsItem( + [void Function(PayoutOrderPayoutsItemBuilder)? updates]) => + (new PayoutOrderPayoutsItemBuilder()..update(updates))._build(); + + _$PayoutOrderPayoutsItem._( + {required this.amount, + required this.currency, + this.expiresAt, + required this.id, + required this.livemode, + required this.object, + this.payoutOrderId, + this.status}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + amount, r'PayoutOrderPayoutsItem', 'amount'); + BuiltValueNullFieldError.checkNotNull( + currency, r'PayoutOrderPayoutsItem', 'currency'); + BuiltValueNullFieldError.checkNotNull(id, r'PayoutOrderPayoutsItem', 'id'); + BuiltValueNullFieldError.checkNotNull( + livemode, r'PayoutOrderPayoutsItem', 'livemode'); + BuiltValueNullFieldError.checkNotNull( + object, r'PayoutOrderPayoutsItem', 'object'); + } + + @override + PayoutOrderPayoutsItem rebuild( + void Function(PayoutOrderPayoutsItemBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + PayoutOrderPayoutsItemBuilder toBuilder() => + new PayoutOrderPayoutsItemBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is PayoutOrderPayoutsItem && + amount == other.amount && + currency == other.currency && + expiresAt == other.expiresAt && + id == other.id && + livemode == other.livemode && + object == other.object && + payoutOrderId == other.payoutOrderId && + status == other.status; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, amount.hashCode); + _$hash = $jc(_$hash, currency.hashCode); + _$hash = $jc(_$hash, expiresAt.hashCode); + _$hash = $jc(_$hash, id.hashCode); + _$hash = $jc(_$hash, livemode.hashCode); + _$hash = $jc(_$hash, object.hashCode); + _$hash = $jc(_$hash, payoutOrderId.hashCode); + _$hash = $jc(_$hash, status.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'PayoutOrderPayoutsItem') + ..add('amount', amount) + ..add('currency', currency) + ..add('expiresAt', expiresAt) + ..add('id', id) + ..add('livemode', livemode) + ..add('object', object) + ..add('payoutOrderId', payoutOrderId) + ..add('status', status)) + .toString(); + } +} + +class PayoutOrderPayoutsItemBuilder + implements Builder { + _$PayoutOrderPayoutsItem? _$v; + + int? _amount; + int? get amount => _$this._amount; + set amount(int? amount) => _$this._amount = amount; + + String? _currency; + String? get currency => _$this._currency; + set currency(String? currency) => _$this._currency = currency; + + int? _expiresAt; + int? get expiresAt => _$this._expiresAt; + set expiresAt(int? expiresAt) => _$this._expiresAt = expiresAt; + + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; + + bool? _livemode; + bool? get livemode => _$this._livemode; + set livemode(bool? livemode) => _$this._livemode = livemode; + + String? _object; + String? get object => _$this._object; + set object(String? object) => _$this._object = object; + + String? _payoutOrderId; + String? get payoutOrderId => _$this._payoutOrderId; + set payoutOrderId(String? payoutOrderId) => + _$this._payoutOrderId = payoutOrderId; + + String? _status; + String? get status => _$this._status; + set status(String? status) => _$this._status = status; + + PayoutOrderPayoutsItemBuilder() { + PayoutOrderPayoutsItem._defaults(this); + } + + PayoutOrderPayoutsItemBuilder get _$this { + final $v = _$v; + if ($v != null) { + _amount = $v.amount; + _currency = $v.currency; + _expiresAt = $v.expiresAt; + _id = $v.id; + _livemode = $v.livemode; + _object = $v.object; + _payoutOrderId = $v.payoutOrderId; + _status = $v.status; + _$v = null; + } + return this; + } + + @override + void replace(PayoutOrderPayoutsItem other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$PayoutOrderPayoutsItem; + } + + @override + void update(void Function(PayoutOrderPayoutsItemBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + PayoutOrderPayoutsItem build() => _build(); + + _$PayoutOrderPayoutsItem _build() { + final _$result = _$v ?? + new _$PayoutOrderPayoutsItem._( + amount: BuiltValueNullFieldError.checkNotNull( + amount, r'PayoutOrderPayoutsItem', 'amount'), + currency: BuiltValueNullFieldError.checkNotNull( + currency, r'PayoutOrderPayoutsItem', 'currency'), + expiresAt: expiresAt, + id: BuiltValueNullFieldError.checkNotNull( + id, r'PayoutOrderPayoutsItem', 'id'), + livemode: BuiltValueNullFieldError.checkNotNull( + livemode, r'PayoutOrderPayoutsItem', 'livemode'), + object: BuiltValueNullFieldError.checkNotNull( + object, r'PayoutOrderPayoutsItem', 'object'), + payoutOrderId: payoutOrderId, + status: status); + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/lib/src/model/payout_order_response.dart b/lib/src/model/payout_order_response.dart new file mode 100644 index 0000000..8df3849 --- /dev/null +++ b/lib/src/model/payout_order_response.dart @@ -0,0 +1,338 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:conekta/src/model/payout_order_payouts_item.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/json_object.dart'; +import 'package:conekta/src/model/payout_order_response_customer_info.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'payout_order_response.g.dart'; + +/// payout order model response +/// +/// Properties: +/// * [allowedPayoutMethods] - The payout methods that are allowed for the payout order. +/// * [amount] - The amount of the payout order. +/// * [createdAt] - The creation date of the payout order. +/// * [currency] - The currency in which the payout order is made. +/// * [customerInfo] +/// * [expiresAt] - The expiration date of the payout order. +/// * [id] - The id of the payout order. +/// * [livemode] - The live mode of the payout order. +/// * [object] - The object of the payout order. +/// * [metadata] - The metadata of the payout order. +/// * [payouts] - The payout information of the payout order. +/// * [reason] - The reason for the payout order. +/// * [status] - The status of the payout order. +/// * [updatedAt] - The update date of the payout order. +@BuiltValue() +abstract class PayoutOrderResponse implements Built { + /// The payout methods that are allowed for the payout order. + @BuiltValueField(wireName: r'allowed_payout_methods') + BuiltList get allowedPayoutMethods; + + /// The amount of the payout order. + @BuiltValueField(wireName: r'amount') + int get amount; + + /// The creation date of the payout order. + @BuiltValueField(wireName: r'created_at') + int get createdAt; + + /// The currency in which the payout order is made. + @BuiltValueField(wireName: r'currency') + String get currency; + + @BuiltValueField(wireName: r'customer_info') + PayoutOrderResponseCustomerInfo get customerInfo; + + /// The expiration date of the payout order. + @BuiltValueField(wireName: r'expires_at') + int? get expiresAt; + + /// The id of the payout order. + @BuiltValueField(wireName: r'id') + String get id; + + /// The live mode of the payout order. + @BuiltValueField(wireName: r'livemode') + bool get livemode; + + /// The object of the payout order. + @BuiltValueField(wireName: r'object') + String get object; + + /// The metadata of the payout order. + @BuiltValueField(wireName: r'metadata') + BuiltMap? get metadata; + + /// The payout information of the payout order. + @BuiltValueField(wireName: r'payouts') + BuiltList get payouts; + + /// The reason for the payout order. + @BuiltValueField(wireName: r'reason') + String get reason; + + /// The status of the payout order. + @BuiltValueField(wireName: r'status') + String? get status; + + /// The update date of the payout order. + @BuiltValueField(wireName: r'updated_at') + int get updatedAt; + + PayoutOrderResponse._(); + + factory PayoutOrderResponse([void updates(PayoutOrderResponseBuilder b)]) = _$PayoutOrderResponse; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PayoutOrderResponseBuilder b) => b + ..currency = 'MXN'; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PayoutOrderResponseSerializer(); +} + +class _$PayoutOrderResponseSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [PayoutOrderResponse, _$PayoutOrderResponse]; + + @override + final String wireName = r'PayoutOrderResponse'; + + Iterable _serializeProperties( + Serializers serializers, + PayoutOrderResponse object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'allowed_payout_methods'; + yield serializers.serialize( + object.allowedPayoutMethods, + specifiedType: const FullType(BuiltList, [FullType(String)]), + ); + yield r'amount'; + yield serializers.serialize( + object.amount, + specifiedType: const FullType(int), + ); + yield r'created_at'; + yield serializers.serialize( + object.createdAt, + specifiedType: const FullType(int), + ); + yield r'currency'; + yield serializers.serialize( + object.currency, + specifiedType: const FullType(String), + ); + yield r'customer_info'; + yield serializers.serialize( + object.customerInfo, + specifiedType: const FullType(PayoutOrderResponseCustomerInfo), + ); + if (object.expiresAt != null) { + yield r'expires_at'; + yield serializers.serialize( + object.expiresAt, + specifiedType: const FullType(int), + ); + } + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + yield r'livemode'; + yield serializers.serialize( + object.livemode, + specifiedType: const FullType(bool), + ); + yield r'object'; + yield serializers.serialize( + object.object, + specifiedType: const FullType(String), + ); + if (object.metadata != null) { + yield r'metadata'; + yield serializers.serialize( + object.metadata, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ); + } + yield r'payouts'; + yield serializers.serialize( + object.payouts, + specifiedType: const FullType(BuiltList, [FullType(PayoutOrderPayoutsItem)]), + ); + yield r'reason'; + yield serializers.serialize( + object.reason, + specifiedType: const FullType(String), + ); + if (object.status != null) { + yield r'status'; + yield serializers.serialize( + object.status, + specifiedType: const FullType(String), + ); + } + yield r'updated_at'; + yield serializers.serialize( + object.updatedAt, + specifiedType: const FullType(int), + ); + } + + @override + Object serialize( + Serializers serializers, + PayoutOrderResponse object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PayoutOrderResponseBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'allowed_payout_methods': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(String)]), + ) as BuiltList; + result.allowedPayoutMethods.replace(valueDes); + break; + case r'amount': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.amount = valueDes; + break; + case r'created_at': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.createdAt = valueDes; + break; + case r'currency': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.currency = valueDes; + break; + case r'customer_info': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(PayoutOrderResponseCustomerInfo), + ) as PayoutOrderResponseCustomerInfo; + result.customerInfo.replace(valueDes); + break; + case r'expires_at': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.expiresAt = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'livemode': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(bool), + ) as bool; + result.livemode = valueDes; + break; + case r'object': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.object = valueDes; + break; + case r'metadata': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ) as BuiltMap; + result.metadata.replace(valueDes); + break; + case r'payouts': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(PayoutOrderPayoutsItem)]), + ) as BuiltList; + result.payouts.replace(valueDes); + break; + case r'reason': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.reason = valueDes; + break; + case r'status': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.status = valueDes; + break; + case r'updated_at': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(int), + ) as int; + result.updatedAt = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + PayoutOrderResponse deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = PayoutOrderResponseBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/lib/src/model/payout_order_response.g.dart b/lib/src/model/payout_order_response.g.dart new file mode 100644 index 0000000..4103f27 --- /dev/null +++ b/lib/src/model/payout_order_response.g.dart @@ -0,0 +1,312 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'payout_order_response.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$PayoutOrderResponse extends PayoutOrderResponse { + @override + final BuiltList allowedPayoutMethods; + @override + final int amount; + @override + final int createdAt; + @override + final String currency; + @override + final PayoutOrderResponseCustomerInfo customerInfo; + @override + final int? expiresAt; + @override + final String id; + @override + final bool livemode; + @override + final String object; + @override + final BuiltMap? metadata; + @override + final BuiltList payouts; + @override + final String reason; + @override + final String? status; + @override + final int updatedAt; + + factory _$PayoutOrderResponse( + [void Function(PayoutOrderResponseBuilder)? updates]) => + (new PayoutOrderResponseBuilder()..update(updates))._build(); + + _$PayoutOrderResponse._( + {required this.allowedPayoutMethods, + required this.amount, + required this.createdAt, + required this.currency, + required this.customerInfo, + this.expiresAt, + required this.id, + required this.livemode, + required this.object, + this.metadata, + required this.payouts, + required this.reason, + this.status, + required this.updatedAt}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + allowedPayoutMethods, r'PayoutOrderResponse', 'allowedPayoutMethods'); + BuiltValueNullFieldError.checkNotNull( + amount, r'PayoutOrderResponse', 'amount'); + BuiltValueNullFieldError.checkNotNull( + createdAt, r'PayoutOrderResponse', 'createdAt'); + BuiltValueNullFieldError.checkNotNull( + currency, r'PayoutOrderResponse', 'currency'); + BuiltValueNullFieldError.checkNotNull( + customerInfo, r'PayoutOrderResponse', 'customerInfo'); + BuiltValueNullFieldError.checkNotNull(id, r'PayoutOrderResponse', 'id'); + BuiltValueNullFieldError.checkNotNull( + livemode, r'PayoutOrderResponse', 'livemode'); + BuiltValueNullFieldError.checkNotNull( + object, r'PayoutOrderResponse', 'object'); + BuiltValueNullFieldError.checkNotNull( + payouts, r'PayoutOrderResponse', 'payouts'); + BuiltValueNullFieldError.checkNotNull( + reason, r'PayoutOrderResponse', 'reason'); + BuiltValueNullFieldError.checkNotNull( + updatedAt, r'PayoutOrderResponse', 'updatedAt'); + } + + @override + PayoutOrderResponse rebuild( + void Function(PayoutOrderResponseBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + PayoutOrderResponseBuilder toBuilder() => + new PayoutOrderResponseBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is PayoutOrderResponse && + allowedPayoutMethods == other.allowedPayoutMethods && + amount == other.amount && + createdAt == other.createdAt && + currency == other.currency && + customerInfo == other.customerInfo && + expiresAt == other.expiresAt && + id == other.id && + livemode == other.livemode && + object == other.object && + metadata == other.metadata && + payouts == other.payouts && + reason == other.reason && + status == other.status && + updatedAt == other.updatedAt; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, allowedPayoutMethods.hashCode); + _$hash = $jc(_$hash, amount.hashCode); + _$hash = $jc(_$hash, createdAt.hashCode); + _$hash = $jc(_$hash, currency.hashCode); + _$hash = $jc(_$hash, customerInfo.hashCode); + _$hash = $jc(_$hash, expiresAt.hashCode); + _$hash = $jc(_$hash, id.hashCode); + _$hash = $jc(_$hash, livemode.hashCode); + _$hash = $jc(_$hash, object.hashCode); + _$hash = $jc(_$hash, metadata.hashCode); + _$hash = $jc(_$hash, payouts.hashCode); + _$hash = $jc(_$hash, reason.hashCode); + _$hash = $jc(_$hash, status.hashCode); + _$hash = $jc(_$hash, updatedAt.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'PayoutOrderResponse') + ..add('allowedPayoutMethods', allowedPayoutMethods) + ..add('amount', amount) + ..add('createdAt', createdAt) + ..add('currency', currency) + ..add('customerInfo', customerInfo) + ..add('expiresAt', expiresAt) + ..add('id', id) + ..add('livemode', livemode) + ..add('object', object) + ..add('metadata', metadata) + ..add('payouts', payouts) + ..add('reason', reason) + ..add('status', status) + ..add('updatedAt', updatedAt)) + .toString(); + } +} + +class PayoutOrderResponseBuilder + implements Builder { + _$PayoutOrderResponse? _$v; + + ListBuilder? _allowedPayoutMethods; + ListBuilder get allowedPayoutMethods => + _$this._allowedPayoutMethods ??= new ListBuilder(); + set allowedPayoutMethods(ListBuilder? allowedPayoutMethods) => + _$this._allowedPayoutMethods = allowedPayoutMethods; + + int? _amount; + int? get amount => _$this._amount; + set amount(int? amount) => _$this._amount = amount; + + int? _createdAt; + int? get createdAt => _$this._createdAt; + set createdAt(int? createdAt) => _$this._createdAt = createdAt; + + String? _currency; + String? get currency => _$this._currency; + set currency(String? currency) => _$this._currency = currency; + + PayoutOrderResponseCustomerInfoBuilder? _customerInfo; + PayoutOrderResponseCustomerInfoBuilder get customerInfo => + _$this._customerInfo ??= new PayoutOrderResponseCustomerInfoBuilder(); + set customerInfo(PayoutOrderResponseCustomerInfoBuilder? customerInfo) => + _$this._customerInfo = customerInfo; + + int? _expiresAt; + int? get expiresAt => _$this._expiresAt; + set expiresAt(int? expiresAt) => _$this._expiresAt = expiresAt; + + String? _id; + String? get id => _$this._id; + set id(String? id) => _$this._id = id; + + bool? _livemode; + bool? get livemode => _$this._livemode; + set livemode(bool? livemode) => _$this._livemode = livemode; + + String? _object; + String? get object => _$this._object; + set object(String? object) => _$this._object = object; + + MapBuilder? _metadata; + MapBuilder get metadata => + _$this._metadata ??= new MapBuilder(); + set metadata(MapBuilder? metadata) => + _$this._metadata = metadata; + + ListBuilder? _payouts; + ListBuilder get payouts => + _$this._payouts ??= new ListBuilder(); + set payouts(ListBuilder? payouts) => + _$this._payouts = payouts; + + String? _reason; + String? get reason => _$this._reason; + set reason(String? reason) => _$this._reason = reason; + + String? _status; + String? get status => _$this._status; + set status(String? status) => _$this._status = status; + + int? _updatedAt; + int? get updatedAt => _$this._updatedAt; + set updatedAt(int? updatedAt) => _$this._updatedAt = updatedAt; + + PayoutOrderResponseBuilder() { + PayoutOrderResponse._defaults(this); + } + + PayoutOrderResponseBuilder get _$this { + final $v = _$v; + if ($v != null) { + _allowedPayoutMethods = $v.allowedPayoutMethods.toBuilder(); + _amount = $v.amount; + _createdAt = $v.createdAt; + _currency = $v.currency; + _customerInfo = $v.customerInfo.toBuilder(); + _expiresAt = $v.expiresAt; + _id = $v.id; + _livemode = $v.livemode; + _object = $v.object; + _metadata = $v.metadata?.toBuilder(); + _payouts = $v.payouts.toBuilder(); + _reason = $v.reason; + _status = $v.status; + _updatedAt = $v.updatedAt; + _$v = null; + } + return this; + } + + @override + void replace(PayoutOrderResponse other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$PayoutOrderResponse; + } + + @override + void update(void Function(PayoutOrderResponseBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + PayoutOrderResponse build() => _build(); + + _$PayoutOrderResponse _build() { + _$PayoutOrderResponse _$result; + try { + _$result = _$v ?? + new _$PayoutOrderResponse._( + allowedPayoutMethods: allowedPayoutMethods.build(), + amount: BuiltValueNullFieldError.checkNotNull( + amount, r'PayoutOrderResponse', 'amount'), + createdAt: BuiltValueNullFieldError.checkNotNull( + createdAt, r'PayoutOrderResponse', 'createdAt'), + currency: BuiltValueNullFieldError.checkNotNull( + currency, r'PayoutOrderResponse', 'currency'), + customerInfo: customerInfo.build(), + expiresAt: expiresAt, + id: BuiltValueNullFieldError.checkNotNull( + id, r'PayoutOrderResponse', 'id'), + livemode: BuiltValueNullFieldError.checkNotNull( + livemode, r'PayoutOrderResponse', 'livemode'), + object: BuiltValueNullFieldError.checkNotNull( + object, r'PayoutOrderResponse', 'object'), + metadata: _metadata?.build(), + payouts: payouts.build(), + reason: BuiltValueNullFieldError.checkNotNull( + reason, r'PayoutOrderResponse', 'reason'), + status: status, + updatedAt: BuiltValueNullFieldError.checkNotNull( + updatedAt, r'PayoutOrderResponse', 'updatedAt')); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'allowedPayoutMethods'; + allowedPayoutMethods.build(); + + _$failedField = 'customerInfo'; + customerInfo.build(); + + _$failedField = 'metadata'; + _metadata?.build(); + _$failedField = 'payouts'; + payouts.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'PayoutOrderResponse', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/lib/src/model/payout_order_response_customer_info.dart b/lib/src/model/payout_order_response_customer_info.dart new file mode 100644 index 0000000..0864102 --- /dev/null +++ b/lib/src/model/payout_order_response_customer_info.dart @@ -0,0 +1,200 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:conekta/src/model/order_customer_info_response.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'payout_order_response_customer_info.g.dart'; + +/// The customer information of the payout order. +/// +/// Properties: +/// * [customerCustomReference] - Custom reference +/// * [name] +/// * [email] +/// * [phone] +/// * [corporate] +/// * [object] +/// * [id] - The id of the customer. +@BuiltValue() +abstract class PayoutOrderResponseCustomerInfo implements OrderCustomerInfoResponse, Built { + /// The id of the customer. + @BuiltValueField(wireName: r'id') + String get id; + + PayoutOrderResponseCustomerInfo._(); + + factory PayoutOrderResponseCustomerInfo([void updates(PayoutOrderResponseCustomerInfoBuilder b)]) = _$PayoutOrderResponseCustomerInfo; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PayoutOrderResponseCustomerInfoBuilder b) => b + ..corporate = false; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PayoutOrderResponseCustomerInfoSerializer(); +} + +class _$PayoutOrderResponseCustomerInfoSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [PayoutOrderResponseCustomerInfo, _$PayoutOrderResponseCustomerInfo]; + + @override + final String wireName = r'PayoutOrderResponseCustomerInfo'; + + Iterable _serializeProperties( + Serializers serializers, + PayoutOrderResponseCustomerInfo object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + if (object.customerCustomReference != null) { + yield r'customer_custom_reference'; + yield serializers.serialize( + object.customerCustomReference, + specifiedType: const FullType.nullable(String), + ); + } + if (object.phone != null) { + yield r'phone'; + yield serializers.serialize( + object.phone, + specifiedType: const FullType(String), + ); + } + if (object.corporate != null) { + yield r'corporate'; + yield serializers.serialize( + object.corporate, + specifiedType: const FullType(bool), + ); + } + if (object.name != null) { + yield r'name'; + yield serializers.serialize( + object.name, + specifiedType: const FullType(String), + ); + } + yield r'id'; + yield serializers.serialize( + object.id, + specifiedType: const FullType(String), + ); + if (object.email != null) { + yield r'email'; + yield serializers.serialize( + object.email, + specifiedType: const FullType(String), + ); + } + if (object.object != null) { + yield r'object'; + yield serializers.serialize( + object.object, + specifiedType: const FullType(String), + ); + } + } + + @override + Object serialize( + Serializers serializers, + PayoutOrderResponseCustomerInfo object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PayoutOrderResponseCustomerInfoBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'customer_custom_reference': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(String), + ) as String?; + if (valueDes == null) continue; + result.customerCustomReference = valueDes; + break; + case r'phone': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.phone = valueDes; + break; + case r'corporate': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(bool), + ) as bool; + result.corporate = valueDes; + break; + case r'name': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.name = valueDes; + break; + case r'id': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.id = valueDes; + break; + case r'email': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.email = valueDes; + break; + case r'object': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.object = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + PayoutOrderResponseCustomerInfo deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = PayoutOrderResponseCustomerInfoBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/lib/src/model/payout_order_response_customer_info.g.dart b/lib/src/model/payout_order_response_customer_info.g.dart new file mode 100644 index 0000000..23b788c --- /dev/null +++ b/lib/src/model/payout_order_response_customer_info.g.dart @@ -0,0 +1,178 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'payout_order_response_customer_info.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$PayoutOrderResponseCustomerInfo + extends PayoutOrderResponseCustomerInfo { + @override + final String id; + @override + final String? customerCustomReference; + @override + final String? name; + @override + final String? email; + @override + final String? phone; + @override + final bool? corporate; + @override + final String? object; + + factory _$PayoutOrderResponseCustomerInfo( + [void Function(PayoutOrderResponseCustomerInfoBuilder)? updates]) => + (new PayoutOrderResponseCustomerInfoBuilder()..update(updates))._build(); + + _$PayoutOrderResponseCustomerInfo._( + {required this.id, + this.customerCustomReference, + this.name, + this.email, + this.phone, + this.corporate, + this.object}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + id, r'PayoutOrderResponseCustomerInfo', 'id'); + } + + @override + PayoutOrderResponseCustomerInfo rebuild( + void Function(PayoutOrderResponseCustomerInfoBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + PayoutOrderResponseCustomerInfoBuilder toBuilder() => + new PayoutOrderResponseCustomerInfoBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is PayoutOrderResponseCustomerInfo && + id == other.id && + customerCustomReference == other.customerCustomReference && + name == other.name && + email == other.email && + phone == other.phone && + corporate == other.corporate && + object == other.object; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, id.hashCode); + _$hash = $jc(_$hash, customerCustomReference.hashCode); + _$hash = $jc(_$hash, name.hashCode); + _$hash = $jc(_$hash, email.hashCode); + _$hash = $jc(_$hash, phone.hashCode); + _$hash = $jc(_$hash, corporate.hashCode); + _$hash = $jc(_$hash, object.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'PayoutOrderResponseCustomerInfo') + ..add('id', id) + ..add('customerCustomReference', customerCustomReference) + ..add('name', name) + ..add('email', email) + ..add('phone', phone) + ..add('corporate', corporate) + ..add('object', object)) + .toString(); + } +} + +class PayoutOrderResponseCustomerInfoBuilder + implements + Builder, + OrderCustomerInfoResponseBuilder { + _$PayoutOrderResponseCustomerInfo? _$v; + + String? _id; + String? get id => _$this._id; + set id(covariant String? id) => _$this._id = id; + + String? _customerCustomReference; + String? get customerCustomReference => _$this._customerCustomReference; + set customerCustomReference(covariant String? customerCustomReference) => + _$this._customerCustomReference = customerCustomReference; + + String? _name; + String? get name => _$this._name; + set name(covariant String? name) => _$this._name = name; + + String? _email; + String? get email => _$this._email; + set email(covariant String? email) => _$this._email = email; + + String? _phone; + String? get phone => _$this._phone; + set phone(covariant String? phone) => _$this._phone = phone; + + bool? _corporate; + bool? get corporate => _$this._corporate; + set corporate(covariant bool? corporate) => _$this._corporate = corporate; + + String? _object; + String? get object => _$this._object; + set object(covariant String? object) => _$this._object = object; + + PayoutOrderResponseCustomerInfoBuilder() { + PayoutOrderResponseCustomerInfo._defaults(this); + } + + PayoutOrderResponseCustomerInfoBuilder get _$this { + final $v = _$v; + if ($v != null) { + _id = $v.id; + _customerCustomReference = $v.customerCustomReference; + _name = $v.name; + _email = $v.email; + _phone = $v.phone; + _corporate = $v.corporate; + _object = $v.object; + _$v = null; + } + return this; + } + + @override + void replace(covariant PayoutOrderResponseCustomerInfo other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$PayoutOrderResponseCustomerInfo; + } + + @override + void update(void Function(PayoutOrderResponseCustomerInfoBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + PayoutOrderResponseCustomerInfo build() => _build(); + + _$PayoutOrderResponseCustomerInfo _build() { + final _$result = _$v ?? + new _$PayoutOrderResponseCustomerInfo._( + id: BuiltValueNullFieldError.checkNotNull( + id, r'PayoutOrderResponseCustomerInfo', 'id'), + customerCustomReference: customerCustomReference, + name: name, + email: email, + phone: phone, + corporate: corporate, + object: object); + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/lib/src/model/payout_orders_response.dart b/lib/src/model/payout_orders_response.dart new file mode 100644 index 0000000..86ada3b --- /dev/null +++ b/lib/src/model/payout_orders_response.dart @@ -0,0 +1,170 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:conekta/src/model/pagination.dart'; +import 'package:built_collection/built_collection.dart'; +import 'package:conekta/src/model/page.dart'; +import 'package:conekta/src/model/payout_order_response.dart'; +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'payout_orders_response.g.dart'; + +/// PayoutOrdersResponse +/// +/// Properties: +/// * [hasMore] - Indicates if there are more pages to be requested +/// * [object] - Object type, in this case is list +/// * [nextPageUrl] - URL of the next page. +/// * [previousPageUrl] - Url of the previous page. +/// * [data] +@BuiltValue() +abstract class PayoutOrdersResponse implements Page, Pagination, Built { + @BuiltValueField(wireName: r'data') + BuiltList? get data; + + PayoutOrdersResponse._(); + + factory PayoutOrdersResponse([void updates(PayoutOrdersResponseBuilder b)]) = _$PayoutOrdersResponse; + + @BuiltValueHook(initializeBuilder: true) + static void _defaults(PayoutOrdersResponseBuilder b) => b; + + @BuiltValueSerializer(custom: true) + static Serializer get serializer => _$PayoutOrdersResponseSerializer(); +} + +class _$PayoutOrdersResponseSerializer implements PrimitiveSerializer { + @override + final Iterable types = const [PayoutOrdersResponse, _$PayoutOrdersResponse]; + + @override + final String wireName = r'PayoutOrdersResponse'; + + Iterable _serializeProperties( + Serializers serializers, + PayoutOrdersResponse object, { + FullType specifiedType = FullType.unspecified, + }) sync* { + yield r'has_more'; + yield serializers.serialize( + object.hasMore, + specifiedType: const FullType(bool), + ); + if (object.nextPageUrl != null) { + yield r'next_page_url'; + yield serializers.serialize( + object.nextPageUrl, + specifiedType: const FullType.nullable(String), + ); + } + if (object.data != null) { + yield r'data'; + yield serializers.serialize( + object.data, + specifiedType: const FullType(BuiltList, [FullType(PayoutOrderResponse)]), + ); + } + if (object.previousPageUrl != null) { + yield r'previous_page_url'; + yield serializers.serialize( + object.previousPageUrl, + specifiedType: const FullType.nullable(String), + ); + } + yield r'object'; + yield serializers.serialize( + object.object, + specifiedType: const FullType(String), + ); + } + + @override + Object serialize( + Serializers serializers, + PayoutOrdersResponse object, { + FullType specifiedType = FullType.unspecified, + }) { + return _serializeProperties(serializers, object, specifiedType: specifiedType).toList(); + } + + void _deserializeProperties( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + required List serializedList, + required PayoutOrdersResponseBuilder result, + required List unhandled, + }) { + for (var i = 0; i < serializedList.length; i += 2) { + final key = serializedList[i] as String; + final value = serializedList[i + 1]; + switch (key) { + case r'has_more': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(bool), + ) as bool; + result.hasMore = valueDes; + break; + case r'next_page_url': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(String), + ) as String?; + if (valueDes == null) continue; + result.nextPageUrl = valueDes; + break; + case r'data': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(BuiltList, [FullType(PayoutOrderResponse)]), + ) as BuiltList; + result.data.replace(valueDes); + break; + case r'previous_page_url': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType.nullable(String), + ) as String?; + if (valueDes == null) continue; + result.previousPageUrl = valueDes; + break; + case r'object': + final valueDes = serializers.deserialize( + value, + specifiedType: const FullType(String), + ) as String; + result.object = valueDes; + break; + default: + unhandled.add(key); + unhandled.add(value); + break; + } + } + } + + @override + PayoutOrdersResponse deserialize( + Serializers serializers, + Object serialized, { + FullType specifiedType = FullType.unspecified, + }) { + final result = PayoutOrdersResponseBuilder(); + final serializedList = (serialized as Iterable).toList(); + final unhandled = []; + _deserializeProperties( + serializers, + serialized, + specifiedType: specifiedType, + serializedList: serializedList, + unhandled: unhandled, + result: result, + ); + return result.build(); + } +} + diff --git a/lib/src/model/payout_orders_response.g.dart b/lib/src/model/payout_orders_response.g.dart new file mode 100644 index 0000000..b096b2c --- /dev/null +++ b/lib/src/model/payout_orders_response.g.dart @@ -0,0 +1,173 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'payout_orders_response.dart'; + +// ************************************************************************** +// BuiltValueGenerator +// ************************************************************************** + +class _$PayoutOrdersResponse extends PayoutOrdersResponse { + @override + final BuiltList? data; + @override + final String? nextPageUrl; + @override + final String? previousPageUrl; + @override + final bool hasMore; + @override + final String object; + + factory _$PayoutOrdersResponse( + [void Function(PayoutOrdersResponseBuilder)? updates]) => + (new PayoutOrdersResponseBuilder()..update(updates))._build(); + + _$PayoutOrdersResponse._( + {this.data, + this.nextPageUrl, + this.previousPageUrl, + required this.hasMore, + required this.object}) + : super._() { + BuiltValueNullFieldError.checkNotNull( + hasMore, r'PayoutOrdersResponse', 'hasMore'); + BuiltValueNullFieldError.checkNotNull( + object, r'PayoutOrdersResponse', 'object'); + } + + @override + PayoutOrdersResponse rebuild( + void Function(PayoutOrdersResponseBuilder) updates) => + (toBuilder()..update(updates)).build(); + + @override + PayoutOrdersResponseBuilder toBuilder() => + new PayoutOrdersResponseBuilder()..replace(this); + + @override + bool operator ==(Object other) { + if (identical(other, this)) return true; + return other is PayoutOrdersResponse && + data == other.data && + nextPageUrl == other.nextPageUrl && + previousPageUrl == other.previousPageUrl && + hasMore == other.hasMore && + object == other.object; + } + + @override + int get hashCode { + var _$hash = 0; + _$hash = $jc(_$hash, data.hashCode); + _$hash = $jc(_$hash, nextPageUrl.hashCode); + _$hash = $jc(_$hash, previousPageUrl.hashCode); + _$hash = $jc(_$hash, hasMore.hashCode); + _$hash = $jc(_$hash, object.hashCode); + _$hash = $jf(_$hash); + return _$hash; + } + + @override + String toString() { + return (newBuiltValueToStringHelper(r'PayoutOrdersResponse') + ..add('data', data) + ..add('nextPageUrl', nextPageUrl) + ..add('previousPageUrl', previousPageUrl) + ..add('hasMore', hasMore) + ..add('object', object)) + .toString(); + } +} + +class PayoutOrdersResponseBuilder + implements + Builder, + PageBuilder, + PaginationBuilder { + _$PayoutOrdersResponse? _$v; + + ListBuilder? _data; + ListBuilder get data => + _$this._data ??= new ListBuilder(); + set data(covariant ListBuilder? data) => + _$this._data = data; + + String? _nextPageUrl; + String? get nextPageUrl => _$this._nextPageUrl; + set nextPageUrl(covariant String? nextPageUrl) => + _$this._nextPageUrl = nextPageUrl; + + String? _previousPageUrl; + String? get previousPageUrl => _$this._previousPageUrl; + set previousPageUrl(covariant String? previousPageUrl) => + _$this._previousPageUrl = previousPageUrl; + + bool? _hasMore; + bool? get hasMore => _$this._hasMore; + set hasMore(covariant bool? hasMore) => _$this._hasMore = hasMore; + + String? _object; + String? get object => _$this._object; + set object(covariant String? object) => _$this._object = object; + + PayoutOrdersResponseBuilder() { + PayoutOrdersResponse._defaults(this); + } + + PayoutOrdersResponseBuilder get _$this { + final $v = _$v; + if ($v != null) { + _data = $v.data?.toBuilder(); + _nextPageUrl = $v.nextPageUrl; + _previousPageUrl = $v.previousPageUrl; + _hasMore = $v.hasMore; + _object = $v.object; + _$v = null; + } + return this; + } + + @override +// ignore: override_on_non_overriding_method + void replace(covariant PayoutOrdersResponse other) { + ArgumentError.checkNotNull(other, 'other'); + _$v = other as _$PayoutOrdersResponse; + } + + @override + void update(void Function(PayoutOrdersResponseBuilder)? updates) { + if (updates != null) updates(this); + } + + @override + PayoutOrdersResponse build() => _build(); + + _$PayoutOrdersResponse _build() { + _$PayoutOrdersResponse _$result; + try { + _$result = _$v ?? + new _$PayoutOrdersResponse._( + data: _data?.build(), + nextPageUrl: nextPageUrl, + previousPageUrl: previousPageUrl, + hasMore: BuiltValueNullFieldError.checkNotNull( + hasMore, r'PayoutOrdersResponse', 'hasMore'), + object: BuiltValueNullFieldError.checkNotNull( + object, r'PayoutOrdersResponse', 'object')); + } catch (_) { + late String _$failedField; + try { + _$failedField = 'data'; + _data?.build(); + } catch (e) { + throw new BuiltValueNestedFieldError( + r'PayoutOrdersResponse', _$failedField, e.toString()); + } + rethrow; + } + replace(_$result); + return _$result; + } +} + +// ignore_for_file: deprecated_member_use_from_same_package,type=lint diff --git a/lib/src/model/product.dart b/lib/src/model/product.dart index 49c23bc..1bf88de 100644 --- a/lib/src/model/product.dart +++ b/lib/src/model/product.dart @@ -37,7 +37,7 @@ abstract class Product { /// It is a key/value hash that can hold custom fields. Maximum 100 elements and allows special characters. @BuiltValueField(wireName: r'metadata') - BuiltMap? get metadata; + BuiltMap? get metadata; /// The name of the item. It will be displayed in the order. @BuiltValueField(wireName: r'name') @@ -100,7 +100,7 @@ class _$ProductSerializer implements PrimitiveSerializer { yield r'metadata'; yield serializers.serialize( object.metadata, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(String)]), + specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), ); } yield r'name'; @@ -219,8 +219,8 @@ class _$$ProductSerializer implements PrimitiveSerializer<$Product> { case r'metadata': final valueDes = serializers.deserialize( value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(String)]), - ) as BuiltMap; + specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ) as BuiltMap; result.metadata.replace(valueDes); break; case r'name': diff --git a/lib/src/model/product.g.dart b/lib/src/model/product.g.dart index 68f1fbc..dbf911a 100644 --- a/lib/src/model/product.g.dart +++ b/lib/src/model/product.g.dart @@ -18,8 +18,8 @@ abstract class ProductBuilder { String? get description; set description(String? description); - MapBuilder get metadata; - set metadata(MapBuilder? metadata); + MapBuilder get metadata; + set metadata(MapBuilder? metadata); String? get name; set name(String? name); @@ -45,7 +45,7 @@ class _$$Product extends $Product { @override final String? description; @override - final BuiltMap? metadata; + final BuiltMap? metadata; @override final String name; @override @@ -149,10 +149,10 @@ class $ProductBuilder set description(covariant String? description) => _$this._description = description; - MapBuilder? _metadata; - MapBuilder get metadata => - _$this._metadata ??= new MapBuilder(); - set metadata(covariant MapBuilder? metadata) => + MapBuilder? _metadata; + MapBuilder get metadata => + _$this._metadata ??= new MapBuilder(); + set metadata(covariant MapBuilder? metadata) => _$this._metadata = metadata; String? _name; diff --git a/lib/src/model/product_data_response.dart b/lib/src/model/product_data_response.dart index 824ac04..3e305f4 100644 --- a/lib/src/model/product_data_response.dart +++ b/lib/src/model/product_data_response.dart @@ -42,7 +42,8 @@ abstract class ProductDataResponse implements Product, Built b; + static void _defaults(ProductDataResponseBuilder b) => b + ..metadata = MapBuilder(); @BuiltValueSerializer(custom: true) static Serializer get serializer => _$ProductDataResponseSerializer(); @@ -69,7 +70,7 @@ class _$ProductDataResponseSerializer implements PrimitiveSerializer; + specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ) as BuiltMap; result.metadata.replace(valueDes); break; case r'quantity': diff --git a/lib/src/model/product_data_response.g.dart b/lib/src/model/product_data_response.g.dart index 16e8e1f..3877e66 100644 --- a/lib/src/model/product_data_response.g.dart +++ b/lib/src/model/product_data_response.g.dart @@ -20,7 +20,7 @@ class _$ProductDataResponse extends ProductDataResponse { @override final String? description; @override - final BuiltMap? metadata; + final BuiltMap? metadata; @override final String name; @override @@ -155,10 +155,10 @@ class ProductDataResponseBuilder set description(covariant String? description) => _$this._description = description; - MapBuilder? _metadata; - MapBuilder get metadata => - _$this._metadata ??= new MapBuilder(); - set metadata(covariant MapBuilder? metadata) => + MapBuilder? _metadata; + MapBuilder get metadata => + _$this._metadata ??= new MapBuilder(); + set metadata(covariant MapBuilder? metadata) => _$this._metadata = metadata; String? _name; diff --git a/lib/src/model/product_order_response.dart b/lib/src/model/product_order_response.dart index 6bdd8f6..05919db 100644 --- a/lib/src/model/product_order_response.dart +++ b/lib/src/model/product_order_response.dart @@ -42,7 +42,8 @@ abstract class ProductOrderResponse implements Product, Built b; + static void _defaults(ProductOrderResponseBuilder b) => b + ..metadata = MapBuilder(); @BuiltValueSerializer(custom: true) static Serializer get serializer => _$ProductOrderResponseSerializer(); @@ -69,7 +70,7 @@ class _$ProductOrderResponseSerializer implements PrimitiveSerializer; + specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]), + ) as BuiltMap; result.metadata.replace(valueDes); break; case r'quantity': diff --git a/lib/src/model/product_order_response.g.dart b/lib/src/model/product_order_response.g.dart index d2a8c0d..5d2bfa5 100644 --- a/lib/src/model/product_order_response.g.dart +++ b/lib/src/model/product_order_response.g.dart @@ -20,7 +20,7 @@ class _$ProductOrderResponse extends ProductOrderResponse { @override final String? description; @override - final BuiltMap? metadata; + final BuiltMap? metadata; @override final String name; @override @@ -156,10 +156,10 @@ class ProductOrderResponseBuilder set description(covariant String? description) => _$this._description = description; - MapBuilder? _metadata; - MapBuilder get metadata => - _$this._metadata ??= new MapBuilder(); - set metadata(covariant MapBuilder? metadata) => + MapBuilder? _metadata; + MapBuilder get metadata => + _$this._metadata ??= new MapBuilder(); + set metadata(covariant MapBuilder? metadata) => _$this._metadata = metadata; String? _name; diff --git a/lib/src/serializers.dart b/lib/src/serializers.dart index 97f0b09..010ebc2 100644 --- a/lib/src/serializers.dart +++ b/lib/src/serializers.dart @@ -136,6 +136,13 @@ import 'package:conekta/src/model/payment_method_cash_response.dart'; import 'package:conekta/src/model/payment_method_response.dart'; import 'package:conekta/src/model/payment_method_spei_recurrent.dart'; import 'package:conekta/src/model/payment_method_spei_request.dart'; +import 'package:conekta/src/model/payout.dart'; +import 'package:conekta/src/model/payout_method.dart'; +import 'package:conekta/src/model/payout_order.dart'; +import 'package:conekta/src/model/payout_order_payouts_item.dart'; +import 'package:conekta/src/model/payout_order_response.dart'; +import 'package:conekta/src/model/payout_order_response_customer_info.dart'; +import 'package:conekta/src/model/payout_orders_response.dart'; import 'package:conekta/src/model/plan_request.dart'; import 'package:conekta/src/model/plan_response.dart'; import 'package:conekta/src/model/plan_update_request.dart'; @@ -306,6 +313,13 @@ part 'serializers.g.dart'; PaymentMethodResponse,$PaymentMethodResponse, PaymentMethodSpeiRecurrent, PaymentMethodSpeiRequest, + Payout, + PayoutMethod, + PayoutOrder, + PayoutOrderPayoutsItem, + PayoutOrderResponse, + PayoutOrderResponseCustomerInfo, + PayoutOrdersResponse, PlanRequest, PlanResponse, PlanUpdateRequest, diff --git a/lib/src/serializers.g.dart b/lib/src/serializers.g.dart index e210333..7eeda90 100644 --- a/lib/src/serializers.g.dart +++ b/lib/src/serializers.g.dart @@ -136,6 +136,13 @@ Serializers _$serializers = (new Serializers().toBuilder() ..add(PaymentMethodCashResponse.serializer) ..add(PaymentMethodSpeiRecurrent.serializer) ..add(PaymentMethodSpeiRequest.serializer) + ..add(Payout.serializer) + ..add(PayoutMethod.serializer) + ..add(PayoutOrder.serializer) + ..add(PayoutOrderPayoutsItem.serializer) + ..add(PayoutOrderResponse.serializer) + ..add(PayoutOrderResponseCustomerInfo.serializer) + ..add(PayoutOrdersResponse.serializer) ..add(PlanRequest.serializer) ..add(PlanRequestIntervalEnum.serializer) ..add(PlanResponse.serializer) @@ -355,6 +362,10 @@ Serializers _$serializers = (new Serializers().toBuilder() ..addBuilderFactory( const FullType(BuiltList, const [const FullType(OrderResponse)]), () => new ListBuilder()) + ..addBuilderFactory( + const FullType( + BuiltList, const [const FullType(PayoutOrderResponse)]), + () => new ListBuilder()) ..addBuilderFactory( const FullType(BuiltList, const [const FullType(PlanResponse)]), () => new ListBuilder()) @@ -437,6 +448,28 @@ Serializers _$serializers = (new Serializers().toBuilder() ..addBuilderFactory( const FullType(BuiltList, const [const FullType(int)]), () => new ListBuilder()) + ..addBuilderFactory( + const FullType(BuiltList, const [const FullType(String)]), + () => new ListBuilder()) + ..addBuilderFactory( + const FullType(BuiltMap, const [ + const FullType(String), + const FullType.nullable(JsonObject) + ]), + () => new MapBuilder()) + ..addBuilderFactory( + const FullType(BuiltList, const [const FullType(String)]), + () => new ListBuilder()) + ..addBuilderFactory( + const FullType(BuiltMap, const [ + const FullType(String), + const FullType.nullable(JsonObject) + ]), + () => new MapBuilder()) + ..addBuilderFactory( + const FullType( + BuiltList, const [const FullType(PayoutOrderPayoutsItem)]), + () => new ListBuilder()) ..addBuilderFactory( const FullType( BuiltList, const [const FullType(TransactionResponse)]), @@ -602,6 +635,10 @@ Serializers _$serializers = (new Serializers().toBuilder() const FullType( BuiltMap, const [const FullType(String), const FullType(String)]), () => new MapBuilder()) + ..addBuilderFactory( + const FullType( + BuiltMap, const [const FullType(String), const FullType(String)]), + () => new MapBuilder()) ..addBuilderFactory( const FullType(BuiltList, const [const FullType(String)]), () => new ListBuilder()) @@ -615,6 +652,10 @@ Serializers _$serializers = (new Serializers().toBuilder() const FullType( BuiltMap, const [const FullType(String), const FullType(String)]), () => new MapBuilder()) + ..addBuilderFactory( + const FullType( + BuiltMap, const [const FullType(String), const FullType(String)]), + () => new MapBuilder()) ..addBuilderFactory( const FullType(BuiltList, const [const FullType(String)]), () => new ListBuilder()) @@ -625,9 +666,11 @@ Serializers _$serializers = (new Serializers().toBuilder() ]), () => new MapBuilder()) ..addBuilderFactory( - const FullType( - BuiltMap, const [const FullType(String), const FullType(String)]), - () => new MapBuilder()) + const FullType(BuiltMap, const [ + const FullType(String), + const FullType.nullable(JsonObject) + ]), + () => new MapBuilder()) ..addBuilderFactory( const FullType(BuiltList, const [const FullType(String)]), () => new ListBuilder()) @@ -638,13 +681,11 @@ Serializers _$serializers = (new Serializers().toBuilder() ]), () => new MapBuilder()) ..addBuilderFactory( - const FullType( - BuiltMap, const [const FullType(String), const FullType(String)]), - () => new MapBuilder()) - ..addBuilderFactory( - const FullType( - BuiltMap, const [const FullType(String), const FullType(String)]), - () => new MapBuilder()) + const FullType(BuiltMap, const [ + const FullType(String), + const FullType.nullable(JsonObject) + ]), + () => new MapBuilder()) ..addBuilderFactory( const FullType(BuiltList, const [const FullType(String)]), () => new ListBuilder()) @@ -655,13 +696,11 @@ Serializers _$serializers = (new Serializers().toBuilder() ]), () => new MapBuilder()) ..addBuilderFactory( - const FullType( - BuiltMap, const [const FullType(String), const FullType(String)]), - () => new MapBuilder()) - ..addBuilderFactory( - const FullType( - BuiltMap, const [const FullType(String), const FullType(String)]), - () => new MapBuilder()) + const FullType(BuiltMap, const [ + const FullType(String), + const FullType.nullable(JsonObject) + ]), + () => new MapBuilder()) ..addBuilderFactory( const FullType(BuiltList, const [const FullType(String)]), () => new ListBuilder())) diff --git a/lib/src/utils/utils.dart b/lib/src/utils/utils.dart index fede660..908edc3 100644 --- a/lib/src/utils/utils.dart +++ b/lib/src/utils/utils.dart @@ -71,7 +71,7 @@ String getConektaClientUserAgent() { return cachedUserClient; } Map cachedData = { - "bindings_version": "6.0.4", + "bindings_version": "6.0.5", "lang": "Dart", "publisher": "conekta", "lang_version": Platform.version.split(' ')[0], diff --git a/pubspec.yaml b/pubspec.yaml index 5966156..cb5fe71 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,11 +1,11 @@ name: conekta -version: 6.0.4 +version: 6.0.5 description: A simple Conekta API wrapper, that is meant to be used on the server. homepage: https://www.github.com/conekta/conekta-dart repository: https://www.github.com/conekta/conekta-dart environment: - sdk: '>=2.18.0 <3.0.0' + sdk: '>=2.18.0 <4.0.0' dependencies: dio: '^5.2.0' diff --git a/templates/dart/pubspec.mustache b/templates/dart/pubspec.mustache index 9e4b254..2ae2595 100644 --- a/templates/dart/pubspec.mustache +++ b/templates/dart/pubspec.mustache @@ -10,7 +10,7 @@ publish_to: {{.}} {{/pubPublishTo}} environment: - sdk: '>={{#useJsonSerializable}}2.17.0{{/useJsonSerializable}}{{^useJsonSerializable}}2.18.0{{/useJsonSerializable}} <3.0.0' + sdk: '>={{#useJsonSerializable}}2.17.0{{/useJsonSerializable}}{{^useJsonSerializable}}2.18.0{{/useJsonSerializable}} <4.0.0' dependencies: dio: '^5.2.0' diff --git a/test/payout_orders_api_test.dart b/test/payout_orders_api_test.dart new file mode 100644 index 0000000..6568dd1 --- /dev/null +++ b/test/payout_orders_api_test.dart @@ -0,0 +1,38 @@ +import 'package:test/test.dart'; +import 'package:conekta/conekta.dart'; + + +/// tests for PayoutOrdersApi +void main() { + final instance = Conekta().getPayoutOrdersApi(); + + group(PayoutOrdersApi, () { + // Create payout order + // + // Create a new payout order. + // + //Future createPayoutOrder(PayoutOrder payoutOrder, { String acceptLanguage }) async + test('test createPayoutOrder', () async { + // TODO + }); + + // Get Payout Order + // + // Gets a payout Order resource that corresponds to a payout order ID. + // + //Future getPayoutOrderById(String id, { String acceptLanguage }) async + test('test getPayoutOrderById', () async { + // TODO + }); + + // Get a list of Payout Orders + // + // Get Payout order details in the form of a list + // + //Future getPayoutOrders({ String acceptLanguage, int limit, String search, String next, String previous }) async + test('test getPayoutOrders', () async { + // TODO + }); + + }); +}