From 64eacd0bdbaa4fd75ebf90392bbcb68284bb87b7 Mon Sep 17 00:00:00 2001 From: xendit-devx-bot Date: Wed, 20 Sep 2023 08:08:32 +0000 Subject: [PATCH] Generated Xendit python SDK --- .flake8 | 6 - .github/dependabot.yml | 6 + .github/workflows/generate-release-tag.yml | 27 + .github/workflows/publish.yml | 33 - .github/workflows/test.yml | 22 - .gitignore | 103 +- .openapi-generator-ignore | 23 + .openapi-generator/FILES | 200 + .openapi-generator/VERSION | 1 + .pre-commit-config.yaml | 18 - .tool-versions | 1 - LICENSE | 4 +- README.md | 3312 +---------------- docs/AddressObject.md | 18 + docs/AlternativeDisplayItem.md | 13 + docs/BadRequestError.md | 13 + docs/Balance.md | 12 + docs/BalanceApi.md | 71 + docs/Bank.md | 18 + docs/BankCode.md | 12 + docs/BillingInformation.md | 17 + docs/Capture.md | 25 + docs/CaptureList.md | 11 + docs/CaptureListResponse.md | 12 + docs/CaptureParameters.md | 12 + docs/Card.md | 14 + docs/CardChannelProperties.md | 16 + docs/CardInformation.md | 21 + docs/CardParameters.md | 13 + docs/CardParametersCardInformation.md | 16 + docs/CardVerificationResults.md | 13 + docs/CardVerificationResultsThreeDSecure.md | 15 + docs/Channel.md | 16 + docs/ChannelAccountType.md | 12 + docs/ChannelAmountLimits.md | 14 + docs/ChannelAmountLimitsAllOf.md | 14 + docs/ChannelCategory.md | 12 + docs/ChannelProperty.md | 13 + docs/ChannelPropertyAllOf.md | 14 + docs/ChannelsCategories.md | 11 + docs/CreateInvoiceRequest.md | 31 + docs/CreatePaymentMethod409Response.md | 12 + docs/CreatePaymentMethod503Response.md | 12 + docs/CreatePayoutRequest.md | 19 + docs/CreateRefund.md | 17 + docs/CreateRefund400Response.md | 12 + docs/CreateRefund403Response.md | 12 + docs/CreateRefund404Response.md | 12 + docs/CreateRefund409Response.md | 12 + docs/CreateRefund503Response.md | 12 + docs/CreateRefundDefaultResponse.md | 12 + docs/Currency.md | 11 + docs/CustomerObject.md | 19 + docs/DateRangeFilter.md | 12 + docs/DigitalPayoutChannelProperties.md | 14 + docs/DirectDebit.md | 16 + docs/DirectDebitAllOf.md | 13 + docs/DirectDebitBankAccount.md | 14 + docs/DirectDebitChannelCode.md | 12 + docs/DirectDebitChannelProperties.md | 19 + ...DirectDebitChannelPropertiesBankAccount.md | 15 + ...irectDebitChannelPropertiesBankRedirect.md | 14 + docs/DirectDebitChannelPropertiesDebitCard.md | 16 + docs/DirectDebitDebitCard.md | 14 + docs/DirectDebitParameters.md | 12 + docs/DirectDebitType.md | 11 + docs/EWallet.md | 14 + docs/EWalletAccount.md | 15 + docs/EWalletAllOf.md | 11 + docs/EWalletChannelCode.md | 12 + docs/EWalletChannelProperties.md | 17 + docs/EWalletParameters.md | 12 + docs/Error.md | 13 + docs/ErrorErrorsInner.md | 12 + docs/Ewallet.md | 12 + docs/EwalletType.md | 12 + docs/FeeResponse.md | 15 + docs/ForbiddenError.md | 13 + docs/GetAllPaymentMethods400Response.md | 12 + docs/GetAllPaymentMethods403Response.md | 12 + docs/GetAllPaymentMethods404Response.md | 12 + docs/GetAllPaymentMethodsDefaultResponse.md | 12 + docs/GetPayouts200Response.md | 13 + docs/GetPayouts200ResponseDataInner.md | 25 + docs/GetPayouts200ResponseLinks.md | 13 + docs/Invoice.md | 44 + docs/InvoiceApi.md | 335 ++ docs/InvoiceClientType.md | 12 + docs/InvoiceCurrency.md | 12 + docs/InvoiceError404ResponseDefinition.md | 13 + docs/InvoiceFee.md | 13 + docs/InvoiceItem.md | 17 + docs/InvoiceNotFoundError.md | 13 + docs/InvoicePaymentMethod.md | 12 + docs/InvoiceStatus.md | 12 + docs/LinkItem.md | 13 + docs/NotificationChannel.md | 12 + docs/NotificationPreference.md | 15 + docs/OverTheCounter.md | 15 + docs/OverTheCounterChannelCode.md | 12 + docs/OverTheCounterChannelProperties.md | 14 + docs/OverTheCounterChannelPropertiesUpdate.md | 13 + docs/OverTheCounterParameters.md | 14 + docs/OverTheCounterUpdateParameters.md | 12 + docs/Paylater.md | 13 + docs/PaylaterType.md | 12 + docs/PaymentChannel.md | 17 + docs/PaymentChannelAllOf.md | 17 + docs/PaymentChannelList.md | 13 + docs/PaymentChannelListLinksInner.md | 13 + docs/PaymentChannelListLinksInnerAllOf.md | 13 + docs/PaymentMethod.md | 32 + docs/PaymentMethodAction.md | 14 + docs/PaymentMethodApi.md | 681 ++++ docs/PaymentMethodAuthParameters.md | 11 + docs/PaymentMethodCountry.md | 11 + docs/PaymentMethodExpireParameters.md | 12 + docs/PaymentMethodList.md | 12 + docs/PaymentMethodParameters.md | 24 + docs/PaymentMethodReusability.md | 11 + docs/PaymentMethodStatus.md | 11 + docs/PaymentMethodType.md | 11 + docs/PaymentMethodUpdateParameters.md | 16 + docs/PaymentRequest.md | 33 + docs/PaymentRequestAction.md | 15 + docs/PaymentRequestApi.md | 476 +++ docs/PaymentRequestAuthParameters.md | 11 + docs/PaymentRequestBasket.md | 11 + docs/PaymentRequestBasketItem.md | 23 + docs/PaymentRequestCaptureMethod.md | 11 + docs/PaymentRequestCardVerificationResults.md | 13 + ...stCardVerificationResultsThreeDeeSecure.md | 15 + docs/PaymentRequestChannelProperties.md | 17 + docs/PaymentRequestCountry.md | 11 + docs/PaymentRequestCurrency.md | 11 + docs/PaymentRequestInitiator.md | 11 + docs/PaymentRequestListResponse.md | 12 + docs/PaymentRequestParameters.md | 24 + ...ymentRequestParametersChannelProperties.md | 18 + ...RequestParametersChannelPropertiesAllOf.md | 11 + docs/PaymentRequestShippingInformation.md | 16 + docs/PaymentRequestStatus.md | 11 + docs/Payout.md | 25 + docs/PayoutAllOf.md | 17 + docs/PayoutApi.md | 330 ++ docs/QRCode.md | 13 + docs/QRCodeChannelCode.md | 12 + docs/QRCodeChannelProperties.md | 13 + docs/QRCodeParameters.md | 12 + docs/QrCode.md | 12 + docs/QrCodeType.md | 12 + docs/ReceiptNotification.md | 14 + docs/Refund.md | 22 + docs/RefundApi.md | 264 ++ docs/RefundList.md | 12 + docs/RetailOutlet.md | 15 + docs/RetailOutletName.md | 12 + docs/ServerError.md | 12 + docs/SimulatePaymentRequest.md | 11 + docs/TokenizedCardInformation.md | 21 + docs/TransactionApi.md | 158 + docs/TransactionId.md | 12 + docs/TransactionResponse.md | 27 + docs/TransactionResponseType.md | 11 + docs/TransactionStatuses.md | 11 + docs/TransactionTypes.md | 11 + docs/TransactionsResponse.md | 14 + docs/UnauthorizedError.md | 13 + docs/ValidationError.md | 14 + docs/VirtualAccount.md | 19 + docs/VirtualAccountAllOf.md | 11 + docs/VirtualAccountAlternativeDisplay.md | 13 + docs/VirtualAccountChannelCode.md | 12 + docs/VirtualAccountChannelProperties.md | 15 + docs/VirtualAccountChannelPropertiesPatch.md | 13 + docs/VirtualAccountParameters.md | 17 + docs/VirtualAccountUpdateParameters.md | 15 + docs/header.jpg | Bin 0 -> 115092 bytes examples/balance_example.py | 45 - examples/batch_disbursement_example.py | 61 - examples/cardless_credit_example.py | 123 - examples/credit_card_example.py | 210 -- examples/direct_debit_example.py | 320 -- examples/disbursement_example.py | 140 - examples/ewallet_example.py | 312 -- examples/invoice_example.py | 127 - examples/main_example.py | 85 - examples/payment_method_example.py | 53 - examples/payment_request_example.py | 55 - examples/payout_example.py | 99 - examples/print_running_function.py | 11 - examples/qrcode_example.py | 76 - examples/recurring_payment_example.py | 173 - examples/retail_outlet_example.py | 113 - examples/virtual_account_example.py | 142 - examples/xenplatform_example.py | 105 - poetry.lock | 828 ----- pyproject.toml | 34 - pytest.ini | 3 - requirements.txt | 3 + setup.cfg | 2 + setup.py | 37 + test-requirements.txt | 1 + {examples => test}/__init__.py | 0 test/test_address_object.py | 30 + test/test_alternative_display_item.py | 30 + test/test_bad_request_error.py | 30 + test/test_balance.py | 30 + test/test_balance_api.py | 30 + test/test_bank.py | 34 + test/test_bank_code.py | 30 + test/test_billing_information.py | 30 + test/test_capture.py | 32 + test/test_capture_list.py | 32 + test/test_capture_list_response.py | 32 + test/test_capture_parameters.py | 30 + test/test_card.py | 36 + test/test_card_channel_properties.py | 30 + test/test_card_information.py | 30 + test/test_card_parameters.py | 34 + test/test_card_parameters_card_information.py | 30 + test/test_card_verification_results.py | 32 + ...ard_verification_results_three_d_secure.py | 30 + test/test_channel.py | 34 + test/test_channel_account_type.py | 30 + test/test_channel_amount_limits.py | 32 + test/test_channel_amount_limits_all_of.py | 30 + test/test_channel_category.py | 30 + test/test_channel_property.py | 32 + test/test_channel_property_all_of.py | 30 + test/test_channels_categories.py | 30 + test/test_create_invoice_request.py | 38 + .../test_create_payment_method409_response.py | 30 + .../test_create_payment_method503_response.py | 30 + test/test_create_payout_request.py | 34 + test/test_create_refund.py | 30 + test/test_create_refund400_response.py | 30 + test/test_create_refund403_response.py | 30 + test/test_create_refund404_response.py | 30 + test/test_create_refund409_response.py | 30 + test/test_create_refund503_response.py | 30 + test/test_create_refund_default_response.py | 30 + test/test_currency.py | 30 + test/test_customer_object.py | 32 + test/test_date_range_filter.py | 30 + .../test_digital_payout_channel_properties.py | 32 + test/test_direct_debit.py | 32 + test/test_direct_debit_all_of.py | 36 + test/test_direct_debit_bank_account.py | 30 + test/test_direct_debit_channel_code.py | 30 + test/test_direct_debit_channel_properties.py | 36 + ...t_debit_channel_properties_bank_account.py | 30 + ..._debit_channel_properties_bank_redirect.py | 30 + ...ect_debit_channel_properties_debit_card.py | 30 + test/test_direct_debit_debit_card.py | 30 + test/test_direct_debit_parameters.py | 36 + test/test_direct_debit_type.py | 30 + test/test_e_wallet.py | 40 + test/test_e_wallet_account.py | 30 + test/test_e_wallet_all_of.py | 32 + test/test_e_wallet_channel_code.py | 30 + test/test_e_wallet_channel_properties.py | 30 + test/test_e_wallet_parameters.py | 36 + test/test_error.py | 30 + test/test_error_errors_inner.py | 30 + test/test_ewallet.py | 32 + test/test_ewallet_type.py | 30 + test/test_fee_response.py | 30 + test/test_forbidden_error.py | 30 + ...est_get_all_payment_methods400_response.py | 30 + ...est_get_all_payment_methods403_response.py | 30 + ...est_get_all_payment_methods404_response.py | 30 + ...et_all_payment_methods_default_response.py | 30 + test/test_get_payouts200_response.py | 34 + ...test_get_payouts200_response_data_inner.py | 36 + test/test_get_payouts200_response_links.py | 30 + test/test_invoice.py | 56 + test/test_invoice_api.py | 51 + test/test_invoice_client_type.py | 30 + test/test_invoice_currency.py | 30 + ...st_invoice_error404_response_definition.py | 30 + test/test_invoice_fee.py | 30 + test/test_invoice_item.py | 30 + test/test_invoice_not_found_error.py | 30 + test/test_invoice_payment_method.py | 30 + test/test_invoice_status.py | 30 + test/test_link_item.py | 30 + test/test_notification_channel.py | 30 + test/test_notification_preference.py | 32 + test/test_over_the_counter.py | 38 + test/test_over_the_counter_channel_code.py | 30 + ...est_over_the_counter_channel_properties.py | 30 + ...r_the_counter_channel_properties_update.py | 30 + test/test_over_the_counter_parameters.py | 36 + ...test_over_the_counter_update_parameters.py | 32 + test/test_paylater.py | 32 + test/test_paylater_type.py | 30 + test/test_payment_channel.py | 36 + test/test_payment_channel_all_of.py | 34 + test/test_payment_channel_list.py | 34 + test/test_payment_channel_list_links_inner.py | 32 + ...payment_channel_list_links_inner_all_of.py | 30 + test/test_payment_method.py | 48 + test/test_payment_method_action.py | 30 + test/test_payment_method_api.py | 86 + test/test_payment_method_auth_parameters.py | 30 + test/test_payment_method_country.py | 30 + test/test_payment_method_expire_parameters.py | 30 + test/test_payment_method_list.py | 32 + test/test_payment_method_parameters.py | 44 + test/test_payment_method_reusability.py | 30 + test/test_payment_method_status.py | 30 + test/test_payment_method_type.py | 30 + test/test_payment_method_update_parameters.py | 38 + test/test_payment_request.py | 50 + test/test_payment_request_action.py | 30 + test/test_payment_request_api.py | 72 + test/test_payment_request_auth_parameters.py | 30 + test/test_payment_request_basket.py | 32 + test/test_payment_request_basket_item.py | 30 + test/test_payment_request_capture_method.py | 30 + ...yment_request_card_verification_results.py | 32 + ...d_verification_results_three_dee_secure.py | 30 + ...test_payment_request_channel_properties.py | 30 + test/test_payment_request_country.py | 30 + test/test_payment_request_currency.py | 30 + test/test_payment_request_initiator.py | 30 + test/test_payment_request_list_response.py | 32 + test/test_payment_request_parameters.py | 44 + ...t_request_parameters_channel_properties.py | 34 + ...st_parameters_channel_properties_all_of.py | 30 + ...st_payment_request_shipping_information.py | 30 + test/test_payment_request_status.py | 30 + test/test_payout.py | 38 + test/test_payout_all_of.py | 30 + test/test_payout_api.py | 58 + test/test_qr_code.py | 32 + test/test_qr_code_channel_code.py | 30 + test/test_qr_code_channel_properties.py | 30 + test/test_qr_code_parameters.py | 34 + test/test_qr_code_type.py | 30 + test/test_receipt_notification.py | 30 + test/test_refund.py | 30 + test/test_refund_api.py | 47 + test/test_refund_list.py | 32 + test/test_retail_outlet.py | 32 + test/test_retail_outlet_name.py | 30 + test/test_server_error.py | 30 + test/test_simulate_payment_request.py | 30 + test/test_tokenized_card_information.py | 30 + test/test_transaction_api.py | 37 + test/test_transaction_id.py | 30 + test/test_transaction_response.py | 42 + test/test_transaction_response_type.py | 32 + test/test_transaction_statuses.py | 30 + test/test_transaction_types.py | 30 + test/test_transactions_response.py | 34 + test/test_unauthorized_error.py | 30 + test/test_validation_error.py | 30 + test/test_virtual_account.py | 42 + test/test_virtual_account_all_of.py | 32 + ...est_virtual_account_alternative_display.py | 30 + test/test_virtual_account_channel_code.py | 30 + ...test_virtual_account_channel_properties.py | 30 + ...irtual_account_channel_properties_patch.py | 30 + test/test_virtual_account_parameters.py | 36 + .../test_virtual_account_update_parameters.py | 32 + tests/__init__.py | 0 tests/integration/__init__.py | 0 tests/integration/base_integration_test.py | 12 - tests/integration/conftest.py | 16 - tests/integration/test_balance.py | 17 - tests/integration/test_batch_disbursement.py | 31 - tests/integration/test_cardless_credit.py | 79 - tests/integration/test_credit_card.py | 123 - tests/integration/test_direct_debit.py | 175 - tests/integration/test_disbursement.py | 51 - tests/integration/test_ewallet.py | 170 - tests/integration/test_invoice.py | 39 - tests/integration/test_payment_method.py | 206 - tests/integration/test_payment_request.py | 48 - tests/integration/test_payout.py | 41 - tests/integration/test_qrcode.py | 39 - tests/integration/test_recurring_payment.py | 87 - tests/integration/test_refund.py | 27 - tests/integration/test_retail_outlet.py | 49 - tests/integration/test_virtual_account.py | 61 - tests/sampleresponse/balance.py | 2 - tests/sampleresponse/batch_disbursement.py | 9 - tests/sampleresponse/cardless_credit.py | 28 - tests/sampleresponse/credit_card.py | 68 - tests/sampleresponse/direct_debit.py | 96 - tests/sampleresponse/disbursement.py | 53 - tests/sampleresponse/ewallet.py | 117 - tests/sampleresponse/invoice.py | 298 -- tests/sampleresponse/payment_method.py | 80 - tests/sampleresponse/payment_request.py | 69 - tests/sampleresponse/payout.py | 25 - tests/sampleresponse/qrcode.py | 12 - tests/sampleresponse/recurring_payment.py | 20 - tests/sampleresponse/refund.py | 19 - tests/sampleresponse/retail_outlet.py | 32 - tests/sampleresponse/virtual_account.py | 40 - tests/sampleresponse/xenplatform.py | 30 - tests/unit/conftest.py | 18 - tests/unit/models/__init__.py | 0 tests/unit/models/balance/__init__.py | 0 tests/unit/models/balance/test_balance.py | 58 - .../unit/models/batchdisbursement/__init__.py | 0 .../test_create_batch_disbursement.py | 83 - tests/unit/models/cardlesscredit/__init__.py | 0 .../test_calculate_payment_type.py | 85 - .../cardlesscredit/test_create_payment.py | 125 - tests/unit/models/creditcard/__init__.py | 0 .../models/creditcard/test_capture_charge.py | 60 - .../creditcard/test_create_authorization.py | 72 - .../models/creditcard/test_create_charge.py | 101 - .../creditcard/test_create_promotion.py | 68 - .../models/creditcard/test_create_refund.py | 61 - .../unit/models/creditcard/test_get_charge.py | 56 - .../creditcard/test_reverse_authorization.py | 60 - tests/unit/models/directdebit/__init__.py | 0 .../directdebit/test_create_customer.py | 72 - .../models/directdebit/test_create_payment.py | 80 - .../directdebit/test_create_payment_method.py | 67 - .../test_get_accessible_accounts_by_token.py | 56 - .../test_get_customer_by_ref_id.py | 56 - ...test_get_payment_methods_by_customer_id.py | 56 - .../directdebit/test_get_payment_status.py | 56 - .../test_get_payment_status_by_ref_id.py | 56 - .../test_initialize_tokenization.py | 97 - .../directdebit/test_validate_payment_otp.py | 60 - .../directdebit/test_validate_token_otp.py | 59 - tests/unit/models/disbursement/__init__.py | 0 .../disbursement/test_create_disbursement.py | 71 - .../disbursement/test_get_disbursement.py | 54 - .../test_get_disbursement_available_banks.py | 54 - .../test_get_disbursement_by_ext_id.py | 54 - tests/unit/models/ewallet/__init__.py | 0 .../ewallet/test_create_dana_payment.py | 66 - .../ewallet/test_create_ewallet_charge.py | 110 - .../ewallet/test_create_linkaja_payment.py | 76 - .../models/ewallet/test_create_ovo_payment.py | 75 - .../ewallet/test_get_dana_payment_status.py | 57 - .../ewallet/test_get_ewallet_charge_status.py | 56 - .../test_get_linkaja_payment_status.py | 57 - .../ewallet/test_get_ovo_payment_status.py | 57 - tests/unit/models/invoice/__init__.py | 0 .../models/invoice/test_create_invoice.py | 65 - .../models/invoice/test_expire_invoice.py | 57 - tests/unit/models/invoice/test_get_invoice.py | 57 - .../models/invoice/test_list_all_invoice.py | 57 - tests/unit/models/model_base_test.py | 189 - tests/unit/models/paymentmethod/__init__.py | 0 .../test_authorize_payment_method.py | 56 - .../test_create_payment_method.py | 73 - .../test_expire_payment_method.py | 53 - .../paymentmethod/test_get_payment_method.py | 53 - .../test_update_payment_method.py | 56 - tests/unit/models/paymentrequests/__init__.py | 0 .../test_confirm_payment_request.py | 56 - .../test_create_payment_request.py | 82 - .../test_get_payment_request.py | 53 - .../test_resend_auth_for_payment_request.py | 53 - tests/unit/models/payout/__init__.py | 0 .../unit/models/payout/test_create_payout.py | 64 - tests/unit/models/payout/test_get_payout.py | 57 - tests/unit/models/payout/test_void_payout.py | 57 - tests/unit/models/qrcode/__init__.py | 0 .../unit/models/qrcode/test_create_qrcode.py | 65 - .../qrcode/test_get_qrcode_by_ext_id.py | 56 - .../unit/models/recurringpayment/__init__.py | 0 .../test_create_recurring_payment.py | 69 - .../test_edit_recurring_payment.py | 59 - .../test_get_recurring_payment.py | 56 - .../test_pause_recurring_payment.py | 56 - .../test_resume_recurring_payment.py | 56 - .../test_stop_recurring_payment.py | 56 - tests/unit/models/refund/__init__.py | 0 .../unit/models/refund/test_create_refund.py | 61 - tests/unit/models/refund/test_get_refund.py | 53 - tests/unit/models/retailoutlet/__init__.py | 0 .../test_create_fixed_payment_code.py | 65 - .../test_get_fixed_payment_code.py | 54 - .../test_update_fixed_payment_code.py | 61 - tests/unit/models/virtualaccount/__init__.py | 0 .../test_create_virtual_account.py | 59 - .../test_get_virtual_account.py | 54 - .../test_get_virtual_account_banks.py | 54 - .../test_get_virtual_account_payment.py | 54 - .../test_update_virtual_account.py | 57 - tests/unit/models/xenplatform/__init__.py | 0 .../models/xenplatform/test_create_account.py | 70 - .../xenplatform/test_set_callback_url.py | 62 - .../unit/models/xenplatform/test_transfers.py | 67 - tests/unit/test_api_requestor.py | 108 - tests/unit/test_xendit_param_injector.py | 22 - tox.ini | 9 + xendit/__init__.py | 29 +- xendit/_api_requestor.py | 74 - xendit/_config.py | 6 - xendit/_extract_params.py | 33 - xendit/_xendit_param_injector.py | 118 - xendit/api_client.py | 901 +++++ xendit/apis/__init__.py | 7 + xendit/balance_and_transaction/__init__.py | 2 + xendit/balance_and_transaction/balance_api.py | 179 + .../balance_and_transaction/model/__init__.py | 25 + .../balance_and_transaction/model/balance.py | 268 ++ .../model/channels_categories.py | 301 ++ .../balance_and_transaction/model/currency.py | 449 +++ .../model/date_range_filter.py | 266 ++ .../model/fee_response.py | 292 ++ .../model/link_item.py | 280 ++ .../model/server_error.py | 280 ++ .../model/transaction_id.py | 290 ++ .../model/transaction_response.py | 385 ++ .../model/transaction_response_type.py | 315 ++ .../model/transaction_statuses.py | 292 ++ .../model/transaction_types.py | 300 ++ .../model/transactions_response.py | 286 ++ .../model/validation_error.py | 284 ++ .../transaction_api.py | 405 ++ xendit/configuration.py | 431 +++ xendit/exceptions.py | 153 + xendit/invoice/__init__.py | 1 + xendit/invoice/invoice_api.py | 634 ++++ xendit/invoice/model/__init__.py | 42 + xendit/invoice/model/address_object.py | 286 ++ .../invoice/model/alternative_display_item.py | 266 ++ xendit/invoice/model/bad_request_error.py | 283 ++ xendit/invoice/model/bank.py | 304 ++ xendit/invoice/model/bank_code.py | 294 ++ .../invoice/model/create_invoice_request.py | 358 ++ xendit/invoice/model/customer_object.py | 296 ++ xendit/invoice/model/direct_debit.py | 274 ++ xendit/invoice/model/direct_debit_type.py | 301 ++ xendit/invoice/model/ewallet.py | 274 ++ xendit/invoice/model/ewallet_type.py | 294 ++ xendit/invoice/model/forbidden_error.py | 279 ++ xendit/invoice/model/invoice.py | 458 +++ xendit/invoice/model/invoice_client_type.py | 293 ++ xendit/invoice/model/invoice_currency.py | 290 ++ .../invoice_error404_response_definition.py | 279 ++ xendit/invoice/model/invoice_fee.py | 274 ++ xendit/invoice/model/invoice_item.py | 295 ++ .../invoice/model/invoice_not_found_error.py | 279 ++ .../invoice/model/invoice_payment_method.py | 297 ++ xendit/invoice/model/invoice_status.py | 291 ++ xendit/invoice/model/notification_channel.py | 291 ++ .../invoice/model/notification_preference.py | 280 ++ xendit/invoice/model/paylater.py | 278 ++ xendit/invoice/model/paylater_type.py | 293 ++ xendit/invoice/model/qr_code.py | 274 ++ xendit/invoice/model/qr_code_type.py | 289 ++ xendit/invoice/model/retail_outlet.py | 286 ++ xendit/invoice/model/retail_outlet_name.py | 296 ++ xendit/invoice/model/server_error.py | 279 ++ xendit/invoice/model/unauthorized_error.py | 279 ++ xendit/model_utils.py | 2053 ++++++++++ xendit/models/__init__.py | 19 +- xendit/models/_base_model.py | 36 - xendit/models/_base_query.py | 9 - xendit/models/balance/__init__.py | 2 - xendit/models/balance/balance.py | 65 - xendit/models/balance/balance_account_type.py | 9 - xendit/models/batchdisbursement/__init__.py | 1 - .../batchdisbursement/batch_disbursement.py | 110 - .../batch_disbursement_item.py | 39 - xendit/models/cardlesscredit/__init__.py | 3 - .../models/cardlesscredit/cardless_credit.py | 207 -- .../cardlesscredit/cardless_credit_item.py | 28 - .../cardlesscredit/cardless_credit_type.py | 7 - .../models/cardlesscredit/payment/__init__.py | 8 - .../cardless_credit_customer_details.py | 28 - .../payment/cardless_credit_payment.py | 20 - .../payment/cardless_credit_payment_type.py | 32 - ...ardless_credit_payment_type_calculation.py | 16 - .../cardless_credit_shipping_address.py | 30 - xendit/models/creditcard/__init__.py | 5 - xendit/models/creditcard/charge/__init__.py | 5 - .../creditcard/charge/credit_card_charge.py | 59 - .../charge/credit_card_charge_address.py | 35 - .../credit_card_charge_billing_details.py | 36 - .../charge/credit_card_charge_installment.py | 29 - .../charge/credit_card_charge_promotion.py | 29 - xendit/models/creditcard/credit_card.py | 485 --- .../creditcard/credit_card_promotion.py | 40 - .../models/creditcard/credit_card_refund.py | 33 - .../credit_card_reverse_authorization.py | 31 - xendit/models/directdebit/__init__.py | 3 - .../models/directdebit/customer/__init__.py | 2 - .../customer/direct_debit_customer.py | 39 - .../customer/direct_debit_customer_address.py | 57 - xendit/models/directdebit/direct_debit.py | 667 ---- xendit/models/directdebit/payment/__init__.py | 2 - .../payment/direct_debit_basket.py | 65 - .../payment/direct_debit_payment.py | 45 - .../directdebit/paymentmethod/__init__.py | 3 - .../direct_debit_payment_method.py | 33 - .../direct_debit_payment_method_properties.py | 21 - .../direct_debit_payment_method_type.py | 8 - xendit/models/directdebit/token/__init__.py | 4 - .../token/direct_debit_accessible_account.py | 23 - .../token/direct_debit_card_link.py | 36 - .../token/direct_debit_online_banking_link.py | 39 - .../directdebit/token/direct_debit_token.py | 26 - xendit/models/disbursement/__init__.py | 2 - xendit/models/disbursement/disbursement.py | 206 - .../models/disbursement/disbursement_bank.py | 17 - xendit/models/ewallet/__init__.py | 6 - xendit/models/ewallet/dana/__init__.py | 2 - xendit/models/ewallet/dana/dana_payment.py | 17 - .../ewallet/dana/dana_payment_status.py | 21 - xendit/models/ewallet/ewallet.py | 371 -- xendit/models/ewallet/ewallet_basket.py | 37 - xendit/models/ewallet/ewallet_charge.py | 53 - xendit/models/ewallet/ewallet_type.py | 9 - xendit/models/ewallet/linkaja/__init__.py | 3 - xendit/models/ewallet/linkaja/linkaja_item.py | 23 - .../models/ewallet/linkaja/linkaja_payment.py | 19 - .../ewallet/linkaja/linkaja_payment_status.py | 27 - xendit/models/ewallet/ovo/__init__.py | 2 - xendit/models/ewallet/ovo/ovo_payment.py | 31 - .../models/ewallet/ovo/ovo_payment_status.py | 21 - xendit/models/invoice/__init__.py | 3 - xendit/models/invoice/invoice.py | 277 -- xendit/models/invoice/invoice_bank.py | 23 - xendit/models/invoice/invoice_ewallet.py | 11 - .../models/invoice/invoice_retail_outlet.py | 15 - xendit/models/payment/__init__.py | 1 - xendit/models/payment/payment.py | 27 - xendit/models/paymentmethod/__init__.py | 7 - .../paymentmethod/billing_information.py | 24 - xendit/models/paymentmethod/card/__init__.py | 4 - xendit/models/paymentmethod/card/card.py | 41 - .../paymentmethod/card/card_information.py | 49 - .../card/card_verification_results.py | 17 - .../paymentmethod/card/channel_properties.py | 36 - .../paymentmethod/direct_debit/__init__.py | 4 - .../direct_debit/bank_account.py | 14 - .../direct_debit/channel_properties.py | 49 - .../paymentmethod/direct_debit/debit_card.py | 18 - .../direct_debit/direct_debit.py | 43 - .../models/paymentmethod/ewallet/__init__.py | 3 - .../models/paymentmethod/ewallet/account.py | 18 - .../ewallet/channel_properties.py | 46 - .../models/paymentmethod/ewallet/ewallet.py | 36 - .../over_the_counter/__init__.py | 2 - .../over_the_counter/channel_properties.py | 33 - .../over_the_counter/over_the_counter.py | 40 - xendit/models/paymentmethod/payment_method.py | 431 --- .../models/paymentmethod/qr_code/__init__.py | 2 - .../qr_code/channel_properties.py | 16 - .../models/paymentmethod/qr_code/qr_code.py | 38 - .../paymentmethod/virtual_account/__init__.py | 2 - .../virtual_account/channel_properties.py | 38 - .../virtual_account/virtual_account.py | 44 - xendit/models/paymentrequest/__init__.py | 1 - .../models/paymentrequest/payment_request.py | 288 -- xendit/models/payout/__init__.py | 1 - xendit/models/payout/payout.py | 168 - xendit/models/qrcode/__init__.py | 2 - xendit/models/qrcode/qrcode.py | 127 - xendit/models/qrcode/qrcode_type.py | 8 - xendit/models/recurringpayment/__init__.py | 1 - .../recurringpayment/recurring_payment.py | 341 -- xendit/models/refund/__init__.py | 1 - xendit/models/refund/refund.py | 180 - xendit/models/retailoutlet/__init__.py | 1 - xendit/models/retailoutlet/retail_outlet.py | 170 - xendit/models/virtualaccount/__init__.py | 3 - .../models/virtualaccount/virtual_account.py | 258 -- .../virtualaccount/virtual_account_payment.py | 33 - .../virtualaccount/virtual_acount_bank.py | 13 - xendit/models/xenplatform/__init__.py | 3 - .../models/xenplatform/response/__init__.py | 3 - .../response/xenplatform_account.py | 19 - .../response/xenplatform_callback_url.py | 19 - .../response/xenplatform_transfers.py | 23 - xendit/models/xenplatform/xenplatform.py | 173 - .../xenplatform/xenplatform_account_type.py | 8 - .../xenplatform_business_profile.py | 18 - .../xenplatform/xenplatform_url_type.py | 13 - xendit/network/__init__.py | 3 - xendit/network/http_client_interface.py | 20 - xendit/network/xendit_response.py | 7 - xendit/payment_method/__init__.py | 1 + xendit/payment_method/model/__init__.py | 77 + .../model/billing_information.py | 306 ++ xendit/payment_method/model/card.py | 292 ++ .../model/card_channel_properties.py | 290 ++ .../payment_method/model/card_parameters.py | 284 ++ .../model/card_parameters_card_information.py | 288 ++ .../model/card_verification_results.py | 282 ++ ...ard_verification_results_three_d_secure.py | 283 ++ .../model/channel_amount_limits.py | 326 ++ .../model/channel_amount_limits_all_of.py | 270 ++ .../payment_method/model/channel_property.py | 326 ++ .../model/channel_property_all_of.py | 270 ++ .../create_payment_method409_response.py | 272 ++ .../create_payment_method503_response.py | 270 ++ xendit/payment_method/model/direct_debit.py | 347 ++ .../model/direct_debit_all_of.py | 286 ++ .../model/direct_debit_bank_account.py | 274 ++ .../model/direct_debit_channel_code.py | 350 ++ .../model/direct_debit_channel_properties.py | 290 ++ .../model/direct_debit_debit_card.py | 274 ++ .../model/direct_debit_parameters.py | 282 ++ .../payment_method/model/direct_debit_type.py | 290 ++ xendit/payment_method/model/e_wallet.py | 332 ++ .../payment_method/model/e_wallet_account.py | 274 ++ .../model/e_wallet_channel_code.py | 307 ++ .../model/e_wallet_channel_properties.py | 302 ++ .../model/e_wallet_parameters.py | 286 ++ .../get_all_payment_methods400_response.py | 282 ++ .../get_all_payment_methods403_response.py | 270 ++ .../get_all_payment_methods404_response.py | 269 ++ ...et_all_payment_methods_default_response.py | 266 ++ .../payment_method/model/over_the_counter.py | 334 ++ .../model/over_the_counter_channel_code.py | 303 ++ .../over_the_counter_channel_properties.py | 276 ++ ...r_the_counter_channel_properties_update.py | 266 ++ .../model/over_the_counter_parameters.py | 290 ++ .../over_the_counter_update_parameters.py | 272 ++ .../payment_method/model/payment_channel.py | 346 ++ .../model/payment_channel_all_of.py | 294 ++ .../model/payment_channel_list.py | 278 ++ .../model/payment_channel_list_links_inner.py | 332 ++ ...payment_channel_list_links_inner_all_of.py | 276 ++ xendit/payment_method/model/payment_method.py | 380 ++ .../model/payment_method_action.py | 274 ++ .../model/payment_method_auth_parameters.py | 272 ++ .../model/payment_method_country.py | 292 ++ .../model/payment_method_expire_parameters.py | 266 ++ .../model/payment_method_list.py | 278 ++ .../model/payment_method_parameters.py | 344 ++ .../model/payment_method_reusability.py | 289 ++ .../model/payment_method_status.py | 293 ++ .../model/payment_method_type.py | 295 ++ .../model/payment_method_update_parameters.py | 294 ++ xendit/payment_method/model/qr_code.py | 334 ++ .../model/qr_code_channel_code.py | 293 ++ .../model/qr_code_channel_properties.py | 266 ++ .../model/qr_code_parameters.py | 282 ++ .../model/simulate_payment_request.py | 262 ++ .../model/tokenized_card_information.py | 320 ++ .../payment_method/model/virtual_account.py | 364 ++ .../model/virtual_account_all_of.py | 268 ++ .../virtual_account_alternative_display.py | 270 ++ .../model/virtual_account_channel_code.py | 302 ++ .../virtual_account_channel_properties.py | 274 ++ ...irtual_account_channel_properties_patch.py | 269 ++ .../model/virtual_account_parameters.py | 311 ++ .../virtual_account_update_parameters.py | 293 ++ xendit/payment_method/payment_method_api.py | 1393 +++++++ xendit/payment_request/__init__.py | 1 + xendit/payment_request/model/__init__.py | 75 + xendit/payment_request/model/capture.py | 362 ++ xendit/payment_request/model/capture_list.py | 290 ++ .../model/capture_list_response.py | 280 ++ .../model/capture_parameters.py | 272 ++ xendit/payment_request/model/card.py | 296 ++ .../model/card_channel_properties.py | 288 ++ .../payment_request/model/card_information.py | 317 ++ .../model/card_verification_results.py | 276 ++ ...ard_verification_results_three_d_secure.py | 283 ++ xendit/payment_request/model/direct_debit.py | 347 ++ .../model/direct_debit_all_of.py | 286 ++ .../model/direct_debit_bank_account.py | 266 ++ .../model/direct_debit_channel_code.py | 350 ++ .../model/direct_debit_channel_properties.py | 352 ++ ...t_debit_channel_properties_bank_account.py | 274 ++ ..._debit_channel_properties_bank_redirect.py | 270 ++ ...ect_debit_channel_properties_debit_card.py | 278 ++ .../model/direct_debit_debit_card.py | 278 ++ .../model/direct_debit_parameters.py | 288 ++ .../model/direct_debit_type.py | 290 ++ xendit/payment_request/model/e_wallet.py | 335 ++ .../payment_request/model/e_wallet_account.py | 274 ++ .../payment_request/model/e_wallet_all_of.py | 268 ++ .../model/e_wallet_channel_code.py | 306 ++ .../model/e_wallet_channel_properties.py | 297 ++ .../model/e_wallet_parameters.py | 274 ++ xendit/payment_request/model/error.py | 324 ++ .../payment_request/model/over_the_counter.py | 336 ++ .../model/over_the_counter_channel_code.py | 303 ++ .../over_the_counter_channel_properties.py | 276 ++ .../model/over_the_counter_parameters.py | 292 ++ .../payment_request/model/payment_method.py | 352 ++ .../model/payment_method_parameters.py | 320 ++ .../model/payment_method_reusability.py | 289 ++ .../model/payment_method_status.py | 292 ++ .../model/payment_method_type.py | 293 ++ .../payment_request/model/payment_request.py | 394 ++ .../model/payment_request_action.py | 305 ++ .../model/payment_request_auth_parameters.py | 268 ++ .../model/payment_request_basket.py | 290 ++ .../model/payment_request_basket_item.py | 324 ++ .../model/payment_request_capture_method.py | 290 ++ ...yment_request_card_verification_results.py | 282 ++ ...d_verification_results_three_dee_secure.py | 278 ++ .../payment_request_channel_properties.py | 301 ++ .../model/payment_request_country.py | 292 ++ .../model/payment_request_currency.py | 292 ++ .../model/payment_request_initiator.py | 290 ++ .../model/payment_request_list_response.py | 280 ++ .../model/payment_request_parameters.py | 338 ++ ...t_request_parameters_channel_properties.py | 364 ++ ...st_parameters_channel_properties_all_of.py | 262 ++ .../payment_request_shipping_information.py | 288 ++ .../model/payment_request_status.py | 295 ++ xendit/payment_request/model/qr_code.py | 326 ++ .../model/qr_code_channel_code.py | 292 ++ .../model/qr_code_channel_properties.py | 266 ++ .../model/qr_code_parameters.py | 274 ++ .../payment_request/model/virtual_account.py | 360 ++ .../model/virtual_account_all_of.py | 268 ++ .../virtual_account_alternative_display.py | 270 ++ .../model/virtual_account_channel_code.py | 302 ++ .../virtual_account_channel_properties.py | 280 ++ .../model/virtual_account_parameters.py | 307 ++ xendit/payment_request/payment_request_api.py | 1018 +++++ xendit/payout/__init__.py | 1 + xendit/payout/model/__init__.py | 25 + xendit/payout/model/channel.py | 300 ++ xendit/payout/model/channel_account_type.py | 292 ++ xendit/payout/model/channel_amount_limits.py | 280 ++ xendit/payout/model/channel_category.py | 290 ++ xendit/payout/model/create_payout_request.py | 315 ++ .../digital_payout_channel_properties.py | 282 ++ xendit/payout/model/error.py | 284 ++ xendit/payout/model/error_errors_inner.py | 274 ++ .../payout/model/get_payouts200_response.py | 278 ++ .../get_payouts200_response_data_inner.py | 397 ++ .../model/get_payouts200_response_links.py | 270 ++ xendit/payout/model/payout.py | 400 ++ xendit/payout/model/payout_all_of.py | 316 ++ xendit/payout/model/receipt_notification.py | 270 ++ xendit/payout/payout_api.py | 727 ++++ xendit/refund/__init__.py | 1 + xendit/refund/model/__init__.py | 20 + xendit/refund/model/create_refund.py | 293 ++ .../refund/model/create_refund400_response.py | 275 ++ .../refund/model/create_refund403_response.py | 269 ++ .../refund/model/create_refund404_response.py | 269 ++ .../refund/model/create_refund409_response.py | 270 ++ .../refund/model/create_refund503_response.py | 270 ++ .../model/create_refund_default_response.py | 266 ++ xendit/refund/model/refund.py | 306 ++ xendit/refund/model/refund_list.py | 278 ++ xendit/refund/refund_api.py | 559 +++ xendit/rest.py | 353 ++ xendit/xendit.py | 36 - xendit/xendit_error.py | 13 - 855 files changed, 78114 insertions(+), 20686 deletions(-) delete mode 100644 .flake8 create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/generate-release-tag.yml delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/test.yml create mode 100644 .openapi-generator-ignore create mode 100644 .openapi-generator/FILES create mode 100644 .openapi-generator/VERSION delete mode 100644 .pre-commit-config.yaml delete mode 100644 .tool-versions create mode 100644 docs/AddressObject.md create mode 100644 docs/AlternativeDisplayItem.md create mode 100644 docs/BadRequestError.md create mode 100644 docs/Balance.md create mode 100644 docs/BalanceApi.md create mode 100644 docs/Bank.md create mode 100644 docs/BankCode.md create mode 100644 docs/BillingInformation.md create mode 100644 docs/Capture.md create mode 100644 docs/CaptureList.md create mode 100644 docs/CaptureListResponse.md create mode 100644 docs/CaptureParameters.md create mode 100644 docs/Card.md create mode 100644 docs/CardChannelProperties.md create mode 100644 docs/CardInformation.md create mode 100644 docs/CardParameters.md create mode 100644 docs/CardParametersCardInformation.md create mode 100644 docs/CardVerificationResults.md create mode 100644 docs/CardVerificationResultsThreeDSecure.md create mode 100644 docs/Channel.md create mode 100644 docs/ChannelAccountType.md create mode 100644 docs/ChannelAmountLimits.md create mode 100644 docs/ChannelAmountLimitsAllOf.md create mode 100644 docs/ChannelCategory.md create mode 100644 docs/ChannelProperty.md create mode 100644 docs/ChannelPropertyAllOf.md create mode 100644 docs/ChannelsCategories.md create mode 100644 docs/CreateInvoiceRequest.md create mode 100644 docs/CreatePaymentMethod409Response.md create mode 100644 docs/CreatePaymentMethod503Response.md create mode 100644 docs/CreatePayoutRequest.md create mode 100644 docs/CreateRefund.md create mode 100644 docs/CreateRefund400Response.md create mode 100644 docs/CreateRefund403Response.md create mode 100644 docs/CreateRefund404Response.md create mode 100644 docs/CreateRefund409Response.md create mode 100644 docs/CreateRefund503Response.md create mode 100644 docs/CreateRefundDefaultResponse.md create mode 100644 docs/Currency.md create mode 100644 docs/CustomerObject.md create mode 100644 docs/DateRangeFilter.md create mode 100644 docs/DigitalPayoutChannelProperties.md create mode 100644 docs/DirectDebit.md create mode 100644 docs/DirectDebitAllOf.md create mode 100644 docs/DirectDebitBankAccount.md create mode 100644 docs/DirectDebitChannelCode.md create mode 100644 docs/DirectDebitChannelProperties.md create mode 100644 docs/DirectDebitChannelPropertiesBankAccount.md create mode 100644 docs/DirectDebitChannelPropertiesBankRedirect.md create mode 100644 docs/DirectDebitChannelPropertiesDebitCard.md create mode 100644 docs/DirectDebitDebitCard.md create mode 100644 docs/DirectDebitParameters.md create mode 100644 docs/DirectDebitType.md create mode 100644 docs/EWallet.md create mode 100644 docs/EWalletAccount.md create mode 100644 docs/EWalletAllOf.md create mode 100644 docs/EWalletChannelCode.md create mode 100644 docs/EWalletChannelProperties.md create mode 100644 docs/EWalletParameters.md create mode 100644 docs/Error.md create mode 100644 docs/ErrorErrorsInner.md create mode 100644 docs/Ewallet.md create mode 100644 docs/EwalletType.md create mode 100644 docs/FeeResponse.md create mode 100644 docs/ForbiddenError.md create mode 100644 docs/GetAllPaymentMethods400Response.md create mode 100644 docs/GetAllPaymentMethods403Response.md create mode 100644 docs/GetAllPaymentMethods404Response.md create mode 100644 docs/GetAllPaymentMethodsDefaultResponse.md create mode 100644 docs/GetPayouts200Response.md create mode 100644 docs/GetPayouts200ResponseDataInner.md create mode 100644 docs/GetPayouts200ResponseLinks.md create mode 100644 docs/Invoice.md create mode 100644 docs/InvoiceApi.md create mode 100644 docs/InvoiceClientType.md create mode 100644 docs/InvoiceCurrency.md create mode 100644 docs/InvoiceError404ResponseDefinition.md create mode 100644 docs/InvoiceFee.md create mode 100644 docs/InvoiceItem.md create mode 100644 docs/InvoiceNotFoundError.md create mode 100644 docs/InvoicePaymentMethod.md create mode 100644 docs/InvoiceStatus.md create mode 100644 docs/LinkItem.md create mode 100644 docs/NotificationChannel.md create mode 100644 docs/NotificationPreference.md create mode 100644 docs/OverTheCounter.md create mode 100644 docs/OverTheCounterChannelCode.md create mode 100644 docs/OverTheCounterChannelProperties.md create mode 100644 docs/OverTheCounterChannelPropertiesUpdate.md create mode 100644 docs/OverTheCounterParameters.md create mode 100644 docs/OverTheCounterUpdateParameters.md create mode 100644 docs/Paylater.md create mode 100644 docs/PaylaterType.md create mode 100644 docs/PaymentChannel.md create mode 100644 docs/PaymentChannelAllOf.md create mode 100644 docs/PaymentChannelList.md create mode 100644 docs/PaymentChannelListLinksInner.md create mode 100644 docs/PaymentChannelListLinksInnerAllOf.md create mode 100644 docs/PaymentMethod.md create mode 100644 docs/PaymentMethodAction.md create mode 100644 docs/PaymentMethodApi.md create mode 100644 docs/PaymentMethodAuthParameters.md create mode 100644 docs/PaymentMethodCountry.md create mode 100644 docs/PaymentMethodExpireParameters.md create mode 100644 docs/PaymentMethodList.md create mode 100644 docs/PaymentMethodParameters.md create mode 100644 docs/PaymentMethodReusability.md create mode 100644 docs/PaymentMethodStatus.md create mode 100644 docs/PaymentMethodType.md create mode 100644 docs/PaymentMethodUpdateParameters.md create mode 100644 docs/PaymentRequest.md create mode 100644 docs/PaymentRequestAction.md create mode 100644 docs/PaymentRequestApi.md create mode 100644 docs/PaymentRequestAuthParameters.md create mode 100644 docs/PaymentRequestBasket.md create mode 100644 docs/PaymentRequestBasketItem.md create mode 100644 docs/PaymentRequestCaptureMethod.md create mode 100644 docs/PaymentRequestCardVerificationResults.md create mode 100644 docs/PaymentRequestCardVerificationResultsThreeDeeSecure.md create mode 100644 docs/PaymentRequestChannelProperties.md create mode 100644 docs/PaymentRequestCountry.md create mode 100644 docs/PaymentRequestCurrency.md create mode 100644 docs/PaymentRequestInitiator.md create mode 100644 docs/PaymentRequestListResponse.md create mode 100644 docs/PaymentRequestParameters.md create mode 100644 docs/PaymentRequestParametersChannelProperties.md create mode 100644 docs/PaymentRequestParametersChannelPropertiesAllOf.md create mode 100644 docs/PaymentRequestShippingInformation.md create mode 100644 docs/PaymentRequestStatus.md create mode 100644 docs/Payout.md create mode 100644 docs/PayoutAllOf.md create mode 100644 docs/PayoutApi.md create mode 100644 docs/QRCode.md create mode 100644 docs/QRCodeChannelCode.md create mode 100644 docs/QRCodeChannelProperties.md create mode 100644 docs/QRCodeParameters.md create mode 100644 docs/QrCode.md create mode 100644 docs/QrCodeType.md create mode 100644 docs/ReceiptNotification.md create mode 100644 docs/Refund.md create mode 100644 docs/RefundApi.md create mode 100644 docs/RefundList.md create mode 100644 docs/RetailOutlet.md create mode 100644 docs/RetailOutletName.md create mode 100644 docs/ServerError.md create mode 100644 docs/SimulatePaymentRequest.md create mode 100644 docs/TokenizedCardInformation.md create mode 100644 docs/TransactionApi.md create mode 100644 docs/TransactionId.md create mode 100644 docs/TransactionResponse.md create mode 100644 docs/TransactionResponseType.md create mode 100644 docs/TransactionStatuses.md create mode 100644 docs/TransactionTypes.md create mode 100644 docs/TransactionsResponse.md create mode 100644 docs/UnauthorizedError.md create mode 100644 docs/ValidationError.md create mode 100644 docs/VirtualAccount.md create mode 100644 docs/VirtualAccountAllOf.md create mode 100644 docs/VirtualAccountAlternativeDisplay.md create mode 100644 docs/VirtualAccountChannelCode.md create mode 100644 docs/VirtualAccountChannelProperties.md create mode 100644 docs/VirtualAccountChannelPropertiesPatch.md create mode 100644 docs/VirtualAccountParameters.md create mode 100644 docs/VirtualAccountUpdateParameters.md create mode 100644 docs/header.jpg delete mode 100644 examples/balance_example.py delete mode 100644 examples/batch_disbursement_example.py delete mode 100644 examples/cardless_credit_example.py delete mode 100644 examples/credit_card_example.py delete mode 100644 examples/direct_debit_example.py delete mode 100644 examples/disbursement_example.py delete mode 100644 examples/ewallet_example.py delete mode 100644 examples/invoice_example.py delete mode 100644 examples/main_example.py delete mode 100644 examples/payment_method_example.py delete mode 100644 examples/payment_request_example.py delete mode 100644 examples/payout_example.py delete mode 100644 examples/print_running_function.py delete mode 100644 examples/qrcode_example.py delete mode 100644 examples/recurring_payment_example.py delete mode 100644 examples/retail_outlet_example.py delete mode 100644 examples/virtual_account_example.py delete mode 100644 examples/xenplatform_example.py delete mode 100644 poetry.lock delete mode 100644 pyproject.toml delete mode 100644 pytest.ini create mode 100644 requirements.txt create mode 100644 setup.cfg create mode 100644 setup.py create mode 100644 test-requirements.txt rename {examples => test}/__init__.py (100%) create mode 100644 test/test_address_object.py create mode 100644 test/test_alternative_display_item.py create mode 100644 test/test_bad_request_error.py create mode 100644 test/test_balance.py create mode 100644 test/test_balance_api.py create mode 100644 test/test_bank.py create mode 100644 test/test_bank_code.py create mode 100644 test/test_billing_information.py create mode 100644 test/test_capture.py create mode 100644 test/test_capture_list.py create mode 100644 test/test_capture_list_response.py create mode 100644 test/test_capture_parameters.py create mode 100644 test/test_card.py create mode 100644 test/test_card_channel_properties.py create mode 100644 test/test_card_information.py create mode 100644 test/test_card_parameters.py create mode 100644 test/test_card_parameters_card_information.py create mode 100644 test/test_card_verification_results.py create mode 100644 test/test_card_verification_results_three_d_secure.py create mode 100644 test/test_channel.py create mode 100644 test/test_channel_account_type.py create mode 100644 test/test_channel_amount_limits.py create mode 100644 test/test_channel_amount_limits_all_of.py create mode 100644 test/test_channel_category.py create mode 100644 test/test_channel_property.py create mode 100644 test/test_channel_property_all_of.py create mode 100644 test/test_channels_categories.py create mode 100644 test/test_create_invoice_request.py create mode 100644 test/test_create_payment_method409_response.py create mode 100644 test/test_create_payment_method503_response.py create mode 100644 test/test_create_payout_request.py create mode 100644 test/test_create_refund.py create mode 100644 test/test_create_refund400_response.py create mode 100644 test/test_create_refund403_response.py create mode 100644 test/test_create_refund404_response.py create mode 100644 test/test_create_refund409_response.py create mode 100644 test/test_create_refund503_response.py create mode 100644 test/test_create_refund_default_response.py create mode 100644 test/test_currency.py create mode 100644 test/test_customer_object.py create mode 100644 test/test_date_range_filter.py create mode 100644 test/test_digital_payout_channel_properties.py create mode 100644 test/test_direct_debit.py create mode 100644 test/test_direct_debit_all_of.py create mode 100644 test/test_direct_debit_bank_account.py create mode 100644 test/test_direct_debit_channel_code.py create mode 100644 test/test_direct_debit_channel_properties.py create mode 100644 test/test_direct_debit_channel_properties_bank_account.py create mode 100644 test/test_direct_debit_channel_properties_bank_redirect.py create mode 100644 test/test_direct_debit_channel_properties_debit_card.py create mode 100644 test/test_direct_debit_debit_card.py create mode 100644 test/test_direct_debit_parameters.py create mode 100644 test/test_direct_debit_type.py create mode 100644 test/test_e_wallet.py create mode 100644 test/test_e_wallet_account.py create mode 100644 test/test_e_wallet_all_of.py create mode 100644 test/test_e_wallet_channel_code.py create mode 100644 test/test_e_wallet_channel_properties.py create mode 100644 test/test_e_wallet_parameters.py create mode 100644 test/test_error.py create mode 100644 test/test_error_errors_inner.py create mode 100644 test/test_ewallet.py create mode 100644 test/test_ewallet_type.py create mode 100644 test/test_fee_response.py create mode 100644 test/test_forbidden_error.py create mode 100644 test/test_get_all_payment_methods400_response.py create mode 100644 test/test_get_all_payment_methods403_response.py create mode 100644 test/test_get_all_payment_methods404_response.py create mode 100644 test/test_get_all_payment_methods_default_response.py create mode 100644 test/test_get_payouts200_response.py create mode 100644 test/test_get_payouts200_response_data_inner.py create mode 100644 test/test_get_payouts200_response_links.py create mode 100644 test/test_invoice.py create mode 100644 test/test_invoice_api.py create mode 100644 test/test_invoice_client_type.py create mode 100644 test/test_invoice_currency.py create mode 100644 test/test_invoice_error404_response_definition.py create mode 100644 test/test_invoice_fee.py create mode 100644 test/test_invoice_item.py create mode 100644 test/test_invoice_not_found_error.py create mode 100644 test/test_invoice_payment_method.py create mode 100644 test/test_invoice_status.py create mode 100644 test/test_link_item.py create mode 100644 test/test_notification_channel.py create mode 100644 test/test_notification_preference.py create mode 100644 test/test_over_the_counter.py create mode 100644 test/test_over_the_counter_channel_code.py create mode 100644 test/test_over_the_counter_channel_properties.py create mode 100644 test/test_over_the_counter_channel_properties_update.py create mode 100644 test/test_over_the_counter_parameters.py create mode 100644 test/test_over_the_counter_update_parameters.py create mode 100644 test/test_paylater.py create mode 100644 test/test_paylater_type.py create mode 100644 test/test_payment_channel.py create mode 100644 test/test_payment_channel_all_of.py create mode 100644 test/test_payment_channel_list.py create mode 100644 test/test_payment_channel_list_links_inner.py create mode 100644 test/test_payment_channel_list_links_inner_all_of.py create mode 100644 test/test_payment_method.py create mode 100644 test/test_payment_method_action.py create mode 100644 test/test_payment_method_api.py create mode 100644 test/test_payment_method_auth_parameters.py create mode 100644 test/test_payment_method_country.py create mode 100644 test/test_payment_method_expire_parameters.py create mode 100644 test/test_payment_method_list.py create mode 100644 test/test_payment_method_parameters.py create mode 100644 test/test_payment_method_reusability.py create mode 100644 test/test_payment_method_status.py create mode 100644 test/test_payment_method_type.py create mode 100644 test/test_payment_method_update_parameters.py create mode 100644 test/test_payment_request.py create mode 100644 test/test_payment_request_action.py create mode 100644 test/test_payment_request_api.py create mode 100644 test/test_payment_request_auth_parameters.py create mode 100644 test/test_payment_request_basket.py create mode 100644 test/test_payment_request_basket_item.py create mode 100644 test/test_payment_request_capture_method.py create mode 100644 test/test_payment_request_card_verification_results.py create mode 100644 test/test_payment_request_card_verification_results_three_dee_secure.py create mode 100644 test/test_payment_request_channel_properties.py create mode 100644 test/test_payment_request_country.py create mode 100644 test/test_payment_request_currency.py create mode 100644 test/test_payment_request_initiator.py create mode 100644 test/test_payment_request_list_response.py create mode 100644 test/test_payment_request_parameters.py create mode 100644 test/test_payment_request_parameters_channel_properties.py create mode 100644 test/test_payment_request_parameters_channel_properties_all_of.py create mode 100644 test/test_payment_request_shipping_information.py create mode 100644 test/test_payment_request_status.py create mode 100644 test/test_payout.py create mode 100644 test/test_payout_all_of.py create mode 100644 test/test_payout_api.py create mode 100644 test/test_qr_code.py create mode 100644 test/test_qr_code_channel_code.py create mode 100644 test/test_qr_code_channel_properties.py create mode 100644 test/test_qr_code_parameters.py create mode 100644 test/test_qr_code_type.py create mode 100644 test/test_receipt_notification.py create mode 100644 test/test_refund.py create mode 100644 test/test_refund_api.py create mode 100644 test/test_refund_list.py create mode 100644 test/test_retail_outlet.py create mode 100644 test/test_retail_outlet_name.py create mode 100644 test/test_server_error.py create mode 100644 test/test_simulate_payment_request.py create mode 100644 test/test_tokenized_card_information.py create mode 100644 test/test_transaction_api.py create mode 100644 test/test_transaction_id.py create mode 100644 test/test_transaction_response.py create mode 100644 test/test_transaction_response_type.py create mode 100644 test/test_transaction_statuses.py create mode 100644 test/test_transaction_types.py create mode 100644 test/test_transactions_response.py create mode 100644 test/test_unauthorized_error.py create mode 100644 test/test_validation_error.py create mode 100644 test/test_virtual_account.py create mode 100644 test/test_virtual_account_all_of.py create mode 100644 test/test_virtual_account_alternative_display.py create mode 100644 test/test_virtual_account_channel_code.py create mode 100644 test/test_virtual_account_channel_properties.py create mode 100644 test/test_virtual_account_channel_properties_patch.py create mode 100644 test/test_virtual_account_parameters.py create mode 100644 test/test_virtual_account_update_parameters.py delete mode 100644 tests/__init__.py delete mode 100644 tests/integration/__init__.py delete mode 100644 tests/integration/base_integration_test.py delete mode 100644 tests/integration/conftest.py delete mode 100644 tests/integration/test_balance.py delete mode 100644 tests/integration/test_batch_disbursement.py delete mode 100644 tests/integration/test_cardless_credit.py delete mode 100644 tests/integration/test_credit_card.py delete mode 100644 tests/integration/test_direct_debit.py delete mode 100644 tests/integration/test_disbursement.py delete mode 100644 tests/integration/test_ewallet.py delete mode 100644 tests/integration/test_invoice.py delete mode 100644 tests/integration/test_payment_method.py delete mode 100644 tests/integration/test_payment_request.py delete mode 100644 tests/integration/test_payout.py delete mode 100644 tests/integration/test_qrcode.py delete mode 100644 tests/integration/test_recurring_payment.py delete mode 100644 tests/integration/test_refund.py delete mode 100644 tests/integration/test_retail_outlet.py delete mode 100644 tests/integration/test_virtual_account.py delete mode 100644 tests/sampleresponse/balance.py delete mode 100644 tests/sampleresponse/batch_disbursement.py delete mode 100644 tests/sampleresponse/cardless_credit.py delete mode 100644 tests/sampleresponse/credit_card.py delete mode 100644 tests/sampleresponse/direct_debit.py delete mode 100644 tests/sampleresponse/disbursement.py delete mode 100644 tests/sampleresponse/ewallet.py delete mode 100644 tests/sampleresponse/invoice.py delete mode 100644 tests/sampleresponse/payment_method.py delete mode 100644 tests/sampleresponse/payment_request.py delete mode 100644 tests/sampleresponse/payout.py delete mode 100644 tests/sampleresponse/qrcode.py delete mode 100644 tests/sampleresponse/recurring_payment.py delete mode 100644 tests/sampleresponse/refund.py delete mode 100644 tests/sampleresponse/retail_outlet.py delete mode 100644 tests/sampleresponse/virtual_account.py delete mode 100644 tests/sampleresponse/xenplatform.py delete mode 100644 tests/unit/conftest.py delete mode 100644 tests/unit/models/__init__.py delete mode 100644 tests/unit/models/balance/__init__.py delete mode 100644 tests/unit/models/balance/test_balance.py delete mode 100644 tests/unit/models/batchdisbursement/__init__.py delete mode 100644 tests/unit/models/batchdisbursement/test_create_batch_disbursement.py delete mode 100644 tests/unit/models/cardlesscredit/__init__.py delete mode 100644 tests/unit/models/cardlesscredit/test_calculate_payment_type.py delete mode 100644 tests/unit/models/cardlesscredit/test_create_payment.py delete mode 100644 tests/unit/models/creditcard/__init__.py delete mode 100644 tests/unit/models/creditcard/test_capture_charge.py delete mode 100644 tests/unit/models/creditcard/test_create_authorization.py delete mode 100644 tests/unit/models/creditcard/test_create_charge.py delete mode 100644 tests/unit/models/creditcard/test_create_promotion.py delete mode 100644 tests/unit/models/creditcard/test_create_refund.py delete mode 100644 tests/unit/models/creditcard/test_get_charge.py delete mode 100644 tests/unit/models/creditcard/test_reverse_authorization.py delete mode 100644 tests/unit/models/directdebit/__init__.py delete mode 100644 tests/unit/models/directdebit/test_create_customer.py delete mode 100644 tests/unit/models/directdebit/test_create_payment.py delete mode 100644 tests/unit/models/directdebit/test_create_payment_method.py delete mode 100644 tests/unit/models/directdebit/test_get_accessible_accounts_by_token.py delete mode 100644 tests/unit/models/directdebit/test_get_customer_by_ref_id.py delete mode 100644 tests/unit/models/directdebit/test_get_payment_methods_by_customer_id.py delete mode 100644 tests/unit/models/directdebit/test_get_payment_status.py delete mode 100644 tests/unit/models/directdebit/test_get_payment_status_by_ref_id.py delete mode 100644 tests/unit/models/directdebit/test_initialize_tokenization.py delete mode 100644 tests/unit/models/directdebit/test_validate_payment_otp.py delete mode 100644 tests/unit/models/directdebit/test_validate_token_otp.py delete mode 100644 tests/unit/models/disbursement/__init__.py delete mode 100644 tests/unit/models/disbursement/test_create_disbursement.py delete mode 100644 tests/unit/models/disbursement/test_get_disbursement.py delete mode 100644 tests/unit/models/disbursement/test_get_disbursement_available_banks.py delete mode 100644 tests/unit/models/disbursement/test_get_disbursement_by_ext_id.py delete mode 100644 tests/unit/models/ewallet/__init__.py delete mode 100644 tests/unit/models/ewallet/test_create_dana_payment.py delete mode 100644 tests/unit/models/ewallet/test_create_ewallet_charge.py delete mode 100644 tests/unit/models/ewallet/test_create_linkaja_payment.py delete mode 100644 tests/unit/models/ewallet/test_create_ovo_payment.py delete mode 100644 tests/unit/models/ewallet/test_get_dana_payment_status.py delete mode 100644 tests/unit/models/ewallet/test_get_ewallet_charge_status.py delete mode 100644 tests/unit/models/ewallet/test_get_linkaja_payment_status.py delete mode 100644 tests/unit/models/ewallet/test_get_ovo_payment_status.py delete mode 100644 tests/unit/models/invoice/__init__.py delete mode 100644 tests/unit/models/invoice/test_create_invoice.py delete mode 100644 tests/unit/models/invoice/test_expire_invoice.py delete mode 100644 tests/unit/models/invoice/test_get_invoice.py delete mode 100644 tests/unit/models/invoice/test_list_all_invoice.py delete mode 100644 tests/unit/models/model_base_test.py delete mode 100644 tests/unit/models/paymentmethod/__init__.py delete mode 100644 tests/unit/models/paymentmethod/test_authorize_payment_method.py delete mode 100644 tests/unit/models/paymentmethod/test_create_payment_method.py delete mode 100644 tests/unit/models/paymentmethod/test_expire_payment_method.py delete mode 100644 tests/unit/models/paymentmethod/test_get_payment_method.py delete mode 100644 tests/unit/models/paymentmethod/test_update_payment_method.py delete mode 100644 tests/unit/models/paymentrequests/__init__.py delete mode 100644 tests/unit/models/paymentrequests/test_confirm_payment_request.py delete mode 100644 tests/unit/models/paymentrequests/test_create_payment_request.py delete mode 100644 tests/unit/models/paymentrequests/test_get_payment_request.py delete mode 100644 tests/unit/models/paymentrequests/test_resend_auth_for_payment_request.py delete mode 100644 tests/unit/models/payout/__init__.py delete mode 100644 tests/unit/models/payout/test_create_payout.py delete mode 100644 tests/unit/models/payout/test_get_payout.py delete mode 100644 tests/unit/models/payout/test_void_payout.py delete mode 100644 tests/unit/models/qrcode/__init__.py delete mode 100644 tests/unit/models/qrcode/test_create_qrcode.py delete mode 100644 tests/unit/models/qrcode/test_get_qrcode_by_ext_id.py delete mode 100644 tests/unit/models/recurringpayment/__init__.py delete mode 100644 tests/unit/models/recurringpayment/test_create_recurring_payment.py delete mode 100644 tests/unit/models/recurringpayment/test_edit_recurring_payment.py delete mode 100644 tests/unit/models/recurringpayment/test_get_recurring_payment.py delete mode 100644 tests/unit/models/recurringpayment/test_pause_recurring_payment.py delete mode 100644 tests/unit/models/recurringpayment/test_resume_recurring_payment.py delete mode 100644 tests/unit/models/recurringpayment/test_stop_recurring_payment.py delete mode 100644 tests/unit/models/refund/__init__.py delete mode 100644 tests/unit/models/refund/test_create_refund.py delete mode 100644 tests/unit/models/refund/test_get_refund.py delete mode 100644 tests/unit/models/retailoutlet/__init__.py delete mode 100644 tests/unit/models/retailoutlet/test_create_fixed_payment_code.py delete mode 100644 tests/unit/models/retailoutlet/test_get_fixed_payment_code.py delete mode 100644 tests/unit/models/retailoutlet/test_update_fixed_payment_code.py delete mode 100644 tests/unit/models/virtualaccount/__init__.py delete mode 100644 tests/unit/models/virtualaccount/test_create_virtual_account.py delete mode 100644 tests/unit/models/virtualaccount/test_get_virtual_account.py delete mode 100644 tests/unit/models/virtualaccount/test_get_virtual_account_banks.py delete mode 100644 tests/unit/models/virtualaccount/test_get_virtual_account_payment.py delete mode 100644 tests/unit/models/virtualaccount/test_update_virtual_account.py delete mode 100644 tests/unit/models/xenplatform/__init__.py delete mode 100644 tests/unit/models/xenplatform/test_create_account.py delete mode 100644 tests/unit/models/xenplatform/test_set_callback_url.py delete mode 100644 tests/unit/models/xenplatform/test_transfers.py delete mode 100644 tests/unit/test_api_requestor.py delete mode 100644 tests/unit/test_xendit_param_injector.py create mode 100644 tox.ini delete mode 100644 xendit/_api_requestor.py delete mode 100644 xendit/_config.py delete mode 100644 xendit/_extract_params.py delete mode 100644 xendit/_xendit_param_injector.py create mode 100644 xendit/api_client.py create mode 100644 xendit/apis/__init__.py create mode 100644 xendit/balance_and_transaction/__init__.py create mode 100644 xendit/balance_and_transaction/balance_api.py create mode 100644 xendit/balance_and_transaction/model/__init__.py create mode 100644 xendit/balance_and_transaction/model/balance.py create mode 100644 xendit/balance_and_transaction/model/channels_categories.py create mode 100644 xendit/balance_and_transaction/model/currency.py create mode 100644 xendit/balance_and_transaction/model/date_range_filter.py create mode 100644 xendit/balance_and_transaction/model/fee_response.py create mode 100644 xendit/balance_and_transaction/model/link_item.py create mode 100644 xendit/balance_and_transaction/model/server_error.py create mode 100644 xendit/balance_and_transaction/model/transaction_id.py create mode 100644 xendit/balance_and_transaction/model/transaction_response.py create mode 100644 xendit/balance_and_transaction/model/transaction_response_type.py create mode 100644 xendit/balance_and_transaction/model/transaction_statuses.py create mode 100644 xendit/balance_and_transaction/model/transaction_types.py create mode 100644 xendit/balance_and_transaction/model/transactions_response.py create mode 100644 xendit/balance_and_transaction/model/validation_error.py create mode 100644 xendit/balance_and_transaction/transaction_api.py create mode 100644 xendit/configuration.py create mode 100644 xendit/exceptions.py create mode 100644 xendit/invoice/__init__.py create mode 100644 xendit/invoice/invoice_api.py create mode 100644 xendit/invoice/model/__init__.py create mode 100644 xendit/invoice/model/address_object.py create mode 100644 xendit/invoice/model/alternative_display_item.py create mode 100644 xendit/invoice/model/bad_request_error.py create mode 100644 xendit/invoice/model/bank.py create mode 100644 xendit/invoice/model/bank_code.py create mode 100644 xendit/invoice/model/create_invoice_request.py create mode 100644 xendit/invoice/model/customer_object.py create mode 100644 xendit/invoice/model/direct_debit.py create mode 100644 xendit/invoice/model/direct_debit_type.py create mode 100644 xendit/invoice/model/ewallet.py create mode 100644 xendit/invoice/model/ewallet_type.py create mode 100644 xendit/invoice/model/forbidden_error.py create mode 100644 xendit/invoice/model/invoice.py create mode 100644 xendit/invoice/model/invoice_client_type.py create mode 100644 xendit/invoice/model/invoice_currency.py create mode 100644 xendit/invoice/model/invoice_error404_response_definition.py create mode 100644 xendit/invoice/model/invoice_fee.py create mode 100644 xendit/invoice/model/invoice_item.py create mode 100644 xendit/invoice/model/invoice_not_found_error.py create mode 100644 xendit/invoice/model/invoice_payment_method.py create mode 100644 xendit/invoice/model/invoice_status.py create mode 100644 xendit/invoice/model/notification_channel.py create mode 100644 xendit/invoice/model/notification_preference.py create mode 100644 xendit/invoice/model/paylater.py create mode 100644 xendit/invoice/model/paylater_type.py create mode 100644 xendit/invoice/model/qr_code.py create mode 100644 xendit/invoice/model/qr_code_type.py create mode 100644 xendit/invoice/model/retail_outlet.py create mode 100644 xendit/invoice/model/retail_outlet_name.py create mode 100644 xendit/invoice/model/server_error.py create mode 100644 xendit/invoice/model/unauthorized_error.py create mode 100644 xendit/model_utils.py delete mode 100644 xendit/models/_base_model.py delete mode 100644 xendit/models/_base_query.py delete mode 100644 xendit/models/balance/__init__.py delete mode 100644 xendit/models/balance/balance.py delete mode 100644 xendit/models/balance/balance_account_type.py delete mode 100644 xendit/models/batchdisbursement/__init__.py delete mode 100644 xendit/models/batchdisbursement/batch_disbursement.py delete mode 100644 xendit/models/batchdisbursement/batch_disbursement_item.py delete mode 100644 xendit/models/cardlesscredit/__init__.py delete mode 100644 xendit/models/cardlesscredit/cardless_credit.py delete mode 100644 xendit/models/cardlesscredit/cardless_credit_item.py delete mode 100644 xendit/models/cardlesscredit/cardless_credit_type.py delete mode 100644 xendit/models/cardlesscredit/payment/__init__.py delete mode 100644 xendit/models/cardlesscredit/payment/cardless_credit_customer_details.py delete mode 100644 xendit/models/cardlesscredit/payment/cardless_credit_payment.py delete mode 100644 xendit/models/cardlesscredit/payment/cardless_credit_payment_type.py delete mode 100644 xendit/models/cardlesscredit/payment/cardless_credit_payment_type_calculation.py delete mode 100644 xendit/models/cardlesscredit/payment/cardless_credit_shipping_address.py delete mode 100644 xendit/models/creditcard/__init__.py delete mode 100644 xendit/models/creditcard/charge/__init__.py delete mode 100644 xendit/models/creditcard/charge/credit_card_charge.py delete mode 100644 xendit/models/creditcard/charge/credit_card_charge_address.py delete mode 100644 xendit/models/creditcard/charge/credit_card_charge_billing_details.py delete mode 100644 xendit/models/creditcard/charge/credit_card_charge_installment.py delete mode 100644 xendit/models/creditcard/charge/credit_card_charge_promotion.py delete mode 100644 xendit/models/creditcard/credit_card.py delete mode 100644 xendit/models/creditcard/credit_card_promotion.py delete mode 100644 xendit/models/creditcard/credit_card_refund.py delete mode 100644 xendit/models/creditcard/credit_card_reverse_authorization.py delete mode 100644 xendit/models/directdebit/__init__.py delete mode 100644 xendit/models/directdebit/customer/__init__.py delete mode 100644 xendit/models/directdebit/customer/direct_debit_customer.py delete mode 100644 xendit/models/directdebit/customer/direct_debit_customer_address.py delete mode 100644 xendit/models/directdebit/direct_debit.py delete mode 100644 xendit/models/directdebit/payment/__init__.py delete mode 100644 xendit/models/directdebit/payment/direct_debit_basket.py delete mode 100644 xendit/models/directdebit/payment/direct_debit_payment.py delete mode 100644 xendit/models/directdebit/paymentmethod/__init__.py delete mode 100644 xendit/models/directdebit/paymentmethod/direct_debit_payment_method.py delete mode 100644 xendit/models/directdebit/paymentmethod/direct_debit_payment_method_properties.py delete mode 100644 xendit/models/directdebit/paymentmethod/direct_debit_payment_method_type.py delete mode 100644 xendit/models/directdebit/token/__init__.py delete mode 100644 xendit/models/directdebit/token/direct_debit_accessible_account.py delete mode 100644 xendit/models/directdebit/token/direct_debit_card_link.py delete mode 100644 xendit/models/directdebit/token/direct_debit_online_banking_link.py delete mode 100644 xendit/models/directdebit/token/direct_debit_token.py delete mode 100644 xendit/models/disbursement/__init__.py delete mode 100644 xendit/models/disbursement/disbursement.py delete mode 100644 xendit/models/disbursement/disbursement_bank.py delete mode 100644 xendit/models/ewallet/__init__.py delete mode 100644 xendit/models/ewallet/dana/__init__.py delete mode 100644 xendit/models/ewallet/dana/dana_payment.py delete mode 100644 xendit/models/ewallet/dana/dana_payment_status.py delete mode 100644 xendit/models/ewallet/ewallet.py delete mode 100644 xendit/models/ewallet/ewallet_basket.py delete mode 100644 xendit/models/ewallet/ewallet_charge.py delete mode 100644 xendit/models/ewallet/ewallet_type.py delete mode 100644 xendit/models/ewallet/linkaja/__init__.py delete mode 100644 xendit/models/ewallet/linkaja/linkaja_item.py delete mode 100644 xendit/models/ewallet/linkaja/linkaja_payment.py delete mode 100644 xendit/models/ewallet/linkaja/linkaja_payment_status.py delete mode 100644 xendit/models/ewallet/ovo/__init__.py delete mode 100644 xendit/models/ewallet/ovo/ovo_payment.py delete mode 100644 xendit/models/ewallet/ovo/ovo_payment_status.py delete mode 100644 xendit/models/invoice/__init__.py delete mode 100644 xendit/models/invoice/invoice.py delete mode 100644 xendit/models/invoice/invoice_bank.py delete mode 100644 xendit/models/invoice/invoice_ewallet.py delete mode 100644 xendit/models/invoice/invoice_retail_outlet.py delete mode 100644 xendit/models/payment/__init__.py delete mode 100644 xendit/models/payment/payment.py delete mode 100644 xendit/models/paymentmethod/__init__.py delete mode 100644 xendit/models/paymentmethod/billing_information.py delete mode 100644 xendit/models/paymentmethod/card/__init__.py delete mode 100644 xendit/models/paymentmethod/card/card.py delete mode 100644 xendit/models/paymentmethod/card/card_information.py delete mode 100644 xendit/models/paymentmethod/card/card_verification_results.py delete mode 100644 xendit/models/paymentmethod/card/channel_properties.py delete mode 100644 xendit/models/paymentmethod/direct_debit/__init__.py delete mode 100644 xendit/models/paymentmethod/direct_debit/bank_account.py delete mode 100644 xendit/models/paymentmethod/direct_debit/channel_properties.py delete mode 100644 xendit/models/paymentmethod/direct_debit/debit_card.py delete mode 100644 xendit/models/paymentmethod/direct_debit/direct_debit.py delete mode 100644 xendit/models/paymentmethod/ewallet/__init__.py delete mode 100644 xendit/models/paymentmethod/ewallet/account.py delete mode 100644 xendit/models/paymentmethod/ewallet/channel_properties.py delete mode 100644 xendit/models/paymentmethod/ewallet/ewallet.py delete mode 100644 xendit/models/paymentmethod/over_the_counter/__init__.py delete mode 100644 xendit/models/paymentmethod/over_the_counter/channel_properties.py delete mode 100644 xendit/models/paymentmethod/over_the_counter/over_the_counter.py delete mode 100644 xendit/models/paymentmethod/payment_method.py delete mode 100644 xendit/models/paymentmethod/qr_code/__init__.py delete mode 100644 xendit/models/paymentmethod/qr_code/channel_properties.py delete mode 100644 xendit/models/paymentmethod/qr_code/qr_code.py delete mode 100644 xendit/models/paymentmethod/virtual_account/__init__.py delete mode 100644 xendit/models/paymentmethod/virtual_account/channel_properties.py delete mode 100644 xendit/models/paymentmethod/virtual_account/virtual_account.py delete mode 100644 xendit/models/paymentrequest/__init__.py delete mode 100644 xendit/models/paymentrequest/payment_request.py delete mode 100644 xendit/models/payout/__init__.py delete mode 100644 xendit/models/payout/payout.py delete mode 100644 xendit/models/qrcode/__init__.py delete mode 100644 xendit/models/qrcode/qrcode.py delete mode 100644 xendit/models/qrcode/qrcode_type.py delete mode 100644 xendit/models/recurringpayment/__init__.py delete mode 100644 xendit/models/recurringpayment/recurring_payment.py delete mode 100644 xendit/models/refund/__init__.py delete mode 100644 xendit/models/refund/refund.py delete mode 100644 xendit/models/retailoutlet/__init__.py delete mode 100644 xendit/models/retailoutlet/retail_outlet.py delete mode 100644 xendit/models/virtualaccount/__init__.py delete mode 100644 xendit/models/virtualaccount/virtual_account.py delete mode 100644 xendit/models/virtualaccount/virtual_account_payment.py delete mode 100644 xendit/models/virtualaccount/virtual_acount_bank.py delete mode 100644 xendit/models/xenplatform/__init__.py delete mode 100644 xendit/models/xenplatform/response/__init__.py delete mode 100644 xendit/models/xenplatform/response/xenplatform_account.py delete mode 100644 xendit/models/xenplatform/response/xenplatform_callback_url.py delete mode 100644 xendit/models/xenplatform/response/xenplatform_transfers.py delete mode 100644 xendit/models/xenplatform/xenplatform.py delete mode 100644 xendit/models/xenplatform/xenplatform_account_type.py delete mode 100644 xendit/models/xenplatform/xenplatform_business_profile.py delete mode 100644 xendit/models/xenplatform/xenplatform_url_type.py delete mode 100644 xendit/network/__init__.py delete mode 100644 xendit/network/http_client_interface.py delete mode 100644 xendit/network/xendit_response.py create mode 100644 xendit/payment_method/__init__.py create mode 100644 xendit/payment_method/model/__init__.py create mode 100644 xendit/payment_method/model/billing_information.py create mode 100644 xendit/payment_method/model/card.py create mode 100644 xendit/payment_method/model/card_channel_properties.py create mode 100644 xendit/payment_method/model/card_parameters.py create mode 100644 xendit/payment_method/model/card_parameters_card_information.py create mode 100644 xendit/payment_method/model/card_verification_results.py create mode 100644 xendit/payment_method/model/card_verification_results_three_d_secure.py create mode 100644 xendit/payment_method/model/channel_amount_limits.py create mode 100644 xendit/payment_method/model/channel_amount_limits_all_of.py create mode 100644 xendit/payment_method/model/channel_property.py create mode 100644 xendit/payment_method/model/channel_property_all_of.py create mode 100644 xendit/payment_method/model/create_payment_method409_response.py create mode 100644 xendit/payment_method/model/create_payment_method503_response.py create mode 100644 xendit/payment_method/model/direct_debit.py create mode 100644 xendit/payment_method/model/direct_debit_all_of.py create mode 100644 xendit/payment_method/model/direct_debit_bank_account.py create mode 100644 xendit/payment_method/model/direct_debit_channel_code.py create mode 100644 xendit/payment_method/model/direct_debit_channel_properties.py create mode 100644 xendit/payment_method/model/direct_debit_debit_card.py create mode 100644 xendit/payment_method/model/direct_debit_parameters.py create mode 100644 xendit/payment_method/model/direct_debit_type.py create mode 100644 xendit/payment_method/model/e_wallet.py create mode 100644 xendit/payment_method/model/e_wallet_account.py create mode 100644 xendit/payment_method/model/e_wallet_channel_code.py create mode 100644 xendit/payment_method/model/e_wallet_channel_properties.py create mode 100644 xendit/payment_method/model/e_wallet_parameters.py create mode 100644 xendit/payment_method/model/get_all_payment_methods400_response.py create mode 100644 xendit/payment_method/model/get_all_payment_methods403_response.py create mode 100644 xendit/payment_method/model/get_all_payment_methods404_response.py create mode 100644 xendit/payment_method/model/get_all_payment_methods_default_response.py create mode 100644 xendit/payment_method/model/over_the_counter.py create mode 100644 xendit/payment_method/model/over_the_counter_channel_code.py create mode 100644 xendit/payment_method/model/over_the_counter_channel_properties.py create mode 100644 xendit/payment_method/model/over_the_counter_channel_properties_update.py create mode 100644 xendit/payment_method/model/over_the_counter_parameters.py create mode 100644 xendit/payment_method/model/over_the_counter_update_parameters.py create mode 100644 xendit/payment_method/model/payment_channel.py create mode 100644 xendit/payment_method/model/payment_channel_all_of.py create mode 100644 xendit/payment_method/model/payment_channel_list.py create mode 100644 xendit/payment_method/model/payment_channel_list_links_inner.py create mode 100644 xendit/payment_method/model/payment_channel_list_links_inner_all_of.py create mode 100644 xendit/payment_method/model/payment_method.py create mode 100644 xendit/payment_method/model/payment_method_action.py create mode 100644 xendit/payment_method/model/payment_method_auth_parameters.py create mode 100644 xendit/payment_method/model/payment_method_country.py create mode 100644 xendit/payment_method/model/payment_method_expire_parameters.py create mode 100644 xendit/payment_method/model/payment_method_list.py create mode 100644 xendit/payment_method/model/payment_method_parameters.py create mode 100644 xendit/payment_method/model/payment_method_reusability.py create mode 100644 xendit/payment_method/model/payment_method_status.py create mode 100644 xendit/payment_method/model/payment_method_type.py create mode 100644 xendit/payment_method/model/payment_method_update_parameters.py create mode 100644 xendit/payment_method/model/qr_code.py create mode 100644 xendit/payment_method/model/qr_code_channel_code.py create mode 100644 xendit/payment_method/model/qr_code_channel_properties.py create mode 100644 xendit/payment_method/model/qr_code_parameters.py create mode 100644 xendit/payment_method/model/simulate_payment_request.py create mode 100644 xendit/payment_method/model/tokenized_card_information.py create mode 100644 xendit/payment_method/model/virtual_account.py create mode 100644 xendit/payment_method/model/virtual_account_all_of.py create mode 100644 xendit/payment_method/model/virtual_account_alternative_display.py create mode 100644 xendit/payment_method/model/virtual_account_channel_code.py create mode 100644 xendit/payment_method/model/virtual_account_channel_properties.py create mode 100644 xendit/payment_method/model/virtual_account_channel_properties_patch.py create mode 100644 xendit/payment_method/model/virtual_account_parameters.py create mode 100644 xendit/payment_method/model/virtual_account_update_parameters.py create mode 100644 xendit/payment_method/payment_method_api.py create mode 100644 xendit/payment_request/__init__.py create mode 100644 xendit/payment_request/model/__init__.py create mode 100644 xendit/payment_request/model/capture.py create mode 100644 xendit/payment_request/model/capture_list.py create mode 100644 xendit/payment_request/model/capture_list_response.py create mode 100644 xendit/payment_request/model/capture_parameters.py create mode 100644 xendit/payment_request/model/card.py create mode 100644 xendit/payment_request/model/card_channel_properties.py create mode 100644 xendit/payment_request/model/card_information.py create mode 100644 xendit/payment_request/model/card_verification_results.py create mode 100644 xendit/payment_request/model/card_verification_results_three_d_secure.py create mode 100644 xendit/payment_request/model/direct_debit.py create mode 100644 xendit/payment_request/model/direct_debit_all_of.py create mode 100644 xendit/payment_request/model/direct_debit_bank_account.py create mode 100644 xendit/payment_request/model/direct_debit_channel_code.py create mode 100644 xendit/payment_request/model/direct_debit_channel_properties.py create mode 100644 xendit/payment_request/model/direct_debit_channel_properties_bank_account.py create mode 100644 xendit/payment_request/model/direct_debit_channel_properties_bank_redirect.py create mode 100644 xendit/payment_request/model/direct_debit_channel_properties_debit_card.py create mode 100644 xendit/payment_request/model/direct_debit_debit_card.py create mode 100644 xendit/payment_request/model/direct_debit_parameters.py create mode 100644 xendit/payment_request/model/direct_debit_type.py create mode 100644 xendit/payment_request/model/e_wallet.py create mode 100644 xendit/payment_request/model/e_wallet_account.py create mode 100644 xendit/payment_request/model/e_wallet_all_of.py create mode 100644 xendit/payment_request/model/e_wallet_channel_code.py create mode 100644 xendit/payment_request/model/e_wallet_channel_properties.py create mode 100644 xendit/payment_request/model/e_wallet_parameters.py create mode 100644 xendit/payment_request/model/error.py create mode 100644 xendit/payment_request/model/over_the_counter.py create mode 100644 xendit/payment_request/model/over_the_counter_channel_code.py create mode 100644 xendit/payment_request/model/over_the_counter_channel_properties.py create mode 100644 xendit/payment_request/model/over_the_counter_parameters.py create mode 100644 xendit/payment_request/model/payment_method.py create mode 100644 xendit/payment_request/model/payment_method_parameters.py create mode 100644 xendit/payment_request/model/payment_method_reusability.py create mode 100644 xendit/payment_request/model/payment_method_status.py create mode 100644 xendit/payment_request/model/payment_method_type.py create mode 100644 xendit/payment_request/model/payment_request.py create mode 100644 xendit/payment_request/model/payment_request_action.py create mode 100644 xendit/payment_request/model/payment_request_auth_parameters.py create mode 100644 xendit/payment_request/model/payment_request_basket.py create mode 100644 xendit/payment_request/model/payment_request_basket_item.py create mode 100644 xendit/payment_request/model/payment_request_capture_method.py create mode 100644 xendit/payment_request/model/payment_request_card_verification_results.py create mode 100644 xendit/payment_request/model/payment_request_card_verification_results_three_dee_secure.py create mode 100644 xendit/payment_request/model/payment_request_channel_properties.py create mode 100644 xendit/payment_request/model/payment_request_country.py create mode 100644 xendit/payment_request/model/payment_request_currency.py create mode 100644 xendit/payment_request/model/payment_request_initiator.py create mode 100644 xendit/payment_request/model/payment_request_list_response.py create mode 100644 xendit/payment_request/model/payment_request_parameters.py create mode 100644 xendit/payment_request/model/payment_request_parameters_channel_properties.py create mode 100644 xendit/payment_request/model/payment_request_parameters_channel_properties_all_of.py create mode 100644 xendit/payment_request/model/payment_request_shipping_information.py create mode 100644 xendit/payment_request/model/payment_request_status.py create mode 100644 xendit/payment_request/model/qr_code.py create mode 100644 xendit/payment_request/model/qr_code_channel_code.py create mode 100644 xendit/payment_request/model/qr_code_channel_properties.py create mode 100644 xendit/payment_request/model/qr_code_parameters.py create mode 100644 xendit/payment_request/model/virtual_account.py create mode 100644 xendit/payment_request/model/virtual_account_all_of.py create mode 100644 xendit/payment_request/model/virtual_account_alternative_display.py create mode 100644 xendit/payment_request/model/virtual_account_channel_code.py create mode 100644 xendit/payment_request/model/virtual_account_channel_properties.py create mode 100644 xendit/payment_request/model/virtual_account_parameters.py create mode 100644 xendit/payment_request/payment_request_api.py create mode 100644 xendit/payout/__init__.py create mode 100644 xendit/payout/model/__init__.py create mode 100644 xendit/payout/model/channel.py create mode 100644 xendit/payout/model/channel_account_type.py create mode 100644 xendit/payout/model/channel_amount_limits.py create mode 100644 xendit/payout/model/channel_category.py create mode 100644 xendit/payout/model/create_payout_request.py create mode 100644 xendit/payout/model/digital_payout_channel_properties.py create mode 100644 xendit/payout/model/error.py create mode 100644 xendit/payout/model/error_errors_inner.py create mode 100644 xendit/payout/model/get_payouts200_response.py create mode 100644 xendit/payout/model/get_payouts200_response_data_inner.py create mode 100644 xendit/payout/model/get_payouts200_response_links.py create mode 100644 xendit/payout/model/payout.py create mode 100644 xendit/payout/model/payout_all_of.py create mode 100644 xendit/payout/model/receipt_notification.py create mode 100644 xendit/payout/payout_api.py create mode 100644 xendit/refund/__init__.py create mode 100644 xendit/refund/model/__init__.py create mode 100644 xendit/refund/model/create_refund.py create mode 100644 xendit/refund/model/create_refund400_response.py create mode 100644 xendit/refund/model/create_refund403_response.py create mode 100644 xendit/refund/model/create_refund404_response.py create mode 100644 xendit/refund/model/create_refund409_response.py create mode 100644 xendit/refund/model/create_refund503_response.py create mode 100644 xendit/refund/model/create_refund_default_response.py create mode 100644 xendit/refund/model/refund.py create mode 100644 xendit/refund/model/refund_list.py create mode 100644 xendit/refund/refund_api.py create mode 100644 xendit/rest.py delete mode 100644 xendit/xendit.py delete mode 100644 xendit/xendit_error.py diff --git a/.flake8 b/.flake8 deleted file mode 100644 index c9b95f05..00000000 --- a/.flake8 +++ /dev/null @@ -1,6 +0,0 @@ -[flake8] -# Needed this so flake8 can be compatible with black -ignore = E501, W503 -max-line-length = 88 -per-file-ignores = - **/__init__.py: F401, F403, E402 diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..570c103f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "pip" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/generate-release-tag.yml b/.github/workflows/generate-release-tag.yml new file mode 100644 index 00000000..344dada4 --- /dev/null +++ b/.github/workflows/generate-release-tag.yml @@ -0,0 +1,27 @@ +name: Generate Release Tag +on: + repository_dispatch: + types: [create-release-tag] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set the value in bash + id: parse-changelog + run: | + echo "changelog<> "$GITHUB_OUTPUT" + echo "${{ github.event.client_payload.changelog }}" | tr -s '%0A' '\n' >> "$GITHUB_OUTPUT" + echo "EOF" >> "$GITHUB_OUTPUT" + - name: Create Release + id: create-release + uses: actions/create-release@latest + env: + GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }} + with: + tag_name: v${{ github.event.client_payload.version }} + release_name: v${{ github.event.client_payload.version }} + body: ${{ steps.parse-changelog.outputs.changelog }} + draft: false + prerelease: false \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 2ab6a8e8..00000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Publish Library -on: - release: - types: [published] - -jobs: - publish: - name: Publish - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: 3.7 - - name: Install Poetry - uses: abatilo/actions-poetry@v2 - with: - poetry-version: 1.2.2 - - name: Build Package - run: | - poetry install - poetry build - - name: Publish a Python distribution to TestPyPI - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.test_pypi_token }} - repository_url: https://test.pypi.org/legacy/ - - name: Publish a Python distribution to PyPI - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.pypi_token }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 32fc9ec4..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Run Linter and Tests -on: [pull_request] - -jobs: - build: - name: Run Linting and Tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: 3.7 - - name: Install Poetry - uses: abatilo/actions-poetry@v2 - with: - poetry-version: 1.2.2 - - name: Install Dependencies - run: poetry install - - name: Run Linter - run: poetry run flake8 - - name: Run Tests - run: poetry run python -m pytest --cov=src --cov-branch diff --git a/.gitignore b/.gitignore index fbec739d..df9425bf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -### Autogenerated gitignore file from https://github.com/github/gitignore -## Python # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] @@ -10,6 +8,7 @@ __pycache__/ # Distribution / packaging .Python +env/ build/ develop-eggs/ dist/ @@ -21,12 +20,9 @@ lib64/ parts/ sdist/ var/ -wheels/ -share/python-wheels/ *.egg-info/ .installed.cfg *.egg -MANIFEST # PyInstaller # Usually these files are written by a python script from a template @@ -41,17 +37,17 @@ pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ -.nox/ .coverage .coverage.* .cache nosetests.xml coverage.xml -*.cover -*.py,cover +*,cover .hypothesis/ -.pytest_cache/ -cover/ +venv/ +.venv/ +.python-version +.pytest_cache # Translations *.mo @@ -59,96 +55,15 @@ cover/ # Django stuff: *.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy # Sphinx documentation docs/_build/ # PyBuilder -.pybuilder/ target/ -# Jupyter Notebook +#Ipython Notebook .ipynb_checkpoints -# IPython -profile_default/ -ipython_config.py - -# pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# pytype static type analyzer -.pytype/ - -# Cython debug symbols -cython_debug/ - -## Vscode - -.vscode/* -*.code-workspace - -# Local History for Visual Studio Code -.history/ - -### End of generation - -.idea/ - -.DS_Store \ No newline at end of file +.vscode/ +test.py \ No newline at end of file diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 00000000..6306064d --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,200 @@ +.github/dependabot.yml +.github/workflows/generate-release-tag.yml +.gitignore +LICENSE +README.md +docs/BillingInformation.md +docs/Card.md +docs/CardChannelProperties.md +docs/CardParameters.md +docs/CardParametersCardInformation.md +docs/CardVerificationResults.md +docs/CardVerificationResultsThreeDSecure.md +docs/ChannelAmountLimits.md +docs/ChannelAmountLimitsAllOf.md +docs/ChannelProperty.md +docs/ChannelPropertyAllOf.md +docs/CreatePaymentMethod409Response.md +docs/CreatePaymentMethod503Response.md +docs/DirectDebit.md +docs/DirectDebitAllOf.md +docs/DirectDebitBankAccount.md +docs/DirectDebitChannelCode.md +docs/DirectDebitChannelProperties.md +docs/DirectDebitDebitCard.md +docs/DirectDebitParameters.md +docs/DirectDebitType.md +docs/EWallet.md +docs/EWalletAccount.md +docs/EWalletChannelCode.md +docs/EWalletChannelProperties.md +docs/EWalletParameters.md +docs/GetAllPaymentMethods400Response.md +docs/GetAllPaymentMethods403Response.md +docs/GetAllPaymentMethods404Response.md +docs/GetAllPaymentMethodsDefaultResponse.md +docs/OverTheCounter.md +docs/OverTheCounterChannelCode.md +docs/OverTheCounterChannelProperties.md +docs/OverTheCounterChannelPropertiesUpdate.md +docs/OverTheCounterParameters.md +docs/OverTheCounterUpdateParameters.md +docs/PaymentChannel.md +docs/PaymentChannelAllOf.md +docs/PaymentChannelList.md +docs/PaymentChannelListLinksInner.md +docs/PaymentChannelListLinksInnerAllOf.md +docs/PaymentMethod.md +docs/PaymentMethodAction.md +docs/PaymentMethodApi.md +docs/PaymentMethodAuthParameters.md +docs/PaymentMethodCountry.md +docs/PaymentMethodExpireParameters.md +docs/PaymentMethodList.md +docs/PaymentMethodParameters.md +docs/PaymentMethodReusability.md +docs/PaymentMethodStatus.md +docs/PaymentMethodType.md +docs/PaymentMethodUpdateParameters.md +docs/QRCode.md +docs/QRCodeChannelCode.md +docs/QRCodeChannelProperties.md +docs/QRCodeParameters.md +docs/SimulatePaymentRequest.md +docs/TokenizedCardInformation.md +docs/VirtualAccount.md +docs/VirtualAccountAllOf.md +docs/VirtualAccountAlternativeDisplay.md +docs/VirtualAccountChannelCode.md +docs/VirtualAccountChannelProperties.md +docs/VirtualAccountChannelPropertiesPatch.md +docs/VirtualAccountParameters.md +docs/VirtualAccountUpdateParameters.md +docs/header.jpg +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_billing_information.py +test/test_card.py +test/test_card_channel_properties.py +test/test_card_parameters.py +test/test_card_parameters_card_information.py +test/test_card_verification_results.py +test/test_card_verification_results_three_d_secure.py +test/test_channel_amount_limits.py +test/test_channel_amount_limits_all_of.py +test/test_channel_property.py +test/test_channel_property_all_of.py +test/test_create_payment_method409_response.py +test/test_create_payment_method503_response.py +test/test_e_wallet_account.py +test/test_e_wallet_channel_properties.py +test/test_e_wallet_parameters.py +test/test_get_all_payment_methods400_response.py +test/test_get_all_payment_methods403_response.py +test/test_get_all_payment_methods404_response.py +test/test_get_all_payment_methods_default_response.py +test/test_over_the_counter_channel_properties_update.py +test/test_over_the_counter_update_parameters.py +test/test_payment_channel.py +test/test_payment_channel_all_of.py +test/test_payment_channel_list.py +test/test_payment_channel_list_links_inner.py +test/test_payment_channel_list_links_inner_all_of.py +test/test_payment_method_action.py +test/test_payment_method_api.py +test/test_payment_method_auth_parameters.py +test/test_payment_method_country.py +test/test_payment_method_expire_parameters.py +test/test_payment_method_list.py +test/test_payment_method_update_parameters.py +test/test_qr_code_channel_code.py +test/test_qr_code_channel_properties.py +test/test_qr_code_parameters.py +test/test_simulate_payment_request.py +test/test_tokenized_card_information.py +test/test_virtual_account_all_of.py +test/test_virtual_account_channel_properties_patch.py +test/test_virtual_account_update_parameters.py +tmp/payment_method.api.py +tmp/payment_method.model.py +tox.ini +xendit/__init__.py +xendit/api_client.py +xendit/apis/__init__.py +xendit/configuration.py +xendit/exceptions.py +xendit/model_utils.py +xendit/models/__init__.py +xendit/payment_method/__init__.py +xendit/payment_method/model/__init__.py +xendit/payment_method/model/billing_information.py +xendit/payment_method/model/card.py +xendit/payment_method/model/card_channel_properties.py +xendit/payment_method/model/card_parameters.py +xendit/payment_method/model/card_parameters_card_information.py +xendit/payment_method/model/card_verification_results.py +xendit/payment_method/model/card_verification_results_three_d_secure.py +xendit/payment_method/model/channel_amount_limits.py +xendit/payment_method/model/channel_amount_limits_all_of.py +xendit/payment_method/model/channel_property.py +xendit/payment_method/model/channel_property_all_of.py +xendit/payment_method/model/create_payment_method409_response.py +xendit/payment_method/model/create_payment_method503_response.py +xendit/payment_method/model/direct_debit.py +xendit/payment_method/model/direct_debit_all_of.py +xendit/payment_method/model/direct_debit_bank_account.py +xendit/payment_method/model/direct_debit_channel_code.py +xendit/payment_method/model/direct_debit_channel_properties.py +xendit/payment_method/model/direct_debit_debit_card.py +xendit/payment_method/model/direct_debit_parameters.py +xendit/payment_method/model/direct_debit_type.py +xendit/payment_method/model/e_wallet.py +xendit/payment_method/model/e_wallet_account.py +xendit/payment_method/model/e_wallet_channel_code.py +xendit/payment_method/model/e_wallet_channel_properties.py +xendit/payment_method/model/e_wallet_parameters.py +xendit/payment_method/model/get_all_payment_methods400_response.py +xendit/payment_method/model/get_all_payment_methods403_response.py +xendit/payment_method/model/get_all_payment_methods404_response.py +xendit/payment_method/model/get_all_payment_methods_default_response.py +xendit/payment_method/model/over_the_counter.py +xendit/payment_method/model/over_the_counter_channel_code.py +xendit/payment_method/model/over_the_counter_channel_properties.py +xendit/payment_method/model/over_the_counter_channel_properties_update.py +xendit/payment_method/model/over_the_counter_parameters.py +xendit/payment_method/model/over_the_counter_update_parameters.py +xendit/payment_method/model/payment_channel.py +xendit/payment_method/model/payment_channel_all_of.py +xendit/payment_method/model/payment_channel_list.py +xendit/payment_method/model/payment_channel_list_links_inner.py +xendit/payment_method/model/payment_channel_list_links_inner_all_of.py +xendit/payment_method/model/payment_method.py +xendit/payment_method/model/payment_method_action.py +xendit/payment_method/model/payment_method_auth_parameters.py +xendit/payment_method/model/payment_method_country.py +xendit/payment_method/model/payment_method_expire_parameters.py +xendit/payment_method/model/payment_method_list.py +xendit/payment_method/model/payment_method_parameters.py +xendit/payment_method/model/payment_method_reusability.py +xendit/payment_method/model/payment_method_status.py +xendit/payment_method/model/payment_method_type.py +xendit/payment_method/model/payment_method_update_parameters.py +xendit/payment_method/model/qr_code.py +xendit/payment_method/model/qr_code_channel_code.py +xendit/payment_method/model/qr_code_channel_properties.py +xendit/payment_method/model/qr_code_parameters.py +xendit/payment_method/model/simulate_payment_request.py +xendit/payment_method/model/tokenized_card_information.py +xendit/payment_method/model/virtual_account.py +xendit/payment_method/model/virtual_account_all_of.py +xendit/payment_method/model/virtual_account_alternative_display.py +xendit/payment_method/model/virtual_account_channel_code.py +xendit/payment_method/model/virtual_account_channel_properties.py +xendit/payment_method/model/virtual_account_channel_properties_patch.py +xendit/payment_method/model/virtual_account_parameters.py +xendit/payment_method/model/virtual_account_update_parameters.py +xendit/payment_method/payment_method_api.py +xendit/rest.py diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 00000000..cd802a1e --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.6.0 \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index e63fc874..00000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,18 +0,0 @@ -repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.1.0 - hooks: - - id: mixed-line-ending - - repo: https://github.com/ambv/black - rev: stable - hooks: - - id: black - language_version: python3.7 - - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.3 - hooks: - - id: flake8 - - repo: https://github.com/thlorenz/doctoc - rev: v1.4.0 - hooks: - - id: doctoc diff --git a/.tool-versions b/.tool-versions deleted file mode 100644 index 4896bb92..00000000 --- a/.tool-versions +++ /dev/null @@ -1 +0,0 @@ -python 3.7.13 diff --git a/LICENSE b/LICENSE index bcc74c0c..0d37b6c5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017-2022 Xendit +Copyright (c) 2017-2023 Xendit Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index a2b20a11..e3f39750 100644 --- a/README.md +++ b/README.md @@ -1,3304 +1,82 @@ - -# Xendit Python Library +![Xendit Python SDK](docs/header.jpg "Xendit Pyton SDK") -This library is the abstraction of Xendit API for access from applications written with Python. +# Xendit Python SDK - -## Table of Contents +The official Xendit Python SDK provides a simple and convenient way to call Xendit's REST API +in applications written in Python. - - +* Package version: 3.0.0 +## Requirements. -- [API Documentation](#api-documentation) -- [Requirements](#requirements) -- [Installation](#installation) -- [Usage](#usage) - - [API Key](#api-key) - - [Global Variable](#global-variable) - - [Use Xendit Instance](#use-xendit-instance) - - [Headers](#headers) - - [Object Creation](#object-creation) - - [Using Custom HTTP Client](#using-custom-http-client) - - [Balance Service](#balance-service) - - [Get Balance](#get-balance) - - [Credit Card Service](#credit-card-service) - - [Create Authorization](#create-authorization) - - [Reverse Authorization](#reverse-authorization) - - [Create Charge](#create-charge) - - [Capture Charge](#capture-charge) - - [Get Charge](#get-charge) - - [Create Refund](#create-refund) - - [Create Promotion](#create-promotion) - - [eWallets Service](#ewallets-service) - - [Create OVO Payment](#create-ovo-payment) - - [Create DANA Payment](#create-dana-payment) - - [Create LinkAja Payment](#create-linkaja-payment) - - [Get Payment Status](#get-payment-status) - - [Cardless Credit Service](#cardless-credit-service) - - [Create Payment / Generate Checkout URL](#create-payment--generate-checkout-url) - - [Calculate Payment Types](#calculate-payment-types) - - [QR Codes Service](#qr-codes-service) - - [Create QR Code](#create-qr-code) - - [Get QR Code by External ID](#get-qr-code-by-external-id) - - [Direct Debit Service](#direct-debit-service) - - [Create Customer](#create-customer) - - [Get Customer by Reference ID](#get-customer-by-reference-id) - - [Initialize Linked Account Tokenization](#initialize-linked-account-tokenization) - - [Validate OTP for Linked Account Token](#validate-otp-for-linked-account-token) - - [Retrieve Accessible Accounts by Linked Account Token](#retrieve-accessible-accounts-by-linked-account-token) - - [Create Payment Method](#create-payment-method) - - [Get Payment Methods by Customer ID](#get-payment-methods-by-customer-id) - - [Create Direct Debit Payment](#create-direct-debit-payment) - - [Create Recurring Payment with Direct Debit](#create-recurring-payment-with-direct-debit) - - [Validate OTP for Direct Debit Payment](#validate-otp-for-direct-debit-payment) - - [Get Direct Debit Payment Status by ID](#get-direct-debit-payment-status-by-id) - - [Get Direct Debit Payment Status by Reference ID](#get-direct-debit-payment-status-by-reference-id) - - [Virtual Account Service](#virtual-account-service) - - [Create Virtual Account](#create-virtual-account) - - [Get Virtual Account Banks](#get-virtual-account-banks) - - [Get Virtual Account](#get-virtual-account) - - [Update Virtual Account](#update-virtual-account) - - [Get Virtual Account Payment](#get-virtual-account-payment) - - [Retail Outlet Service](#retail-outlet-service) - - [Create Fixed Payment Code](#create-fixed-payment-code) - - [Update Fixed Payment Code](#update-fixed-payment-code) - - [Get Fixed Payment Code](#get-fixed-payment-code) - - [Invoice Service](#invoice-service) - - [Create Invoice](#create-invoice) - - [Get Invoice](#get-invoice) - - [Expire Invoice](#expire-invoice) - - [List All Invoice](#list-all-invoice) - - [Recurring Payment Service](#recurring-payment-service) - - [Create Recurring Payment](#create-recurring-payment) - - [Get Recurring Payment](#get-recurring-payment) - - [Edit Recurring Payment](#edit-recurring-payment) - - [Stop Recurring Payment](#stop-recurring-payment) - - [Pause Recurring Payment](#pause-recurring-payment) - - [Resume Recurring Payment](#resume-recurring-payment) - - [Payout Service](#payout-service) - - [Create Payout](#create-payout) - - [Get Payout](#get-payout) - - [Void a Payout](#void-a-payout) - - [Disbursement Service](#disbursement-service) - - [Create Disbursement](#create-disbursement) - - [Get Disbursement by ID](#get-disbursement-by-id) - - [Get Disbursement by External ID](#get-disbursement-by-external-id) - - [Get Available Banks](#get-available-banks) - - [Batch Disbursement Service](#batch-disbursement-service) - - [Create Batch Disbursement](#create-batch-disbursement) - - [Get Batch Disbursement Available Banks](#get-batch-disbursement-available-banks) - - [xenPlatform Service](#xenplatform-service) - - [Create Account](#create-account) - - [Set Callback URLs](#set-callback-urls) - - [Transfers](#transfers) - - [Payment Methods](#payment-methods) - - [Create Payment Method](#create-payment-method-1) - - [Get Payment Method](#get-payment-method) - - [Update Payment Method](#update-payment-method) - - [Expire Payment Method](#expire-payment-method) - - [List Payment Methods](#expire-payment-method) - - [Authorize Payment Method](#authorize-a-payment-method) - - [List Payments](#list-payments) - - [Payment Requests](#payment-requests) - - [Create Payment Request](#create-payment-request) - - [Get Payment Request](#get-payment-request) - - [Create Payment Request](#create-payment-request) - - [Confirm Payment Request](#confirm-payment-request) - - [Resend Auth for Payment Request](#resend-auth-for-payment-request) - - [List Payment Request](#list-payment-request) - - [Refunds](#refunds) - - [Create Refund](#create-refund) - - [Get Refund](#get-refund) - - [List Refund](#list-refunds) -- [Contributing](#contributing) - - [Tests](#tests) - - [Running the Test](#running-the-test) +Python >=3.6 - - -## API Documentation -Please check [Xendit API Reference](https://xendit.github.io/apireference/). - -## Requirements - -Python 3.7 or later +# Getting Started ## Installation -To use the package, run ```pip install xendit-python``` - -## Usage - -### API Key - -To add API Key, you have 2 option: Use global variable or use Xendit instance - -#### Global Variable - -```python -import xendit -xendit.api_key = "test-key123" +Install directly from Xendit's Github Repository: -# Then just run each class as static -from xendit import Balance -Balance.get() +```sh +pip install git+https://github.com/xendit/xendit-python.git ``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/xendit/xendit-python.git`) -#### Use Xendit Instance +Then import the package: ```python import xendit -x = xendit.Xendit(api_key="test-key123") - -# Then access each class from x attribute -Balance = x.Balance -Balance.get() -``` - -### Headers - -You can add headers by using the following keyword parameters -- X-IDEMPOTENCY-KEY: `x_idempotency_key` - -``` -VirtualAccount.create(x_idempotency_key="your-idemp-key") ``` -- for-user-id: `for_user_id` +### Setuptools -``` -Balance.get(for_user_id='subaccount-user-id') -``` - -- X-API-VERSION: `x_api_version` - -``` -Balance.get(x_api_version='2020-01-01') -``` - -### Object Creation - -If an API need an object as its parameter, you can use either dictionary for that class or a helper method e.g: +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). -```python -items = [] -item = { - id: "123123", - name: "Phone Case", - price: 100000, - quantity: 1 -} -items.append(item) -EWallet.create_linkaja_payment( - external_id="linkaja-ewallet-test-1593663498", - phone="089911111111", - items=items, - amount=300000, - callback_url="https://my-shop.com/callbacks", - redirect_url="https://xendit.co/", -) -``` - -is equivalent with - -```python -items = [] -item = EWallet.helper_create_linkaja_item( - id="123123", name="Phone Case", price=100000, quantity=1 -) -items.append(item) -EWallet.create_linkaja_payment( - external_id="linkaja-ewallet-test-1593663498", - phone="089911111111", - items=items, - amount=300000, - callback_url="https://my-shop.com/callbacks", - redirect_url="https://xendit.co/", -) +```sh +python setup.py install --user ``` +(or `sudo python setup.py install` to install the package for all users) -### Using Custom HTTP Client - -To use your own HTTP Client, you can do it as long as your http client adhere to HTTP client interface at `xendit/network/http_client_interface.py`. For example, [requests](https://github.com/psf/requests) library are compatible with that interface, so we can freely use it in our library. To attach it to your instance, add it to your xendit parameter. - +Then import the package: ```python import xendit - -xendit_instance = xendit.Xendit(api_key='', http_client=YourHTTPClientClass) -``` - -### Balance Service - -#### Get Balance - -The `account_type` parameter is optional. - -```python -from xendit import Balance -Balance.get() - -Balance.AccountType( - account_type=BalanceAccountType.CASH, -) -``` - -Usage example: - -```python -from xendit import Balance, BalanceAccountType -Balance balance = Balance.get( - account_type=BalanceAccountType.CASH, -) - -# To get the JSON view -print(balance) - -# To get only the value -print(balance.balance) -``` - -Will return - -``` -{'balance': 1000000000} -1000000000 -``` - -### Credit Card Service - -#### Create Authorization - -```python -from xendit import CreditCard - -charge = CreditCard.create_authorization( - token_id="5f0410898bcf7a001a00879d", - external_id="card_preAuth-1594106356", - amount=75000, - card_cvn="123", - metadata={ - "meta": "data", - }, -) -print(charge) -``` - -Will return - -``` -{ - "status": "AUTHORIZED", - "authorized_amount": 75000, - "capture_amount": 0, - "currency": "IDR", - "business_id": "5ed75086a883856178afc12e", - "merchant_id": "xendit_ctv_agg", - "merchant_reference_code": "5f0421faa98815a4f4c92a0d", - "external_id": "card_preAuth-1594106356", - "eci": "07", - "charge_type": "MULTIPLE_USE_TOKEN", - "masked_card_number": "400000XXXXXX0002", - "card_brand": "VISA", - "card_type": "CREDIT", - "descriptor": "XENDIT*XENDIT&#X27;S INTERN", - "bank_reconciliation_id": "5941063625146828103011", - "approval_code": "831000", - "created": "2020-07-07T07:19:22.921Z", - "id": "5f0421fa8cc1e8001973a1d6", - "metadata": { - "meta": "data" - } -} -``` - -#### Reverse Authorization - -```python -from xendit import CreditCard - -reverse_authorization = CreditCard.reverse_authorizatiton( - credit_card_charge_id="5f0421fa8cc1e8001973a1d6", - external_id="reverse-authorization-1594106387", -) -print(reverse_authorization) -``` - -Will return - -``` -{ - "status": "SUCCEEDED", - "currency": "IDR", - "credit_card_charge_id": "5f0421fa8cc1e8001973a1d6", - "business_id": "5ed75086a883856178afc12e", - "external_id": "card_preAuth-1594106356", - "amount": 75000, - "created": "2020-07-07T07:19:48.896Z", - "id": "5f0422148cc1e8001973a1dc" -} -``` - -#### Create Charge - -```python -from xendit import CreditCard - -charge = CreditCard.create_charge( - token_id="5f0410898bcf7a001a00879d", - external_id="card_charge-1594106478", - amount=75000, - card_cvn="123", - metadata={ - "meta": "data", - }, -) -print(charge) -``` - -Will return - -``` -{ - "status": "CAPTURED", - "authorized_amount": 75000, - "capture_amount": 75000, - "currency": "IDR", - "business_id": "5ed75086a883856178afc12e", - "merchant_id": "xendit_ctv_agg", - "merchant_reference_code": "5f0422746fc1d25bd222df2e", - "external_id": "card_charge-1594106478", - "eci": "07", - "charge_type": "MULTIPLE_USE_TOKEN", - "masked_card_number": "400000XXXXXX0002", - "card_brand": "VISA", - "card_type": "CREDIT", - "descriptor": "XENDIT*XENDIT&#X27;S INTERN", - "bank_reconciliation_id": "5941064846646923303008", - "approval_code": "831000", - "created": "2020-07-07T07:21:25.027Z", - "id": "5f0422752bbbe50019a368b5", - "metadata": { - "meta": "data" - } -} -``` - -#### Capture Charge - -```python -from xendit import CreditCard - -charge = CreditCard.capture_charge( - credit_card_charge_id="5f0422aa2bbbe50019a368c2", - amount=75000, -) -print(charge) -``` - -Will return - -``` -{ - "status": "CAPTURED", - "authorized_amount": 75000, - "capture_amount": 75000, - "currency": "IDR", - "created": "2020-07-07T07:22:18.719Z", - "business_id": "5ed75086a883856178afc12e", - "merchant_id": "xendit_ctv_agg", - "merchant_reference_code": "5f0422aa6fc1d25bd222df32", - "external_id": "card_preAuth-1594106532", - "eci": "07", - "charge_type": "MULTIPLE_USE_TOKEN", - "masked_card_number": "400000XXXXXX0002", - "card_brand": "VISA", - "card_type": "CREDIT", - "descriptor": "XENDIT*XENDIT&#X27;S INTERN", - "bank_reconciliation_id": "5941065383296525603007", - "approval_code": "831000", - "mid_label": "CTV_TEST", - "id": "5f0422aa2bbbe50019a368c2" -} -``` - -#### Get Charge - -```python -from xendit import CreditCard - -charge = CreditCard.get_charge( - credit_card_charge_id="5f0422aa2bbbe50019a368c2", -) -print(charge) -``` - -Will return - -``` -{ - "status": "CAPTURED", - "authorized_amount": 75000, - "capture_amount": 75000, - "currency": "IDR", - "created": "2020-07-07T07:22:18.719Z", - "business_id": "5ed75086a883856178afc12e", - "merchant_id": "xendit_ctv_agg", - "merchant_reference_code": "5f0422aa6fc1d25bd222df32", - "external_id": "card_preAuth-1594106532", - "eci": "07", - "charge_type": "MULTIPLE_USE_TOKEN", - "masked_card_number": "400000XXXXXX0002", - "card_brand": "VISA", - "card_type": "CREDIT", - "descriptor": "XENDIT*XENDIT&#X27;S INTERN", - "bank_reconciliation_id": "5941065383296525603007", - "approval_code": "831000", - "mid_label": "CTV_TEST", - "metadata": {}, - "id": "5f0422aa2bbbe50019a368c2" -} -``` - -#### Create Refund - -```python -from xendit import CreditCard - -refund = CreditCard.create_refund( - credit_card_charge_id="5f0422aa2bbbe50019a368c2", - amount=10000, - external_id="card_refund-1594106755", -) -print(refund) -``` - -Will return - -``` -{ - "status": "REQUESTED", - "currency": "IDR", - "credit_card_charge_id": "5f0422aa2bbbe50019a368c2", - "user_id": "5ed75086a883856178afc12e", - "amount": 10000, - "external_id": "card_refund-1594106755", - "created": "2020-07-07T07:25:56.872Z", - "updated": "2020-07-07T07:25:57.740Z", - "id": "5f0423848bb8da600c57c44f", - "fee_refund_amount": 290 -} -``` - -#### Create Promotion - -```python -from xendit import CreditCard - -promotion = CreditCard.create_promotion( - reference_id="BRI_20_JAN-1594176600", - description="20% discount applied for all BRI cards", - discount_amount=10000, - bin_list=['400000', '460000'], - start_time="2020-01-01T00:00:00.000Z", - end_time="2021-01-01T00:00:00.000Z", -) -print(promotion) -``` - -Will return - -``` -{ - "business_id": "5ed75086a883856178afc12e", - "reference_id": "BRI_20_JAN-1594176600", - "description": "20% discount applied for all BRI cards", - "start_time": "2020-01-01T00:00:00.000Z", - "end_time": "2021-01-01T00:00:00.000Z", - "type": "CARD_BIN", - "discount_amount": 10000, - "bin_list": [ - "400000", - "460000" - ], - "currency": "IDR", - "id": "c65a2ae7-ce75-4a15-bbec-55d076f46bd0", - "created": "2020-07-08T02:50:02.296Z", - "status": "ACTIVE" -} -``` - -### eWallets Service - -#### Create E-Wallet Charge -```python -from xendit import EWallet - -basket = [] -basket_item = EWallet.helper_create_basket_item( - reference_id = "basket-product-ref-id", - name = "product_name", - category = "product_category", - currency = "IDR", - price = 50000, - quantity = 5, - type = "product_type", - sub_category = "product_sub_category", - metadata = { - "meta": "data" - } -) -basket.append(basket_item) - -ewallet_charge = EWallet.create_ewallet_charge( - reference_id="basket-product-ref-id", - currency="IDR", - amount=10000, - checkout_method="ONE_TIME_PAYMENT", - channel_code="ID_SHOPEEPAY", - channel_properties={ - "success_redirect_url": "https://yourwebsite.com/order/123", - }, - basket=basket, -) -``` - -Will return - -```json -{ - "id": "ewc_f3925450-5c54-4777-98c1-fcf22b0d1e1c", - "business_id": "5ed75086a883856178afc12e", - "reference_id": "basket-product-ref-id", - "status": "PENDING", - "currency": "IDR", - "charge_amount": 10000, - "capture_amount": 10000, - "checkout_method": "ONE_TIME_PAYMENT", - "channel_code": "ID_SHOPEEPAY", - "channel_properties": { - "success_redirect_url": "https://yourwebsite.com/order/123", - }, - "actions": { - "desktop_web_checkout_url": null, - "mobile_web_checkout_url": null, - "mobile_deeplink_checkout_url": "https://ewallet-mock-connector.xendit.co/v1/ewallet_connector/checkouts?token=ZjQyOGIzMGVlNGFjOWJhNTE2YWQ3NGQyN2RiMTIwODg6ZTY2YjA2YjQ1ZjJlZWI0NDA4OGNjODg2NGFlYzQ2N2U5YTI5MjM3ODUzODViYzljNjQyYWYwOGExMjU4MzdmMTc3NDFlMWZmYjcxN2MzOWZiYmMyNjY4N2ViNmMxM2ZkMjg1ZmIzZDM5ZmZiZDYzM2ViNGMyMDRkOWM3ZTUzNWUyMDBlOWUzMzdhZTkwZjllZjQwZjQyMjExOTkyNWQ2MTg2YzgzZTQ3N2JhYWZkNDFhN2U0MWM1ZDMzMGJmMmNhNzhiMjhmMmY5ZDBjZDQ4MjlkODA3MjE5YWQzYTlhNTE0YmM1NjUzYjljMmZlOWU1YjMwM2FmNTZiNmViNGVlZDIxODQzNzdjNDJmYjRmNzBmZDZlZDhlM2MyMGM4YmExY2RmNTVkOTdjZmU3MWYxMWVmMDYzMmQzNGE1ZTFmMzE=", - "qr_checkout_string": "test-qr-string", - }, - "is_redirect_required": true, - "callback_url": "https://yourwebsite.com/order/123", - "created": "2021-02-09T06:22:35.064408Z", - "updated": "2021-02-09T06:22:35.064408Z", - "voided_at": null, - "capture_now": true, - "customer_id": null, - "payment_method_id": null, - "failure_code": null, - "basket": [ - { - "reference_id": "basket-product-ref-id", - "name": "product_name", - "category": "product_category", - "currency": "IDR", - "price": 50000, - "quantity": 5, - "type": "product_type", - "url": "", - "description": "", - "sub_category": "product_sub_category", - "metadata": { - "meta": "data" - } - } - ], - "metadata": null, -} -``` - -#### Get E-Wallet Charge Status -```python -from xendit import EWallet - -ewallet_charge = EWallet.get_ewallet_charge_status( - charge_id="ewc_f3925450-5c54-4777-98c1-fcf22b0d1e1c", -) -``` - -Will return - -```json -{ - "id": "ewc_f3925450-5c54-4777-98c1-fcf22b0d1e1c", - "business_id": "5ed75086a883856178afc12e", - "reference_id": "basket-product-ref-id", - "status": "PENDING", - "currency": "IDR", - "charge_amount": 10000, - "capture_amount": 10000, - "checkout_method": "ONE_TIME_PAYMENT", - "channel_code": "ID_SHOPEEPAY", - "channel_properties": { - "success_redirect_url": "https://yourwebsite.com/order/123", - }, - "actions": { - "desktop_web_checkout_url": null, - "mobile_web_checkout_url": null, - "mobile_deeplink_checkout_url": "https://ewallet-mock-connector.xendit.co/v1/ewallet_connector/checkouts?token=ZjQyOGIzMGVlNGFjOWJhNTE2YWQ3NGQyN2RiMTIwODg6ZTY2YjA2YjQ1ZjJlZWI0NDA4OGNjODg2NGFlYzQ2N2U5YTI5MjM3ODUzODViYzljNjQyYWYwOGExMjU4MzdmMTc3NDFlMWZmYjcxN2MzOWZiYmMyNjY4N2ViNmMxM2ZkMjg1ZmIzZDM5ZmZiZDYzM2ViNGMyMDRkOWM3ZTUzNWUyMDBlOWUzMzdhZTkwZjllZjQwZjQyMjExOTkyNWQ2MTg2YzgzZTQ3N2JhYWZkNDFhN2U0MWM1ZDMzMGJmMmNhNzhiMjhmMmY5ZDBjZDQ4MjlkODA3MjE5YWQzYTlhNTE0YmM1NjUzYjljMmZlOWU1YjMwM2FmNTZiNmViNGVlZDIxODQzNzdjNDJmYjRmNzBmZDZlZDhlM2MyMGM4YmExY2RmNTVkOTdjZmU3MWYxMWVmMDYzMmQzNGE1ZTFmMzE=", - "qr_checkout_string": "test-qr-string", - }, - "is_redirect_required": true, - "callback_url": "https://yourwebsite.com/order/123", - "created": "2021-02-09T06:22:35.064408Z", - "updated": "2021-02-09T06:22:35.064408Z", - "voided_at": null, - "capture_now": true, - "customer_id": null, - "payment_method_id": null, - "failure_code": null, - "basket": [ - { - "reference_id": "basket-product-ref-id", - "name": "product_name", - "category": "product_category", - "currency": "IDR", - "price": 50000, - "quantity": 5, - "type": "product_type", - "url": "", - "description": "", - "sub_category": "product_sub_category", - "metadata": { - "meta": "data" - } - } - ], - "metadata": null, -} ``` -### Cardless Credit Service +## Authorization -#### Create Payment / Generate Checkout URL +The SDK needs to be instantiated using your secret API key obtained from the [Xendit Dashboard](https://dashboard.xendit.co/settings/developers#api-keys). +You can sign up for a free Dashboard account [here](https://dashboard.xendit.co/register). ```python -from xendit import CardlessCredit, CardlessCreditType - -cardless_credit_items = [] -cardless_credit_items.append( - CardlessCredit.helper_create_item( - id="item-123", - name="Phone Case", - price=200000, - type="Smartphone", - url="http://example.com/phone/phone_case", - quantity=2, - ) -) -customer_details = CardlessCredit.helper_create_customer_details( - first_name="customer first name", - last_name="customer last name", - email="customer@email.com", - phone="0812332145", -) -shipping_address = CardlessCredit.helper_create_shipping_address( - first_name="first name", - last_name="last name", - address="Jl Teknologi No. 12", - city="Jakarta", - postal_code="12345", - phone="081513114262", - country_code="IDN", -) -cardless_credit_payment = CardlessCredit.create_payment( - cardless_credit_type=CardlessCreditType.KREDIVO, - external_id="id-1595923113", - amount=10000, - payment_type="3_months", - items=cardless_credit_items, - customer_details=customer_details, - shipping_address=shipping_address, - redirect_url="https://my-shop.com/home", - callback_url="https://my-shop.com/callback", -) -print(cardless_credit_payment) -``` - -Will return - -``` -{ - "redirect_url": "https://pay-sandbox.kredivo.com/signIn?tk=26458cdf-660c-4491-a1de-bb6e63312d8a", - "order_id": "e8ae4066-7980-499f-b92c-eb3a587782c1", - "external_id": "id-1595923113", - "cardless_credit_type": "KREDIVO" -} -``` - -#### Calculate Payment Types - -```python -from xendit import CardlessCredit, CardlessCreditType - -cardless_credit_items = [] -cardless_credit_items.append( - CardlessCredit.helper_create_item( - id="item-123", - name="Phone Case", - price=200000, - type="Smartphone", - url="http://example.com/phone/phone_case", - quantity=2, - ) -) -cardless_credit_payment_types = CardlessCredit.calculate_payment_type( - cardless_credit_type=CardlessCreditType.KREDIVO, - amount=10000, - items=cardless_credit_items, -) -print(cardless_credit_payment_types) -``` - -Will return - -``` -{ - "message": "Available payment types are listed.", - "payments": [ - { - "raw_monthly_installment": 401000, - "name": "Bayar dalam 30 hari", - "amount": 401000, - "installment_amount": 401000, - "raw_amount": 401000, - "rate": 0, - "down_payment": 0, - "monthly_installment": 401000, - "discounted_monthly_installment": 0, - "tenure": 1, - "id": "30_days" - } - ] -} -``` - -### QR Codes Service - -#### Create QR Code - -```python -from xendit import QRCode, QRCodeType - -qrcode = QRCode.create( - external_id="qrcode-id-1594794038", - type=QRCodeType.DYNAMIC, - callback_url="https://webhook.site", - amount=4000, -) -print(qrcode) -``` - -Will return - -``` -{ - "id": "qr_13c31ddd-9d58-449b-9f52-1bf5123a45b5", - "external_id": "qrcode-id-1594794038", - "amount": 4000, - "qr_string": "00020101021226660014ID.LINKAJA.WWW011893600911002411480002152004230411480010303UME51450015ID.OR.GPNQR.WWW02150000000000000000303UME520454995802ID5920Placeholder merchant6007Jakarta610612345662380115wLoc6DRGwAOgSkZ0715wLoc6DRGwAOgSkZ53033605404400063047668", - "callback_url": "https://webhook.site", - "type": "DYNAMIC", - "status": "ACTIVE", - "created": "2020-07-15T06:20:40.636Z", - "updated": "2020-07-15T06:20:40.636Z" -} -``` - -#### Get QR Code by External ID - -```python -from xendit import QRCode - -qrcode = QRCode.get_by_ext_id( - external_id="qrcode-id-1594794038", -) -print(qrcode) -``` - -Will return - -``` -{ - "id": "qr_13c31ddd-9d58-449b-9f52-1bf5123a45b5", - "external_id": "qrcode-id-1594794038", - "amount": 4000, - "qr_string": "00020101021226660014ID.LINKAJA.WWW011893600911002411480002152004230411480010303UME51450015ID.OR.GPNQR.WWW02150000000000000000303UME520454995802ID5920Placeholder merchant6007Jakarta610612345662380115wLoc6DRGwAOgSkZ0715wLoc6DRGwAOgSkZ53033605404400063047668", - "callback_url": "https://webhook.site", - "type": "DYNAMIC", - "status": "ACTIVE", - "created": "2020-07-15T06:20:40.636Z", - "updated": "2020-07-15T06:20:40.636Z" -} -``` - -### Direct Debit Service - -#### Create Customer - -```python -from xendit import DirectDebit - -customer = DirectDebit.create_customer( - reference_id="merc-1594279037", - email="t@x.co", - given_names="Adyaksa", -) -print(customer) -``` - -Will return - -``` -{ - "id": "ed20b5db-df04-41fc-8018-8ea4ac4d1030", - "reference_id": "merc-1594279037", - "description": null, - "given_names": "Adyaksa", - "middle_name": null, - "surname": null, - "mobile_number": null, - "phone_number": null, - "email": "t@x.co", - "nationality": null, - "addresses": null, - "date_of_birth": null, - "employment": null, - "source_of_wealth": null, - "metadata": null -} -``` - -#### Get Customer by Reference ID - -```python -from xendit import DirectDebit - -customer = DirectDebit.get_customer_by_ref_id( - reference_id="merc-1594279037", -) -print(customer) -``` - -Will return - -``` -[{ - "id": "ed20b5db-df04-41fc-8018-8ea4ac4d1030", - "reference_id": "merc-1594279037", - "description": null, - "given_names": "Adyaksa", - "middle_name": null, - "surname": null, - "mobile_number": null, - "phone_number": null, - "email": "t@x.co", - "nationality": null, - "addresses": null, - "date_of_birth": null, - "employment": null, - "source_of_wealth": null, - "metadata": null -}] -``` - -#### Initialize Linked Account Tokenization - -```python -from xendit import DirectDebit - -card_linking = DirectDebit.helper_create_card_link( - account_mobile_number="+62818555988", - card_last_four="8888", - card_expiry="06/24", - account_email="test.email@xendit.co", -) -linked_account = DirectDebit.initialize_tokenization( - customer_id="ed20b5db-df04-41fc-8018-8ea4ac4d1030", - channel_code="DC_BRI", - properties=card_linking, -) -print(linked_account) -``` - -Will return - -``` -{ - "id": "lat-f325b757-0aae-4c24-92c5-3661e299e154", - "customer_id": "ed20b5db-df04-41fc-8018-8ea4ac4d1030", - "channel_code": "DC_BRI", - "authorizer_url": null, - "status": "PENDING", - "metadata": null -} -``` - -#### Validate OTP for Linked Account Token - -```python -from xendit import DirectDebit - -linked_account = DirectDebit.validate_token_otp( - linked_account_token_id="lat-f325b757-0aae-4c24-92c5-3661e299e154", - otp_code="333000", -) -print(linked_account) -``` - -Will return - -``` -{ - "id": "lat-f325b757-0aae-4c24-92c5-3661e299e154", - "customer_id": "ed20b5db-df04-41fc-8018-8ea4ac4d1030", - "channel_code": "DC_BRI", - "status": "SUCCESS", - "metadata": null -} -``` - -#### Retrieve Accessible Accounts by Linked Account Token - -```python -from xendit import DirectDebit - -accessible_accounts = DirectDebit.get_accessible_account_by_token( - linked_account_token_id="lat-f325b757-0aae-4c24-92c5-3661e299e154", -) -print(accessible_accounts) -``` - -Will return - -``` -[{ - "channel_code": "DC_BRI", - "id": "la-08b089e8-7035-4f5f-bdd9-94edd9dc9480", - "properties": { - "card_expiry": "06/24", - "card_last_four": "8888", - "currency": "IDR", - "description": "" - }, - "type": "DEBIT_CARD" -}] -``` - -#### Create Payment Method - -```python -from xendit import DirectDebit, DirectDebitPaymentMethodType - -payment_method = DirectDebit.create_payment_method( - customer_id="ed20b5db-df04-41fc-8018-8ea4ac4d1030", - type=DirectDebitPaymentMethodType.DEBIT_CARD, - properties={'id': 'la-fac7e744-ab40-4100-a447-cbbb16f29ded'}, -) - -print(payment_method) -``` - -Will return - -``` -{ - "customer_id": "ed20b5db-df04-41fc-8018-8ea4ac4d1030", - "type": "DEBIT_CARD", - "properties": { - "id": "la-fac7e744-ab40-4100-a447-cbbb16f29ded", - "currency": "IDR", - "card_expiry": "06/24", - "description": "", - "channel_code": "DC_BRI", - "card_last_four": "8888" - }, - "status": "ACTIVE", - "metadata": {}, - "id": "pm-b6116aea-8c23-42d0-a1e6-33227b52fccd", - "created": "2020-07-13T07:28:57.716Z", - "updated": "2020-07-13T07:28:57.716Z" -} -``` - -#### Get Payment Methods by Customer ID - -```python -from xendit import DirectDebit - -payment_methods = DirectDebit.get_payment_methods_by_customer_id( - customer_id="ed20b5db-df04-41fc-8018-8ea4ac4d1030", -) - -print(payment_methods) -``` - -Will return - -``` -[{ - "id": "pm-b6116aea-8c23-42d0-a1e6-33227b52fccd", - "customer_id": "ed20b5db-df04-41fc-8018-8ea4ac4d1030", - "status": "ACTIVE", - "type": "DEBIT_CARD", - "properties": { - "id": "la-fac7e744-ab40-4100-a447-cbbb16f29ded", - "currency": "IDR", - "card_expiry": "06/24", - "description": "", - "channel_code": "DC_BRI", - "card_last_four": "8888" - }, - "metadata": {}, - "created": "2020-07-13T07:28:57.716Z", - "updated": "2020-07-13T07:28:57.716Z" -}] -``` - -#### Create Direct Debit Payment - -```python -from xendit import DirectDebit - -payment = DirectDebit.create_payment( - reference_id="direct-debit-ref-1594718940", - payment_method_id="pm-b6116aea-8c23-42d0-a1e6-33227b52fccd", - currency="IDR", - amount="60000", - callback_url="http://webhook.site/", - enable_otp=True, - idempotency_key="idemp_key-1594718940", -) - -print(payment) -``` - -Will return - -``` -{ - "failure_code": null, - "otp_mobile_number": null, - "otp_expiration_timestamp": null, - "id": "ddpy-eaa093b6-b669-401a-ba2e-61ac644b2aff", - "reference_id": "direct-debit-ref-1594718940", - "payment_method_id": "pm-b6116aea-8c23-42d0-a1e6-33227b52fccd", - "channel_code": "DC_BRI", - "currency": "IDR", - "amount": 60000, - "is_otp_required": true, - "basket": null, - "description": "", - "status": "PENDING", - "metadata": null, - "created": "2020-07-14T09:29:02.614443Z", - "updated": "2020-07-14T09:29:02.614443Z" -} -``` - -#### Create Recurring Payment with Direct Debit - -You can use [Create Recurring Payment](#create-recurring-payment) to use this feature. - -#### Validate OTP for Direct Debit Payment - -```python -from xendit import DirectDebit - -payment = DirectDebit.validate_payment_otp( - direct_debit_id="ddpy-eaa093b6-b669-401a-ba2e-61ac644b2aff", - otp_code="222000", -) - -print(payment) -``` - -Will return - -``` -{ - "failure_code": null, - "otp_mobile_number": null, - "otp_expiration_timestamp": null, - "id": "ddpy-eaa093b6-b669-401a-ba2e-61ac644b2aff", - "reference_id": "direct-debit-ref-1594718940", - "payment_method_id": "pm-b6116aea-8c23-42d0-a1e6-33227b52fccd", - "channel_code": "DC_BRI", - "currency": "IDR", - "amount": 60000, - "is_otp_required": true, - "basket": null, - "description": "", - "status": "PENDING", - "metadata": null, - "created": "2020-07-14T09:29:02.614443Z", - "updated": "2020-07-14T09:29:02.614443Z" -} -``` - -#### Get Direct Debit Payment Status by ID +import xendit +from xendit.apis import BalancesApi +from pprint import pprint -```python -from xendit import DirectDebit +xendit.set_api_key('XENDIT_API_KEY') -payment = DirectDebit.get_payment_status( - direct_debit_id="ddpy-38ef50a8-00f0-4019-8b28-9bca81f2cbf1", -) +client = xendit.ApiClient() -print(payment) +try: + response = BalancesApi(client).get_balance('CASH') + pprint(response) +except xendit.ApiException as e: + print("Exception when calling BalancesApi->get_balance: %s\n" % e) ``` -Will return +# Documentation -``` -{ - "failure_code": null, - "otp_mobile_number": null, - "otp_expiration_timestamp": null, - "id": "ddpy-38ef50a8-00f0-4019-8b28-9bca81f2cbf1", - "reference_id": "direct-debit-ref-1594717458", - "payment_method_id": "pm-b6116aea-8c23-42d0-a1e6-33227b52fccd", - "channel_code": "DC_BRI", - "currency": "IDR", - "amount": 60000, - "is_otp_required": false, - "basket": null, - "description": "", - "status": "PENDING", - "metadata": null, - "created": "2020-07-14T09:04:20.031451Z", - "updated": "2020-07-14T09:04:20.031451Z" -} -``` +Find detailed API infomration and examples for each of our product's by clicking the links below, -#### Get Direct Debit Payment Status by Reference ID +* [Balance](docs/BalanceApi.md) +* [Invoice](docs/InvoiceApi.md) +* [PaymentMethod](docs/PaymentMethodApi.md) +* [PaymentRequest](docs/PaymentRequestApi.md) +* [Payout](docs/PayoutApi.md) +* [Refund](docs/RefundApi.md) +* [Transaction](docs/TransactionApi.md) -```python -from xendit import DirectDebit +All URIs are relative to *https://api.xendit.co*. For more information about our API, please refer to *https://developers.xendit.co/*. -payments = DirectDebit.get_payment_status_by_ref_id( - reference_id="direct-debit-ref-1594717458", -) +Further Reading -print(payments) -``` - -Will return - -``` -[{ - "amount": 60000, - "basket": null, - "channel_code": "DC_BRI", - "created": "2020-07-14T09:04:20.031451Z", - "currency": "IDR", - "description": "", - "failure_code": null, - "id": "ddpy-38ef50a8-00f0-4019-8b28-9bca81f2cbf1", - "is_otp_required": false, - "metadata": null, - "otp_expiration_timestamp": null, - "otp_mobile_number": null, - "payment_method_id": "pm-b6116aea-8c23-42d0-a1e6-33227b52fccd", - "reference_id": "direct-debit-ref-1594717458", - "status": "PENDING", - "updated": "2020-07-14T09:04:20.031451Z" -}] -``` - -### Virtual Account Service - -#### Create Virtual Account - -```python -from xendit import VirtualAccount - -virtual_account = VirtualAccount.create( - external_id="demo_1475459775872", - bank_code="BNI", - name="Rika Sutanto", -) -print(virtual_account) -``` - -Will return - -``` -{ - "owner_id": "5ed75086a883856178afc12e", - "external_id": "demo_1475459775872", - "bank_code": "BNI", - "merchant_code": "8808", - "name": "Rika Sutanto", - "account_number": "8808999956275653", - "is_single_use": false, - "status": "PENDING", - "expiration_date": "2051-06-22T17:00:00.000Z", - "is_closed": false, - "id": "5ef174c48dd9ea2fc97d6a1e" -} -``` - -#### Get Virtual Account Banks -```python -from xendit import VirtualAccount - -virtual_account_banks = VirtualAccount.get_banks() -print(virtual_account_banks) -``` - -Will return - -``` -[{ - "name": "Bank Mandiri", - "code": "MANDIRI" -}, { - "name": "Bank Negara Indonesia", - "code": "BNI" -}, { - "name": "Bank Rakyat Indonesia", - "code": "BRI" -}, { - "name": "Bank Permata", - "code": "PERMATA" -}, { - "name": "Bank Central Asia", - "code": "BCA" -}] -``` -#### Get Virtual Account - -```python -from xendit import VirtualAccount - -virtual_account = VirtualAccount.get( - id="5eec3a3e8dd9ea2fc97d6728", -) -print(virtual_account) -``` - -Will return - -``` -{ - "owner_id": "5ed75086a883856178afc12e", - "external_id": "demo_1475459775872", - "bank_code": "BNI", - "merchant_code": "8808", - "name": "Rika Sutanto", - "account_number": "8808999917965673", - "is_single_use": true, - "status": "ACTIVE", - "expiration_date": "2051-06-18T17:00:00.000Z", - "is_closed": false, - "id": "5eec3a3e8dd9ea2fc97d6728" -} -``` - -#### Update Virtual Account - -```python -from xendit import VirtualAccount - -virtual_account = VirtualAccount.update( - id="5eec3a3e8dd9ea2fc97d6728", - is_single_use=True, -) -print(virtual_account) -``` - -Will return - -``` -{ - "owner_id": "5ed75086a883856178afc12e", - "external_id": "demo_1475459775872", - "bank_code": "BNI", - "merchant_code": "8808", - "name": "Rika Sutanto", - "account_number": "8808999917965673", - "is_single_use": true, - "status": "PENDING", - "expiration_date": "2051-06-18T17:00:00.000Z", - "is_closed": false, - "id": "5eec3a3e8dd9ea2fc97d6728" -} -``` - -#### Get Virtual Account Payment - -```python -from xendit import VirtualAccount - -virtual_account_payment = VirtualAccount.get_payment( - payment_id="5ef18efca7d10d1b4d61fb52", -) -print(virtual_account_payment) -``` - -Will return - -``` -{ - "id": "5ef18efcf9ce3b5f8e188ee4", - "payment_id": "5ef18efca7d10d1b4d61fb52", - "callback_virtual_account_id": "5ef18ece8dd9ea2fc97d6a84", - "external_id": "VA_fixed-1592889038", - "merchant_code": "88608", - "account_number": "9999317837", - "bank_code": "MANDIRI", - "amount": 50000, - "transaction_timestamp": "2020-06-23T05:11:24.000Z" -} -``` - -### Retail Outlet Service - -#### Create Fixed Payment Code - -```python -from xendit import RetailOutlet - -retail_outlet = RetailOutlet.create_fixed_payment_code( - external_id="demo_fixed_payment_code_123", - retail_outlet_name="ALFAMART", - name="Rika Sutanto", - expected_amount=10000, -) -print(retail_outlet) -``` - -Will return - -``` -{ - "owner_id": "5ed75086a883856178afc12e", - "external_id": "demo_fixed_payment_code_123", - "retail_outlet_name": "ALFAMART", - "prefix": "TEST", - "name": "Rika Sutanto", - "payment_code": "TEST56147", - "expected_amount": 10000, - "is_single_use": False, - "expiration_date": "2051-06-23T17:00:00.000Z", - "id": "5ef2f0f8e7f5c14077275493", -} -``` - -#### Update Fixed Payment Code - -```python -from xendit import RetailOutlet - -retail_outlet = RetailOutlet.update_fixed_payment_code( - fixed_payment_code_id="5ef2f0f8e7f5c14077275493", - name="Joe Contini", -) -print(retail_outlet) -``` - -Will return - -``` -{ - "owner_id": "5ed75086a883856178afc12e", - "external_id": "demo_fixed_payment_code_123", - "retail_outlet_name": "ALFAMART", - "prefix": "TEST", - "name": "Joe Contini", - "payment_code": "TEST56147", - "expected_amount": 10000, - "is_single_use": False, - "expiration_date": "2051-06-23T17:00:00.000Z", - "id": "5ef2f0f8e7f5c14077275493", -} -``` - -#### Get Fixed Payment Code - -```python -from xendit import RetailOutlet - -retail_outlet = RetailOutlet.get_fixed_payment_code( - fixed_payment_code_id="5ef2f0f8e7f5c14077275493", -) -print(retail_outlet) -``` - -Will return - -``` -{ - "owner_id": "5ed75086a883856178afc12e", - "external_id": "demo_fixed_payment_code_123", - "retail_outlet_name": "ALFAMART", - "prefix": "TEST", - "name": "Rika Sutanto", - "payment_code": "TEST56147", - "expected_amount": 10000, - "is_single_use": False, - "expiration_date": "2051-06-23T17:00:00.000Z", - "id": "5ef2f0f8e7f5c14077275493", -} -``` - -### Invoice Service - -#### Create Invoice - -```python -from xendit import Invoice - -invoice = Invoice.create( - external_id="invoice-1593684000", - amount=20000, - payer_email="customer@domain.com", - description="Invoice Demo #123", -) -print(invoice) -``` - -Will return - -``` -{ - "id": "5efdb0210425db620ec35fb3", - "external_id": "invoice-1593684000", - "user_id": "5ed75086a883856178afc12e", - "status": "PENDING", - "merchant_name": "Xendit&#x27;s Intern", - "merchant_profile_picture_url": "https://xnd-companies.s3.amazonaws.com/prod/1591169469152_279.png", - "amount": 20000, - "payer_email": "customer@domain.com", - "description": "Invoice Demo #123", - "expiry_date": "2020-07-03T10:00:01.148Z", - "invoice_url": "https://invoice-staging.xendit.co/web/invoices/5efdb0210425db620ec35fb3", - "available_banks": [ - { - "bank_code": "MANDIRI", - "collection_type": "POOL", - "bank_account_number": "8860846854335", - "transfer_amount": 20000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0 - }, - { - "bank_code": "BRI", - "collection_type": "POOL", - "bank_account_number": "2621554807492", - "transfer_amount": 20000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0 - }, - { - "bank_code": "BNI", - "collection_type": "POOL", - "bank_account_number": "880854597383", - "transfer_amount": 20000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0 - }, - { - "bank_code": "PERMATA", - "collection_type": "POOL", - "bank_account_number": "821456659745", - "transfer_amount": 20000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0 - }, - { - "bank_code": "BCA", - "collection_type": "POOL", - "bank_account_number": "1076619844859", - "transfer_amount": 20000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0 - } - ], - "available_retail_outlets": [ - { - "retail_outlet_name": "ALFAMART", - "payment_code": "TEST34956", - "transfer_amount": 20000 - } - ], - "available_ewallets": [], - "should_exclude_credit_card": false, - "should_send_email": false, - "created": "2020-07-02T10:00:01.285Z", - "updated": "2020-07-02T10:00:01.285Z", - "currency": "IDR" -} -``` - -#### Get Invoice - -```python -from xendit import Invoice - -invoice = Invoice.get( - invoice_id="5efda8a20425db620ec35f43", -) -print(invoice) -``` - -Will return - -``` -{ - "id": "5efda8a20425db620ec35f43", - "external_id": "invoice-1593682080", - "user_id": "5ed75086a883856178afc12e", - "status": "EXPIRED", - "merchant_name": "Xendit&#x27;s Intern", - "merchant_profile_picture_url": "https://xnd-companies.s3.amazonaws.com/prod/1591169469152_279.png", - "amount": 20000, - "payer_email": "customer@domain.com", - "description": "Invoice Demo #123", - "expiry_date": "2020-07-02T09:55:47.794Z", - "invoice_url": "https://invoice-staging.xendit.co/web/invoices/5efda8a20425db620ec35f43", - "available_banks": [ - { - "bank_code": "MANDIRI", - "collection_type": "POOL", - "bank_account_number": "8860846853111", - "transfer_amount": 20000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0 - }, - { - "bank_code": "BRI", - "collection_type": "POOL", - "bank_account_number": "2621554806292", - "transfer_amount": 20000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0 - } - ], - "available_retail_outlets": [ - { - "retail_outlet_name": "ALFAMART", - "payment_code": "TEST34950", - "transfer_amount": 20000 - } - ], - "available_ewallets": [], - "should_exclude_credit_card": false, - "should_send_email": false, - "created": "2020-07-02T09:28:02.191Z", - "updated": "2020-07-02T09:55:47.794Z", - "currency": "IDR" -} -``` - -#### Expire Invoice - -```python -from xendit import Invoice - -invoice = Invoice.expire( - invoice_id="5efda8a20425db620ec35f43", -) -print(invoice) -``` - -Will return - -``` -{ - "id": "5efda8a20425db620ec35f43", - "external_id": "invoice-1593682080", - "user_id": "5ed75086a883856178afc12e", - "status": "EXPIRED", - "merchant_name": "Xendit&#x27;s Intern", - "merchant_profile_picture_url": "https://xnd-companies.s3.amazonaws.com/prod/1591169469152_279.png", - "amount": 20000, - "payer_email": "customer@domain.com", - "description": "Invoice Demo #123", - "expiry_date": "2020-07-02T09:55:47.794Z", - "invoice_url": "https://invoice-staging.xendit.co/web/invoices/5efda8a20425db620ec35f43", - "available_banks": [ - { - "bank_code": "MANDIRI", - "collection_type": "POOL", - "bank_account_number": "8860846853111", - "transfer_amount": 20000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0 - }, - { - "bank_code": "BRI", - "collection_type": "POOL", - "bank_account_number": "2621554806292", - "transfer_amount": 20000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0 - } - "available_retail_outlets": [ - { - "retail_outlet_name": "ALFAMART", - "payment_code": "TEST34950", - "transfer_amount": 20000 - } - ], - "available_ewallets": [], - "should_exclude_credit_card": false, - "should_send_email": false, - "created": "2020-07-02T09:28:02.191Z", - "updated": "2020-07-02T09:55:47.794Z", - "currency": "IDR" -} -``` - -#### List All Invoice - -```python -from xendit import Invoice - -invoices = Invoice.list_all( - limit=3, -) -print(invoices) -``` - -Will return - -``` -[ - ... - { - "id": "5efda8a20425db620ec35f43", - "external_id": "invoice-1593682080", - "user_id": "5ed75086a883856178afc12e", - "status": "EXPIRED", - "merchant_name": "Xendit&#x27;s Intern", - "merchant_profile_picture_url": "https://xnd-companies.s3.amazonaws.com/prod/1591169469152_279.png", - "amount": 20000, - "payer_email": "customer@domain.com", - "description": "Invoice Demo #123", - "expiry_date": "2020-07-02T09:55:47.794Z", - "invoice_url": "https://invoice-staging.xendit.co/web/invoices/5efda8a20425db620ec35f43", - "available_banks": [ - { - "bank_code": "MANDIRI", - "collection_type": "POOL", - "bank_account_number": "8860846853111", - "transfer_amount": 20000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0 - }, - { - "bank_code": "BRI", - "collection_type": "POOL", - "bank_account_number": "2621554806292", - "transfer_amount": 20000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0 - } - "available_retail_outlets": [ - { - "retail_outlet_name": "ALFAMART", - "payment_code": "TEST34950", - "transfer_amount": 20000 - } - ], - "available_ewallets": [], - "should_exclude_credit_card": false, - "should_send_email": false, - "created": "2020-07-02T09:28:02.191Z", - "updated": "2020-07-02T09:55:47.794Z", - "currency": "IDR" - } - ... -] -``` - -### Recurring Payment Service - -#### Create Recurring Payment - -```python -from xendit import RecurringPayment - -recurring_payment = RecurringPayment.create( - external_id="recurring_12345", - payer_email="test@x.co", - description="Test Curring Payment", - amount=100000, - interval="MONTH", - interval_count=1, -) -print(recurring_payment) -``` - -Will return - -``` -{ - "status": "ACTIVE", - "should_send_email": false, - "missed_payment_action": "IGNORE", - "recurrence_progress": 1, - "recharge": true, - "user_id": "5ed75086a883856178afc12e", - "external_id": "recurring_12345", - "payer_email": "test@x.co", - "description": "Test Curring Payment", - "amount": 100000, - "interval": "MONTH", - "interval_count": 1, - "start_date": "2020-07-08T08:22:55.815Z", - "currency": "IDR", - "created": "2020-07-08T08:22:55.817Z", - "updated": "2020-07-08T08:22:55.994Z", - "id": "5f05825ff9f52d3ed204c687", - "last_created_invoice_url": "https://invoice-staging.xendit.co/web/invoices/5f05825ff9f52d3ed204c688" -} -``` - -#### Get Recurring Payment - -```python -from xendit import RecurringPayment - -recurring_payment = RecurringPayment.get( - id="5f05825ff9f52d3ed204c687", -) -print(recurring_payment) -``` - -Will return - -``` -{ - "status": "ACTIVE", - "should_send_email": false, - "missed_payment_action": "IGNORE", - "recurrence_progress": 1, - "recharge": true, - "user_id": "5ed75086a883856178afc12e", - "external_id": "recurring_12345", - "payer_email": "test@x.co", - "description": "Test Curring Payment", - "amount": 100000, - "interval": "MONTH", - "interval_count": 1, - "start_date": "2020-07-08T08:22:55.815Z", - "currency": "IDR", - "created": "2020-07-08T08:22:55.817Z", - "updated": "2020-07-08T08:22:55.994Z", - "id": "5f05825ff9f52d3ed204c687", - "last_created_invoice_url": "https://invoice-staging.xendit.co/web/invoices/5f05825ff9f52d3ed204c688" -} -``` - -#### Edit Recurring Payment - -```python -from xendit import RecurringPayment - -recurring_payment = RecurringPayment.edit( - id="5f05825ff9f52d3ed204c687", - interval_count=2, -) -print(recurring_payment) -``` - -Will return - -``` -{ - "status": "ACTIVE", - "should_send_email": false, - "missed_payment_action": "IGNORE", - "recurrence_progress": 1, - "recharge": true, - "user_id": "5ed75086a883856178afc12e", - "external_id": "recurring_12345", - "payer_email": "test@x.co", - "description": "Test Curring Payment", - "amount": 100000, - "interval": "MONTH", - "interval_count": 2, - "start_date": "2020-07-08T08:22:55.815Z", - "currency": "IDR", - "created": "2020-07-08T08:22:55.817Z", - "updated": "2020-07-08T08:24:58.295Z", - "id": "5f05825ff9f52d3ed204c687" -} -``` - -#### Stop Recurring Payment - -```python -from xendit import RecurringPayment - -recurring_payment = RecurringPayment.stop( - id="5f05825ff9f52d3ed204c687", -) -print(recurring_payment) -``` - -Will return - -``` -{ - "status": "STOPPED", - "should_send_email": false, - "missed_payment_action": "IGNORE", - "recurrence_progress": 1, - "recharge": true, - "user_id": "5ed75086a883856178afc12e", - "external_id": "recurring_12345", - "payer_email": "test@x.co", - "description": "Test Curring Payment", - "amount": 100000, - "interval": "MONTH", - "interval_count": 2, - "start_date": "2020-07-08T08:22:55.815Z", - "currency": "IDR", - "created": "2020-07-08T08:22:55.817Z", - "updated": "2020-07-08T08:26:32.464Z", - "id": "5f05825ff9f52d3ed204c687" -} -``` - -#### Pause Recurring Payment - -```python -from xendit import RecurringPayment - -recurring_payment = RecurringPayment.pause( - id="5f05825ff9f52d3ed204c687", -) -print(recurring_payment) -``` - -Will return - -``` -{ - "status": "PAUSED", - "should_send_email": false, - "missed_payment_action": "IGNORE", - "recurrence_progress": 1, - "recharge": true, - "user_id": "5ed75086a883856178afc12e", - "external_id": "recurring_12345", - "payer_email": "test@x.co", - "description": "Test Curring Payment", - "amount": 100000, - "interval": "MONTH", - "interval_count": 2, - "start_date": "2020-07-08T08:22:55.815Z", - "currency": "IDR", - "created": "2020-07-08T08:22:55.817Z", - "updated": "2020-07-08T08:25:44.580Z", - "id": "5f05825ff9f52d3ed204c687" -} -``` - -#### Resume Recurring Payment - -```python -from xendit import RecurringPayment - -recurring_payment = RecurringPayment.resume( - id="5f05825ff9f52d3ed204c687", -) -print(recurring_payment) -``` - -Will return - -``` -{ - "status": "ACTIVE", - "should_send_email": false, - "missed_payment_action": "IGNORE", - "recurrence_progress": 1, - "recharge": true, - "user_id": "5ed75086a883856178afc12e", - "external_id": "recurring_12345", - "payer_email": "test@x.co", - "description": "Test Curring Payment", - "amount": 100000, - "interval": "MONTH", - "interval_count": 2, - "start_date": "2020-07-08T08:22:55.815Z", - "currency": "IDR", - "created": "2020-07-08T08:22:55.817Z", - "updated": "2020-07-08T08:26:03.082Z", - "id": "5f05825ff9f52d3ed204c687" -} -``` - -### Payout Service - -#### Create Payout - -```python -from xendit import Payout - -payout = Payout.create( - external_id="payout-1595405117", - amount=50000, - email="test@email.co", -) -print(payout) -``` - -Will return - -``` -{ - "id": "a6ee1bf1-ffcd-4bda-a7ab-99c1d5cd0472", - "external_id": "payout-1595405117", - "amount": 50000, - "merchant_name": "Xendit&#x27;s Intern", - "status": "PENDING", - "expiration_timestamp": "2020-07-23T08:05:19.815Z", - "created": "2020-07-22T08:05:18.421Z", - "email": "test@email.co", - "payout_url": "https://payout-staging.xendit.co/web/a6ee1bf1-ffcd-4bda-a7ab-99c1d5cd0472" -} -``` - -#### Get Payout - -```python -from xendit import Payout - -payout = Payout.get( - id="a6ee1bf1-ffcd-4bda-a7ab-99c1d5cd0472", -) -print(payout) -``` - -Will return - -``` -{ - "id": "a6ee1bf1-ffcd-4bda-a7ab-99c1d5cd0472", - "external_id": "payout-1595405117", - "amount": 50000, - "merchant_name": "Xendit&#x27;s Intern", - "status": "PENDING", - "expiration_timestamp": "2020-07-23T08:05:19.815Z", - "created": "2020-07-22T08:05:18.421Z", - "email": "test@email.co", - "payout_url": "https://payout-staging.xendit.co/web/a6ee1bf1-ffcd-4bda-a7ab-99c1d5cd0472" -} -``` - -#### Void a Payout - -```python -from xendit import Payout - -payout = Payout.void( - id="a6ee1bf1-ffcd-4bda-a7ab-99c1d5cd0472", -) -print(payout) -``` - -Will return - -``` -{ - "id": "a6ee1bf1-ffcd-4bda-a7ab-99c1d5cd0472", - "external_id": "payout-1595405117", - "amount": 50000, - "merchant_name": "Xendit&#x27;s Intern", - "status": "VOIDED", - "expiration_timestamp": "2020-07-23T08:05:19.815Z", - "created": "2020-07-22T08:05:18.421Z", - "email": "test@email.co" -} -``` - -### Disbursement Service - -#### Create Disbursement - -```python -from xendit import Disbursement - -disbursement = Disbursement.create( - external_id="demo_1475459775872", - bank_code="BCA", - account_holder_name="Bob Jones", - account_number="1231242311", - description="Reimbursement for shoes", - amount=17000, -) -print(disbursement) -``` - -Will return - -``` -{ - "user_id": "5ed75086a883856178afc12e", - "external_id": "demo_1475459775872", - "amount": 17000, - "bank_code": "BCA", - "account_holder_name": "Bob Jones", - "disbursement_description": "Reimbursement for shoes", - "status": "PENDING", - "id": "5ef1c4f40c2e150017ce3b96", -} -``` - -#### Get Disbursement by ID - -```python -from xendit import Disbursement - -disbursement = Disbursement.get( - id="5ef1befeecb16100179e1d05", -) -print(disbursement) -``` - -Will return - -``` -{ - "user_id": "5ed75086a883856178afc12e", - "external_id": "demo_1475459775872", - "amount": 17000, - "bank_code": "BCA", - "account_holder_name": "Bob Jones", - "disbursement_description": "Disbursement from Postman", - "status": "PENDING", - "id": "5ef1befeecb16100179e1d05" -} -``` - -#### Get Disbursement by External ID - -```python -from xendit import Disbursement - -disbursement_list = Disbursement.get_by_ext_id( - external_id="demo_1475459775872", -) -print(disbursement_list) - -``` - -Will return - -``` -[ - { - "user_id": "5ed75086a883856178afc12e", - "external_id": "demo_1475459775872", - "amount": 17000, - "bank_code": "BCA", - "account_holder_name": "Bob Jones", - "disbursement_description": "Reimbursement for shoes", - "status": "PENDING", - "id": "5ef1c4f40c2e150017ce3b96", - }, - { - "user_id": "5ed75086a883856178afc12e", - "external_id": "demo_1475459775872", - "amount": 17000, - "bank_code": "BCA", - "account_holder_name": "Bob Jones", - "disbursement_description": "Disbursement from Postman", - "status": "PENDING", - "id": "5ef1befeecb16100179e1d05", - }, - ... -] -``` -#### Get Available Banks - -```python -from xendit import Disbursement - -disbursement_banks = Disbursement.get_available_banks() -print(disbursement_banks) -``` - -Will return - -``` -[ - ... - { - "name": "Mandiri Taspen Pos (formerly Bank Sinar Harapan Bali)", - "code": "MANDIRI_TASPEN", - "can_disburse": True, - "can_name_validate": True, - }, - { - "name": "Bank QNB Indonesia (formerly Bank QNB Kesawan)", - "code": "QNB_INDONESIA", - "can_disburse": True, - "can_name_validate": True, - } -] -``` - -### Batch Disbursement Service - -#### Create Batch Disbursement - -```python -from xendit import BatchDisbursement - -batch_disbursement_items = [] -batch_disbursement_items.append( - BatchDisbursement.helper_create_batch_item( - amount=10000, - bank_code="BCA", - bank_account_name="Adyaksa W", - bank_account_number="12345678", - description="Sample Batch Disbursement", - external_id=f"batch-disbursement-item-12345" - ) -) -batch_disbursement = BatchDisbursement.create( - reference="batch_disbursement-1595326225", - disbursements=batch_disbursement_items, -) -print(batch_disbursement) -``` - -Will return - -``` -{ - "status": "UPLOADING", - "reference": "batch_disbursement-1595326225", - "total_uploaded_amount": 10000, - "total_uploaded_count": 1, - "created": "2020-07-21T10:10:35.782Z", - "id": "5f16bf1bfc70de0017b858bf" -} -``` - -#### Get Batch Disbursement Available Banks - -You can use [Get Available Banks](#get-available-banks) to use this feature. - -### xenPlatform Service - -#### Create Account - -```python -from xendit import XenPlatform, XenPlatformAccountType - -xenplatform_account = XenPlatform.create_account( - account_email="test-xenplatform@pythonxendit.co", - type=XenPlatformAccountType.OWNED, - business_profile={'business_name': 'python-xendit'}, -) -print(xenplatform_account) -``` - -Will return - -``` -{ - "account_email": "test-xenplatform@pythonxendit.co", - "user_id": "5f2132ed172cd67992c402d6", - "created": "2020-07-29T08:27:25.346Z", - "status": "SUCCESSFUL", - "type": "OWNED" -} -``` - -#### Set Callback URLs - -```python -from xendit import XenPlatform, XenPlatformURLType - -xenplatform_callback_url = XenPlatform.set_callback_url( - type=XenPlatformURLType.INVOICE, - url="https://test-url-invoice.com", -) -print(xenplatform_callback_url) -``` - -Will return - -``` -{ - "status": "SUCCESSFUL", - "user_id": "5e6b30d967627b957de8c123", - "url": "https://test-url-invoice.com", - "environment": "TEST", - "callback_token": "66a6680348e1c33ed2b9053a8eb9291b9e2230ff4f4d3057c9f4ac26405d2123" -} -``` - -#### Transfers - -```python -from xendit import XenPlatform - -xenplatform_transfers = XenPlatform.transfers( - reference="transfer001", - amount=10000, - source_user_id="54afeb170a2b18519b1b8768", - destination_user_id="5cafeb170a2b1851246b8768", -) -print(xenplatform_transfers) -``` - -Will return - -``` -{ - "created": "2020-01-01T08:51:44.484Z", - "transfer_id": "60b9d810-d9a3-456c-abbf-2786ec7a9651", - "reference": "transfer001", - "source_user_id": "54afeb170a2b18519b1b8768", - "destination_user_id": "5cafeb170a2b1851246b8768", - "status": "SUCCESSFUL", - "amount": 10000 -} -``` - -### Payment Methods - -#### Create Payment Method - -```python -from xendit import PaymentMethod -from xendit.models.paymentmethod import ewallet - -payment_method = PaymentMethod.create( - type="EWALLET", - reusability="ONE_TIME_USE", - ewallet=ewallet.EWallet.Query( - channel_code="PAYMAYA", - channel_properties=ewallet.ChannelProperties.Query( - success_return_url="https://mock-test.co", - failure_return_url="https://mock-test.co", - cancel_return_url="https://mock-test.co", - ), - ) -) -print(payment_method) -``` - -Will return - -``` -{ - "id": "pm-9cee5b23-5f70-49f0-8b2c-82cae820c380", - "type": "EWALLET", - "country": "PH", - "business_id": "5f9a3fbd571a1c4068aa40ce", - "customer_id": null, - "reference_id": "729aaf53-69bc-4be5-b232-8ad16c092c71", - "reusability": "ONE_TIME_USE", - "status": "ACTIVE", - "actions": [], - "description": null, - "created": "2022-11-04T02:14:02.830773203Z", - "updated": "2022-11-04T02:14:02.830773203Z", - "metadata": null, - "billing_information": null, - "failure_code": null, - "ewallet": { - "channel_code": "PAYMAYA", - "channel_properties": { - "cancel_return_url": "https://mock-test.co", - "failure_return_url": "https://mock-test.co", - "success_return_url": "https://mock-test.co" - }, - "account": { - "name": null, - "account_details": null, - "balance": null, - "point_balance": null - } - }, - "direct_bank_transfer": null, - "direct_debit": null, - "card": null, - "over_the_counter": null, - "qr_code": null, - "virtual_account": null -} -``` - -#### Get Payment Method - -```python -from xendit import PaymentMethod - -payment_method = PaymentMethod.get( - payment_method_id="pm-9cee5b23-5f70-49f0-8b2c-82cae820c380" -) -print(payment_method) -``` - -Will return - -``` -{ - "id": "pm-9cee5b23-5f70-49f0-8b2c-82cae820c380", - "type": "EWALLET", - "country": "PH", - "business_id": "5f9a3fbd571a1c4068aa40ce", - "customer_id": null, - "reference_id": "729aaf53-69bc-4be5-b232-8ad16c092c71", - "reusability": "ONE_TIME_USE", - "status": "ACTIVE", - "actions": [], - "description": null, - "created": "2022-11-04T02:14:02.830773203Z", - "updated": "2022-11-04T02:14:02.830773203Z", - "metadata": null, - "billing_information": null, - "failure_code": null, - "ewallet": { - "channel_code": "PAYMAYA", - "channel_properties": { - "cancel_return_url": "https://mock-test.co", - "failure_return_url": "https://mock-test.co", - "success_return_url": "https://mock-test.co" - }, - "account": { - "name": null, - "account_details": null, - "balance": null, - "point_balance": null - } - }, - "direct_bank_transfer": null, - "direct_debit": null, - "card": null, - "over_the_counter": null, - "qr_code": null, - "virtual_account": null -} -``` - -#### Update Payment Method - -```python -from xendit import PaymentMethod - -payment_method = PaymentMethod.update( - payment_method_id="pm-9cee5b23-5f70-49f0-8b2c-82cae820c380", - status="INACTIVE" -) -print(payment_method) -``` - -Will return - -``` -{ - "id": "pm-9cee5b23-5f70-49f0-8b2c-82cae820c380", - "type": "EWALLET", - "country": "PH", - "business_id": "5f9a3fbd571a1c4068aa40ce", - "customer_id": null, - "reference_id": "729aaf53-69bc-4be5-b232-8ad16c092c71", - "reusability": "ONE_TIME_USE", - "status": "INACTIVE", - "actions": [], - "description": null, - "created": "2022-11-04T02:14:02.830773Z", - "updated": "2022-11-04T02:32:42.982673023Z", - "metadata": null, - "billing_information": null, - "failure_code": null, - "ewallet": { - "channel_code": "PAYMAYA", - "channel_properties": { - "cancel_return_url": "https://mock-test.co", - "failure_return_url": "https://mock-test.co", - "success_return_url": "https://mock-test.co" - }, - "account": { - "name": null, - "account_details": null, - "balance": null, - "point_balance": null - } - }, - "direct_bank_transfer": null, - "direct_debit": null, - "card": null, - "over_the_counter": null, - "qr_code": null, - "virtual_account": null -} -``` - -#### Expire Payment Method - -```python -from xendit import PaymentMethod - -payment_method = PaymentMethod.expire( - payment_method_id="pm-9cee5b23-5f70-49f0-8b2c-82cae820c380" -) -print(payment_method) -``` - -Will return - -``` -{ - "id": "pm-9cee5b23-5f70-49f0-8b2c-82cae820c380", - "type": "EWALLET", - "country": "PH", - "business_id": "5f9a3fbd571a1c4068aa40ce", - "customer_id": null, - "reference_id": "729aaf53-69bc-4be5-b232-8ad16c092c71", - "reusability": "ONE_TIME_USE", - "status": "EXPIRED", - "actions": [], - "description": null, - "created": "2022-11-04T02:14:02.830773Z", - "updated": "2022-11-04T02:32:42.982673023Z", - "metadata": null, - "billing_information": null, - "failure_code": null, - "ewallet": { - "channel_code": "PAYMAYA", - "channel_properties": { - "cancel_return_url": "https://mock-test.co", - "failure_return_url": "https://mock-test.co", - "success_return_url": "https://mock-test.co" - }, - "account": { - "name": null, - "account_details": null, - "balance": null, - "point_balance": null - } - }, - "direct_bank_transfer": null, - "direct_debit": null, - "card": null, - "over_the_counter": null, - "qr_code": null, - "virtual_account": null -} -``` - -#### List Payment Methods - -```python -from xendit import PaymentMethod - -payment_methods = PaymentMethod.list() -print(payment_methods) -``` - -Will return - -``` -{ - "has_more": false, - "data": [{ - "id": "pm-9cee5b23-5f70-49f0-8b2c-82cae820c380", - "type": "EWALLET", - "country": "PH", - "business_id": "5f9a3fbd571a1c4068aa40ce", - "customer_id": null, - "reference_id": "729aaf53-69bc-4be5-b232-8ad16c092c71", - "reusability": "ONE_TIME_USE", - "status": "INACTIVE", - "actions": [], - "description": null, - "created": "2022-11-04T02:14:02.830773Z", - "updated": "2022-11-04T02:32:42.982673023Z", - "metadata": null, - "billing_information": null, - "failure_code": null, - "ewallet": { - "channel_code": "PAYMAYA", - "channel_properties": { - "cancel_return_url": "https://mock-test.co", - "failure_return_url": "https://mock-test.co", - "success_return_url": "https://mock-test.co" - }, - "account": { - "name": null, - "account_details": null, - "balance": null, - "point_balance": null - } - }, - "direct_bank_transfer": null, - "direct_debit": null, - "card": null, - "over_the_counter": null, - "qr_code": null, - "virtual_account": null - }] -} -``` - - -#### Authorize a Payment Method - -This endpoint only applies to BRI Direct Debit. This is used when an additional authorization (ex. OTP Validation) is required in order to successfully activate a payment method. This is equivalent to the POST - AUTH action provided when a Payment Method has the status REQUIRES_ACTION. - -```python -from xendit import PaymentMethod - -payment_method = PaymentMethod.authorize( - payment_method_id="pm-6ff0b6f2-f5de-457f-b08f-bc98fbae485a", - auth_code="123456" -) -print(payment_method) -``` - -Will return - -``` -{ - "id": "pm-6ff0b6f2-f5de-457f-b08f-bc98fbae485a", - "card": null, - "type": "DIRECT_DEBIT", - "status": "ACTIVE", - "actions": [], - "country": "ID", - "created": "2022-08-12T13:30:26.579048Z", - "ewallet": null, - "qr_code": null, - "updated": "2022-08-12T13:30:58.908220358Z", - "metadata": null, - "customer_id": "e2878b4c-d57e-4a2c-922d-c0313c2800a3", - "description": null, - "reusability": "MULTIPLE_USE", - "direct_debit": { - "type": "DEBIT_CARD", - "debit_card": { - "mobile_number": "+62818555988", - "card_last_four": "8888", - "card_expiry": "06/24", - "email": "email@email.com" - }, - "bank_account": null, - "channel_code": "BRI", - "channel_properties": { - "mobile_number": "+62818555988", - "card_last_four": "8888", - "card_expiry": "06/24", - "email": "test.email@xendit.co" - } - }, - "failure_code": null, - "reference_id": "620b9df4-fe69-4bfd-b9d4-5cba6861db8a", - "virtual_account": null, - "over_the_counter": null, - "billing_information": null, - "direct_bank_transfer": null, - "business_id": "5f27a14a9bf05c73dd040bc8" -} -``` - - -#### List Payments - -```python -from xendit import PaymentMethod - -payments = PaymentMethod.list_payments( - payment_method_id="pm-62605ad7-3fbd-462c-9fd4-193e5a9e77b6" -) - -print(payments) -``` - -Will return - -``` -{ - "has_more": false, - "data": [ - { - "amount": 100, - "business_id": "61371058772b574041bc5ee2", - "channel_code": "RCBC", - "country": "PH", - "created": "2022-09-22T09:05:30.484Z", - "currency": "PHP", - "id": "pymt-c025b648-bd51-4138-8cf1-94b48bc1a9f8", - "instrument_id": "qrpy_fe3c2e20-f885-4a68-b841-0973121e20d4", - "payment_detail": { - "issuer_name": "", - "receipt_id": "" - }, - "payment_method": { - "card": {}, - "created": "2022-09-22T09:03:39.197475Z", - "direct_bank_transfer": null, - "direct_debit": null, - "ewallet": null, - "id": "pm-62605ad7-3fbd-462c-9fd4-193e5a9e77b6", - "over_the_counter": null, - "qr_code": { - "channel_code": "RCBC", - "channel_properties": { - "qr_string": "some-random-qr-string" - } - }, - "reference_id": "a4486137-7624-4b34-b879-16cbbfc1a032", - "reusability": "ONE_TIME_USE", - "status": "EXPIRED", - "type": "QR_CODE", - "updated": "2022-09-22T09:05:30.409211Z", - "virtual_account": null - }, - "payment_request_id": "pr-b33ecb15-c8e6-455c-9b1b-84612b6fd13b", - "reference_id": "a4486137-7624-4b34-b879-16cbbfc1a032", - "status": "SUCCEEDED", - "type": "QR_CODE", - "updated": "2022-09-22T09:05:30.484Z" - } - ] -} -``` - -### Payment Requests -#### Create Payment Request - -#### With Payment Method ID - -```python -from xendit import PaymentRequest - -payment_request = PaymentRequest.create( - amount=50, - currency="PHP", - payment_method_id="pm-64eedc01-702e-439c-9a96-b3b665caeb05" -) -print(payment_request) -``` - -Will return - -``` -{ - "id": "ddpy-74ebdd86-e052-42e8-8b53-d84255ab7004", - "reference_id": "7200b7ce-4634-489e-976b-269d641e4343", - "business_id": "5f9a3fbd571a1c4068aa40ce", - "currency": "PHP", - "amount": 50, - "country": "PH", - "payment_method": { - "id": "pm-64eedc01-702e-439c-9a96-b3b665caeb05", - "type": "DIRECT_DEBIT", - "reference_id": "9c511ec0-a9b7-4eee-9cb5-b91085edbdd3", - "description": null, - "created": "2022-11-04T04:43:04.259281Z", - "updated": "2022-11-04T04:43:29.063919Z", - "card": null, - "ewallet": null, - "direct_debit": { - "channel_code": "BPI", - "channel_properties": { - "success_return_url": "https://mock-test.co", - "failure_return_url": "https://mock-test.co" - }, - "type": "BANK_ACCOUNT", - "bank_account": { - "masked_bank_account_number": "XXX1631", - "bank_account_hash": "8f06b7dc684aa57a283adf49b2f67bdb11750ac04300f3996d97c7412ac5ca48" - }, - "debit_card": null - }, - "direct_bank_transfer": null, - "over_the_counter": null, - "virtual_account": null, - "qr_code": null, - "metadata": null, - "reusability": "MULTIPLE_USE", - "status": "ACTIVE" - }, - "description": null, - "metadata": null, - "customer_id": "fa8f36a4-60e4-4a49-a040-adf953539f71", - "created": "2022-11-04T04:44:39.220981439Z", - "updated": "2022-11-04T04:44:39.220981439Z", - "status": "REQUIRES_ACTION", - "actions": [ - { - "action": "AUTH", - "url": "https://direct-debit-web-dev.xendit.co/direct_debits/ddpy-74ebdd86-e052-42e8-8b53-d84255ab7004/checkout?failure_redirect_url=https%3A%2F%2Fredirect.me%2Fbadstuff&payment_redirect_delay=10", - "url_type": "WEB", - "method": "GET", - "qr_code": null - }, - { - "action": "AUTH", - "url": "https://api.xendit.co/payment_requests/ddpy-74ebdd86-e052-42e8-8b53-d84255ab7004/auth", - "url_type": "API", - "method": "POST", - "qr_code": null - } - ], - "failure_code": null, - "capture_method": "AUTOMATIC", - "initiator": null, - "card_verification_results": null, - "channel_properties": null, - "shipping_information": null, - "items": null -} -``` - -##### With Payment Method Object - -```python -from xendit import PaymentRequest -from xendit.models.paymentmethod import direct_debit, PaymentMethod - -payment_request = PaymentRequest.create( - amount=50, - currency="PHP", - customer_id="fa8f36a4-60e4-4a49-a040-adf953539f71", - payment_method=PaymentMethod.Query( - type="DIRECT_DEBIT", - reusability="MULTIPLE_USE", - direct_debit=direct_debit.DirectDebit.Query( - channel_code="BPI", - channel_properties=direct_debit.ChannelProperties.Query( - success_return_url="https://mock-test.co", - failure_return_url="https://mock-test.co" - ) - ) - ) -) -print(payment_request) -``` - -Will return - -``` -{ - "id": "pr-db958a53-cf92-4c1f-99d2-dcf2401211d2", - "reference_id": "e192b1c2-8814-4e71-a203-ecd43b7af808", - "business_id": "5f9a3fbd571a1c4068aa40ce", - "currency": "PHP", - "amount": 50, - "country": "PH", - "payment_method": { - "id": "pm-b8c93e5c-0bc9-44ef-869a-ca5eb73f1ad0", - "type": "DIRECT_DEBIT", - "reference_id": "9b1841a2-e4a4-4ab7-ab7a-ca7d78b4ce07", - "description": null, - "created": "2022-11-04T04:51:28.284694454Z", - "updated": "2022-11-04T04:51:28.284694454Z", - "card": null, - "ewallet": null, - "direct_debit": { - "channel_code": "BPI", - "channel_properties": { - "success_return_url": "https://mock-test.co", - "failure_return_url": "https://mock-test.co" - }, - "type": "BANK_ACCOUNT", - "bank_account": { - "masked_bank_account_number": null, - "bank_account_hash": null - }, - "debit_card": null - }, - "direct_bank_transfer": null, - "over_the_counter": null, - "virtual_account": null, - "qr_code": null, - "metadata": null, - "reusability": "MULTIPLE_USE", - "status": "PENDING" - }, - "description": null, - "metadata": null, - "customer_id": "fa8f36a4-60e4-4a49-a040-adf953539f71", - "created": "2022-11-04T04:51:28.157374805Z", - "updated": "2022-11-04T04:51:28.157374805Z", - "status": "REQUIRES_ACTION", - "actions": [ - { - "action": "AUTH", - "url": "https://link-web-staging.xendit.co/oauth/lat-c752e0e0-c4eb-4e4f-9fc8-fbfb12a8d095/confirm", - "url_type": "WEB", - "method": "GET", - "qr_code": null - } - ], - "failure_code": null, - "capture_method": "AUTOMATIC", - "initiator": null, - "card_verification_results": null, - "channel_properties": null, - "shipping_information": null, - "items": null -} -``` - -#### Get Payment Request - -```python -from xendit import PaymentRequest - -payment_request = PaymentRequest.get( - payment_request_id="pr-db958a53-cf92-4c1f-99d2-dcf2401211d2" -) -print(payment_request) -``` - -Will return - -``` -{ - "id": "pr-db958a53-cf92-4c1f-99d2-dcf2401211d2", - "reference_id": "e192b1c2-8814-4e71-a203-ecd43b7af808", - "business_id": "5f9a3fbd571a1c4068aa40ce", - "currency": "PHP", - "amount": 50, - "country": "PH", - "payment_method": { - "id": "pm-b8c93e5c-0bc9-44ef-869a-ca5eb73f1ad0", - "type": "DIRECT_DEBIT", - "reference_id": "9b1841a2-e4a4-4ab7-ab7a-ca7d78b4ce07", - "description": null, - "created": "2022-11-04T04:51:28.284694454Z", - "updated": "2022-11-04T04:51:28.284694454Z", - "card": null, - "ewallet": null, - "direct_debit": { - "channel_code": "BPI", - "channel_properties": { - "success_return_url": "https://mock-test.co", - "failure_return_url": "https://mock-test.co" - }, - "type": "BANK_ACCOUNT", - "bank_account": { - "masked_bank_account_number": null, - "bank_account_hash": null - }, - "debit_card": null - }, - "direct_bank_transfer": null, - "over_the_counter": null, - "virtual_account": null, - "qr_code": null, - "metadata": null, - "reusability": "MULTIPLE_USE", - "status": "PENDING" - }, - "description": null, - "metadata": null, - "customer_id": "fa8f36a4-60e4-4a49-a040-adf953539f71", - "created": "2022-11-04T04:51:28.157374805Z", - "updated": "2022-11-04T04:51:28.157374805Z", - "status": "REQUIRES_ACTION", - "actions": [ - { - "action": "AUTH", - "url": "https://link-web-staging.xendit.co/oauth/lat-c752e0e0-c4eb-4e4f-9fc8-fbfb12a8d095/confirm", - "url_type": "WEB", - "method": "GET", - "qr_code": null - } - ], - "failure_code": null, - "capture_method": "AUTOMATIC", - "initiator": null, - "card_verification_results": null, - "channel_properties": null, - "shipping_information": null, - "items": null -} -``` - -#### Confirm Payment Request - -```python -from xendit import PaymentRequest - -payment_request = PaymentRequest.confirm( - payment_request_id="pr-db958a53-cf92-4c1f-99d2-dcf2401211d2", - auth_code="123456" -) -print(payment_request) -``` - -Will return - -``` -{ - "id": "pr-db958a53-cf92-4c1f-99d2-dcf2401211d2", - "reference_id": "e192b1c2-8814-4e71-a203-ecd43b7af808", - "business_id": "5f9a3fbd571a1c4068aa40ce", - "currency": "PHP", - "amount": 50, - "country": "PH", - "payment_method": { - "id": "pm-b8c93e5c-0bc9-44ef-869a-ca5eb73f1ad0", - "type": "DIRECT_DEBIT", - "reference_id": "9b1841a2-e4a4-4ab7-ab7a-ca7d78b4ce07", - "description": null, - "created": "2022-11-04T04:51:28.284694454Z", - "updated": "2022-11-04T04:51:28.284694454Z", - "card": null, - "ewallet": null, - "direct_debit": { - "channel_code": "RCBC", - "channel_properties": { - "success_return_url": "https://mock-test.co", - "failure_return_url": "https://mock-test.co" - }, - "type": "BANK_ACCOUNT", - "bank_account": { - "masked_bank_account_number": "11111111111", - "bank_account_hash": "loremipman" - }, - "debit_card": null - }, - "direct_bank_transfer": null, - "over_the_counter": null, - "virtual_account": null, - "qr_code": null, - "metadata": null, - "reusability": "MULTIPLE_USE", - "status": "PENDING" - }, - "description": null, - "metadata": null, - "customer_id": "fa8f36a4-60e4-4a49-a040-adf953539f71", - "created": "2022-11-04T04:51:28.157374805Z", - "updated": "2022-11-04T04:51:28.157374805Z", - "status": "SUCCEEDED", - "actions": [], - "failure_code": null, - "capture_method": "AUTOMATIC", - "initiator": null, - "card_verification_results": null, - "channel_properties": null, - "shipping_information": null, - "items": null -} -``` - -#### Resend Auth for Payment Request - -```python -from xendit import PaymentRequest - -payment_request = PaymentRequest.resend_auth(payment_request_id="ddpy-a310d9c2-ed99-4031-a3bf-fb4d8e384f45") -print(payment_request) -``` - -Will return - -``` -{ - "id": "ddpy-a310d9c2-ed99-4031-a3bf-fb4d8e384f45", - "reference_id": "3abc9ab4-294e-4f9d-994c-f755b5b87a2a", - "business_id": "5f9a3fbd571a1c4068aa40ce", - "currency": "PHP", - "amount": 500, - "country": "PH", - "payment_method": { - "id": "pm-3d15aa4f-7b08-4355-a4ab-94187151d33c", - "type": "DIRECT_DEBIT", - "reference_id": "b869964d-37b7-4fc2-9915-386c12a48791", - "description": null, - "created": "2022-11-04T05:50:27.446274Z", - "updated": "2022-11-04T05:50:49.865006Z", - "card": null, - "ewallet": null, - "direct_debit": { - "channel_code": "BPI", - "channel_properties": { - "success_return_url": "https://redirect.me/goodstuff", - "failure_return_url": "https://redirect.me/badstuff" - }, - "type": "BANK_ACCOUNT", - "bank_account": { - "masked_bank_account_number": "XXX1631", - "bank_account_hash": "8f06b7dc684aa57a283adf49b2f67bdb11750ac04300f3996d97c7412ac5ca48" - }, - "debit_card": null - }, - "direct_bank_transfer": null, - "over_the_counter": null, - "virtual_account": null, - "qr_code": null, - "metadata": null, - "reusability": "MULTIPLE_USE", - "status": "ACTIVE" - }, - "description": null, - "metadata": null, - "customer_id": "96f2bab4-4a59-4a80-8da4-1e086c200512", - "created": "2022-11-04T05:54:35.703988Z", - "updated": "2022-11-04T05:54:35.942271Z", - "status": "REQUIRES_ACTION", - "actions": [ - { - "action": "AUTH", - "url": "https://direct-debit-web-dev.xendit.co/direct_debits/ddpy-a310d9c2-ed99-4031-a3bf-fb4d8e384f45/checkout?failure_redirect_url=https%3A%2F%2Fredirect.me%2Fbadstuff&payment_redirect_delay=10", - "url_type": "WEB", - "method": "GET", - "qr_code": null - }, - { - "action": "AUTH", - "url": "https://api.xendit.co/payment_requests/ddpy-a310d9c2-ed99-4031-a3bf-fb4d8e384f45/auth", - "url_type": "API", - "method": "POST", - "qr_code": null - } - ], - "failure_code": null, - "capture_method": "AUTOMATIC", - "initiator": null, - "card_verification_results": null, - "channel_properties": null, - "shipping_information": null, - "items": null -} -``` - - -#### List Payment Requests - -```python -from xendit import PaymentRequest - -payment_requests = PaymentRequest.list() -print(payment_requests) -``` - -Will return - -``` -{ - "has_more": false, - "data": [ - { - "id": "pr-ba8a686b-57d7-4d93-aa50-2753af90e889", - "reference_id": "48e11a9f-025d-4c6b-bc7d-7cec7d91c3ea", - "business_id": "5ed75086a883856178afc12e", - "currency": "PHP", - "amount": 1500, - "country": "PH", - "payment_method": { - "id": "pm-193fff85-e457-41f8-adcd-da8b61525d2e", - "type": "EWALLET", - "reference_id": "1c376b0a-bbf0-4c7d-89e4-88d63443a955", - "description": null, - "created": "2022-10-21T03:42:11.602144Z", - "updated": "2022-10-21T03:42:11.602144Z", - "card": null, - "ewallet": { - "channel_code": "PAYMAYA", - "channel_properties": { - "cancel_return_url": "https://redirect.me/nostuff", - "failure_return_url": "https://redirect.me/badstuff", - "success_return_url": "https://redirect.me/goodstuff" - }, - "account": { - "name": null, - "account_details": null, - "balance": null, - "point_balance": null - } - }, - "direct_debit": null, - "direct_bank_transfer": null, - "over_the_counter": null, - "virtual_account": null, - "qr_code": null, - "metadata": null, - "reusability": "ONE_TIME_USE", - "status": "ACTIVE" - }, - "description": null, - "metadata": null, - "customer_id": null, - "created": "2022-10-21T03:42:11.617507Z", - "updated": "2022-10-21T03:42:11.617507Z", - "status": "UNKNOWN", - "actions": [], - "failure_code": null, - "capture_method": "AUTOMATIC", - "initiator": null, - "card_verification_results": null, - "channel_properties": null, - "shipping_information": null, - "items": null - } - ] -} -``` - -### Refunds - -#### Create Refund - -```python -from xendit import Refund - -refund = Refund.create( - payment_request_id="ewc_0b98b8c6-2f5f-4355-87f1-d3afe372495b" -) -print(refund) -``` - -Will return - -``` -{ - "id": "rfd-107ac068-0737-4c85-8aaf-61f908e3c136", - "payment_id": "ewc_0b98b8c6-2f5f-4355-87f1-d3afe372495b", - "invoice_id": "", - "amount": 1500, - "payment_method_type": "EWALLET", - "channel_code": "GRABPAY", - "country": "PH", - "currency": "PHP", - "status": "PENDING", - "reason": "", - "reference_id": "", - "failure_code": null, - "refund_fee_amount": null, - "created": "2022-11-04T06:21:35.213018123Z", - "updated": "2022-11-04T06:21:35.213018243Z", - "metadata": null, - "refund_method": "DIRECT", - "payout_link_properties": null, - "actions": null -} -``` - -#### Get Refund - -```python -from xendit import Refund - -refund = Refund.get( - refund_id="rfd-107ac068-0737-4c85-8aaf-61f908e3c136" -) -print(refund) -``` - -Will return - -``` -{ - "id": "rfd-107ac068-0737-4c85-8aaf-61f908e3c136", - "payment_id": "ewc_0b98b8c6-2f5f-4355-87f1-d3afe372495b", - "invoice_id": "", - "amount": 1500, - "payment_method_type": "EWALLET", - "channel_code": "GRABPAY", - "country": "PH", - "currency": "PHP", - "status": "PENDING", - "reason": "", - "reference_id": "", - "failure_code": null, - "refund_fee_amount": null, - "created": "2022-11-04T06:21:35.213018123Z", - "updated": "2022-11-04T06:21:35.213018243Z", - "metadata": null, - "refund_method": "DIRECT", - "payout_link_properties": null, - "actions": null -} -``` - - -#### List Refunds - -```python -from xendit import Refund - -refunds = Refund.list() -print(refunds) -``` - -Will return - -``` -{ - "has_more": true, - "data": [{ - "id": "rfd-107ac068-0737-4c85-8aaf-61f908e3c136", - "payment_id": "ewc_0b98b8c6-2f5f-4355-87f1-d3afe372495b", - "invoice_id": "", - "amount": 1500, - "payment_method_type": "EWALLET", - "channel_code": "GRABPAY", - "country": "PH", - "currency": "PHP", - "status": "PENDING", - "reason": "", - "reference_id": "", - "failure_code": null, - "refund_fee_amount": null, - "created": "2022-11-04T06:21:35.213018123Z", - "updated": "2022-11-04T06:21:35.213018243Z", - "metadata": null, - "refund_method": "DIRECT", - "payout_link_properties": null, - "actions": null - }] -} -``` - - -## Contributing - -For any requests, bugs, or comments, please open an [issue](https://github.com/xendit/xendit-python/issues) or [submit a pull request](https://github.com/xendit/xendit-python/pulls). - -To start developing on this repository, you need to have Poetry installed for package dependency. After that, you can run ```poetry install``` to install the dependency. To enter the environment, run ```poetry shell``` - -### Tests - -#### Running the Test - -Make sure the the code passes all tests. - -Run the test: - -``` -python -m pytest tests/ -``` - -Run with coverage: - -``` -python -m pytest tests/ --cov=xendit/ -``` \ No newline at end of file +* [Xendit Docs](https://docs.xendit.co/) +* [Xendit API Reference](https://developers.xendit.co/) \ No newline at end of file diff --git a/docs/AddressObject.md b/docs/AddressObject.md new file mode 100644 index 00000000..97196393 --- /dev/null +++ b/docs/AddressObject.md @@ -0,0 +1,18 @@ +# xendit.invoice.model.AddressObject + +An object representing an address with various properties. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country** | **str, none_type** | The country where the address is located. | [optional] +**street_line1** | **str, none_type** | The first line of the street address. | [optional] +**street_line2** | **str, none_type** | The second line of the street address. | [optional] +**city** | **str, none_type** | The city or locality within the address. | [optional] +**province** | **str, none_type** | The province or region within the country. | [optional] +**state** | **str, none_type** | The state or administrative division within the country. | [optional] +**postal_code** | **str, none_type** | The postal code or ZIP code for the address. | [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/docs/AlternativeDisplayItem.md b/docs/AlternativeDisplayItem.md new file mode 100644 index 00000000..45bb74ec --- /dev/null +++ b/docs/AlternativeDisplayItem.md @@ -0,0 +1,13 @@ +# xendit.invoice.model.AlternativeDisplayItem + +An object representing alternative display of a VA. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | Represent type of alternative display. | [optional] +**value** | **str** | Represent value of alternative display value. | [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/docs/BadRequestError.md b/docs/BadRequestError.md new file mode 100644 index 00000000..3dabe4c6 --- /dev/null +++ b/docs/BadRequestError.md @@ -0,0 +1,13 @@ +# xendit.invoice.model.BadRequestError + +Response definition for a 400 Bad Request error when creating an invoice. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error_code** | **str** | The error code indicating the type of error that occurred. | +**message** | **str** | A human-readable error message that provides additional information about the error. | + +[[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/docs/Balance.md b/docs/Balance.md new file mode 100644 index 00000000..2736437e --- /dev/null +++ b/docs/Balance.md @@ -0,0 +1,12 @@ +# xendit.balance_and_transaction.model.Balance + +The balance remaining in your account + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**balance** | **float** | | + +[[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/docs/BalanceApi.md b/docs/BalanceApi.md new file mode 100644 index 00000000..c1e407a9 --- /dev/null +++ b/docs/BalanceApi.md @@ -0,0 +1,71 @@ +# xendit.apis.BalanceApi + +All URIs are relative to *https://api.xendit.co* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_balance**](BalanceApi.md#get_balance) | **GET** /balance | Retrieves balances for a business, default to CASH type + + +# **get_balance** +> Balance get_balance() + +Retrieves balances for a business, default to CASH type + +Retrieves balance for your business, defaults to CASH type + +### Example + + +```python +import time +import xendit +from xendit.apis import BalanceApi +from xendit.balance_and_transaction.model.server_error import ServerError +from xendit.balance_and_transaction.model.validation_error import ValidationError +from xendit.balance_and_transaction.model.balance import Balance +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = BalanceApi(api_client) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Retrieves balances for a business, default to CASH type + api_response = api_instance.get_balance(account_type=account_type, currency=currency, for_user_id=for_user_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling BalanceApi->get_balance: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_type** | **str**| The selected balance type | [optional] if omitted the server will use the default value of "CASH" + **currency** | **str**| Currency for filter for customers with multi currency accounts | [optional] + **for_user_id** | **str**| The sub-account user-id that you want to make this transaction for. This header is only used if you have access to xenPlatform. See xenPlatform for more information | [optional] + +### Return type + +[**Balance**](Balance.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | success | - | +**400** | invalid input, object invalid | - | +**0** | Errors | - | + +[[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/docs/Bank.md b/docs/Bank.md new file mode 100644 index 00000000..1751da99 --- /dev/null +++ b/docs/Bank.md @@ -0,0 +1,18 @@ +# xendit.invoice.model.Bank + +An object representing bank details for invoices. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bank_code** | [**BankCode**](BankCode.md) | | +**collection_type** | **str** | The collection type for the bank details. | +**account_holder_name** | **str** | The name of the account holder. | +**bank_branch** | **str** | The branch of the bank. | [optional] +**bank_account_number** | **str** | The bank account number. | [optional] +**transfer_amount** | **float** | The transfer amount. | [optional] +**alternative_displays** | [**[AlternativeDisplayItem]**](AlternativeDisplayItem.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/docs/BankCode.md b/docs/BankCode.md new file mode 100644 index 00000000..f2d248ad --- /dev/null +++ b/docs/BankCode.md @@ -0,0 +1,12 @@ +# xendit.invoice.model.BankCode + +Representing the available bank channels used for invoice-related transactions. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | Representing the available bank channels used for invoice-related transactions. | must be one of ["BCA", "BNI", "BRI", "MANDIRI", "PERMATA", "BSI", "BJB", ] + +[[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/docs/BillingInformation.md b/docs/BillingInformation.md new file mode 100644 index 00000000..488bae93 --- /dev/null +++ b/docs/BillingInformation.md @@ -0,0 +1,17 @@ +# xendit.payment_method.model.BillingInformation + +Billing Information + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country** | **str** | | +**street_line1** | **str, none_type** | | [optional] +**street_line2** | **str, none_type** | | [optional] +**city** | **str, none_type** | | [optional] +**province_state** | **str, none_type** | | [optional] +**postal_code** | **str, none_type** | | [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/docs/Capture.md b/docs/Capture.md new file mode 100644 index 00000000..89d5c14d --- /dev/null +++ b/docs/Capture.md @@ -0,0 +1,25 @@ +# xendit.payment_request.model.Capture + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**payment_request_id** | **str** | | +**payment_id** | **str** | | +**reference_id** | **str** | | +**currency** | **str** | | +**authorized_amount** | **float** | | +**captured_amount** | **float** | | +**status** | **str** | | +**payment_method** | [**PaymentMethod**](PaymentMethod.md) | | +**failure_code** | **str, none_type** | | +**customer_id** | **str, none_type** | | +**metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | +**channel_properties** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | +**created** | **str** | | +**updated** | **str** | | + +[[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/docs/CaptureList.md b/docs/CaptureList.md new file mode 100644 index 00000000..caca66cc --- /dev/null +++ b/docs/CaptureList.md @@ -0,0 +1,11 @@ +# xendit.payment_request.model.CaptureList + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | [**[Capture]**](Capture.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/docs/CaptureListResponse.md b/docs/CaptureListResponse.md new file mode 100644 index 00000000..2631b9b4 --- /dev/null +++ b/docs/CaptureListResponse.md @@ -0,0 +1,12 @@ +# xendit.payment_request.model.CaptureListResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**CaptureList**](CaptureList.md) | | +**has_more** | **bool** | | + +[[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/docs/CaptureParameters.md b/docs/CaptureParameters.md new file mode 100644 index 00000000..cc7c5e1e --- /dev/null +++ b/docs/CaptureParameters.md @@ -0,0 +1,12 @@ +# xendit.payment_request.model.CaptureParameters + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**capture_amount** | **float** | | +**reference_id** | **str, none_type** | | [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/docs/Card.md b/docs/Card.md new file mode 100644 index 00000000..abc72c92 --- /dev/null +++ b/docs/Card.md @@ -0,0 +1,14 @@ +# xendit.payment_request.model.Card + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | [**PaymentRequestCurrency**](PaymentRequestCurrency.md) | | +**channel_properties** | [**CardChannelProperties**](CardChannelProperties.md) | | +**card_information** | [**CardInformation**](CardInformation.md) | | +**card_verification_results** | [**CardVerificationResults**](CardVerificationResults.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/docs/CardChannelProperties.md b/docs/CardChannelProperties.md new file mode 100644 index 00000000..c17396ab --- /dev/null +++ b/docs/CardChannelProperties.md @@ -0,0 +1,16 @@ +# xendit.payment_request.model.CardChannelProperties + +Card Channel Properties + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**skip_three_d_secure** | **bool, none_type** | To indicate whether to perform 3DS during the linking phase | [optional] +**success_return_url** | **str, none_type** | URL where the end-customer is redirected if the authorization is successful | [optional] +**failure_return_url** | **str, none_type** | URL where the end-customer is redirected if the authorization failed | [optional] +**cardonfile_type** | **str, none_type** | Type of “credential-on-file” / “card-on-file” payment being made. Indicate that this payment uses a previously linked Payment Method for charging. | [optional] +**merchant_id_tag** | **str** | Tag for a Merchant ID that you want to associate this payment with. For merchants using their own MIDs to specify which MID they want to use | [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/docs/CardInformation.md b/docs/CardInformation.md new file mode 100644 index 00000000..387bec98 --- /dev/null +++ b/docs/CardInformation.md @@ -0,0 +1,21 @@ +# xendit.payment_request.model.CardInformation + +Card Information + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**token_id** | **str** | | +**masked_card_number** | **str** | 1st 6 and last 4 digits of the card | +**expiry_month** | **str** | Card expiry month in MM format | +**expiry_year** | **str** | Card expiry month in YY format | +**cardholder_name** | **str, none_type** | Cardholder name | [optional] +**fingerprint** | **str** | | [optional] +**type** | **str** | | [optional] +**network** | **str** | | [optional] +**country** | **str** | | [optional] +**issuer** | **str** | | [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/docs/CardParameters.md b/docs/CardParameters.md new file mode 100644 index 00000000..da8ed998 --- /dev/null +++ b/docs/CardParameters.md @@ -0,0 +1,13 @@ +# xendit.payment_method.model.CardParameters + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | | +**channel_properties** | [**CardChannelProperties**](CardChannelProperties.md) | | [optional] +**card_information** | [**CardParametersCardInformation**](CardParametersCardInformation.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/docs/CardParametersCardInformation.md b/docs/CardParametersCardInformation.md new file mode 100644 index 00000000..d88f3f61 --- /dev/null +++ b/docs/CardParametersCardInformation.md @@ -0,0 +1,16 @@ +# xendit.payment_method.model.CardParametersCardInformation + +Card Information + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**card_number** | **str** | | +**expiry_month** | **str** | Card expiry month in MM format | +**expiry_year** | **str** | Card expiry month in YY format | +**cardholder_name** | **str, none_type** | Cardholder name | [optional] +**cvv** | **str, none_type** | | [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/docs/CardVerificationResults.md b/docs/CardVerificationResults.md new file mode 100644 index 00000000..7a74dae4 --- /dev/null +++ b/docs/CardVerificationResults.md @@ -0,0 +1,13 @@ +# xendit.payment_request.model.CardVerificationResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**three_d_secure** | [**CardVerificationResultsThreeDSecure**](CardVerificationResultsThreeDSecure.md) | | [optional] +**cvv_result** | **str, none_type** | | [optional] +**address_verification_result** | **str, none_type** | | [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/docs/CardVerificationResultsThreeDSecure.md b/docs/CardVerificationResultsThreeDSecure.md new file mode 100644 index 00000000..eb5a4a68 --- /dev/null +++ b/docs/CardVerificationResultsThreeDSecure.md @@ -0,0 +1,15 @@ +# xendit.payment_request.model.CardVerificationResultsThreeDSecure + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**three_d_secure_flow** | **str, none_type** | | [optional] +**eci_code** | **str, none_type** | | [optional] +**three_d_secure_result** | **str, none_type** | | [optional] +**three_d_secure_result_reason** | **str, none_type** | | [optional] +**three_d_secure_version** | **str, none_type** | | [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/docs/Channel.md b/docs/Channel.md new file mode 100644 index 00000000..9a603a74 --- /dev/null +++ b/docs/Channel.md @@ -0,0 +1,16 @@ +# xendit.payout.model.Channel + +Channel information where you can send the money to + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**channel_code** | **str** | Destination channel to send the money to, prefixed by ISO-3166 country code | +**channel_category** | [**ChannelCategory**](ChannelCategory.md) | | +**currency** | **str** | Currency of the destination channel using ISO-4217 currency code | +**channel_name** | **str** | Name of the destination channel | +**amount_limits** | [**ChannelAmountLimits**](ChannelAmountLimits.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/docs/ChannelAccountType.md b/docs/ChannelAccountType.md new file mode 100644 index 00000000..60242a57 --- /dev/null +++ b/docs/ChannelAccountType.md @@ -0,0 +1,12 @@ +# xendit.payout.model.ChannelAccountType + +Available account types (applicable for MY_DUITNOW) + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | Available account types (applicable for MY_DUITNOW) | must be one of ["NATIONAL_ID", "MOBILE_NO", "PASSPORT", "BUSINESS_REGISTRATION", "BANK_ACCOUNT", ] + +[[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/docs/ChannelAmountLimits.md b/docs/ChannelAmountLimits.md new file mode 100644 index 00000000..2bff371f --- /dev/null +++ b/docs/ChannelAmountLimits.md @@ -0,0 +1,14 @@ +# xendit.payout.model.ChannelAmountLimits + +Supported amount ranges for payouts to this channel + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**minimum** | **float** | Lowest amount supported for a payout to this channel | +**maximum** | **float** | Highest amount supported for a payout to this channel | +**minimum_increment** | **float** | Supported increments | + +[[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/docs/ChannelAmountLimitsAllOf.md b/docs/ChannelAmountLimitsAllOf.md new file mode 100644 index 00000000..0985dccc --- /dev/null +++ b/docs/ChannelAmountLimitsAllOf.md @@ -0,0 +1,14 @@ +# xendit.payment_method.model.ChannelAmountLimitsAllOf + +Contains objects of the support currencies and its respective limits per transaction + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency supported by the payment channel | [optional] +**min_limit** | **float** | The minimum allowed transaction amount for the payment channel | [optional] +**max_limit** | **float** | The minimum allowed transaction amount for the payment channel | [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/docs/ChannelCategory.md b/docs/ChannelCategory.md new file mode 100644 index 00000000..3b52fcc0 --- /dev/null +++ b/docs/ChannelCategory.md @@ -0,0 +1,12 @@ +# xendit.payout.model.ChannelCategory + +Category of channel code, as some channels might require more fields during processing + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | Category of channel code, as some channels might require more fields during processing | must be one of ["BANK", "EWALLET", "OTC", ] + +[[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/docs/ChannelProperty.md b/docs/ChannelProperty.md new file mode 100644 index 00000000..412ec760 --- /dev/null +++ b/docs/ChannelProperty.md @@ -0,0 +1,13 @@ +# xendit.payment_method.model.ChannelProperty + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The corresponding parameter name | [optional] +**type** | **str** | Data type of the parameter | [optional] +**is_required** | **bool** | Indicates whether or not the parameter is required | [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/docs/ChannelPropertyAllOf.md b/docs/ChannelPropertyAllOf.md new file mode 100644 index 00000000..bd8573c6 --- /dev/null +++ b/docs/ChannelPropertyAllOf.md @@ -0,0 +1,14 @@ +# xendit.payment_method.model.ChannelPropertyAllOf + +Objects that enumerate the parameters needed as `channel_properties` when creating a Payment Method + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The corresponding parameter name | [optional] +**type** | **str** | Data type of the parameter | [optional] +**is_required** | **bool** | Indicates whether or not the parameter is required | [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/docs/ChannelsCategories.md b/docs/ChannelsCategories.md new file mode 100644 index 00000000..60e9479f --- /dev/null +++ b/docs/ChannelsCategories.md @@ -0,0 +1,11 @@ +# xendit.balance_and_transaction.model.ChannelsCategories + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | must be one of ["BANK", "CARDLESS_CREDIT", "PAYLATER", "CARDS", "CASH", "DIRECT_DEBIT", "EWALLET", "INVOICE", "QR_CODE", "RETAIL_OUTLET", "VIRTUAL_ACCOUNT", "XENPLATFORM", "DIRECT_BANK_TRANSFER", "OTHER", ] + +[[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/docs/CreateInvoiceRequest.md b/docs/CreateInvoiceRequest.md new file mode 100644 index 00000000..6dea5c84 --- /dev/null +++ b/docs/CreateInvoiceRequest.md @@ -0,0 +1,31 @@ +# xendit.invoice.model.CreateInvoiceRequest + +An object representing for an invoice creation request. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**external_id** | **str** | The external ID of the invoice. | +**amount** | **float** | The invoice amount. | +**payer_email** | **str** | The email address of the payer. | [optional] +**description** | **str** | A description of the payment. | [optional] +**invoice_duration** | **str** | The duration of the invoice. | [optional] +**callback_virtual_account_id** | **str** | The ID of the callback virtual account. | [optional] +**should_send_email** | **bool** | Indicates whether email notifications should be sent. | [optional] +**customer** | [**CustomerObject**](CustomerObject.md) | | [optional] +**customer_notification_preference** | [**NotificationPreference**](NotificationPreference.md) | | [optional] +**success_redirect_url** | **str** | The URL to redirect to on successful payment. | [optional] +**failure_redirect_url** | **str** | The URL to redirect to on payment failure. | [optional] +**payment_methods** | **[str]** | An array of available payment methods. | [optional] +**mid_label** | **str** | The middle label. | [optional] +**should_authenticate_credit_card** | **bool** | Indicates whether credit card authentication is required. | [optional] +**currency** | **str** | The currency of the invoice. | [optional] +**reminder_time** | **float** | The reminder time. | [optional] +**local** | **str** | The local. | [optional] +**reminder_time_unit** | **str** | The unit of the reminder time. | [optional] +**items** | [**[InvoiceItem]**](InvoiceItem.md) | An array of items included in the invoice. | [optional] +**fees** | [**[InvoiceFee]**](InvoiceFee.md) | An array of fees associated with the invoice. | [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/docs/CreatePaymentMethod409Response.md b/docs/CreatePaymentMethod409Response.md new file mode 100644 index 00000000..dd89728b --- /dev/null +++ b/docs/CreatePaymentMethod409Response.md @@ -0,0 +1,12 @@ +# xendit.payment_method.model.CreatePaymentMethod409Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error_code** | **str** | | [optional] +**message** | **str** | | [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/docs/CreatePaymentMethod503Response.md b/docs/CreatePaymentMethod503Response.md new file mode 100644 index 00000000..08b01fbd --- /dev/null +++ b/docs/CreatePaymentMethod503Response.md @@ -0,0 +1,12 @@ +# xendit.payment_method.model.CreatePaymentMethod503Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error_code** | **str** | | [optional] +**message** | **str** | | [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/docs/CreatePayoutRequest.md b/docs/CreatePayoutRequest.md new file mode 100644 index 00000000..3f5d76d3 --- /dev/null +++ b/docs/CreatePayoutRequest.md @@ -0,0 +1,19 @@ +# xendit.payout.model.CreatePayoutRequest + +Information needed by Xendit to send money to the destination channel provided + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reference_id** | **str** | A client defined payout identifier | +**channel_code** | **str** | Channel code of selected destination bank or e-wallet | +**channel_properties** | [**DigitalPayoutChannelProperties**](DigitalPayoutChannelProperties.md) | | +**amount** | **float** | Amount to be sent to the destination account and should be a multiple of the minimum increment for the selected channel | +**currency** | **str** | Currency of the destination channel using ISO-4217 currency code | +**description** | **str** | Description to send with the payout, the recipient may see this e.g., in their bank statement (if supported) or in email receipts we send on your behalf | [optional] +**receipt_notification** | [**ReceiptNotification**](ReceiptNotification.md) | | [optional] +**metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | Object of additional information you may use | [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/docs/CreateRefund.md b/docs/CreateRefund.md new file mode 100644 index 00000000..79ecc201 --- /dev/null +++ b/docs/CreateRefund.md @@ -0,0 +1,17 @@ +# xendit.refund.model.CreateRefund + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payment_request_id** | **str** | | [optional] +**invoice_id** | **str** | | [optional] +**reference_id** | **str** | | [optional] +**amount** | **float** | | [optional] +**currency** | **str** | | [optional] +**reason** | **str** | | [optional] +**metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [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/docs/CreateRefund400Response.md b/docs/CreateRefund400Response.md new file mode 100644 index 00000000..16055b2b --- /dev/null +++ b/docs/CreateRefund400Response.md @@ -0,0 +1,12 @@ +# xendit.refund.model.CreateRefund400Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error_code** | **str** | | [optional] +**message** | **str** | | [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/docs/CreateRefund403Response.md b/docs/CreateRefund403Response.md new file mode 100644 index 00000000..ac077cbd --- /dev/null +++ b/docs/CreateRefund403Response.md @@ -0,0 +1,12 @@ +# xendit.refund.model.CreateRefund403Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error_code** | **str** | | [optional] if omitted the server will use the default value of "UNAUTHORIZED" +**message** | **str** | | [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/docs/CreateRefund404Response.md b/docs/CreateRefund404Response.md new file mode 100644 index 00000000..c9b49aeb --- /dev/null +++ b/docs/CreateRefund404Response.md @@ -0,0 +1,12 @@ +# xendit.refund.model.CreateRefund404Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error_code** | **str** | | [optional] if omitted the server will use the default value of "DATA_NOT_FOUND" +**message** | **str** | | [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/docs/CreateRefund409Response.md b/docs/CreateRefund409Response.md new file mode 100644 index 00000000..6951fd35 --- /dev/null +++ b/docs/CreateRefund409Response.md @@ -0,0 +1,12 @@ +# xendit.refund.model.CreateRefund409Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error_code** | **str** | | [optional] +**message** | **str** | | [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/docs/CreateRefund503Response.md b/docs/CreateRefund503Response.md new file mode 100644 index 00000000..0be86deb --- /dev/null +++ b/docs/CreateRefund503Response.md @@ -0,0 +1,12 @@ +# xendit.refund.model.CreateRefund503Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error_code** | **str** | | [optional] +**message** | **str** | | [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/docs/CreateRefundDefaultResponse.md b/docs/CreateRefundDefaultResponse.md new file mode 100644 index 00000000..40942bce --- /dev/null +++ b/docs/CreateRefundDefaultResponse.md @@ -0,0 +1,12 @@ +# xendit.refund.model.CreateRefundDefaultResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error_code** | **str** | | [optional] +**message** | **str** | | [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/docs/Currency.md b/docs/Currency.md new file mode 100644 index 00000000..cb8a2dbc --- /dev/null +++ b/docs/Currency.md @@ -0,0 +1,11 @@ +# xendit.balance_and_transaction.model.Currency + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | must be one of ["IDR", "PHP", "USD", "JPY", "VND", "SGD", "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "ILS", "IMP", "INR", "IQD", "IRR", "ISK", "JEP", "JMD", "JOD", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SHP", "SLL", "SOS", "SPL", "SRD", "STN", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TVD", "TWD", "TZS", "UAH", "UGX", "UYU", "UZS", "VEF", "VUV", "WST", "XAF", "XCD", "XDR", "XOF", "XPF", "YER", "ZAR", "ZMW", "ZWD", ] + +[[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/docs/CustomerObject.md b/docs/CustomerObject.md new file mode 100644 index 00000000..faf5867c --- /dev/null +++ b/docs/CustomerObject.md @@ -0,0 +1,19 @@ +# xendit.invoice.model.CustomerObject + +An object representing a customer with various properties, including addresses. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str, none_type** | The unique identifier for the customer. | [optional] +**phone_number** | **str, none_type** | The customer's phone number. | [optional] +**given_names** | **str, none_type** | The customer's given names or first names. | [optional] +**surname** | **str, none_type** | The customer's surname or last name. | [optional] +**email** | **str, none_type** | The customer's email address. | [optional] +**mobile_number** | **str, none_type** | The customer's mobile phone number. | [optional] +**customer_id** | **str, none_type** | An additional identifier for the customer. | [optional] +**addresses** | [**[AddressObject], none_type**](AddressObject.md) | An array of addresses associated with the customer. | [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/docs/DateRangeFilter.md b/docs/DateRangeFilter.md new file mode 100644 index 00000000..c345e7ba --- /dev/null +++ b/docs/DateRangeFilter.md @@ -0,0 +1,12 @@ +# xendit.balance_and_transaction.model.DateRangeFilter + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**gte** | **datetime** | Start time of transaction. If not specified will list all dates. | [optional] +**lte** | **datetime** | End time of transaction. If not specified will list all dates. | [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/docs/DigitalPayoutChannelProperties.md b/docs/DigitalPayoutChannelProperties.md new file mode 100644 index 00000000..9f1ffdae --- /dev/null +++ b/docs/DigitalPayoutChannelProperties.md @@ -0,0 +1,14 @@ +# xendit.payout.model.DigitalPayoutChannelProperties + +Channel information for digital destinations (banks, e-wallets) + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_number** | **str** | Registered account number | +**account_holder_name** | **str, none_type** | Registered account name | [optional] +**account_type** | [**ChannelAccountType**](ChannelAccountType.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/docs/DirectDebit.md b/docs/DirectDebit.md new file mode 100644 index 00000000..1e997619 --- /dev/null +++ b/docs/DirectDebit.md @@ -0,0 +1,16 @@ +# xendit.payment_method.model.DirectDebit + +Direct Debit Payment Method Details + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**channel_code** | [**DirectDebitChannelCode**](DirectDebitChannelCode.md) | | +**channel_properties** | [**DirectDebitChannelProperties**](DirectDebitChannelProperties.md) | | +**type** | [**DirectDebitType**](DirectDebitType.md) | | +**bank_account** | [**DirectDebitBankAccount**](DirectDebitBankAccount.md) | | [optional] +**debit_card** | [**DirectDebitDebitCard**](DirectDebitDebitCard.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/docs/DirectDebitAllOf.md b/docs/DirectDebitAllOf.md new file mode 100644 index 00000000..6daf9b1d --- /dev/null +++ b/docs/DirectDebitAllOf.md @@ -0,0 +1,13 @@ +# xendit.payment_method.model.DirectDebitAllOf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**DirectDebitType**](DirectDebitType.md) | | +**bank_account** | [**DirectDebitBankAccount**](DirectDebitBankAccount.md) | | [optional] +**debit_card** | [**DirectDebitDebitCard**](DirectDebitDebitCard.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/docs/DirectDebitBankAccount.md b/docs/DirectDebitBankAccount.md new file mode 100644 index 00000000..5bb65247 --- /dev/null +++ b/docs/DirectDebitBankAccount.md @@ -0,0 +1,14 @@ +# xendit.payment_method.model.DirectDebitBankAccount + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**masked_bank_account_number** | **str, none_type** | | [optional] +**bank_account_hash** | **str, none_type** | | [optional] +**mobile_number** | **str, none_type** | Mobile number of the customer registered to the partner channel | [optional] +**identity_document_number** | **str, none_type** | Identity number of the customer registered to the partner channel | [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/docs/DirectDebitChannelCode.md b/docs/DirectDebitChannelCode.md new file mode 100644 index 00000000..45bf1ba9 --- /dev/null +++ b/docs/DirectDebitChannelCode.md @@ -0,0 +1,12 @@ +# xendit.payment_method.model.DirectDebitChannelCode + +Direct Debit Channel Code + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | Direct Debit Channel Code | must be one of ["BCA_KLIKPAY", "BCA_ONEKLIK", "BDO", "BPI", "BRI", "BNI", "CHINABANK", "CIMBNIAGA", "MTB", "RCBC", "UBP", "MANDIRI", "BBL", "SCB", "KTB", "BAY", "KBANK_MB", "BAY_MB", "KTB_MB", "BBL_MB", "SCB_MB", "BDO_EPAY", "AUTODEBIT_UBP", "AFFIN_FPX", "AGRO_FPX", "ALLIANCE_FPX", "AMBANK_FPX", "ISLAM_FPX", "MUAMALAT_FPX", "BOC_FPX", "RAKYAT_FPX", "BSN_FPX", "CIMB_FPX", "HLB_FPX", "HSBC_FPX", "KFH_FPX", "MAYB2E_FPX", "MAYB2U_FPX", "OCBC_FPX", "PUBLIC_FPX", "RHB_FPX", "SCH_FPX", "UOB_FPX", "AFFIN_FPX_BUSINESS", "AGRO_FPX_BUSINESS", "ALLIANCE_FPX_BUSINESS", "AMBANK_FPX_BUSINESS", "ISLAM_FPX_BUSINESS", "MUAMALAT_FPX_BUSINESS", "BNP_FPX_BUSINESS", "CIMB_FPX_BUSINESS", "CITIBANK_FPX_BUSINESS", "DEUTSCHE_FPX_BUSINESS", "HLB_FPX_BUSINESS", "HSBC_FPX_BUSINESS", "RAKYAT_FPX_BUSINESS", "KFH_FPX_BUSINESS", "MAYB2E_FPX_BUSINESS", "OCBC_FPX_BUSINESS", "PUBLIC_FPX_BUSINESS", "RHB_FPX_BUSINESS", "SCH_FPX_BUSINESS", "UOB_FPX_BUSINESS", ] + +[[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/docs/DirectDebitChannelProperties.md b/docs/DirectDebitChannelProperties.md new file mode 100644 index 00000000..b044f24c --- /dev/null +++ b/docs/DirectDebitChannelProperties.md @@ -0,0 +1,19 @@ +# xendit.payment_method.model.DirectDebitChannelProperties + +Direct Debit Channel Properties + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success_return_url** | **str** | | [optional] +**failure_return_url** | **str, none_type** | | [optional] +**mobile_number** | **str, none_type** | Mobile number of the customer registered to the partner channel | [optional] +**card_last_four** | **str, none_type** | Last four digits of the debit card | [optional] +**card_expiry** | **str, none_type** | Expiry month and year of the debit card (in MM/YY format) | [optional] +**email** | **str, none_type** | Email address of the customer that is registered to the partner channel | [optional] +**identity_document_number** | **str, none_type** | Identity number of the customer registered to the partner channel | [optional] +**require_auth** | **bool, none_type** | | [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/docs/DirectDebitChannelPropertiesBankAccount.md b/docs/DirectDebitChannelPropertiesBankAccount.md new file mode 100644 index 00000000..ad92a990 --- /dev/null +++ b/docs/DirectDebitChannelPropertiesBankAccount.md @@ -0,0 +1,15 @@ +# xendit.payment_request.model.DirectDebitChannelPropertiesBankAccount + +Direct Debit Bank Account Channel Properties + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success_return_url** | **str** | | [optional] +**failure_return_url** | **str** | | [optional] +**mobile_number** | **str** | | [optional] +**identity_document_number** | **str** | | [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/docs/DirectDebitChannelPropertiesBankRedirect.md b/docs/DirectDebitChannelPropertiesBankRedirect.md new file mode 100644 index 00000000..bd4ab92a --- /dev/null +++ b/docs/DirectDebitChannelPropertiesBankRedirect.md @@ -0,0 +1,14 @@ +# xendit.payment_request.model.DirectDebitChannelPropertiesBankRedirect + +Direct Debit Bank Account Channel Properties + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mobile_number** | **str** | Mobile number of the customer that is registered to channel | [optional] +**success_return_url** | **str** | | [optional] +**failure_return_url** | **str** | | [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/docs/DirectDebitChannelPropertiesDebitCard.md b/docs/DirectDebitChannelPropertiesDebitCard.md new file mode 100644 index 00000000..4b2b0919 --- /dev/null +++ b/docs/DirectDebitChannelPropertiesDebitCard.md @@ -0,0 +1,16 @@ +# xendit.payment_request.model.DirectDebitChannelPropertiesDebitCard + +Direct Debit Debit Card Channel Properties + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mobile_number** | **str** | Mobile number of the customer registered to the partner channel | [optional] +**account_number** | **str** | | [optional] +**card_last_four** | **str** | Last four digits of the debit card | [optional] +**card_expiry** | **str** | Expiry month and year of the debit card (in MM/YY format) | [optional] +**email** | **str** | Email address of the customer that is registered to the partner channel | [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/docs/DirectDebitDebitCard.md b/docs/DirectDebitDebitCard.md new file mode 100644 index 00000000..f1ab04cf --- /dev/null +++ b/docs/DirectDebitDebitCard.md @@ -0,0 +1,14 @@ +# xendit.payment_method.model.DirectDebitDebitCard + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mobile_number** | **str, none_type** | Mobile number of the customer registered to the partner channel | [optional] +**card_last_four** | **str, none_type** | Last four digits of the debit card | [optional] +**card_expiry** | **str, none_type** | Expiry month and year of the debit card (in MM/YY format) | [optional] +**email** | **str, none_type** | Email address of the customer that is registered to the partner channel | [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/docs/DirectDebitParameters.md b/docs/DirectDebitParameters.md new file mode 100644 index 00000000..3958f101 --- /dev/null +++ b/docs/DirectDebitParameters.md @@ -0,0 +1,12 @@ +# xendit.payment_method.model.DirectDebitParameters + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**channel_code** | [**DirectDebitChannelCode**](DirectDebitChannelCode.md) | | +**channel_properties** | [**DirectDebitChannelProperties**](DirectDebitChannelProperties.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/docs/DirectDebitType.md b/docs/DirectDebitType.md new file mode 100644 index 00000000..44bf8e25 --- /dev/null +++ b/docs/DirectDebitType.md @@ -0,0 +1,11 @@ +# xendit.payment_method.model.DirectDebitType + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | must be one of ["DEBIT_CARD", "BANK_ACCOUNT", "BANK_REDIRECT", ] + +[[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/docs/EWallet.md b/docs/EWallet.md new file mode 100644 index 00000000..a33aaeca --- /dev/null +++ b/docs/EWallet.md @@ -0,0 +1,14 @@ +# xendit.payment_request.model.EWallet + +Ewallet Payment Method Details + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**channel_code** | [**EWalletChannelCode**](EWalletChannelCode.md) | | [optional] +**channel_properties** | [**EWalletChannelProperties**](EWalletChannelProperties.md) | | [optional] +**account** | [**EWalletAccount**](EWalletAccount.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/docs/EWalletAccount.md b/docs/EWalletAccount.md new file mode 100644 index 00000000..060dbf3a --- /dev/null +++ b/docs/EWalletAccount.md @@ -0,0 +1,15 @@ +# xendit.payment_method.model.EWalletAccount + +EWallet Account Properties + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str, none_type** | Name of the eWallet account holder. The value is null if unavailableName of the eWallet account holder. The value is null if unavailable | [optional] +**account_details** | **str, none_type** | Identifier from eWallet provider e.g. phone number. The value is null if unavailable | [optional] +**balance** | **float, none_type** | The main balance amount on eWallet account provided from eWallet provider. The value is null if unavailable | [optional] +**point_balance** | **float, none_type** | The point balance amount on eWallet account. Applicable only on some eWallet provider that has point system. The value is null if unavailabl | [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/docs/EWalletAllOf.md b/docs/EWalletAllOf.md new file mode 100644 index 00000000..37bd61a4 --- /dev/null +++ b/docs/EWalletAllOf.md @@ -0,0 +1,11 @@ +# xendit.payment_request.model.EWalletAllOf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account** | [**EWalletAccount**](EWalletAccount.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/docs/EWalletChannelCode.md b/docs/EWalletChannelCode.md new file mode 100644 index 00000000..54b2cadc --- /dev/null +++ b/docs/EWalletChannelCode.md @@ -0,0 +1,12 @@ +# xendit.payment_method.model.EWalletChannelCode + +EWallet Channel Code + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | EWallet Channel Code | must be one of ["GCASH", "GRABPAY", "PAYMAYA", "OVO", "DANA", "LINKAJA", "SHOPEEPAY", "SAKUKU", "NEXCASH", "ASTRAPAY", "JENIUSPAY", "APPOTA", "MOMO", "VNPTWALLET", "VIETTELPAY", "ZALOPAY", "WECHATPAY", "LINEPAY", "TRUEMONEY", "ALIPAY", ] + +[[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/docs/EWalletChannelProperties.md b/docs/EWalletChannelProperties.md new file mode 100644 index 00000000..ecc561a3 --- /dev/null +++ b/docs/EWalletChannelProperties.md @@ -0,0 +1,17 @@ +# xendit.payment_request.model.EWalletChannelProperties + +Ewallet Channel Properties + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success_return_url** | **str** | URL where the end-customer is redirected if the authorization is successful | [optional] +**failure_return_url** | **str** | URL where the end-customer is redirected if the authorization failed | [optional] +**cancel_return_url** | **str** | URL where the end-customer is redirected if the authorization cancelled | [optional] +**redeem_points** | **str** | REDEEM_NONE will not use any point, REDEEM_ALL will use all available points before cash balance is used. For OVO and ShopeePay tokenized payment use only. | [optional] +**mobilenumber** | **str** | | [optional] +**cashtag** | **str** | | [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/docs/EWalletParameters.md b/docs/EWalletParameters.md new file mode 100644 index 00000000..c40dc531 --- /dev/null +++ b/docs/EWalletParameters.md @@ -0,0 +1,12 @@ +# xendit.payment_request.model.EWalletParameters + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**channel_code** | [**EWalletChannelCode**](EWalletChannelCode.md) | | [optional] +**channel_properties** | [**EWalletChannelProperties**](EWalletChannelProperties.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/docs/Error.md b/docs/Error.md new file mode 100644 index 00000000..0c9377b5 --- /dev/null +++ b/docs/Error.md @@ -0,0 +1,13 @@ +# xendit.payout.model.Error + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error_code** | **str** | Specific error encountered when processing the request, can refer to the API documentation on proper handling of each available error code https://developers.xendit.co/api-reference/#payouts | +**message** | **str** | Human readable error message | +**errors** | [**[ErrorErrorsInner]**](ErrorErrorsInner.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/docs/ErrorErrorsInner.md b/docs/ErrorErrorsInner.md new file mode 100644 index 00000000..d3486b38 --- /dev/null +++ b/docs/ErrorErrorsInner.md @@ -0,0 +1,12 @@ +# xendit.payout.model.ErrorErrorsInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**path** | **str** | Precise location of the error | +**message** | **str** | Specific description of the error | + +[[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/docs/Ewallet.md b/docs/Ewallet.md new file mode 100644 index 00000000..a9982684 --- /dev/null +++ b/docs/Ewallet.md @@ -0,0 +1,12 @@ +# xendit.invoice.model.Ewallet + +An object representing e-wallet details for invoices. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ewallet_type** | [**EwalletType**](EwalletType.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/docs/EwalletType.md b/docs/EwalletType.md new file mode 100644 index 00000000..7dcf0599 --- /dev/null +++ b/docs/EwalletType.md @@ -0,0 +1,12 @@ +# xendit.invoice.model.EwalletType + +Representing the available eWallet channels used for invoice-related transactions. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | Representing the available eWallet channels used for invoice-related transactions. | must be one of ["OVO", "DANA", "LINKAJA", "PAYMAYA", "SHOPEEPAY", "GCASH", "GRABPAY", ] + +[[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/docs/FeeResponse.md b/docs/FeeResponse.md new file mode 100644 index 00000000..672b549a --- /dev/null +++ b/docs/FeeResponse.md @@ -0,0 +1,15 @@ +# xendit.balance_and_transaction.model.FeeResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**xendit_fee** | **float** | Amount of the Xendit fee for this transaction. | +**value_added_tax** | **float** | Amount of the VAT for this transaction. | +**xendit_withholding_tax** | **float** | Amount of the Xendit Withholding Tax for this transaction if applicable. See [Tax Documentation](https://docs.xendit.co/fees-and-vat#vat) for more information. | [optional] +**third_party_withholding_tax** | **float** | Amount of the 3rd Party Withholding Tax for this transaction if applicable. 3rd party example: Bank | [optional] +**status** | **str** | | [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/docs/ForbiddenError.md b/docs/ForbiddenError.md new file mode 100644 index 00000000..71e32682 --- /dev/null +++ b/docs/ForbiddenError.md @@ -0,0 +1,13 @@ +# xendit.invoice.model.ForbiddenError + +An error object used to indicate a 403 Forbidden response related to invoice operations. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **str** | A human-readable error message providing additional context about the 403 Forbidden response. | +**error_code** | **str** | The specific error code indicating that access to the invoice operation is suspended. | defaults to "ACCESS_SUSPENDED" + +[[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/docs/GetAllPaymentMethods400Response.md b/docs/GetAllPaymentMethods400Response.md new file mode 100644 index 00000000..07102f5b --- /dev/null +++ b/docs/GetAllPaymentMethods400Response.md @@ -0,0 +1,12 @@ +# xendit.payment_method.model.GetAllPaymentMethods400Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error_code** | **str** | | [optional] +**message** | **str** | | [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/docs/GetAllPaymentMethods403Response.md b/docs/GetAllPaymentMethods403Response.md new file mode 100644 index 00000000..024e7cc8 --- /dev/null +++ b/docs/GetAllPaymentMethods403Response.md @@ -0,0 +1,12 @@ +# xendit.payment_method.model.GetAllPaymentMethods403Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error_code** | **str** | | [optional] +**message** | **str** | | [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/docs/GetAllPaymentMethods404Response.md b/docs/GetAllPaymentMethods404Response.md new file mode 100644 index 00000000..88a399c0 --- /dev/null +++ b/docs/GetAllPaymentMethods404Response.md @@ -0,0 +1,12 @@ +# xendit.payment_method.model.GetAllPaymentMethods404Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error_code** | **str** | | [optional] if omitted the server will use the default value of "DATA_NOT_FOUND" +**message** | **str** | | [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/docs/GetAllPaymentMethodsDefaultResponse.md b/docs/GetAllPaymentMethodsDefaultResponse.md new file mode 100644 index 00000000..095ff633 --- /dev/null +++ b/docs/GetAllPaymentMethodsDefaultResponse.md @@ -0,0 +1,12 @@ +# xendit.payment_method.model.GetAllPaymentMethodsDefaultResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error_code** | **str** | | [optional] +**message** | **str** | | [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/docs/GetPayouts200Response.md b/docs/GetPayouts200Response.md new file mode 100644 index 00000000..ce242603 --- /dev/null +++ b/docs/GetPayouts200Response.md @@ -0,0 +1,13 @@ +# xendit.payout.model.GetPayouts200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**[GetPayouts200ResponseDataInner]**](GetPayouts200ResponseDataInner.md) | | [optional] +**has_more** | **bool** | | [optional] +**links** | [**GetPayouts200ResponseLinks**](GetPayouts200ResponseLinks.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/docs/GetPayouts200ResponseDataInner.md b/docs/GetPayouts200ResponseDataInner.md new file mode 100644 index 00000000..24972087 --- /dev/null +++ b/docs/GetPayouts200ResponseDataInner.md @@ -0,0 +1,25 @@ +# xendit.payout.model.GetPayouts200ResponseDataInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | Description to send with the payout, the recipient may see this e.g., in their bank statement (if supported) or in email receipts we send on your behalf | [optional] +**receipt_notification** | [**ReceiptNotification**](ReceiptNotification.md) | | [optional] +**metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | Object of additional information you may use | [optional] +**failure_code** | **str** | If the Payout failed, we include a failure code for more details on the failure. | [optional] +**estimated_arrival_time** | **datetime** | Our estimated time on to when your payout is reflected to the destination account | [optional] +**reference_id** | **str** | A client defined payout identifier | [optional] +**channel_code** | **str** | Channel code of selected destination bank or e-wallet | [optional] +**channel_properties** | [**DigitalPayoutChannelProperties**](DigitalPayoutChannelProperties.md) | | [optional] +**amount** | **float** | Amount to be sent to the destination account and should be a multiple of the minimum increment for the selected channel | [optional] +**currency** | **str** | Currency of the destination channel using ISO-4217 currency code | [optional] +**id** | **str** | Xendit-generated unique identifier for each payout | [optional] +**created** | **datetime** | The time payout was created on Xendit's system, in ISO 8601 format | [optional] +**updated** | **datetime** | The time payout was last updated on Xendit's system, in ISO 8601 format | [optional] +**business_id** | **str** | Xendit Business ID | [optional] +**status** | **str** | Status of 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/docs/GetPayouts200ResponseLinks.md b/docs/GetPayouts200ResponseLinks.md new file mode 100644 index 00000000..dd09f135 --- /dev/null +++ b/docs/GetPayouts200ResponseLinks.md @@ -0,0 +1,13 @@ +# xendit.payout.model.GetPayouts200ResponseLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | | [optional] +**rel** | **str** | | [optional] +**method** | **str** | | [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/docs/Invoice.md b/docs/Invoice.md new file mode 100644 index 00000000..7ca2ed3a --- /dev/null +++ b/docs/Invoice.md @@ -0,0 +1,44 @@ +# xendit.invoice.model.Invoice + +An object representing details for an invoice. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**external_id** | **str** | The external identifier for the invoice. | +**user_id** | **str** | The user ID associated with the invoice. | +**status** | [**InvoiceStatus**](InvoiceStatus.md) | | +**merchant_name** | **str** | The name of the merchant. | +**merchant_profile_picture_url** | **str** | The URL of the merchant's profile picture. | +**amount** | **float** | The total amount of the invoice. | +**expiry_date** | **datetime** | Representing a date and time in ISO 8601 format. | +**invoice_url** | **str** | The URL to view the invoice. | +**available_banks** | [**[Bank]**](Bank.md) | An array of available banks for payment. | +**available_retail_outlets** | [**[RetailOutlet]**](RetailOutlet.md) | An array of available retail outlets for payment. | +**available_ewallets** | [**[Ewallet]**](Ewallet.md) | An array of available e-wallets for payment. | +**available_qr_codes** | [**[QrCode]**](QrCode.md) | An array of available QR codes for payment. | +**available_direct_debits** | [**[DirectDebit]**](DirectDebit.md) | An array of available direct debit options for payment. | +**available_paylaters** | [**[Paylater]**](Paylater.md) | An array of available pay-later options for payment. | +**should_send_email** | **bool** | Indicates whether email notifications should be sent. | +**created** | **datetime** | Representing a date and time in ISO 8601 format. | +**updated** | **datetime** | Representing a date and time in ISO 8601 format. | +**id** | **str** | The unique identifier for the invoice. | [optional] +**payer_email** | **str** | The email address of the payer. | [optional] +**description** | **str** | A description of the invoice. | [optional] +**payment_method** | [**InvoicePaymentMethod**](InvoicePaymentMethod.md) | | [optional] +**locale** | **str** | The locale or language used for the invoice. | [optional] +**should_exclude_credit_card** | **bool** | Indicates whether credit card payments should be excluded. | [optional] +**success_redirect_url** | **str** | The URL to redirect to on successful payment. | [optional] +**failure_redirect_url** | **str** | The URL to redirect to on payment failure. | [optional] +**should_authenticate_credit_card** | **bool** | Indicates whether credit card authentication is required. | [optional] +**currency** | [**InvoiceCurrency**](InvoiceCurrency.md) | | [optional] +**items** | [**[InvoiceItem]**](InvoiceItem.md) | An array of items included in the invoice. | [optional] +**fixed_va** | **bool** | Indicates whether the virtual account is fixed. | [optional] +**reminder_date** | **datetime** | Representing a date and time in ISO 8601 format. | [optional] +**customer** | [**CustomerObject**](CustomerObject.md) | | [optional] +**customer_notification_preference** | [**NotificationPreference**](NotificationPreference.md) | | [optional] +**fees** | [**[InvoiceFee]**](InvoiceFee.md) | An array of fees associated with the invoice. | [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/docs/InvoiceApi.md b/docs/InvoiceApi.md new file mode 100644 index 00000000..d0eb34db --- /dev/null +++ b/docs/InvoiceApi.md @@ -0,0 +1,335 @@ +# xendit.apis.InvoiceApi + +All URIs are relative to *https://api.xendit.co* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_invoice**](InvoiceApi.md#create_invoice) | **POST** /v2/invoices/ | Create an invoice +[**expire_invoice**](InvoiceApi.md#expire_invoice) | **POST** /invoices/{invoice_id}/expire! | Manually expire an invoice +[**get_invoice_by_id**](InvoiceApi.md#get_invoice_by_id) | **GET** /v2/invoices/{invoice_id} | Get invoice by invoice id +[**get_invoices**](InvoiceApi.md#get_invoices) | **GET** /v2/invoices | Get all Invoices + + +# **create_invoice** +> Invoice create_invoice(create_invoice_request) + +Create an invoice + +### Example + + +```python +import time +import xendit +from xendit.apis import InvoiceApi +from xendit.invoice.model.invoice_not_found_error import InvoiceNotFoundError +from xendit.invoice.model.invoice import Invoice +from xendit.invoice.model.bad_request_error import BadRequestError +from xendit.invoice.model.unauthorized_error import UnauthorizedError +from xendit.invoice.model.forbidden_error import ForbiddenError +from xendit.invoice.model.create_invoice_request import CreateInvoiceRequest +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = InvoiceApi(api_client) +create_invoice_request = CreateInvoiceRequest( + external_id="external_id_example", + amount=3.14, + payer_email="payer_email_example", + description="description_example", + invoice_duration="invoice_duration_example", + callback_virtual_account_id="callback_virtual_account_id_example", + should_send_email=True, + customer=CustomerObject( + id="id_example", + phone_number="phone_number_example", + given_names="given_names_example", + surname="surname_example", + email="email_example", + mobile_number="mobile_number_example", + customer_id="customer_id_example", + addresses=[ + AddressObject( + country="country_example", + street_line1="street_line1_example", + street_line2="street_line2_example", + city="city_example", + province="province_example", + state="state_example", + postal_code="postal_code_example", + ), + ], + ), + customer_notification_preference=NotificationPreference( + invoice_created=[ + NotificationChannel("email"), + ], + invoice_reminder=[ + NotificationChannel("email"), + ], + invoice_expired=[ + NotificationChannel("email"), + ], + invoice_paid=[ + NotificationChannel("email"), + ], + ), + success_redirect_url="success_redirect_url_example", + failure_redirect_url="failure_redirect_url_example", + payment_methods=[ + "payment_methods_example", + ], + mid_label="mid_label_example", + should_authenticate_credit_card=True, + currency="currency_example", + reminder_time=3.14, + local="local_example", + reminder_time_unit="reminder_time_unit_example", + items=[ + InvoiceItem( + name="name_example", + price=3.14, + quantity=0, + reference_id="reference_id_example", + url="url_example", + category="category_example", + ), + ], + fees=[ + InvoiceFee( + type="type_example", + value=3.14, + ), + ], + ) # CreateInvoiceRequest | + +# example passing only required values which don't have defaults set +try: + # Create an invoice + api_response = api_instance.create_invoice(create_invoice_request) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling InvoiceApi->create_invoice: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **create_invoice_request** | [**CreateInvoiceRequest**](CreateInvoiceRequest.md)| | + +### Return type + +[**Invoice**](Invoice.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad request | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**404** | Not found | - | + +[[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) + +# **expire_invoice** +> Invoice expire_invoice(invoice_id) + +Manually expire an invoice + +### Example + + +```python +import time +import xendit +from xendit.apis import InvoiceApi +from xendit.invoice.model.invoice_not_found_error import InvoiceNotFoundError +from xendit.invoice.model.invoice import Invoice +from xendit.invoice.model.server_error import ServerError +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = InvoiceApi(api_client) +invoice_id = "5f4708b7bd394b0400b96276" # str | Invoice ID to be expired + +# example passing only required values which don't have defaults set +try: + # Manually expire an invoice + api_response = api_instance.expire_invoice(invoice_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling InvoiceApi->expire_invoice: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **invoice_id** | **str**| Invoice ID to be expired | + +### Return type + +[**Invoice**](Invoice.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**404** | Not found | - | +**500** | Internal server error | - | + +[[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) + +# **get_invoice_by_id** +> Invoice get_invoice_by_id(invoice_id) + +Get invoice by invoice id + +### Example + + +```python +import time +import xendit +from xendit.apis import InvoiceApi +from xendit.invoice.model.invoice import Invoice +from xendit.invoice.model.invoice_error404_response_definition import InvoiceError404ResponseDefinition +from xendit.invoice.model.unauthorized_error import UnauthorizedError +from xendit.invoice.model.server_error import ServerError +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = InvoiceApi(api_client) +invoice_id = "62efe4c33e45294d63f585f2" # str | Invoice ID + +# example passing only required values which don't have defaults set +try: + # Get invoice by invoice id + api_response = api_instance.get_invoice_by_id(invoice_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling InvoiceApi->get_invoice_by_id: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **invoice_id** | **str**| Invoice ID | + +### Return type + +[**Invoice**](Invoice.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**404** | Not found | - | +**500** | Internal server error | - | + +[[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) + +# **get_invoices** +> [Invoice] get_invoices() + +Get all Invoices + +### Example + + +```python +import time +import xendit +from xendit.apis import InvoiceApi +from xendit.invoice.model.invoice_status import InvoiceStatus +from xendit.invoice.model.invoice import Invoice +from xendit.invoice.model.invoice_client_type import InvoiceClientType +from xendit.invoice.model.unauthorized_error import UnauthorizedError +from xendit.invoice.model.server_error import ServerError +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = InvoiceApi(api_client) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Get all Invoices + api_response = api_instance.get_invoices(external_id=external_id, statuses=statuses, limit=limit, created_after=created_after, created_before=created_before, paid_after=paid_after, paid_before=paid_before, expired_after=expired_after, expired_before=expired_before, last_invoice=last_invoice, client_types=client_types, payment_channels=payment_channels, on_demand_link=on_demand_link, recurring_payment_id=recurring_payment_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling InvoiceApi->get_invoices: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **external_id** | **str**| | [optional] + **statuses** | [**[InvoiceStatus]**](InvoiceStatus.md)| | [optional] + **limit** | **float**| | [optional] + **created_after** | **datetime**| | [optional] + **created_before** | **datetime**| | [optional] + **paid_after** | **datetime**| | [optional] + **paid_before** | **datetime**| | [optional] + **expired_after** | **datetime**| | [optional] + **expired_before** | **datetime**| | [optional] + **last_invoice** | **str**| | [optional] + **client_types** | [**[InvoiceClientType]**](InvoiceClientType.md)| | [optional] + **payment_channels** | **[str]**| | [optional] + **on_demand_link** | **str**| | [optional] + **recurring_payment_id** | **str**| | [optional] + +### Return type + +[**[Invoice]**](Invoice.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**500** | Internal server error | - | + +[[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/docs/InvoiceClientType.md b/docs/InvoiceClientType.md new file mode 100644 index 00000000..7c17c0a0 --- /dev/null +++ b/docs/InvoiceClientType.md @@ -0,0 +1,12 @@ +# xendit.invoice.model.InvoiceClientType + +Representing the client type or source of an invoice. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | Representing the client type or source of an invoice. | must be one of ["DASHBOARD", "API_GATEWAY", "INTEGRATION", "ON_DEMAND", "RECURRING", "MOBILE", ] + +[[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/docs/InvoiceCurrency.md b/docs/InvoiceCurrency.md new file mode 100644 index 00000000..3aff7d52 --- /dev/null +++ b/docs/InvoiceCurrency.md @@ -0,0 +1,12 @@ +# xendit.invoice.model.InvoiceCurrency + +Representing the currency used for an invoice. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | Representing the currency used for an invoice. | must be one of ["IDR", "USD", "PHP", ] + +[[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/docs/InvoiceError404ResponseDefinition.md b/docs/InvoiceError404ResponseDefinition.md new file mode 100644 index 00000000..1ce3da3d --- /dev/null +++ b/docs/InvoiceError404ResponseDefinition.md @@ -0,0 +1,13 @@ +# xendit.invoice.model.InvoiceError404ResponseDefinition + +An error object used to indicate that the requested resource, in this case, an invoice, was not found. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **str** | A human-readable error message providing additional context about the resource not being found. | +**error_code** | **str** | The specific error code indicating that the requested invoice was not found. | defaults to "INVOICE_NOT_FOUND_ERROR" + +[[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/docs/InvoiceFee.md b/docs/InvoiceFee.md new file mode 100644 index 00000000..cd350d9f --- /dev/null +++ b/docs/InvoiceFee.md @@ -0,0 +1,13 @@ +# xendit.invoice.model.InvoiceFee + +An object representing internal details for a fee associated with an invoice. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | The type of fee. | +**value** | **float** | The value or amount of the fee. | + +[[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/docs/InvoiceItem.md b/docs/InvoiceItem.md new file mode 100644 index 00000000..5a7f01ac --- /dev/null +++ b/docs/InvoiceItem.md @@ -0,0 +1,17 @@ +# xendit.invoice.model.InvoiceItem + +An object representing an item within an invoice. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name of the item. | +**price** | **float** | The price of the item. | +**quantity** | **float** | The quantity of the item. Must be greater than or equal to 0. | +**reference_id** | **str** | The reference ID of the item. | [optional] +**url** | **str** | The URL associated with the item. | [optional] +**category** | **str** | The category of the item. | [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/docs/InvoiceNotFoundError.md b/docs/InvoiceNotFoundError.md new file mode 100644 index 00000000..07d05c7f --- /dev/null +++ b/docs/InvoiceNotFoundError.md @@ -0,0 +1,13 @@ +# xendit.invoice.model.InvoiceNotFoundError + +Response definition for a 404 Not Found error when creating an invoice. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error_code** | **str** | The error code indicating the type of error that occurred. | +**message** | **str** | A human-readable error message that provides additional information about the error. | + +[[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/docs/InvoicePaymentMethod.md b/docs/InvoicePaymentMethod.md new file mode 100644 index 00000000..fef13b9a --- /dev/null +++ b/docs/InvoicePaymentMethod.md @@ -0,0 +1,12 @@ +# xendit.invoice.model.InvoicePaymentMethod + +Representing the payment method used for an invoice. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | Representing the payment method used for an invoice. | must be one of ["POOL", "CALLBACK_VIRTUAL_ACCOUNT", "CREDIT_CARD", "RETAIL_OUTLET", "QR_CODE", "QRIS", "EWALLET", "DIRECT_DEBIT", "BANK_TRANSFER", "PAYLATER", ] + +[[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/docs/InvoiceStatus.md b/docs/InvoiceStatus.md new file mode 100644 index 00000000..cc77fae6 --- /dev/null +++ b/docs/InvoiceStatus.md @@ -0,0 +1,12 @@ +# xendit.invoice.model.InvoiceStatus + +Representing the status of an invoice. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | Representing the status of an invoice. | must be one of ["PENDING", "PAID", "SETTLED", "EXPIRED", ] + +[[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/docs/LinkItem.md b/docs/LinkItem.md new file mode 100644 index 00000000..174d4f7c --- /dev/null +++ b/docs/LinkItem.md @@ -0,0 +1,13 @@ +# xendit.balance_and_transaction.model.LinkItem + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | URI of target, this will be to the next link. | +**rel** | **str** | The relationship between source and target. The value will be `next`. | +**method** | **str** | The HTTP method, the value will be `GET`. | + +[[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/docs/NotificationChannel.md b/docs/NotificationChannel.md new file mode 100644 index 00000000..90afddc1 --- /dev/null +++ b/docs/NotificationChannel.md @@ -0,0 +1,12 @@ +# xendit.invoice.model.NotificationChannel + +Representing a notification channel for sending messages. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | Representing a notification channel for sending messages. | must be one of ["email", "sms", "whatsapp", "viber", ] + +[[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/docs/NotificationPreference.md b/docs/NotificationPreference.md new file mode 100644 index 00000000..0e9a0b31 --- /dev/null +++ b/docs/NotificationPreference.md @@ -0,0 +1,15 @@ +# xendit.invoice.model.NotificationPreference + +An object representing notification preferences for different invoice events. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**invoice_created** | [**[NotificationChannel]**](NotificationChannel.md) | Notification channels for when an invoice is created. | [optional] +**invoice_reminder** | [**[NotificationChannel]**](NotificationChannel.md) | Notification channels for invoice reminders. | [optional] +**invoice_expired** | [**[NotificationChannel]**](NotificationChannel.md) | Notification channels for expired invoices. | [optional] +**invoice_paid** | [**[NotificationChannel]**](NotificationChannel.md) | Notification channels for when an invoice is paid. | [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/docs/OverTheCounter.md b/docs/OverTheCounter.md new file mode 100644 index 00000000..f195e987 --- /dev/null +++ b/docs/OverTheCounter.md @@ -0,0 +1,15 @@ +# xendit.payment_method.model.OverTheCounter + +Over The Counter Payment Method Details + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**channel_code** | [**OverTheCounterChannelCode**](OverTheCounterChannelCode.md) | | +**channel_properties** | [**OverTheCounterChannelProperties**](OverTheCounterChannelProperties.md) | | +**amount** | **float, none_type** | | [optional] +**currency** | **str** | | [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/docs/OverTheCounterChannelCode.md b/docs/OverTheCounterChannelCode.md new file mode 100644 index 00000000..9f5f58ba --- /dev/null +++ b/docs/OverTheCounterChannelCode.md @@ -0,0 +1,12 @@ +# xendit.payment_method.model.OverTheCounterChannelCode + +Over The Counter Channel Code + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | Over The Counter Channel Code | must be one of ["7ELEVEN", "7ELEVEN_CLIQQ", "CEBUANA", "ECPAY", "PALAWAN", "MLHUILLIER", "ECPAY_DRAGONLOAN", "LBC", "ECPAY_SCHOOL", "RD_PAWNSHOP", "CVM", "USSC", "SM_BILLS", "ROBINSONS_BILLS", "ALFAMART", "INDOMARET", ] + +[[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/docs/OverTheCounterChannelProperties.md b/docs/OverTheCounterChannelProperties.md new file mode 100644 index 00000000..3db427e3 --- /dev/null +++ b/docs/OverTheCounterChannelProperties.md @@ -0,0 +1,14 @@ +# xendit.payment_method.model.OverTheCounterChannelProperties + +Over The Counter Channel Properties + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**customer_name** | **str** | Name of customer. | +**payment_code** | **str** | The payment code that you want to assign, e.g 12345. If you do not send one, one will be picked at random. | [optional] +**expires_at** | **datetime** | The time when the payment code will be expired. The minimum is 2 hours and the maximum is 9 days for 7ELEVEN. Default expired date will be 2 days from payment code generated. | [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/docs/OverTheCounterChannelPropertiesUpdate.md b/docs/OverTheCounterChannelPropertiesUpdate.md new file mode 100644 index 00000000..72f3c407 --- /dev/null +++ b/docs/OverTheCounterChannelPropertiesUpdate.md @@ -0,0 +1,13 @@ +# xendit.payment_method.model.OverTheCounterChannelPropertiesUpdate + +Over The Counter Channel properties that can be updated + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**customer_name** | **str** | Name of customer. | [optional] +**expires_at** | **datetime** | The time when the payment code will be expired. The minimum is 2 hours and the maximum is 9 days for 7ELEVEN. Default expired date will be 2 days from payment code generated. | [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/docs/OverTheCounterParameters.md b/docs/OverTheCounterParameters.md new file mode 100644 index 00000000..28edeeb6 --- /dev/null +++ b/docs/OverTheCounterParameters.md @@ -0,0 +1,14 @@ +# xendit.payment_method.model.OverTheCounterParameters + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**channel_code** | [**OverTheCounterChannelCode**](OverTheCounterChannelCode.md) | | +**channel_properties** | [**OverTheCounterChannelProperties**](OverTheCounterChannelProperties.md) | | +**amount** | **float, none_type** | | [optional] +**currency** | **str** | | [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/docs/OverTheCounterUpdateParameters.md b/docs/OverTheCounterUpdateParameters.md new file mode 100644 index 00000000..3c32fdab --- /dev/null +++ b/docs/OverTheCounterUpdateParameters.md @@ -0,0 +1,12 @@ +# xendit.payment_method.model.OverTheCounterUpdateParameters + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **float, none_type** | | [optional] +**channel_properties** | [**OverTheCounterChannelPropertiesUpdate**](OverTheCounterChannelPropertiesUpdate.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/docs/Paylater.md b/docs/Paylater.md new file mode 100644 index 00000000..3edf4675 --- /dev/null +++ b/docs/Paylater.md @@ -0,0 +1,13 @@ +# xendit.invoice.model.Paylater + +An object representing paylater details for invoices. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**paylater_type** | [**PaylaterType**](PaylaterType.md) | | +**should_exclude** | **bool** | Indicates whether this paylater option should be excluded. | [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/docs/PaylaterType.md b/docs/PaylaterType.md new file mode 100644 index 00000000..fe4e252a --- /dev/null +++ b/docs/PaylaterType.md @@ -0,0 +1,12 @@ +# xendit.invoice.model.PaylaterType + +Representing the available paylater channels used for invoice-related transactions. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | Representing the available paylater channels used for invoice-related transactions. | must be one of ["KREDIVO", "AKULAKU", "UANGME", "BILLEASE", "CASHALO", "ATOME", ] + +[[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/docs/PaymentChannel.md b/docs/PaymentChannel.md new file mode 100644 index 00000000..0e215165 --- /dev/null +++ b/docs/PaymentChannel.md @@ -0,0 +1,17 @@ +# xendit.payment_method.model.PaymentChannel + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**channel_code** | **str** | The specific Xendit code used to identify the partner channel | [optional] +**type** | **str** | The payment method type | [optional] +**country** | **str** | The country where the channel operates in ISO 3166-2 country code | [optional] +**channel_name** | **str** | Official parter name of the payment channel | [optional] +**channel_properties** | [**[ChannelProperty]**](ChannelProperty.md) | | [optional] +**logo_url** | **str** | If available, this contains a URL to the logo of the partner channel | [optional] +**amount_limits** | [**[ChannelAmountLimits]**](ChannelAmountLimits.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/docs/PaymentChannelAllOf.md b/docs/PaymentChannelAllOf.md new file mode 100644 index 00000000..b93c8396 --- /dev/null +++ b/docs/PaymentChannelAllOf.md @@ -0,0 +1,17 @@ +# xendit.payment_method.model.PaymentChannelAllOf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**channel_code** | **str** | The specific Xendit code used to identify the partner channel | [optional] +**type** | **str** | The payment method type | [optional] +**country** | **str** | The country where the channel operates in ISO 3166-2 country code | [optional] +**channel_name** | **str** | Official parter name of the payment channel | [optional] +**channel_properties** | [**[ChannelProperty]**](ChannelProperty.md) | | [optional] +**logo_url** | **str** | If available, this contains a URL to the logo of the partner channel | [optional] +**amount_limits** | [**[ChannelAmountLimits]**](ChannelAmountLimits.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/docs/PaymentChannelList.md b/docs/PaymentChannelList.md new file mode 100644 index 00000000..2a9bdd38 --- /dev/null +++ b/docs/PaymentChannelList.md @@ -0,0 +1,13 @@ +# xendit.payment_method.model.PaymentChannelList + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**[PaymentChannel]**](PaymentChannel.md) | Array of resources that match the provided filters | [optional] +**links** | [**[PaymentChannelListLinksInner]**](PaymentChannelListLinksInner.md) | Array of objects that can be used to assist on navigating through the data | [optional] +**has_more** | **bool** | Indicates whether there are more items in the list | [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/docs/PaymentChannelListLinksInner.md b/docs/PaymentChannelListLinksInner.md new file mode 100644 index 00000000..6b781028 --- /dev/null +++ b/docs/PaymentChannelListLinksInner.md @@ -0,0 +1,13 @@ +# xendit.payment_method.model.PaymentChannelListLinksInner + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Target URI that should contain a target to Internationalized Resource Identifiers (IRI) | [optional] +**rel** | **str** | The link relation type described how the current context (source) is related to target resource | [optional] +**method** | **str** | The HTTP method to be used to call `href` | [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/docs/PaymentChannelListLinksInnerAllOf.md b/docs/PaymentChannelListLinksInnerAllOf.md new file mode 100644 index 00000000..417c2a96 --- /dev/null +++ b/docs/PaymentChannelListLinksInnerAllOf.md @@ -0,0 +1,13 @@ +# xendit.payment_method.model.PaymentChannelListLinksInnerAllOf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Target URI that should contain a target to Internationalized Resource Identifiers (IRI) | [optional] +**rel** | **str** | The link relation type described how the current context (source) is related to target resource | [optional] +**method** | **str** | The HTTP method to be used to call `href` | [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/docs/PaymentMethod.md b/docs/PaymentMethod.md new file mode 100644 index 00000000..3a012260 --- /dev/null +++ b/docs/PaymentMethod.md @@ -0,0 +1,32 @@ +# xendit.payment_method.model.PaymentMethod + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**business_id** | **str** | | [optional] +**type** | [**PaymentMethodType**](PaymentMethodType.md) | | [optional] +**country** | [**PaymentMethodCountry**](PaymentMethodCountry.md) | | [optional] +**customer_id** | **str, none_type** | | [optional] +**customer** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional] +**reference_id** | **str** | | [optional] +**description** | **str, none_type** | | [optional] +**status** | [**PaymentMethodStatus**](PaymentMethodStatus.md) | | [optional] +**reusability** | [**PaymentMethodReusability**](PaymentMethodReusability.md) | | [optional] +**actions** | [**[PaymentMethodAction]**](PaymentMethodAction.md) | | [optional] +**metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional] +**billing_information** | [**BillingInformation**](BillingInformation.md) | | [optional] +**failure_code** | **str, none_type** | | [optional] +**created** | **datetime** | | [optional] +**updated** | **datetime** | | [optional] +**ewallet** | [**EWallet**](EWallet.md) | | [optional] +**direct_debit** | [**DirectDebit**](DirectDebit.md) | | [optional] +**over_the_counter** | [**OverTheCounter**](OverTheCounter.md) | | [optional] +**card** | [**Card**](Card.md) | | [optional] +**qr_code** | [**QRCode**](QRCode.md) | | [optional] +**virtual_account** | [**VirtualAccount**](VirtualAccount.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/docs/PaymentMethodAction.md b/docs/PaymentMethodAction.md new file mode 100644 index 00000000..07c4bd2d --- /dev/null +++ b/docs/PaymentMethodAction.md @@ -0,0 +1,14 @@ +# xendit.payment_method.model.PaymentMethodAction + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **str** | | [optional] +**method** | **str** | | [optional] +**url** | **str** | | [optional] +**url_type** | **str** | | [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/docs/PaymentMethodApi.md b/docs/PaymentMethodApi.md new file mode 100644 index 00000000..3a1ac58f --- /dev/null +++ b/docs/PaymentMethodApi.md @@ -0,0 +1,681 @@ +# xendit.apis.PaymentMethodApi + +All URIs are relative to *https://api.xendit.co* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**auth_payment_method**](PaymentMethodApi.md#auth_payment_method) | **POST** /v2/payment_methods/{paymentMethodId}/auth | Validate a payment method's linking OTP +[**create_payment_method**](PaymentMethodApi.md#create_payment_method) | **POST** /v2/payment_methods | Creates payment method +[**expire_payment_method**](PaymentMethodApi.md#expire_payment_method) | **POST** /v2/payment_methods/{paymentMethodId}/expire | Expires a payment method +[**get_all_payment_channels**](PaymentMethodApi.md#get_all_payment_channels) | **GET** /v2/payment_methods/channels | Get all payment channels +[**get_all_payment_methods**](PaymentMethodApi.md#get_all_payment_methods) | **GET** /v2/payment_methods | Get all payment methods by filters +[**get_payment_method_by_id**](PaymentMethodApi.md#get_payment_method_by_id) | **GET** /v2/payment_methods/{paymentMethodId} | Get payment method by ID +[**get_payments_by_payment_method_id**](PaymentMethodApi.md#get_payments_by_payment_method_id) | **GET** /v2/payment_methods/{paymentMethodId}/payments | Returns payments with matching PaymentMethodID. +[**patch_payment_method**](PaymentMethodApi.md#patch_payment_method) | **PATCH** /v2/payment_methods/{paymentMethodId} | Patch payment methods +[**simulate_payment**](PaymentMethodApi.md#simulate_payment) | **POST** /v2/payment_methods/{paymentMethodId}/payments/simulate | Makes payment with matching PaymentMethodID. + + +# **auth_payment_method** +> PaymentMethod auth_payment_method(payment_method_id) + +Validate a payment method's linking OTP + +This endpoint validates a payment method linking OTP + +### Example + + +```python +import time +import xendit +from xendit.apis import PaymentMethodApi +from xendit.payment_method.model.get_all_payment_methods403_response import GetAllPaymentMethods403Response +from xendit.payment_method.model.get_all_payment_methods400_response import GetAllPaymentMethods400Response +from xendit.payment_method.model.get_all_payment_methods404_response import GetAllPaymentMethods404Response +from xendit.payment_method.model.create_payment_method503_response import CreatePaymentMethod503Response +from xendit.payment_method.model.payment_method import PaymentMethod +from xendit.payment_method.model.create_payment_method409_response import CreatePaymentMethod409Response +from xendit.payment_method.model.payment_method_auth_parameters import PaymentMethodAuthParameters +from xendit.payment_method.model.get_all_payment_methods_default_response import GetAllPaymentMethodsDefaultResponse +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = PaymentMethodApi(api_client) +payment_method_id = "pm-1fdaf346-dd2e-4b6c-b938-124c7167a822" # str | + +# example passing only required values which don't have defaults set +try: + # Validate a payment method's linking OTP + api_response = api_instance.auth_payment_method(payment_method_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PaymentMethodApi->auth_payment_method: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Validate a payment method's linking OTP + api_response = api_instance.auth_payment_method(payment_method_id, payment_method_auth_parameters=payment_method_auth_parameters) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PaymentMethodApi->auth_payment_method: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **payment_method_id** | **str**| | + **payment_method_auth_parameters** | [**PaymentMethodAuthParameters**](PaymentMethodAuthParameters.md)| | [optional] + +### Return type + +[**PaymentMethod**](PaymentMethod.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request successful | - | +**400** | Bad request | - | +**403** | Forbidden due to permissions | - | +**404** | Data not found | - | +**409** | Request causes conflict | - | +**503** | Service is unavailable due to dependencies | - | +**0** | Internal server error | - | + +[[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) + +# **create_payment_method** +> PaymentMethod create_payment_method() + +Creates payment method + +This endpoint initiates creation of payment method + +### Example + + +```python +import time +import xendit +from xendit.apis import PaymentMethodApi +from xendit.payment_method.model.get_all_payment_methods403_response import GetAllPaymentMethods403Response +from xendit.payment_method.model.get_all_payment_methods400_response import GetAllPaymentMethods400Response +from xendit.payment_method.model.get_all_payment_methods404_response import GetAllPaymentMethods404Response +from xendit.payment_method.model.create_payment_method503_response import CreatePaymentMethod503Response +from xendit.payment_method.model.payment_method_parameters import PaymentMethodParameters +from xendit.payment_method.model.payment_method import PaymentMethod +from xendit.payment_method.model.create_payment_method409_response import CreatePaymentMethod409Response +from xendit.payment_method.model.get_all_payment_methods_default_response import GetAllPaymentMethodsDefaultResponse +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = PaymentMethodApi(api_client) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Creates payment method + api_response = api_instance.create_payment_method(payment_method_parameters=payment_method_parameters) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PaymentMethodApi->create_payment_method: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **payment_method_parameters** | [**PaymentMethodParameters**](PaymentMethodParameters.md)| | [optional] + +### Return type + +[**PaymentMethod**](PaymentMethod.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Request successful | - | +**400** | Bad request | - | +**403** | Forbidden due to permissions | - | +**404** | Data not found | - | +**409** | Request causes conflict | - | +**503** | Service is unavailable due to dependencies | - | +**0** | Internal server error | - | + +[[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) + +# **expire_payment_method** +> PaymentMethod expire_payment_method(payment_method_id) + +Expires a payment method + +This endpoint expires a payment method and performs unlinking if necessary + +### Example + + +```python +import time +import xendit +from xendit.apis import PaymentMethodApi +from xendit.payment_method.model.get_all_payment_methods403_response import GetAllPaymentMethods403Response +from xendit.payment_method.model.get_all_payment_methods400_response import GetAllPaymentMethods400Response +from xendit.payment_method.model.get_all_payment_methods404_response import GetAllPaymentMethods404Response +from xendit.payment_method.model.create_payment_method503_response import CreatePaymentMethod503Response +from xendit.payment_method.model.payment_method import PaymentMethod +from xendit.payment_method.model.get_all_payment_methods_default_response import GetAllPaymentMethodsDefaultResponse +from xendit.payment_method.model.payment_method_expire_parameters import PaymentMethodExpireParameters +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = PaymentMethodApi(api_client) +payment_method_id = "pm-1fdaf346-dd2e-4b6c-b938-124c7167a822" # str | + +# example passing only required values which don't have defaults set +try: + # Expires a payment method + api_response = api_instance.expire_payment_method(payment_method_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PaymentMethodApi->expire_payment_method: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Expires a payment method + api_response = api_instance.expire_payment_method(payment_method_id, payment_method_expire_parameters=payment_method_expire_parameters) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PaymentMethodApi->expire_payment_method: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **payment_method_id** | **str**| | + **payment_method_expire_parameters** | [**PaymentMethodExpireParameters**](PaymentMethodExpireParameters.md)| | [optional] + +### Return type + +[**PaymentMethod**](PaymentMethod.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request successful | - | +**400** | Bad request | - | +**403** | Forbidden due to permissions | - | +**404** | Data not found | - | +**503** | Service is unavailable due to dependencies | - | +**0** | Internal server error | - | + +[[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) + +# **get_all_payment_channels** +> PaymentChannelList get_all_payment_channels() + +Get all payment channels + +Get all payment channels + +### Example + + +```python +import time +import xendit +from xendit.apis import PaymentMethodApi +from xendit.payment_method.model.get_all_payment_methods403_response import GetAllPaymentMethods403Response +from xendit.payment_method.model.get_all_payment_methods400_response import GetAllPaymentMethods400Response +from xendit.payment_method.model.payment_channel_list import PaymentChannelList +from xendit.payment_method.model.get_all_payment_methods_default_response import GetAllPaymentMethodsDefaultResponse +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = PaymentMethodApi(api_client) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Get all payment channels + api_response = api_instance.get_all_payment_channels(is_activated=is_activated, type=type) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PaymentMethodApi->get_all_payment_channels: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **is_activated** | **bool**| | [optional] if omitted the server will use the default value of True + **type** | **str**| | [optional] + +### Return type + +[**PaymentChannelList**](PaymentChannelList.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request successful | - | +**400** | Bad request | - | +**403** | Forbidden due to permissions | - | +**0** | Internal server error | - | + +[[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) + +# **get_all_payment_methods** +> PaymentMethodList get_all_payment_methods() + +Get all payment methods by filters + +Get all payment methods by filters + +### Example + + +```python +import time +import xendit +from xendit.apis import PaymentMethodApi +from xendit.payment_method.model.get_all_payment_methods403_response import GetAllPaymentMethods403Response +from xendit.payment_method.model.payment_method_status import PaymentMethodStatus +from xendit.payment_method.model.payment_method_reusability import PaymentMethodReusability +from xendit.payment_method.model.get_all_payment_methods400_response import GetAllPaymentMethods400Response +from xendit.payment_method.model.get_all_payment_methods404_response import GetAllPaymentMethods404Response +from xendit.payment_method.model.get_all_payment_methods_default_response import GetAllPaymentMethodsDefaultResponse +from xendit.payment_method.model.payment_method_list import PaymentMethodList +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = PaymentMethodApi(api_client) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Get all payment methods by filters + api_response = api_instance.get_all_payment_methods(id=id, type=type, status=status, reusability=reusability, customer_id=customer_id, reference_id=reference_id, after_id=after_id, before_id=before_id, limit=limit) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PaymentMethodApi->get_all_payment_methods: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **[str]**| | [optional] + **type** | **[str]**| | [optional] + **status** | [**[PaymentMethodStatus]**](PaymentMethodStatus.md)| | [optional] + **reusability** | **PaymentMethodReusability**| | [optional] + **customer_id** | **str**| | [optional] + **reference_id** | **str**| | [optional] + **after_id** | **str**| | [optional] + **before_id** | **str**| | [optional] + **limit** | **int**| | [optional] + +### Return type + +[**PaymentMethodList**](PaymentMethodList.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request successful | - | +**400** | Bad request | - | +**403** | Forbidden due to permissions | - | +**404** | Data not found | - | +**0** | Internal server error | - | + +[[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) + +# **get_payment_method_by_id** +> PaymentMethod get_payment_method_by_id(payment_method_id) + +Get payment method by ID + +Get payment method by ID + +### Example + + +```python +import time +import xendit +from xendit.apis import PaymentMethodApi +from xendit.payment_method.model.get_all_payment_methods403_response import GetAllPaymentMethods403Response +from xendit.payment_method.model.get_all_payment_methods400_response import GetAllPaymentMethods400Response +from xendit.payment_method.model.get_all_payment_methods404_response import GetAllPaymentMethods404Response +from xendit.payment_method.model.payment_method import PaymentMethod +from xendit.payment_method.model.get_all_payment_methods_default_response import GetAllPaymentMethodsDefaultResponse +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = PaymentMethodApi(api_client) +payment_method_id = "pm-1fdaf346-dd2e-4b6c-b938-124c7167a822" # str | + +# example passing only required values which don't have defaults set +try: + # Get payment method by ID + api_response = api_instance.get_payment_method_by_id(payment_method_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PaymentMethodApi->get_payment_method_by_id: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **payment_method_id** | **str**| | + +### Return type + +[**PaymentMethod**](PaymentMethod.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request successful | - | +**400** | Bad request | - | +**403** | Forbidden due to permissions | - | +**404** | Data not found | - | +**0** | Internal server error | - | + +[[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) + +# **get_payments_by_payment_method_id** +> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} get_payments_by_payment_method_id(payment_method_id) + +Returns payments with matching PaymentMethodID. + +Returns payments with matching PaymentMethodID. + +### Example + + +```python +import time +import xendit +from xendit.apis import PaymentMethodApi +from xendit.payment_method.model.get_all_payment_methods403_response import GetAllPaymentMethods403Response +from xendit.payment_method.model.get_all_payment_methods400_response import GetAllPaymentMethods400Response +from xendit.payment_method.model.get_all_payment_methods404_response import GetAllPaymentMethods404Response +from xendit.payment_method.model.create_payment_method503_response import CreatePaymentMethod503Response +from xendit.payment_method.model.payment_method_type import PaymentMethodType +from xendit.payment_method.model.get_all_payment_methods_default_response import GetAllPaymentMethodsDefaultResponse +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = PaymentMethodApi(api_client) +payment_method_id = "pm-1fdaf346-dd2e-4b6c-b938-124c7167a822" # str | + +# example passing only required values which don't have defaults set +try: + # Returns payments with matching PaymentMethodID. + api_response = api_instance.get_payments_by_payment_method_id(payment_method_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PaymentMethodApi->get_payments_by_payment_method_id: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Returns payments with matching PaymentMethodID. + api_response = api_instance.get_payments_by_payment_method_id(payment_method_id, payment_request_id=payment_request_id, payment_method_id2=payment_method_id2, reference_id=reference_id, payment_method_type=payment_method_type, channel_code=channel_code, status=status, currency=currency, created_gte=created_gte, created_lte=created_lte, updated_gte=updated_gte, updated_lte=updated_lte, limit=limit, after_id=after_id, before_id=before_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PaymentMethodApi->get_payments_by_payment_method_id: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **payment_method_id** | **str**| | + **payment_request_id** | **[str]**| | [optional] + **payment_method_id2** | **[str]**| | [optional] + **reference_id** | **[str]**| | [optional] + **payment_method_type** | [**[PaymentMethodType]**](PaymentMethodType.md)| | [optional] + **channel_code** | **[str]**| | [optional] + **status** | **[str]**| | [optional] + **currency** | **[str]**| | [optional] + **created_gte** | **datetime**| | [optional] + **created_lte** | **datetime**| | [optional] + **updated_gte** | **datetime**| | [optional] + **updated_lte** | **datetime**| | [optional] + **limit** | **int**| | [optional] + **after_id** | **str**| | [optional] + **before_id** | **str**| | [optional] + +### Return type + +**{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request successful | - | +**400** | Bad request | - | +**403** | Forbidden due to permissions | - | +**404** | Data not found | - | +**503** | Service is unavailable due to dependencies | - | +**0** | Internal server error | - | + +[[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) + +# **patch_payment_method** +> PaymentMethod patch_payment_method(payment_method_id) + +Patch payment methods + +This endpoint is used to toggle the ```status``` of an e-Wallet or a Direct Debit payment method to ```ACTIVE``` or ```INACTIVE```. This is also used to update the details of an Over-the-Counter or a Virtual Account payment method. + +### Example + + +```python +import time +import xendit +from xendit.apis import PaymentMethodApi +from xendit.payment_method.model.get_all_payment_methods403_response import GetAllPaymentMethods403Response +from xendit.payment_method.model.get_all_payment_methods400_response import GetAllPaymentMethods400Response +from xendit.payment_method.model.get_all_payment_methods404_response import GetAllPaymentMethods404Response +from xendit.payment_method.model.payment_method import PaymentMethod +from xendit.payment_method.model.payment_method_update_parameters import PaymentMethodUpdateParameters +from xendit.payment_method.model.get_all_payment_methods_default_response import GetAllPaymentMethodsDefaultResponse +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = PaymentMethodApi(api_client) +payment_method_id = "pm-1fdaf346-dd2e-4b6c-b938-124c7167a822" # str | + +# example passing only required values which don't have defaults set +try: + # Patch payment methods + api_response = api_instance.patch_payment_method(payment_method_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PaymentMethodApi->patch_payment_method: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Patch payment methods + api_response = api_instance.patch_payment_method(payment_method_id, payment_method_update_parameters=payment_method_update_parameters) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PaymentMethodApi->patch_payment_method: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **payment_method_id** | **str**| | + **payment_method_update_parameters** | [**PaymentMethodUpdateParameters**](PaymentMethodUpdateParameters.md)| | [optional] + +### Return type + +[**PaymentMethod**](PaymentMethod.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request successful | - | +**400** | Bad request | - | +**403** | Forbidden due to permissions | - | +**404** | Data not found | - | +**0** | Internal server error | - | + +[[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) + +# **simulate_payment** +> simulate_payment(payment_method_id) + +Makes payment with matching PaymentMethodID. + +Makes payment with matching PaymentMethodID. + +### Example + + +```python +import time +import xendit +from xendit.apis import PaymentMethodApi +from xendit.payment_method.model.get_all_payment_methods403_response import GetAllPaymentMethods403Response +from xendit.payment_method.model.get_all_payment_methods400_response import GetAllPaymentMethods400Response +from xendit.payment_method.model.get_all_payment_methods404_response import GetAllPaymentMethods404Response +from xendit.payment_method.model.create_payment_method503_response import CreatePaymentMethod503Response +from xendit.payment_method.model.simulate_payment_request import SimulatePaymentRequest +from xendit.payment_method.model.get_all_payment_methods_default_response import GetAllPaymentMethodsDefaultResponse +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = PaymentMethodApi(api_client) +payment_method_id = "pm-1fdaf346-dd2e-4b6c-b938-124c7167a822" # str | + +# example passing only required values which don't have defaults set +try: + # Makes payment with matching PaymentMethodID. + api_instance.simulate_payment(payment_method_id) +except xendit.ApiException as e: + print("Exception when calling PaymentMethodApi->simulate_payment: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Makes payment with matching PaymentMethodID. + api_instance.simulate_payment(payment_method_id, simulate_payment_request=simulate_payment_request) +except xendit.ApiException as e: + print("Exception when calling PaymentMethodApi->simulate_payment: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **payment_method_id** | **str**| | + **simulate_payment_request** | [**SimulatePaymentRequest**](SimulatePaymentRequest.md)| | [optional] + +### Return type + +void (empty response body) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request successful | - | +**400** | Bad request | - | +**403** | Forbidden due to permissions | - | +**404** | Data not found | - | +**503** | Service is unavailable due to dependencies | - | +**0** | Internal server error | - | + +[[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/docs/PaymentMethodAuthParameters.md b/docs/PaymentMethodAuthParameters.md new file mode 100644 index 00000000..5152f35b --- /dev/null +++ b/docs/PaymentMethodAuthParameters.md @@ -0,0 +1,11 @@ +# xendit.payment_method.model.PaymentMethodAuthParameters + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auth_code** | **str** | | + +[[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/docs/PaymentMethodCountry.md b/docs/PaymentMethodCountry.md new file mode 100644 index 00000000..9dc80531 --- /dev/null +++ b/docs/PaymentMethodCountry.md @@ -0,0 +1,11 @@ +# xendit.payment_method.model.PaymentMethodCountry + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | must be one of ["PH", "ID", "VN", "TH", "MY", ] + +[[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/docs/PaymentMethodExpireParameters.md b/docs/PaymentMethodExpireParameters.md new file mode 100644 index 00000000..7177dc22 --- /dev/null +++ b/docs/PaymentMethodExpireParameters.md @@ -0,0 +1,12 @@ +# xendit.payment_method.model.PaymentMethodExpireParameters + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success_return_url** | **str, none_type** | URL where the end customer is redirected if the unlinking authorization is successful. | [optional] +**failure_return_url** | **str, none_type** | URL where the end customer is redirected if the unlinking authorization is failed. | [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/docs/PaymentMethodList.md b/docs/PaymentMethodList.md new file mode 100644 index 00000000..d642346e --- /dev/null +++ b/docs/PaymentMethodList.md @@ -0,0 +1,12 @@ +# xendit.payment_method.model.PaymentMethodList + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**[PaymentMethod]**](PaymentMethod.md) | | +**has_more** | **bool** | | [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/docs/PaymentMethodParameters.md b/docs/PaymentMethodParameters.md new file mode 100644 index 00000000..82f26c6f --- /dev/null +++ b/docs/PaymentMethodParameters.md @@ -0,0 +1,24 @@ +# xendit.payment_method.model.PaymentMethodParameters + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**PaymentMethodType**](PaymentMethodType.md) | | +**reusability** | [**PaymentMethodReusability**](PaymentMethodReusability.md) | | +**country** | **str, none_type** | | [optional] +**customer_id** | **str, none_type** | | [optional] +**reference_id** | **str** | | [optional] +**description** | **str, none_type** | | [optional] +**card** | [**CardParameters**](CardParameters.md) | | [optional] +**direct_debit** | [**DirectDebitParameters**](DirectDebitParameters.md) | | [optional] +**ewallet** | [**EWalletParameters**](EWalletParameters.md) | | [optional] +**over_the_counter** | [**OverTheCounterParameters**](OverTheCounterParameters.md) | | [optional] +**virtual_account** | [**VirtualAccountParameters**](VirtualAccountParameters.md) | | [optional] +**qr_code** | [**QRCodeParameters**](QRCodeParameters.md) | | [optional] +**metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional] +**billing_information** | [**BillingInformation**](BillingInformation.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/docs/PaymentMethodReusability.md b/docs/PaymentMethodReusability.md new file mode 100644 index 00000000..4444d101 --- /dev/null +++ b/docs/PaymentMethodReusability.md @@ -0,0 +1,11 @@ +# xendit.payment_method.model.PaymentMethodReusability + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | must be one of ["MULTIPLE_USE", "ONE_TIME_USE", ] + +[[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/docs/PaymentMethodStatus.md b/docs/PaymentMethodStatus.md new file mode 100644 index 00000000..624959a5 --- /dev/null +++ b/docs/PaymentMethodStatus.md @@ -0,0 +1,11 @@ +# xendit.payment_method.model.PaymentMethodStatus + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | must be one of ["ACTIVE", "EXPIRED", "INACTIVE", "PENDING", "REQUIRES_ACTION", "FAILED", ] + +[[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/docs/PaymentMethodType.md b/docs/PaymentMethodType.md new file mode 100644 index 00000000..a7b9f1a0 --- /dev/null +++ b/docs/PaymentMethodType.md @@ -0,0 +1,11 @@ +# xendit.payment_method.model.PaymentMethodType + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | must be one of ["CARD", "CRYPTOCURRENCY", "DIRECT_BANK_TRANSFER", "DIRECT_DEBIT", "EWALLET", "OVER_THE_COUNTER", "QR_CODE", "VIRTUAL_ACCOUNT", ] + +[[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/docs/PaymentMethodUpdateParameters.md b/docs/PaymentMethodUpdateParameters.md new file mode 100644 index 00000000..2f3293f9 --- /dev/null +++ b/docs/PaymentMethodUpdateParameters.md @@ -0,0 +1,16 @@ +# xendit.payment_method.model.PaymentMethodUpdateParameters + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **str** | | [optional] +**reference_id** | **str** | | [optional] +**reusability** | [**PaymentMethodReusability**](PaymentMethodReusability.md) | | [optional] +**status** | [**PaymentMethodStatus**](PaymentMethodStatus.md) | | [optional] +**over_the_counter** | [**OverTheCounterUpdateParameters**](OverTheCounterUpdateParameters.md) | | [optional] +**virtual_account** | [**VirtualAccountUpdateParameters**](VirtualAccountUpdateParameters.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/docs/PaymentRequest.md b/docs/PaymentRequest.md new file mode 100644 index 00000000..279b1126 --- /dev/null +++ b/docs/PaymentRequest.md @@ -0,0 +1,33 @@ +# xendit.payment_request.model.PaymentRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**created** | **str** | | +**updated** | **str** | | +**reference_id** | **str** | | +**business_id** | **str** | | +**currency** | [**PaymentRequestCurrency**](PaymentRequestCurrency.md) | | +**payment_method** | [**PaymentMethod**](PaymentMethod.md) | | +**status** | [**PaymentRequestStatus**](PaymentRequestStatus.md) | | +**customer_id** | **str, none_type** | | [optional] +**customer** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional] +**amount** | **float** | | [optional] +**min_amount** | **float, none_type** | | [optional] +**max_amount** | **float, none_type** | | [optional] +**country** | [**PaymentRequestCountry**](PaymentRequestCountry.md) | | [optional] +**description** | **str, none_type** | | [optional] +**failure_code** | **str, none_type** | | [optional] +**capture_method** | [**PaymentRequestCaptureMethod**](PaymentRequestCaptureMethod.md) | | [optional] +**initiator** | [**PaymentRequestInitiator**](PaymentRequestInitiator.md) | | [optional] +**card_verification_results** | [**PaymentRequestCardVerificationResults**](PaymentRequestCardVerificationResults.md) | | [optional] +**actions** | [**[PaymentRequestAction]**](PaymentRequestAction.md) | | [optional] +**metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional] +**shipping_information** | [**PaymentRequestShippingInformation**](PaymentRequestShippingInformation.md) | | [optional] +**items** | [**PaymentRequestBasket**](PaymentRequestBasket.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/docs/PaymentRequestAction.md b/docs/PaymentRequestAction.md new file mode 100644 index 00000000..3cb4ea3e --- /dev/null +++ b/docs/PaymentRequestAction.md @@ -0,0 +1,15 @@ +# xendit.payment_request.model.PaymentRequestAction + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **str** | | +**url_type** | **str** | | +**method** | **str, none_type** | | +**url** | **str, none_type** | | +**qr_code** | **str, none_type** | | + +[[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/docs/PaymentRequestApi.md b/docs/PaymentRequestApi.md new file mode 100644 index 00000000..179d6122 --- /dev/null +++ b/docs/PaymentRequestApi.md @@ -0,0 +1,476 @@ +# xendit.apis.PaymentRequestApi + +All URIs are relative to *https://api.xendit.co* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**authorize_payment_request**](PaymentRequestApi.md#authorize_payment_request) | **POST** /payment_requests/{paymentRequestId}/auth | Payment Request Authorize +[**capture_payment_request**](PaymentRequestApi.md#capture_payment_request) | **POST** /payment_requests/{paymentRequestId}/captures | Payment Request Capture +[**create_payment_request**](PaymentRequestApi.md#create_payment_request) | **POST** /payment_requests | Create Payment Request +[**get_all_payment_requests**](PaymentRequestApi.md#get_all_payment_requests) | **GET** /payment_requests | Get all payment requests by filter +[**get_payment_request_by_id**](PaymentRequestApi.md#get_payment_request_by_id) | **GET** /payment_requests/{paymentRequestId} | Get payment request by ID +[**get_payment_request_captures**](PaymentRequestApi.md#get_payment_request_captures) | **GET** /payment_requests/{paymentRequestId}/captures | Get Payment Request Capture +[**resend_payment_request_auth**](PaymentRequestApi.md#resend_payment_request_auth) | **POST** /payment_requests/{paymentRequestId}/auth/resend | Payment Request Resend Auth + + +# **authorize_payment_request** +> PaymentRequest authorize_payment_request(payment_request_id) + +Payment Request Authorize + +Payment Request Authorize + +### Example + + +```python +import time +import xendit +from xendit.apis import PaymentRequestApi +from xendit.payment_request.model.error import Error +from xendit.payment_request.model.payment_request_auth_parameters import PaymentRequestAuthParameters +from xendit.payment_request.model.payment_request import PaymentRequest +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = PaymentRequestApi(api_client) +payment_request_id = "pr-1fdaf346-dd2e-4b6c-b938-124c7167a822" # str | + +# example passing only required values which don't have defaults set +try: + # Payment Request Authorize + api_response = api_instance.authorize_payment_request(payment_request_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PaymentRequestApi->authorize_payment_request: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Payment Request Authorize + api_response = api_instance.authorize_payment_request(payment_request_id, payment_request_auth_parameters=payment_request_auth_parameters) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PaymentRequestApi->authorize_payment_request: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **payment_request_id** | **str**| | + **payment_request_auth_parameters** | [**PaymentRequestAuthParameters**](PaymentRequestAuthParameters.md)| | [optional] + +### Return type + +[**PaymentRequest**](PaymentRequest.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request successful | - | +**400** | Errors | - | +**500** | Errors | - | +**0** | Errors | - | + +[[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) + +# **capture_payment_request** +> Capture capture_payment_request(payment_request_id) + +Payment Request Capture + +Payment Request Capture + +### Example + + +```python +import time +import xendit +from xendit.apis import PaymentRequestApi +from xendit.payment_request.model.capture_parameters import CaptureParameters +from xendit.payment_request.model.error import Error +from xendit.payment_request.model.capture import Capture +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = PaymentRequestApi(api_client) +payment_request_id = "pr-1fdaf346-dd2e-4b6c-b938-124c7167a822" # str | + +# example passing only required values which don't have defaults set +try: + # Payment Request Capture + api_response = api_instance.capture_payment_request(payment_request_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PaymentRequestApi->capture_payment_request: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Payment Request Capture + api_response = api_instance.capture_payment_request(payment_request_id, capture_parameters=capture_parameters) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PaymentRequestApi->capture_payment_request: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **payment_request_id** | **str**| | + **capture_parameters** | [**CaptureParameters**](CaptureParameters.md)| | [optional] + +### Return type + +[**Capture**](Capture.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Capture created | - | +**400** | Errors | - | +**500** | Errors | - | +**0** | Errors | - | + +[[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) + +# **create_payment_request** +> PaymentRequest create_payment_request() + +Create Payment Request + +Create Payment Request + +### Example + + +```python +import time +import xendit +from xendit.apis import PaymentRequestApi +from xendit.payment_request.model.payment_request_parameters import PaymentRequestParameters +from xendit.payment_request.model.error import Error +from xendit.payment_request.model.payment_request import PaymentRequest +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = PaymentRequestApi(api_client) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Create Payment Request + api_response = api_instance.create_payment_request(idempotency_key=idempotency_key, payment_request_parameters=payment_request_parameters) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PaymentRequestApi->create_payment_request: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **idempotency_key** | **str**| | [optional] + **payment_request_parameters** | [**PaymentRequestParameters**](PaymentRequestParameters.md)| | [optional] + +### Return type + +[**PaymentRequest**](PaymentRequest.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request successful | - | +**400** | Errors | - | +**500** | Errors | - | +**0** | Errors | - | + +[[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) + +# **get_all_payment_requests** +> PaymentRequestListResponse get_all_payment_requests() + +Get all payment requests by filter + +Get all payment requests by filter + +### Example + + +```python +import time +import xendit +from xendit.apis import PaymentRequestApi +from xendit.payment_request.model.payment_request_list_response import PaymentRequestListResponse +from xendit.payment_request.model.error import Error +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = PaymentRequestApi(api_client) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Get all payment requests by filter + api_response = api_instance.get_all_payment_requests(reference_id=reference_id, id=id, customer_id=customer_id, limit=limit, before_id=before_id, after_id=after_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PaymentRequestApi->get_all_payment_requests: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **reference_id** | **[str]**| | [optional] + **id** | **[str]**| | [optional] + **customer_id** | **[str]**| | [optional] + **limit** | **int**| | [optional] + **before_id** | **str**| | [optional] + **after_id** | **str**| | [optional] + +### Return type + +[**PaymentRequestListResponse**](PaymentRequestListResponse.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request successful | - | +**404** | Errors | - | +**500** | Errors | - | +**0** | Errors | - | + +[[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) + +# **get_payment_request_by_id** +> PaymentRequest get_payment_request_by_id(payment_request_id) + +Get payment request by ID + +Get payment request by ID + +### Example + + +```python +import time +import xendit +from xendit.apis import PaymentRequestApi +from xendit.payment_request.model.error import Error +from xendit.payment_request.model.payment_request import PaymentRequest +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = PaymentRequestApi(api_client) +payment_request_id = "pr-1fdaf346-dd2e-4b6c-b938-124c7167a822" # str | + +# example passing only required values which don't have defaults set +try: + # Get payment request by ID + api_response = api_instance.get_payment_request_by_id(payment_request_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PaymentRequestApi->get_payment_request_by_id: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **payment_request_id** | **str**| | + +### Return type + +[**PaymentRequest**](PaymentRequest.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request successful | - | +**404** | Errors | - | +**500** | Errors | - | +**0** | Errors | - | + +[[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) + +# **get_payment_request_captures** +> CaptureListResponse get_payment_request_captures(payment_request_id) + +Get Payment Request Capture + +Get Payment Request Capture + +### Example + + +```python +import time +import xendit +from xendit.apis import PaymentRequestApi +from xendit.payment_request.model.error import Error +from xendit.payment_request.model.capture_list_response import CaptureListResponse +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = PaymentRequestApi(api_client) +payment_request_id = "pr-1fdaf346-dd2e-4b6c-b938-124c7167a822" # str | + +# example passing only required values which don't have defaults set +try: + # Get Payment Request Capture + api_response = api_instance.get_payment_request_captures(payment_request_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PaymentRequestApi->get_payment_request_captures: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Get Payment Request Capture + api_response = api_instance.get_payment_request_captures(payment_request_id, limit=limit, after_id=after_id, before_id=before_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PaymentRequestApi->get_payment_request_captures: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **payment_request_id** | **str**| | + **limit** | **int**| | [optional] + **after_id** | **str**| | [optional] + **before_id** | **str**| | [optional] + +### Return type + +[**CaptureListResponse**](CaptureListResponse.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request successful | - | +**400** | Errors | - | +**500** | Errors | - | +**0** | Errors | - | + +[[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) + +# **resend_payment_request_auth** +> PaymentRequest resend_payment_request_auth(payment_request_id) + +Payment Request Resend Auth + +Payment Request Resend Auth + +### Example + + +```python +import time +import xendit +from xendit.apis import PaymentRequestApi +from xendit.payment_request.model.error import Error +from xendit.payment_request.model.payment_request import PaymentRequest +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = PaymentRequestApi(api_client) +payment_request_id = "pr-1fdaf346-dd2e-4b6c-b938-124c7167a822" # str | + +# example passing only required values which don't have defaults set +try: + # Payment Request Resend Auth + api_response = api_instance.resend_payment_request_auth(payment_request_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PaymentRequestApi->resend_payment_request_auth: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **payment_request_id** | **str**| | + +### Return type + +[**PaymentRequest**](PaymentRequest.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Request successful | - | +**400** | Errors | - | +**500** | Errors | - | +**0** | Errors | - | + +[[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/docs/PaymentRequestAuthParameters.md b/docs/PaymentRequestAuthParameters.md new file mode 100644 index 00000000..d4a54131 --- /dev/null +++ b/docs/PaymentRequestAuthParameters.md @@ -0,0 +1,11 @@ +# xendit.payment_request.model.PaymentRequestAuthParameters + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auth_code** | **str** | | + +[[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/docs/PaymentRequestBasket.md b/docs/PaymentRequestBasket.md new file mode 100644 index 00000000..93587be4 --- /dev/null +++ b/docs/PaymentRequestBasket.md @@ -0,0 +1,11 @@ +# xendit.payment_request.model.PaymentRequestBasket + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | [**[PaymentRequestBasketItem], none_type**](PaymentRequestBasketItem.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/docs/PaymentRequestBasketItem.md b/docs/PaymentRequestBasketItem.md new file mode 100644 index 00000000..d19c0022 --- /dev/null +++ b/docs/PaymentRequestBasketItem.md @@ -0,0 +1,23 @@ +# xendit.payment_request.model.PaymentRequestBasketItem + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | +**category** | **str** | | +**currency** | **str** | | +**quantity** | **float** | | +**price** | **float** | | +**reference_id** | **str** | | [optional] +**description** | **str** | | [optional] +**type** | **str** | | [optional] +**sub_category** | **str** | | [optional] +**payer_charged_currency** | **str** | | [optional] +**payer_charged_price** | **float** | | [optional] +**url** | **str** | | [optional] +**metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [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/docs/PaymentRequestCaptureMethod.md b/docs/PaymentRequestCaptureMethod.md new file mode 100644 index 00000000..8ff826bd --- /dev/null +++ b/docs/PaymentRequestCaptureMethod.md @@ -0,0 +1,11 @@ +# xendit.payment_request.model.PaymentRequestCaptureMethod + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | must be one of ["AUTOMATIC", "MANUAL", ] + +[[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/docs/PaymentRequestCardVerificationResults.md b/docs/PaymentRequestCardVerificationResults.md new file mode 100644 index 00000000..8531898c --- /dev/null +++ b/docs/PaymentRequestCardVerificationResults.md @@ -0,0 +1,13 @@ +# xendit.payment_request.model.PaymentRequestCardVerificationResults + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**three_d_secure** | [**PaymentRequestCardVerificationResultsThreeDeeSecure**](PaymentRequestCardVerificationResultsThreeDeeSecure.md) | | +**cvv_result** | **str, none_type** | | [optional] +**address_verification_result** | **str, none_type** | | [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/docs/PaymentRequestCardVerificationResultsThreeDeeSecure.md b/docs/PaymentRequestCardVerificationResultsThreeDeeSecure.md new file mode 100644 index 00000000..cf0eea19 --- /dev/null +++ b/docs/PaymentRequestCardVerificationResultsThreeDeeSecure.md @@ -0,0 +1,15 @@ +# xendit.payment_request.model.PaymentRequestCardVerificationResultsThreeDeeSecure + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**three_d_secure_flow** | **str** | | [optional] +**eci_code** | **str** | | [optional] +**three_d_secure_result** | **str** | | [optional] +**three_d_secure_result_reason** | **str, none_type** | | [optional] +**three_d_secure_version** | **str** | | [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/docs/PaymentRequestChannelProperties.md b/docs/PaymentRequestChannelProperties.md new file mode 100644 index 00000000..65167c32 --- /dev/null +++ b/docs/PaymentRequestChannelProperties.md @@ -0,0 +1,17 @@ +# xendit.payment_request.model.PaymentRequestChannelProperties + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success_return_url** | **str** | URL where the end-customer is redirected if the authorization is successful | [optional] +**failure_return_url** | **str** | URL where the end-customer is redirected if the authorization failed | [optional] +**cancel_return_url** | **str** | URL where the end-customer is redirected if the authorization cancelled | [optional] +**redeem_points** | **str** | REDEEM_NONE will not use any point, REDEEM_ALL will use all available points before cash balance is used. For OVO and ShopeePay tokenized payment use only. | [optional] +**require_auth** | **bool** | Toggle used to require end-customer to input undergo OTP validation before completing a payment. OTP will always be required for transactions greater than 1,000,000 IDR. For BRI tokenized payment use only. | [optional] +**merchant_id_tag** | **str** | Tag for a Merchant ID that you want to associate this payment with. For merchants using their own MIDs to specify which MID they want to use | [optional] +**cardonfile_type** | **str, none_type** | Type of “credential-on-file” / “card-on-file” payment being made. Indicate that this payment uses a previously linked Payment Method for charging. | [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/docs/PaymentRequestCountry.md b/docs/PaymentRequestCountry.md new file mode 100644 index 00000000..076874be --- /dev/null +++ b/docs/PaymentRequestCountry.md @@ -0,0 +1,11 @@ +# xendit.payment_request.model.PaymentRequestCountry + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | must be one of ["ID", "PH", "VN", "TH", "MY", ] + +[[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/docs/PaymentRequestCurrency.md b/docs/PaymentRequestCurrency.md new file mode 100644 index 00000000..079af366 --- /dev/null +++ b/docs/PaymentRequestCurrency.md @@ -0,0 +1,11 @@ +# xendit.payment_request.model.PaymentRequestCurrency + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | must be one of ["IDR", "PHP", "VND", "THB", "MYR", ] + +[[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/docs/PaymentRequestInitiator.md b/docs/PaymentRequestInitiator.md new file mode 100644 index 00000000..b17a65e0 --- /dev/null +++ b/docs/PaymentRequestInitiator.md @@ -0,0 +1,11 @@ +# xendit.payment_request.model.PaymentRequestInitiator + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | must be one of ["CUSTOMER", "MERCHANT", ] + +[[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/docs/PaymentRequestListResponse.md b/docs/PaymentRequestListResponse.md new file mode 100644 index 00000000..9373aad8 --- /dev/null +++ b/docs/PaymentRequestListResponse.md @@ -0,0 +1,12 @@ +# xendit.payment_request.model.PaymentRequestListResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**[PaymentRequest]**](PaymentRequest.md) | | +**has_more** | **bool** | | + +[[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/docs/PaymentRequestParameters.md b/docs/PaymentRequestParameters.md new file mode 100644 index 00000000..2d3b949c --- /dev/null +++ b/docs/PaymentRequestParameters.md @@ -0,0 +1,24 @@ +# xendit.payment_request.model.PaymentRequestParameters + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | [**PaymentRequestCurrency**](PaymentRequestCurrency.md) | | +**reference_id** | **str** | | [optional] +**amount** | **float** | | [optional] +**payment_method** | [**PaymentMethodParameters**](PaymentMethodParameters.md) | | [optional] +**description** | **str, none_type** | | [optional] +**capture_method** | [**PaymentRequestCaptureMethod**](PaymentRequestCaptureMethod.md) | | [optional] +**initiator** | [**PaymentRequestInitiator**](PaymentRequestInitiator.md) | | [optional] +**payment_method_id** | **str** | | [optional] +**channel_properties** | [**PaymentRequestParametersChannelProperties**](PaymentRequestParametersChannelProperties.md) | | [optional] +**shipping_information** | [**PaymentRequestShippingInformation**](PaymentRequestShippingInformation.md) | | [optional] +**items** | [**PaymentRequestBasket**](PaymentRequestBasket.md) | | [optional] +**customer_id** | **str, none_type** | | [optional] +**customer** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional] +**metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [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/docs/PaymentRequestParametersChannelProperties.md b/docs/PaymentRequestParametersChannelProperties.md new file mode 100644 index 00000000..da0167f1 --- /dev/null +++ b/docs/PaymentRequestParametersChannelProperties.md @@ -0,0 +1,18 @@ +# xendit.payment_request.model.PaymentRequestParametersChannelProperties + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success_return_url** | **str** | URL where the end-customer is redirected if the authorization is successful | [optional] +**failure_return_url** | **str** | URL where the end-customer is redirected if the authorization failed | [optional] +**cancel_return_url** | **str** | URL where the end-customer is redirected if the authorization cancelled | [optional] +**redeem_points** | **str** | REDEEM_NONE will not use any point, REDEEM_ALL will use all available points before cash balance is used. For OVO and ShopeePay tokenized payment use only. | [optional] +**require_auth** | **bool** | Toggle used to require end-customer to input undergo OTP validation before completing a payment. OTP will always be required for transactions greater than 1,000,000 IDR. For BRI tokenized payment use only. | [optional] +**merchant_id_tag** | **str** | Tag for a Merchant ID that you want to associate this payment with. For merchants using their own MIDs to specify which MID they want to use | [optional] +**cardonfile_type** | **str, none_type** | Type of “credential-on-file” / “card-on-file” payment being made. Indicate that this payment uses a previously linked Payment Method for charging. | [optional] +**cvv** | **str** | Three digit code written on the back of the card (usually called CVV/CVN). | [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/docs/PaymentRequestParametersChannelPropertiesAllOf.md b/docs/PaymentRequestParametersChannelPropertiesAllOf.md new file mode 100644 index 00000000..a4e322f7 --- /dev/null +++ b/docs/PaymentRequestParametersChannelPropertiesAllOf.md @@ -0,0 +1,11 @@ +# xendit.payment_request.model.PaymentRequestParametersChannelPropertiesAllOf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cvv** | **str** | Three digit code written on the back of the card (usually called CVV/CVN). | [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/docs/PaymentRequestShippingInformation.md b/docs/PaymentRequestShippingInformation.md new file mode 100644 index 00000000..b54efaa1 --- /dev/null +++ b/docs/PaymentRequestShippingInformation.md @@ -0,0 +1,16 @@ +# xendit.payment_request.model.PaymentRequestShippingInformation + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country** | **str** | | +**street_line1** | **str** | | [optional] +**street_line2** | **str** | | [optional] +**city** | **str** | | [optional] +**province_state** | **str** | | [optional] +**postal_code** | **str** | | [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/docs/PaymentRequestStatus.md b/docs/PaymentRequestStatus.md new file mode 100644 index 00000000..fa20ef1d --- /dev/null +++ b/docs/PaymentRequestStatus.md @@ -0,0 +1,11 @@ +# xendit.payment_request.model.PaymentRequestStatus + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | must be one of ["PENDING", "REQUIRES_ACTION", "CANCELED", "SUCCEEDED", "FAILED", "VOIDED", "UNKNOWN", "AWAITING_CAPTURE", ] + +[[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/docs/Payout.md b/docs/Payout.md new file mode 100644 index 00000000..63f77881 --- /dev/null +++ b/docs/Payout.md @@ -0,0 +1,25 @@ +# xendit.payout.model.Payout + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reference_id** | **str** | A client defined payout identifier | +**channel_code** | **str** | Channel code of selected destination bank or e-wallet | +**channel_properties** | [**DigitalPayoutChannelProperties**](DigitalPayoutChannelProperties.md) | | +**amount** | **float** | Amount to be sent to the destination account and should be a multiple of the minimum increment for the selected channel | +**currency** | **str** | Currency of the destination channel using ISO-4217 currency code | +**id** | **str** | Xendit-generated unique identifier for each payout | +**created** | **datetime** | The time payout was created on Xendit's system, in ISO 8601 format | +**updated** | **datetime** | The time payout was last updated on Xendit's system, in ISO 8601 format | +**business_id** | **str** | Xendit Business ID | +**status** | **str** | Status of payout | +**description** | **str** | Description to send with the payout, the recipient may see this e.g., in their bank statement (if supported) or in email receipts we send on your behalf | [optional] +**receipt_notification** | [**ReceiptNotification**](ReceiptNotification.md) | | [optional] +**metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | Object of additional information you may use | [optional] +**failure_code** | **str** | If the Payout failed, we include a failure code for more details on the failure. | [optional] +**estimated_arrival_time** | **datetime** | Our estimated time on to when your payout is reflected to the destination account | [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/docs/PayoutAllOf.md b/docs/PayoutAllOf.md new file mode 100644 index 00000000..72c76a5d --- /dev/null +++ b/docs/PayoutAllOf.md @@ -0,0 +1,17 @@ +# xendit.payout.model.PayoutAllOf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Xendit-generated unique identifier for each payout | +**created** | **datetime** | The time payout was created on Xendit's system, in ISO 8601 format | +**updated** | **datetime** | The time payout was last updated on Xendit's system, in ISO 8601 format | +**business_id** | **str** | Xendit Business ID | +**status** | **str** | Status of payout | +**failure_code** | **str** | If the Payout failed, we include a failure code for more details on the failure. | [optional] +**estimated_arrival_time** | **datetime** | Our estimated time on to when your payout is reflected to the destination account | [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/docs/PayoutApi.md b/docs/PayoutApi.md new file mode 100644 index 00000000..fdc8242b --- /dev/null +++ b/docs/PayoutApi.md @@ -0,0 +1,330 @@ +# xendit.apis.PayoutApi + +All URIs are relative to *https://api.xendit.co* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**cancel_payout**](PayoutApi.md#cancel_payout) | **POST** /v2/payouts/{id}/cancel | API to cancel requested payouts that have not yet been sent to partner banks and e-wallets. Cancellation is possible if the payout has not been sent out via our partner and when payout status is ACCEPTED. +[**create_payout**](PayoutApi.md#create_payout) | **POST** /v2/payouts | API to send money at scale to bank accounts & eWallets +[**get_payout_by_id**](PayoutApi.md#get_payout_by_id) | **GET** /v2/payouts/{id} | API to fetch the current status, or details of the payout +[**get_payout_channels**](PayoutApi.md#get_payout_channels) | **GET** /payouts_channels | API providing the current list of banks and e-wallets we support for payouts for both regions +[**get_payouts**](PayoutApi.md#get_payouts) | **GET** /v2/payouts | API to retrieve all matching payouts with reference ID + + +# **cancel_payout** +> GetPayouts200ResponseDataInner cancel_payout(id) + +API to cancel requested payouts that have not yet been sent to partner banks and e-wallets. Cancellation is possible if the payout has not been sent out via our partner and when payout status is ACCEPTED. + +### Example + + +```python +import time +import xendit +from xendit.apis import PayoutApi +from xendit.payout.model.get_payouts200_response_data_inner import GetPayouts200ResponseDataInner +from xendit.payout.model.error import Error +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = PayoutApi(api_client) +id = "disb-7baa7335-a0b2-4678-bb8c-318c0167f332" # str | Payout id returned from the response of /v2/payouts + +# example passing only required values which don't have defaults set +try: + # API to cancel requested payouts that have not yet been sent to partner banks and e-wallets. Cancellation is possible if the payout has not been sent out via our partner and when payout status is ACCEPTED. + api_response = api_instance.cancel_payout(id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PayoutApi->cancel_payout: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Payout id returned from the response of /v2/payouts | + +### Return type + +[**GetPayouts200ResponseDataInner**](GetPayouts200ResponseDataInner.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Cancelled Successfully | - | +**400** | Unable to Cancel | - | +**404** | Invalid Payout ID | - | +**0** | Errors | - | + +[[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) + +# **create_payout** +> GetPayouts200ResponseDataInner create_payout(idempotency_key) + +API to send money at scale to bank accounts & eWallets + +### Example + + +```python +import time +import xendit +from xendit.apis import PayoutApi +from xendit.payout.model.create_payout_request import CreatePayoutRequest +from xendit.payout.model.get_payouts200_response_data_inner import GetPayouts200ResponseDataInner +from xendit.payout.model.error import Error +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = PayoutApi(api_client) +idempotency_key = "DISB-1234" # str | A unique key to prevent duplicate requests from pushing through our system. No expiration. + +# example passing only required values which don't have defaults set +try: + # API to send money at scale to bank accounts & eWallets + api_response = api_instance.create_payout(idempotency_key) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PayoutApi->create_payout: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # API to send money at scale to bank accounts & eWallets + api_response = api_instance.create_payout(idempotency_key, for_user_id=for_user_id, create_payout_request=create_payout_request) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PayoutApi->create_payout: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **idempotency_key** | **str**| A unique key to prevent duplicate requests from pushing through our system. No expiration. | + **for_user_id** | **str**| The sub-account user-id that you want to make this transaction for. This header is only used if you have access to xenPlatform. See xenPlatform for more information. | [optional] + **create_payout_request** | [**CreatePayoutRequest**](CreatePayoutRequest.md)| | [optional] + +### Return type + +[**GetPayouts200ResponseDataInner**](GetPayouts200ResponseDataInner.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Created payout | - | +**400** | Error when creating payout, see error_code for more details | - | +**401** | Invalid API key | - | +**403** | API key in use does not have necessary permissions to perform the request. Please assign proper permissions for the key. | - | +**409** | Duplicate Error, payout already exists | - | +**0** | Errors | - | + +[[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) + +# **get_payout_by_id** +> GetPayouts200ResponseDataInner get_payout_by_id(id) + +API to fetch the current status, or details of the payout + +### Example + + +```python +import time +import xendit +from xendit.apis import PayoutApi +from xendit.payout.model.get_payouts200_response_data_inner import GetPayouts200ResponseDataInner +from xendit.payout.model.error import Error +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = PayoutApi(api_client) +id = "disb-7baa7335-a0b2-4678-bb8c-318c0167f332" # str | Payout id returned from the response of /v2/payouts + +# example passing only required values which don't have defaults set +try: + # API to fetch the current status, or details of the payout + api_response = api_instance.get_payout_by_id(id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PayoutApi->get_payout_by_id: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Payout id returned from the response of /v2/payouts | + +### Return type + +[**GetPayouts200ResponseDataInner**](GetPayouts200ResponseDataInner.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The Payout object | - | +**401** | Invalid API key | - | +**403** | API key in use does not have necessary permissions to perform the request. Please assign proper permissions for the key. | - | +**404** | Payout Not Found | - | +**0** | Errors | - | + +[[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) + +# **get_payout_channels** +> [Channel] get_payout_channels() + +API providing the current list of banks and e-wallets we support for payouts for both regions + +### Example + + +```python +import time +import xendit +from xendit.apis import PayoutApi +from xendit.payout.model.error import Error +from xendit.payout.model.channel_category import ChannelCategory +from xendit.payout.model.channel import Channel +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = PayoutApi(api_client) + +# example passing only required values which don't have defaults set +# and optional values +try: + # API providing the current list of banks and e-wallets we support for payouts for both regions + api_response = api_instance.get_payout_channels(currency=currency, channel_category=channel_category, channel_code=channel_code) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PayoutApi->get_payout_channels: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Filter channels by currency from ISO-4217 values | [optional] + **channel_category** | [**[ChannelCategory]**](ChannelCategory.md)| Filter channels by category | [optional] + **channel_code** | **str**| Filter channels by channel code, prefixed by ISO-3166 country code | [optional] + +### Return type + +[**[Channel]**](Channel.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Current list of banks and e-wallets supported for payouts for all regions | - | +**0** | Errors | - | + +[[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) + +# **get_payouts** +> GetPayouts200Response get_payouts(reference_id) + +API to retrieve all matching payouts with reference ID + +### Example + + +```python +import time +import xendit +from xendit.apis import PayoutApi +from xendit.payout.model.error import Error +from xendit.payout.model.get_payouts200_response import GetPayouts200Response +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = PayoutApi(api_client) +reference_id = "DISB-123" # str | Reference_id provided when creating the payout + +# example passing only required values which don't have defaults set +try: + # API to retrieve all matching payouts with reference ID + api_response = api_instance.get_payouts(reference_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PayoutApi->get_payouts: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # API to retrieve all matching payouts with reference ID + api_response = api_instance.get_payouts(reference_id, limit=limit, after_id=after_id, before_id=before_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling PayoutApi->get_payouts: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **reference_id** | **str**| Reference_id provided when creating the payout | + **limit** | **float**| Number of records to fetch per API call | [optional] + **after_id** | **str**| Used to fetch record after this payout unique id | [optional] + **before_id** | **str**| Used to fetch record before this payout unique id | [optional] + +### Return type + +[**GetPayouts200Response**](GetPayouts200Response.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | An array of Payout objects sorted by created time in desc order. \"data\" will be an empty array and \"has_more' will be equal to false when there are no matching data. | - | +**403** | API key in use does not have necessary permissions to perform the request. Please assign proper permissions for the key. | - | +**0** | Errors | - | + +[[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/docs/QRCode.md b/docs/QRCode.md new file mode 100644 index 00000000..909374b9 --- /dev/null +++ b/docs/QRCode.md @@ -0,0 +1,13 @@ +# xendit.payment_request.model.QRCode + +QRCode Payment Method Details + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**channel_code** | [**QRCodeChannelCode**](QRCodeChannelCode.md) | | [optional] +**channel_properties** | [**QRCodeChannelProperties**](QRCodeChannelProperties.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/docs/QRCodeChannelCode.md b/docs/QRCodeChannelCode.md new file mode 100644 index 00000000..c38feb6f --- /dev/null +++ b/docs/QRCodeChannelCode.md @@ -0,0 +1,12 @@ +# xendit.payment_request.model.QRCodeChannelCode + +QR Code Channel Code + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | QR Code Channel Code | must be one of ["DANA", "RCBC", "LINKAJA", "PROMPTPAY", ] + +[[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/docs/QRCodeChannelProperties.md b/docs/QRCodeChannelProperties.md new file mode 100644 index 00000000..243c729a --- /dev/null +++ b/docs/QRCodeChannelProperties.md @@ -0,0 +1,13 @@ +# xendit.payment_request.model.QRCodeChannelProperties + +QR Code Channel Properties + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**qr_string** | **str** | | [optional] +**expires_at** | **datetime** | | [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/docs/QRCodeParameters.md b/docs/QRCodeParameters.md new file mode 100644 index 00000000..1230ef94 --- /dev/null +++ b/docs/QRCodeParameters.md @@ -0,0 +1,12 @@ +# xendit.payment_request.model.QRCodeParameters + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**channel_code** | [**QRCodeChannelCode**](QRCodeChannelCode.md) | | [optional] +**channel_properties** | [**QRCodeChannelProperties**](QRCodeChannelProperties.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/docs/QrCode.md b/docs/QrCode.md new file mode 100644 index 00000000..5b941b17 --- /dev/null +++ b/docs/QrCode.md @@ -0,0 +1,12 @@ +# xendit.invoice.model.QrCode + +An object representing QR code details for invoices. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**qr_code_type** | [**QrCodeType**](QrCodeType.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/docs/QrCodeType.md b/docs/QrCodeType.md new file mode 100644 index 00000000..ed09a35a --- /dev/null +++ b/docs/QrCodeType.md @@ -0,0 +1,12 @@ +# xendit.invoice.model.QrCodeType + +Representing the available QR Code channels used for invoice-related transactions. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | Representing the available QR Code channels used for invoice-related transactions. | must be one of ["QRIS", "PROMPTPAY", ] + +[[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/docs/ReceiptNotification.md b/docs/ReceiptNotification.md new file mode 100644 index 00000000..e10bcf0a --- /dev/null +++ b/docs/ReceiptNotification.md @@ -0,0 +1,14 @@ +# xendit.payout.model.ReceiptNotification + +Additional notification for completed payout + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email_to** | **[str], none_type** | Valid email address to send the payout receipt | [optional] +**email_cc** | **[str], none_type** | Valid email address to cc the payout receipt | [optional] +**email_bcc** | **[str], none_type** | Valid email address to bcc the payout receipt | [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/docs/Refund.md b/docs/Refund.md new file mode 100644 index 00000000..08cd0944 --- /dev/null +++ b/docs/Refund.md @@ -0,0 +1,22 @@ +# xendit.refund.model.Refund + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**payment_request_id** | **str** | | [optional] +**amount** | **float** | | [optional] +**channel_code** | **str** | | [optional] +**country** | **str** | | [optional] +**currency** | **str** | | [optional] +**reference_id** | **str, none_type** | | [optional] +**failure_code** | **str, none_type** | | [optional] +**refund_fee_amount** | **float, none_type** | | [optional] +**created** | **str** | | [optional] +**updated** | **str** | | [optional] +**metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [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/docs/RefundApi.md b/docs/RefundApi.md new file mode 100644 index 00000000..16ea165a --- /dev/null +++ b/docs/RefundApi.md @@ -0,0 +1,264 @@ +# xendit.apis.RefundApi + +All URIs are relative to *https://api.xendit.co* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**cancel_refund**](RefundApi.md#cancel_refund) | **POST** /refunds/{refundID}/cancel | +[**create_refund**](RefundApi.md#create_refund) | **POST** /refunds | +[**get_all_refunds**](RefundApi.md#get_all_refunds) | **GET** /refunds/ | +[**get_refund**](RefundApi.md#get_refund) | **GET** /refunds/{refundID} | + + +# **cancel_refund** +> Refund cancel_refund(refund_id) + + + +### Example + + +```python +import time +import xendit +from xendit.apis import RefundApi +from xendit.refund.model.create_refund404_response import CreateRefund404Response +from xendit.refund.model.create_refund403_response import CreateRefund403Response +from xendit.refund.model.refund import Refund +from xendit.refund.model.create_refund400_response import CreateRefund400Response +from xendit.refund.model.create_refund_default_response import CreateRefundDefaultResponse +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = RefundApi(api_client) +refund_id = "rfd-1fdaf346-dd2e-4b6c-b938-124c7167a822" # str | + +# example passing only required values which don't have defaults set +try: + api_response = api_instance.cancel_refund(refund_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling RefundApi->cancel_refund: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + api_response = api_instance.cancel_refund(refund_id, idempotency_key=idempotency_key) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling RefundApi->cancel_refund: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **refund_id** | **str**| | + **idempotency_key** | **str**| | [optional] + +### Return type + +[**Refund**](Refund.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad request | - | +**403** | Forbidden due to permissions | - | +**404** | Data not found | - | +**0** | Internal server error | - | + +[[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) + +# **create_refund** +> Refund create_refund() + + + +### Example + + +```python +import time +import xendit +from xendit.apis import RefundApi +from xendit.refund.model.create_refund404_response import CreateRefund404Response +from xendit.refund.model.create_refund403_response import CreateRefund403Response +from xendit.refund.model.create_refund503_response import CreateRefund503Response +from xendit.refund.model.refund import Refund +from xendit.refund.model.create_refund400_response import CreateRefund400Response +from xendit.refund.model.create_refund import CreateRefund +from xendit.refund.model.create_refund409_response import CreateRefund409Response +from xendit.refund.model.create_refund_default_response import CreateRefundDefaultResponse +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = RefundApi(api_client) + +# example passing only required values which don't have defaults set +# and optional values +try: + api_response = api_instance.create_refund(idempotency_key=idempotency_key, create_refund=create_refund) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling RefundApi->create_refund: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **idempotency_key** | **str**| | [optional] + **create_refund** | [**CreateRefund**](CreateRefund.md)| | [optional] + +### Return type + +[**Refund**](Refund.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad request | - | +**403** | Forbidden due to permissions | - | +**404** | Data not found | - | +**409** | Request causes conflict | - | +**503** | Service is unavailable due to dependencies | - | +**0** | Internal server error | - | + +[[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) + +# **get_all_refunds** +> RefundList get_all_refunds() + + + +### Example + + +```python +import time +import xendit +from xendit.apis import RefundApi +from xendit.refund.model.refund_list import RefundList +from xendit.refund.model.create_refund_default_response import CreateRefundDefaultResponse +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = RefundApi(api_client) + +# example, this endpoint has no required or optional parameters +try: + api_response = api_instance.get_all_refunds() + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling RefundApi->get_all_refunds: %s\n" % e) +``` + + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**RefundList**](RefundList.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**0** | Internal server error | - | + +[[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) + +# **get_refund** +> Refund get_refund(refund_id) + + + +### Example + + +```python +import time +import xendit +from xendit.apis import RefundApi +from xendit.refund.model.refund import Refund +from xendit.refund.model.create_refund_default_response import CreateRefundDefaultResponse +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = RefundApi(api_client) +refund_id = "rfd-1fdaf346-dd2e-4b6c-b938-124c7167a822" # str | + +# example passing only required values which don't have defaults set +try: + api_response = api_instance.get_refund(refund_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling RefundApi->get_refund: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + api_response = api_instance.get_refund(refund_id, idempotency_key=idempotency_key) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling RefundApi->get_refund: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **refund_id** | **str**| | + **idempotency_key** | **str**| | [optional] + +### Return type + +[**Refund**](Refund.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**0** | Internal server error | - | + +[[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/docs/RefundList.md b/docs/RefundList.md new file mode 100644 index 00000000..a88b3c86 --- /dev/null +++ b/docs/RefundList.md @@ -0,0 +1,12 @@ +# xendit.refund.model.RefundList + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**[Refund]**](Refund.md) | | +**has_more** | **bool** | | [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/docs/RetailOutlet.md b/docs/RetailOutlet.md new file mode 100644 index 00000000..eb0db599 --- /dev/null +++ b/docs/RetailOutlet.md @@ -0,0 +1,15 @@ +# xendit.invoice.model.RetailOutlet + +An object representing retail outlet details for invoices. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**retail_outlet_name** | [**RetailOutletName**](RetailOutletName.md) | | +**payment_code** | **str** | The payment code. | [optional] +**transfer_amount** | **float** | The transfer amount. | [optional] +**merchant_name** | **str** | The name of the merchant. | [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/docs/RetailOutletName.md b/docs/RetailOutletName.md new file mode 100644 index 00000000..36bb39ac --- /dev/null +++ b/docs/RetailOutletName.md @@ -0,0 +1,12 @@ +# xendit.invoice.model.RetailOutletName + +Representing the available retail outlet channels used for invoice-related transactions. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | Representing the available retail outlet channels used for invoice-related transactions. | must be one of ["ALFAMART", "INDOMARET", "7ELEVEN", "CEBUANA", "DP_ECPAY_LOAN", "DP_MLHUILLIER", "DP_PALAWAN", "DP_ECPAY_SCHOOL", "LBC", ] + +[[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/docs/ServerError.md b/docs/ServerError.md new file mode 100644 index 00000000..1f4c7ef4 --- /dev/null +++ b/docs/ServerError.md @@ -0,0 +1,12 @@ +# xendit.invoice.model.ServerError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **str** | | +**error_code** | **str** | | defaults to "SERVER_ERROR" + +[[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/docs/SimulatePaymentRequest.md b/docs/SimulatePaymentRequest.md new file mode 100644 index 00000000..61ba5ec6 --- /dev/null +++ b/docs/SimulatePaymentRequest.md @@ -0,0 +1,11 @@ +# xendit.payment_method.model.SimulatePaymentRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **float** | | [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/docs/TokenizedCardInformation.md b/docs/TokenizedCardInformation.md new file mode 100644 index 00000000..67f25101 --- /dev/null +++ b/docs/TokenizedCardInformation.md @@ -0,0 +1,21 @@ +# xendit.payment_method.model.TokenizedCardInformation + +Tokenized Card Information + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**token_id** | **str** | | +**masked_card_number** | **str** | 1st 6 and last 4 digits of the card | +**expiry_month** | **str** | Card expiry month in MM format | +**expiry_year** | **str** | Card expiry month in YY format | +**fingerprint** | **str** | Xendit-generated identifier for the unique card number. Multiple payment method objects can be created for the same account - e.g. if the user first creates a one-time payment request, and then later on creates a multiple-use payment method using the same account. The fingerprint helps to identify the unique account being used. | +**type** | **str** | Whether the card is a credit or debit card | +**network** | **str** | Card network - VISA, MASTERCARD, JCB, AMEX, DISCOVER, BCA | +**country** | **str** | Country where the card was issued ISO 3166-1 Alpha-2 | +**issuer** | **str** | Issuer of the card, most often an issuing bank For example, “BCA”, “MANDIRI” | +**cardholder_name** | **str, none_type** | Cardholder name is optional but recommended for 3DS 2 / AVS verification | [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/docs/TransactionApi.md b/docs/TransactionApi.md new file mode 100644 index 00000000..554a7e6a --- /dev/null +++ b/docs/TransactionApi.md @@ -0,0 +1,158 @@ +# xendit.apis.TransactionApi + +All URIs are relative to *https://api.xendit.co* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_all_transactions**](TransactionApi.md#get_all_transactions) | **GET** /transactions | Get a list of transactions +[**get_transaction_by_id**](TransactionApi.md#get_transaction_by_id) | **GET** /transactions/{id} | Get a transaction based on its id + + +# **get_all_transactions** +> TransactionsResponse get_all_transactions() + +Get a list of transactions + +Get a list of all transactions based on filter and search parameters. + +### Example + + +```python +import time +import xendit +from xendit.apis import TransactionApi +from xendit.balance_and_transaction.model.transaction_statuses import TransactionStatuses +from xendit.balance_and_transaction.model.server_error import ServerError +from xendit.balance_and_transaction.model.transaction_types import TransactionTypes +from xendit.balance_and_transaction.model.date_range_filter import DateRangeFilter +from xendit.balance_and_transaction.model.channels_categories import ChannelsCategories +from xendit.balance_and_transaction.model.transactions_response import TransactionsResponse +from xendit.balance_and_transaction.model.validation_error import ValidationError +from xendit.balance_and_transaction.model.currency import Currency +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = TransactionApi(api_client) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Get a list of transactions + api_response = api_instance.get_all_transactions(for_user_id=for_user_id, types=types, statuses=statuses, channel_categories=channel_categories, reference_id=reference_id, product_id=product_id, account_identifier=account_identifier, amount=amount, currency=currency, created=created, updated=updated, limit=limit, after_id=after_id, before_id=before_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling TransactionApi->get_all_transactions: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **for_user_id** | **str**| The sub-account user-id that you want to make this transaction for. This header is only used if you have access to xenPlatform. See xenPlatform for more information | [optional] + **types** | [**[TransactionTypes]**](TransactionTypes.md)| Transaction types that will be included in the result. Default is to include all transaction types | [optional] + **statuses** | [**[TransactionStatuses]**](TransactionStatuses.md)| Status of the transaction. Default is to include all status. | [optional] + **channel_categories** | [**[ChannelsCategories]**](ChannelsCategories.md)| Payment channels in which the transaction is carried out. Default is to include all channels. | [optional] + **reference_id** | **str**| To filter the result for transactions with matching reference given (case sensitive) | [optional] + **product_id** | **str**| To filter the result for transactions with matching product_id (a.k.a payment_id) given (case sensitive) | [optional] + **account_identifier** | **str**| Account identifier of transaction. The format will be different from each channel. For example, on `BANK` channel it will be account number and on `CARD` it will be masked card number. | [optional] + **amount** | **float**| Specific transaction amount to search for | [optional] + **currency** | **Currency**| | [optional] + **created** | **DateRangeFilter**| Filter time of transaction by created date. If not specified will list all dates. | [optional] + **updated** | **DateRangeFilter**| Filter time of transaction by updated date. If not specified will list all dates. | [optional] + **limit** | **float**| number of items in the result per page. Another name for \"results_per_page\" | [optional] if omitted the server will use the default value of 10 + **after_id** | **TransactionId**| | [optional] + **before_id** | **TransactionId**| | [optional] + +### Return type + +[**TransactionsResponse**](TransactionsResponse.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | List of transaction object | - | +**400** | invalid input, object invalid | - | +**0** | Errors | - | + +[[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) + +# **get_transaction_by_id** +> TransactionResponse get_transaction_by_id(id) + +Get a transaction based on its id + +Get single specific transaction by transaction id. + +### Example + + +```python +import time +import xendit +from xendit.apis import TransactionApi +from xendit.balance_and_transaction.model.transaction_response import TransactionResponse +from xendit.balance_and_transaction.model.server_error import ServerError +from xendit.balance_and_transaction.model.validation_error import ValidationError +from pprint import pprint + +# See configuration.py for a list of all supported configuration parameters. +xendit.set_api_key('XENDIT API KEY') + + +# Enter a context with an instance of the API client +api_client = xendit.ApiClient() +# Create an instance of the API class +api_instance = TransactionApi(api_client) +id = TransactionId("txn_438e4b61-7c4c-4dbb-bbba-94a896bff333") # TransactionId | + +# example passing only required values which don't have defaults set +try: + # Get a transaction based on its id + api_response = api_instance.get_transaction_by_id(id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling TransactionApi->get_transaction_by_id: %s\n" % e) + +# example passing only required values which don't have defaults set +# and optional values +try: + # Get a transaction based on its id + api_response = api_instance.get_transaction_by_id(id, for_user_id=for_user_id) + pprint(api_response) +except xendit.ApiException as e: + print("Exception when calling TransactionApi->get_transaction_by_id: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **TransactionId**| | + **for_user_id** | **str**| The sub-account user-id that you want to make this transaction for. This header is only used if you have access to xenPlatform. See xenPlatform for more information | [optional] + +### Return type + +[**TransactionResponse**](TransactionResponse.md) + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | invalid input, object invalid | - | +**0** | Errors | - | + +[[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/docs/TransactionId.md b/docs/TransactionId.md new file mode 100644 index 00000000..c2663ad5 --- /dev/null +++ b/docs/TransactionId.md @@ -0,0 +1,12 @@ +# xendit.balance_and_transaction.model.TransactionId + +The unique id of a transaction. It will have `txn_` as prefix + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | The unique id of a transaction. It will have `txn_` as prefix | + +[[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/docs/TransactionResponse.md b/docs/TransactionResponse.md new file mode 100644 index 00000000..7de4a5e0 --- /dev/null +++ b/docs/TransactionResponse.md @@ -0,0 +1,27 @@ +# xendit.balance_and_transaction.model.TransactionResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | [**TransactionId**](TransactionId.md) | | +**product_id** | **str** | The product_id of the transaction. Product id will have a different prefix for each product. You can use this id to match the transaction from this API to each product API. | +**type** | [**TransactionResponseType**](TransactionResponseType.md) | | +**status** | [**TransactionStatuses**](TransactionStatuses.md) | | +**channel_category** | [**ChannelsCategories**](ChannelsCategories.md) | | +**channel_code** | **str, none_type** | The channel of the transaction that is used. See [channel codes](https://docs.xendit.co/xendisburse/channel-codes) for the list of available per channel categories. | +**account_identifier** | **str, none_type** | Account identifier of transaction. The format will be different from each channel. | +**reference_id** | **str** | customer supplied reference/external_id | +**currency** | [**Currency**](Currency.md) | | +**amount** | **float** | The transaction amount. The number of decimal places will be different for each currency according to ISO 4217. | +**cashflow** | **str** | Representing whether the transaction is money in or money out For transfer, the transfer out side it will shows up as money out and on transfer in side in will shows up as money-in. Available values are `MONEY_IN` for money in and `MONEY_OUT` for money out. | +**business_id** | **str** | The id of business where this transaction belong to | +**fee** | [**FeeResponse**](FeeResponse.md) | | +**created** | **datetime** | Transaction created timestamp (UTC+0) | +**updated** | **datetime** | Transaction updated timestamp (UTC+0) | +**settlement_status** | **str, none_type** | The settlement status of the transaction. `PENDING` - Transaction amount has not been settled to merchant's balance. `SETTLED` - Transaction has been settled to merchant's balance | [optional] +**estimated_settlement_time** | **datetime, none_type** | Estimated settlement time will only apply to money-in transactions. For money-out transaction, the value will be `NULL`. Estimated settlement time in which transaction amount will be settled to merchant's balance. | [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/docs/TransactionResponseType.md b/docs/TransactionResponseType.md new file mode 100644 index 00000000..ac6e4a2e --- /dev/null +++ b/docs/TransactionResponseType.md @@ -0,0 +1,11 @@ +# xendit.balance_and_transaction.model.TransactionResponseType + +The type of the transactions. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/docs/TransactionStatuses.md b/docs/TransactionStatuses.md new file mode 100644 index 00000000..8225eaa9 --- /dev/null +++ b/docs/TransactionStatuses.md @@ -0,0 +1,11 @@ +# xendit.balance_and_transaction.model.TransactionStatuses + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | must be one of ["SUCCESS", "PENDING", "FAILED", "REVERSED", "VOIDED", ] + +[[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/docs/TransactionTypes.md b/docs/TransactionTypes.md new file mode 100644 index 00000000..6831f545 --- /dev/null +++ b/docs/TransactionTypes.md @@ -0,0 +1,11 @@ +# xendit.balance_and_transaction.model.TransactionTypes + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | | must be one of ["BATCH_DISBURSEMENT", "DISBURSEMENT", "PAYMENT", "REMITTANCE", "REMITTANCE_PAYOUT", "REMITTANCE_COLLECTION", "TRANSFER", "PLATFORM_FEE", "REFUND", "CASHBACK", "TOPUP", "WITHDRAWAL", "OTHER", ] + +[[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/docs/TransactionsResponse.md b/docs/TransactionsResponse.md new file mode 100644 index 00000000..6f942a9d --- /dev/null +++ b/docs/TransactionsResponse.md @@ -0,0 +1,14 @@ +# xendit.balance_and_transaction.model.TransactionsResponse + +Returns an array of Transaction Objects. Returns empty array when there is no result. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**has_more** | **bool** | Indicates whether there are more items to be queried with `after_id` of the last item from the current result. Use the `links` to follow to the next result. | +**data** | [**[TransactionResponse]**](TransactionResponse.md) | | +**links** | [**[LinkItem]**](LinkItem.md) | The links to the next page based on LinkItem if there is next result. | [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/docs/UnauthorizedError.md b/docs/UnauthorizedError.md new file mode 100644 index 00000000..9bd15271 --- /dev/null +++ b/docs/UnauthorizedError.md @@ -0,0 +1,13 @@ +# xendit.invoice.model.UnauthorizedError + +An error object used to indicate unauthorized access to an invoice-related resource. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **str** | A human-readable error message providing additional context about the unauthorized access. | +**error_code** | **str** | The specific error code associated with the unauthorized access. | defaults to "INVALID_API_KEY" + +[[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/docs/ValidationError.md b/docs/ValidationError.md new file mode 100644 index 00000000..c0f67a44 --- /dev/null +++ b/docs/ValidationError.md @@ -0,0 +1,14 @@ +# xendit.balance_and_transaction.model.ValidationError + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status_code** | **float** | | +**error** | **str** | | +**message** | **str** | | +**validation** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [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/docs/VirtualAccount.md b/docs/VirtualAccount.md new file mode 100644 index 00000000..9a9ca892 --- /dev/null +++ b/docs/VirtualAccount.md @@ -0,0 +1,19 @@ +# xendit.payment_request.model.VirtualAccount + +Virtual Account Payment Method Details + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**channel_code** | [**VirtualAccountChannelCode**](VirtualAccountChannelCode.md) | | +**channel_properties** | [**VirtualAccountChannelProperties**](VirtualAccountChannelProperties.md) | | +**min_amount** | **float, none_type** | | [optional] +**max_amount** | **float, none_type** | | [optional] +**amount** | **float, none_type** | | [optional] +**currency** | [**PaymentRequestCurrency**](PaymentRequestCurrency.md) | | [optional] +**alternative_display_types** | **[str]** | Alternative display requested for the virtual account | [optional] +**alternative_displays** | [**[VirtualAccountAlternativeDisplay]**](VirtualAccountAlternativeDisplay.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/docs/VirtualAccountAllOf.md b/docs/VirtualAccountAllOf.md new file mode 100644 index 00000000..514161b6 --- /dev/null +++ b/docs/VirtualAccountAllOf.md @@ -0,0 +1,11 @@ +# xendit.payment_request.model.VirtualAccountAllOf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alternative_displays** | [**[VirtualAccountAlternativeDisplay]**](VirtualAccountAlternativeDisplay.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/docs/VirtualAccountAlternativeDisplay.md b/docs/VirtualAccountAlternativeDisplay.md new file mode 100644 index 00000000..d3acfad2 --- /dev/null +++ b/docs/VirtualAccountAlternativeDisplay.md @@ -0,0 +1,13 @@ +# xendit.payment_method.model.VirtualAccountAlternativeDisplay + +Alternative Display Object + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | Type of the alternative display | [optional] [readonly] if omitted the server will use the default value of "QR_STRING" +**data** | **str** | Data payload of the given alternative display | [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/docs/VirtualAccountChannelCode.md b/docs/VirtualAccountChannelCode.md new file mode 100644 index 00000000..95c31d47 --- /dev/null +++ b/docs/VirtualAccountChannelCode.md @@ -0,0 +1,12 @@ +# xendit.payment_method.model.VirtualAccountChannelCode + +Virtual Account Channel Code + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | Virtual Account Channel Code | must be one of ["BCA", "BJB", "BNI", "BRI", "MANDIRI", "PERMATA", "BSI", "CIMB", "SAHABAT_SAMPOERNA", "ARTAJASA", "PV", "VIETCAPITAL", "WOORI", "MSB", "STANDARD_CHARTERED", ] + +[[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/docs/VirtualAccountChannelProperties.md b/docs/VirtualAccountChannelProperties.md new file mode 100644 index 00000000..15ef0b20 --- /dev/null +++ b/docs/VirtualAccountChannelProperties.md @@ -0,0 +1,15 @@ +# xendit.payment_method.model.VirtualAccountChannelProperties + +Virtual Account Channel Properties + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**customer_name** | **str** | Name of customer. | [optional] +**virtual_account_number** | **str** | You can assign specific Virtual Account number using this parameter. If you do not send one, one will be picked at random. Make sure the number you specify is within your Virtual Account range. | [optional] +**expires_at** | **datetime** | The date and time in ISO 8601 UTC+0 when the virtual account number will be expired. Default: The default expiration date will be 31 years from creation date. | [optional] +**suggested_amount** | **float** | The suggested amount you want to assign. Note: Suggested amounts is the amounts that can see as a suggestion, but user can still put any numbers (only supported for Mandiri and BRI) | [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/docs/VirtualAccountChannelPropertiesPatch.md b/docs/VirtualAccountChannelPropertiesPatch.md new file mode 100644 index 00000000..7e1d6671 --- /dev/null +++ b/docs/VirtualAccountChannelPropertiesPatch.md @@ -0,0 +1,13 @@ +# xendit.payment_method.model.VirtualAccountChannelPropertiesPatch + +Virtual Account Channel Properties + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**expires_at** | **datetime** | The date and time in ISO 8601 UTC+0 when the virtual account number will be expired. Default: The default expiration date will be 31 years from creation date. | [optional] +**suggested_amount** | **float** | The suggested amount you want to assign. Note: Suggested amounts is the amounts that can see as a suggestion, but user can still put any numbers (only supported for Mandiri and BRI) | [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/docs/VirtualAccountParameters.md b/docs/VirtualAccountParameters.md new file mode 100644 index 00000000..eca0e892 --- /dev/null +++ b/docs/VirtualAccountParameters.md @@ -0,0 +1,17 @@ +# xendit.payment_method.model.VirtualAccountParameters + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**channel_code** | [**VirtualAccountChannelCode**](VirtualAccountChannelCode.md) | | +**channel_properties** | [**VirtualAccountChannelProperties**](VirtualAccountChannelProperties.md) | | +**amount** | **float, none_type** | | [optional] +**min_amount** | **float, none_type** | | [optional] +**max_amount** | **float, none_type** | | [optional] +**currency** | **str** | | [optional] +**alternative_display_types** | **[str]** | For payments in Vietnam only, alternative display requested for the virtual account | [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/docs/VirtualAccountUpdateParameters.md b/docs/VirtualAccountUpdateParameters.md new file mode 100644 index 00000000..077bef01 --- /dev/null +++ b/docs/VirtualAccountUpdateParameters.md @@ -0,0 +1,15 @@ +# xendit.payment_method.model.VirtualAccountUpdateParameters + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **float, none_type** | | [optional] +**min_amount** | **float, none_type** | | [optional] +**max_amount** | **float, none_type** | | [optional] +**channel_properties** | [**VirtualAccountChannelPropertiesPatch**](VirtualAccountChannelPropertiesPatch.md) | | [optional] +**alternative_display_types** | **[str]** | For payments in Vietnam only, alternative display requested for the virtual account | [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/docs/header.jpg b/docs/header.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b5d37ba2b9730c991c5462a2cc5382334c7afbd9 GIT binary patch literal 115092 zcmeFYXH;8FwAM3e*=k&|)6Bnd>ch%Xr=k`N*q zut_3glE`3k#srgthwskZHPd~k@0#wfe@yrK_R(5erK+>{UXN<;I`y1ge@6fOqtz&jf|)KU)8k{6on%AXbr zPKqlOSFc{ZcIofG%N@#Fw{PCPcKycHe+&RWprE*U^~&WKsynxC-@18=g5v6B-_0wx zZr`D$p`)Z{U}EOtmIL|vB~_6bS!K+9zT{O7^GHa_KCc*I;Zrg5CJqkq@=F_<+Exol z$s2uc13LS^ODtHv)Xi~e_1|p&-^Op>xq0jQ4a#f(X4{j7;>z_)+t;pMqoQWGb?5qB zip$2OahhASx9Pa(B^bD$-(h6tkufv{*?JQPm?WiDJbd0IR7On|b+8lbqV8?5ZV4r~E(T6jawPouau$ zL!nH8+*x~-|N7r?`PcWq5cn4Y|3ctj2>c6yeu1cK4Z;;vq_hn7>SS%qG3TtAj|+aOk0_c-4(HE%jUM{mZG`l0*oWkuKYo9g zZF=f6nLKF4r$b&08WZ-w14|S0gyMY=KADg>{N8iJZTuQpZsibwi-!eR4_9^Y224{Q z0J%)yd(YX-O>Zd>!5t;~D_E67?n6MV{z%Q&nqt$e!jJV+UqQ!)=i#F>UN_TE06|j0 z<$ow#>YrT*VMZ3N4L9PI$2Ogg>;vokN_VqQ>F^CJxB79jDVs^BFV=4Dn7nzWXmLt+ zo=y%4)vT+E_(LJ2j8|aWdK=8zz|t@lQZfB^2!rOo^!)!3AHDU`gUXumC=hz2idk3J z(O>tzG0O7~g+cV*Zr+2IDC5{n0rt-vIt`^s#Setv=TyFw*v6d6XhaTeUMs99vgw!Z zmhQR%w6jEgLW%Wj*PTVXw~fMCSntTUipNw5eTzFb644LPxOmJSX*lLBOhX>suENv4 zm?Ta)0uBN>Y}_#$1q zHHi!&8<3{2IFw}G-ra)OMuODMCxz>2roXbMGqH%lB*L4&Ex?a06R7N|O%~ZiPYr>{ z&h)QYN~YNSuKjrYa(3x}MRZ)M#oyj+i*Dt)ztRnN110NdvrZjBUo2q(x@LB+3)T(q zMu?GD5rCD|j@w}$Ma9GfTl4LroSu#s)9<86)1sWtCf!qdNkhm|iRw+zV&j+Y@u1!M zEkv{Fb)Zi5njsbk`;mRi0U9F}N}{7nU&c+Zn~wk{O>v>w@0(2>pij8qaG0UOQXI;W zV7t05nnLTV`?Tb!H!x{(NFz5xv9FeHLG|T1cu@I$)U#i=Y7SL`!l0Zuu+#R-Ym=v$ zN@{@n!^KiZkFIP5|H$BG{k%rToY7MpDy+Cwu>h@%`C-&#jNg4~CRYEBb!^{m&aRnHhMxs!5s>Ce@${f;7nciZpey zI}Ululiq1glua4x(*fl>o+bSP7Ndn_BID2bTt6q4wYEBh~xC#n$}UG4D!3P30IMzDbS@sO|^4 z95R(_M?It~=#kwYfBf2%h@4s!(cc zjFWafN|m3lDR14LU5(58Lt$Kh_jeNR&9y9(%8}#3u{VDxmXvRg$!+&g|L>1Ag#`7* z*$20oWX0&yq{jd!%Zn^4yNlMe=YJ?n%9kL6jo6!!Cmv+wd;Q{@KPKirtuFtDj5JOr zaJWT+_+I@7uvI`g?mL2eeZQ~1JD4bXMjuL6jzjvN+&BC~@mlk~UYg8F+KNq1y~Q>= zZEj^_kABzT9}0;hjgG!hXRrUD?0>r-u7vp>F0lEW^>2hs*1W^XFYnW?GaZPm-9O1q zlHy1^fBD2_5QRT-3lDJ%ouL;uP|oJ4zgQ^P^8(ih|DRyovs_Bz$87(KvampxtZp4# zt=*NrUG_UM?h$#QQjN574Hg;6DyS}Dwnm)mL*CP?7}E$yAHK5v}A=9Ml<{yfbV2fz0^g5u>L;AuRoMvMM z$whWFZM9~@f_b~JkQYUCueILl~de}0Y$Q}6WQ9iIF&gfXCVA6_9P?8@07FZnH!JSm#Jr$M%&e& za=RsqU|jj-c#>t8LN#>hi{NNowiI53CXZo%2itfFZ1kY!;Rpa&0?o?83bI&^Nc2L+ zi#>thr5c73NOD2M2sc*f-vklaDHII1>bP**frKIjdu#Zr>;Rorhr4i>AFUrNCyS*D zzmbx`J<Y%$MN!Bd< zXzuqix=*p~&U@)6j~T_gTvdoexF6j?#ts4rt}5~&Nfi?a7Kf3i1t zGfG)Vb`-kom6v9F_ijuDTnrZ-?Np|e$NN*K_S_0Gz#D*Aw0;mA3ri}xZYh^lg&WN^ImLec)QwI;X-bqq+z;@qFJkJyj|0XT*nUcGVvD_ zzX`=}coM}6K$827fWpKQsvY4!6s`q*llx9pjeO8@^p@;i4lZ6XUu*OL+v51m&HT|+ zP3^)Qj`Kr*?XvZfcABY*ha7t}EPv_Ij=^uv%N;hYmCQ=M!9kFcr}&M{8GEu6^QQX? zQhOImptNN5x|hp>Hhd6!bT|ntsWaBea_EZ5}`GPsr65>(<9 z`A~)@JmOGVS|Y5CumRhY5x8F_mNNKy!)5cleKYifb0Gg>jVfr?s%e0`+xXjBnk}%T z9CoW{-(D(8P&~PagVFOo!$k{=$o)qdO%wZlG_U(moypcfcpq@phU3=O)>TSZeo z+{Ap|a53=iDB3E%N2kNIu}YUpuh@{yIw7C~KpO7}@E^PvnD5Q+sL*hrKVDktD5gnk z8OytAI{c1#TG$wh=QU$qE-K&S9nc=5RPU1aGd9if78&#|z~B5u z_n%H5PcXG>Q7eOOvDR%%LWP9I!rCsM#!+cXLVFTpf!3P7D>}9p$@%CL;jH^S1DgWU zt_-y3eKYNA)Cvc@X1%*RAU|!5eVIjAUJv4VQc8r}yE@hUJ@UO*pi2+6O1+Cw9gFpC z{G0+CZtkGS-b{zauyc&m6(~PmtOeCw?i*7vaDo^;+EVVQ;maqD6D0N*&^Vq%&Cze> zTdn&uwR20Z>@3vM{u3B$D!0Z9e*V7n>vT_s~|)`EAO^^ zK*bJTYv`9f#-hT=hr8Gd)6ukn6v$ObKW`be41Cp=J=q~8CsUgzQR2Rcc^FPl7!L%^ z)mPv~&4vy6cKiM1Dr0}JL*z>OD@e5RKGWF+i2Am$F$FX)VAI+hrR6Oldd+@pPrkhL z@eH1U&iFC4sB=P_WQSDA-gl{IqFqZ-TU9y9_vkc6wgC*5?Imzix8+?iC&3AYSGoL* zNOQ|D?25gcj*XtuHHd^_HPfU%t@onikXf$;> z{)tt%HqvL2f60Qex`b$ylij z1W__F78w|#FirYH@#~N#-)n*T=RE&+O~bvus6dN|kzAb;a4m7TNHmlG0X*x)q+Sc( zU*DN%hbKjXXas8`Cvxm+D+l#(60~44fS73?^)qOF=2Rhe9GJS=;YAYXC>K-cIkgzDDK|c`ECl`DUZmi_3x#! zkpSF_V$Kr_qOzQ4WD4(^BUF$3r*i0^Aav+Yl^(}W9SX!>)?7P=ITk|+3!%=#hTsxp zpPHxT@N9blI&_om%Y^5Tb`!kDra7Z9K(v`J@Ud2^P`R@M9HFtrz(m}HZhtM!%E~bF z`FvUD@jqRzj!q*F7wY0U^T+oNeZC3lE}<`=0XByp?9K$9B~Q~g?kmk6b}^hL_T$pg zrTd?LC`-{QH%jq9gL=gaM_xASdpBM&e*A}mK{+`X@{8&Z#YcYOY7zTLzQNV0Ye&{2 z1{y;pVQ?1LytzAtPCgZ`WECatG_+$l=7f0CuT#(W$ftC-kO!j+TC!SvXZ&I#u8KwK z>wu3FX$I^t318eU9l=8TXA+#DiLYbKilqT@a>4|zIFOX|dhCdXD5h{hP<0uXcFznl z$6H3J#QK}@RaSOzjW$87sL#1aJtk2QQn|$4zDA^BkJe%l7o_(jr(J*nyqI5$>jt9D zCF!f@H5L0JaYObC-ac)0>xFk1TRL4AIE>)s-uVU=d7jLx+&g})OxjY+V}kU8lJFGv zrn%qesCy*CVW06IN<`Oui|-rW>v{`b2|s)0g%;-CgLn)%jdf#p^>f*E&d`;lgB8~umEU_O66-Tt zI?*!fxY)8wRk!i$%!4qU?c{!&zuPSAz3Y<~jY@a>tzP%El=LF!?w)l7`c`MDN-CEl z*0nTp8LaCoKfnZ>UsBt!_L9U+o?eA+O(k5jvLyN z7pk$1gBNC57c00F5rM1x*svLkltdoRX)jfK&9YgE)aROYW+-*&(XKLGvc?l zBHjEkY$dLiH>mraLl8}elsQ{P-WOMx8<`02SH2EUPKIVvg5SN;Wf9em&%rT|#%MR^ zP26qy`u3?d7#*P%zp41L@WH1IvBytSmj<1hH;(Q5&LpBHA32JPIUw#r(|t<(D|0O) zONt`d+a>RKICy_nw2;&*@k~nCve3<`p7=73(;VHHb1I}XKJY?;jrz@!V|cZuSJJF( zXL-~XBYJ5R6{(+%6+@G3c3G-E6b{4i>%|L|>L2gDp%jdT%6XM0qQN8$%?d4?td+ra zw!bhY=6W&J5_oc#n6Vssk3aDOA{t9zQ&_CAh>@!zbZiMIPQWl7i^hV>> zA<381)Ql{kSzOwJD*j016S=9>)-NLF$wy>JgzN-wS~Cbw1TijEhAr6SX&MUG7ob90 zibDiDw}z>+Szo+QR3tQYqJHF-tMx7|RvR|v98L|;WO_!icMz$E2EMv~1)oKIsd?%~ z&_8uVWPI^qAZh9fvMEkAIPlLP+jQNZt(CC3bX;-=uTO8*K!C2Oq2uu5aT#vP* z=F|J?DCf}wobjy7mdc3y8${MIzKW{bAuxQh%`~bD;_C8;0tBHUxjkE7s|$F+-5f%c zv#OInKuvf#uha&1bY%10E3HfmXqcU-+>lOf9*vAT#=QA!J8?h!tJ1QKE?at&S?97> z;grZr{?@4W@gzP>E01+?a1>c+;{ZVeK*d`4`7dmQK6>rh^+bJ#E7LNPx91>2*AY3o z*58e1T|VP<{OVe)KY~D@2Z?ui-gOp`)m@QWfm7Z{`!1Ni|2E9a>I>|JLig4qS0qv> z8K?dOkk3uLv9-w?OJx#gWy%1qZ!-0sb8gEidY|w1T_vxTk3EC$S*S7NxVkFr8wJIc zJJ#sNmi#{DAC$Ky-0&1eY-ShwfaMiM&GYXM6(zl9)_gPH#O}L)^U_Hi|3d*#5T7|C z&9Vt7v1I=EFEi$U-D0ilxO>oUHxFFB$3{Qr9<-}*dI#%manoN_{NAf_{qN+_yl<$W z2i+B^Jt#)nhrJ39o-ag~G9Nc{3Tk=J^OUkEMXgky`IL$i+$>sZC}mTVXlh>jZFoZK z#1kR}nGclKr1!yo`+9jkmt%`dPBJ6QX(v6aGVkFVu)0hi7nD5H! z9tgyauMzXo`=EzPvKF_p^jFz@-OvpvCOX+$AnYdUxhd>v{?f#6%$OLP#jEnxCQPYl z7rSN&vrF<68k6$Gh`p(h2bu8d)!MntU;X}-)KC##yqT>=mDpta1R;dWt!I6NKenf? zN+5B#&Xga~;Ic86_AA*xH!$^>FJUWi61yx11nS;@e_N>e9`r}6^;eqmM}NJSR;7~A z7=nAW(mRti*;vEK5=adq&86Jsrk2>JptyEr*B~-AaOozt%tc8Ls$)G*_R(19J*Yy2 zt6wnJ0&9z7Q%ZE=IxvOfJni_Q&qPyRJNWC~Kr40aiq|T*xAG$a8NcTmeseA?nzuTB zcNwjhm*Z6UtIyg@pa*jYsp`sAetgb2dd#>g*?lI=a9@H!Xqb6-0}64`G((wo7$!7p zyUyCQpe(Z4fO=wx^SWR_?>MRw!p@5mF}us?05iwW^MoMC;66m7sC5+#LI0JcBv=B< zS^1r0E^n+G+|(CCG7V)Xu;0zgc8StZ7NFMy`Up*=H0i_v>ML@S5^xYa%|@wcXx&jn zd$qd2y@VHDOnQ-j)e1Bf6h%~j9|ZE!4Xo&P<#yLFakDUG{W^XRHG;0weG-oLX~n|F4a}WygND6@ zAK__v3WLh(n*cFE-k|5Ve@CyimJ}^_Zw?^p(oz@M*TqAJ#TM-AmGUj_7{R>f(m^i( zRE|w&AGiyF5sMM|6|da7tgqV}#5PYX73GlpvPK1e+L1;_oM(ET1BvrJx-n@nokycl z4k>BTj>Qr}2%O?u6o0oW|Scl42 z0EM2R0_)PzBcIUOsaPy>5eQ1)0jyUdKyLP8S_F$mXzRMM5VuIBtIqK<+OQxj;@Emw zh{upFLrqPNKXXL#^aBj`!uZ;UB`169wRpez7>sedr*oPur6v@@ECca*QohheR5;g$$l>kUb# z8Z|GARMj3A0{Vvw)Gajd+I!Alf-_6)%(Hw8rC)evP+8=~cKSkugG5p|@5<6w{rp4W z*auI4M1-Sk1br5xzSi~X@9`28{*ImMv9Ya^nz*~*$(kO73Z(nA@mp>AqriwIo_W$n za}VG=SbE*Wykw}TC{((={Z+T!Ph{eN4-Kl@ls zaka$K-t|g&gN;@{v*z=)LNPx?ePVIZxA}6M_1mnCByi=pPKwvyi#S;}{)xEjSYe@SkI1-*`5-Fifgv(94~S)&j8>t!uSNku&0Gn=;pz4CW1j*!YIEjnhxd zbdKcum1r};XV{3a5&7?5pQ^ekVSdDR59l(arh}pP0sb>X z$XxmQOA;s|LT}8hi>2`+Hyq?Kv>Z*dBUm%uI)|_QbSLfZUUA|QSVJ5#!UEPH-B9zb z=dN?%^;#Q-rLik>^?EV#LyB_xvrX?=NZ5_l@r$Hn^`}UO<&EJqisOVtC#2oNwIc5Q zQ2VHT-H3}$Tax~xppGRIQ?iQZD8(};yH zSaor|#FVYLJzIKGqa6p+E&Uc=FHq*d5??N(<_7-0@SVL-^F^<4^Ahs6E>q)gyJe%o zp-@FqZjqyg!bWr?%RT*`f}cIJ%jm-2?Jl+5{%eskA>|!98^E*DkDDSXe<+&C%di{O z>Lp#mQ(uvz6oNxVQlBPA+zx|g96^m>bzOUgoCn@8$T|4qmY-59UC7eZsHL5_J5xe)|K z!A37vky03%V?@Hx&`{RIM4&Dir3vVPB`@JDN4SOL7#L)&gBchU8Q51zlgnv5OAs(B zbI5!1^v-=Su5YI=aHly)y$c_Oiu6pZoe6m9=(_#U5W^zpr|Z_(TKji}5jABImag-$ zRs^<&?#YjB(FQnk2)&{d3Z7_p{%|q1w+>x!3KEmlIfgUpuE$=Me zjF9gQLLtMJ`P0|ks6RC%!%+?aF$OyF7}nh!54EKZqkVr~m}S^7NY~2gQ?dGDFS;NM z*TmS)5wEj$dH994o+l*SAU))7`umkrb`&|%__I`4-;aRk)AzCg_N$FUzf{io)@I(W zB#06(pguN@$I(sF`ax2vfB&}w{2x6MZ_*){27K^eb{?OG_LWT6F_Sb@{Hjbefnt%5 z9V8)n?)0zCo?<$bbJtc27g+%JKg{L7ae1<~v8=t8ofL+*fS-RAxLqms3Ig&Z36&g} zsH+1t4zjWYgd(2=JtDO!c%?)i>sD(WF9rt{Nb1i=BRrM^&(}NmR>DcJXGO6VZ~x&1 zP0w(~ryrIVtD7ASPug3u1sn+Lm`IKSk3==U6E=k5gdmh`WQf_}30;@1(2)EP+r=02 z`lL=uhT4IOtlcT}ZX~kpO`=jv!}p>1*dIso38vY%s6LvgB_5~zy(T=kL{rE{)8kN3 zC*y2VDngk;TY+?*9cC4YiJw zU0nOb&@T7JSOZH0F2ywERW=)L@I6S?DmoU_z1&_aEHS&R((AZ8HWBN@jZdlqjNwe` zO(|cG5}G%(uQ7g%4LHSWSzVilHY~I~{T5pA}DN)yMf15{t+N-?IIkm7l<**lYJ|Q?en& zKLW=)c26uTA5GzygmB{DY9fl=!AP`ZC(I&9<4p@-F8s>@RW^S_=5wF*pE&cAGZjV zN7*d=x@ZA(=>T_Onuhz!=N(3dfIzC)!qfxvto>^SYt~mAdUBjxmdp0)I)nBt4_+Ac zL3m>mRpNV4(@MYfV&!-X5zJ07K9ss$>t)!!7$v42_rjZH*g6I;Ib3!i+ z4on9GF~aJ*JuRNlYO|%1q-r=wM7hx({g3~cC;z>2Z+ms>R!d6nMfmV!<6AU1sa&$R z-lXnvb+-vRXNtjcA*^K%jm;Z_o~L=ohWZ^J+Py}wM4}A`wNmv&k=N#g4ndCRtHT7t0bK5AFWynKfrKo%`XMD6h54oTst=F+{IJcajt1XK!sl~f+!`|GB3IL-7Y@n zh0gY>a2Py(wh{QICMHh5*r((>7(i5yn@Jv$No1_)Bh@56EJBhoU9T_<=~f>f=E_M$ zSw4|cwPP*v7O3f*|c|u^5%RGh!C7!7TNSL7~6)eBz-*@+^CKR)svV=VT( z1&q<)Bj4qE#eKsF>^*R-*KOVDNKt%dYZA<5IOVZ3Tt{BJtg;w*7%Ehm`AMynz~fG5 zEWjVg12zw?6Smg%@CA{IBF5vnoe&21Y(6sTi&awYx#y>|dmj^%eSIUU9D41UCag^F z5{%uXi;A2G#tCJLv=&-J<{R}>IQqCiA*o|4`$U@B6r*bYg2SwFP}u&e+Qd4L*Y*I} zrav#|qGGfQ9CX{lQKcr6pkwtSo2id60ig_r3wxjOqmqIuhhI}JmtJOYwZ0~8-#*=i0Q6!626-!BqW8bW_VxIw6bj5+g^s|^8od9rdtB-SR8{>oYeJo-0Ee= zx-Gy%>lx8s9JD^u`29Qvs6Pa5XYJ;zR>CIrB-Ri@p%p=gvO#6A8yh&si|Q z0o&y+>r*_nKIHkqXjmJx0(E<4c*x(jYHvYeCNdZY{?F5KBnbGkvz5}NSW-~PJT!r1pZ{_C9%J%|Eunj+@?OCS40Ug zh9Q7wU>q&Y4}G#YTQD3uT!bvNT5YPaPhW^Y*@TE}YLqV06oiGBru1dX-1Z4l{X+pW zgK504EC}yzLS)#cR6Mi2@QC8AXjR%275k8PUEsR{j@Trc$4^wBsTQH3F8=V!*G`!qZ;2=aEy!8M70iJUCKf}Z%P*Z3)xcd3kvvUN0d zxLw)_?^)MhKMJGWTQz;Keb9#aGzNa>7CD^+U`s{34b+stZ`3>4lT8qRN_}ZfIy7)|OVEXEk zl|;>#34nk9z&s)$`FAe*9X4z+yid(+L!|@;AC6m%sp&z8#AsjNUEQ8+yKOFzWAH*> z2yqxCZIxLEV+>F6a$Bqz1j~ok>VuMLZwlqBCOS@b+l^?~ka@;ddD1!}mkNNlRh{tM z5Qf~j)0RfyiSjU&TXBwqgcqLCtJ@lCR$}XH@8Esv58v0$(caWJW^E1q$x*}hVS3!n|xY+wC z%}ul7icRH4ygGMgTx>|zY*s7jn2cU^>XG51^QSmhSoL8uDqqL)4U8u;QZzO3rp}~; z!b_8gVK87ec52uc!eU*Q_D1Ys1H1TQz`OJ|$P7P|Zd;$WZ6_F>m|xaqc2YT``>^BT zaMe>uy(34w2=aZcfM=q)Au&TTxhm_kL9sji2W?lNIMI<#_fDz9n6EC+VQ*lBYK4w6kaTjUj9W@`lSq&9pEQgC6WBR|!Pg`&yv^iJ88np^Vmhr@=gjOs}M| z164t+fNpNHU&{{Dr(`*nAq)RU$zPR9oM_&4G)o05@y439iMDYIaUX(+RN-rBDcQ?6~K^^<(n_s}AE>zy+o_V*J_SEKoL?qd=Gc7MR zC|>@%g5?Kz)=H=l;vPHGLIy&Bk?G6tmNK0soZvo~aSV?A? zZEQ=F!LbB@r4J+Wi?*uJ8!a^m4h zha++`^Lp{7*Xv3_QC+&a;bA6xUs^<;R(cxId1xNIQ&J=RGtt=mJh>yVTw6|Va0BRV zr8~~RjR23;xS zSN*jO5GzQ7gQ?N6G;oM|yvBFT@41B_gy`tCpYCG@Nb6CWJJJfNeY2 zM%MTjas!ZVGI&4F)oHssbWEnxRo>tRU}|t3p+J_V^hvDL*%eWH?Tg@lEl*K0E}ue4mEd$l*-FZ zH_N>q)_b(eufbt$yg#>IRGVZe^gG{`%qeRAvvp&%d#llVCrI#phq^nBa)JXlqCCK7 z9=|k?py7Uwc(mvamtMCl1ReL^yDu|1R`pcOswi1bY|eGQ9N2$BLSv8IHD_q+Y5GS$ z^&ePZ_sxatyRGftn+YTfDe~B?-~IcIBX7tXN43)9R2$=x%r~j)Z?5LKWc-I$`($E> zTKbi7@4PyKZoj)umsvpq%b2?1SYi&XsfP7crRQtmf29=hM>rv7;b?Bibv?{?N=qhY zdUS=~^v;!tu}Tq#r(1UtB*rF*ltn)HaCA?p0his^dqJpAmWR@h#v=~J#Y`51P0F4s zf9_4TY_Z!MCE4337I_Ox$w?l9QHcTly4=}@D@gUg1jE9WA?pYEPmASn$U44f;l@KO zrTA&%Y$ls-@3j~41VPFU^>WB8NT~=Np77M9DbnA6M^4Xe7QrATNh&ZM6_pw1cdVgy z9OThx-K4EzoFGUm(U@~$xaH_Vapsfhsoa^@mr3}s4t$J4Cvwc?k;*dS4~1x?2du4R zF)(9vnjzTV_s)7(B<^)~Hi$zu+@;9X9Ck0|^;R-Anq6fgPa>IUdS{O;#zVbzHIngo zhw^6>hr+XnF@d5BqprohCu8#JnG;5zExtN=GvSVk@(PXFqXsLAaJCU!9LZ;b360n3 zNG@eFz2on1m`&L+TQ5PJ?M^YAXsNvLJ!$jv!HW;jam7x5OtD4p@@lQN@N~wpewsfY z@&|4mk{PSErIizCNZy#7?c3wgnvOEnBK_sXQN6HKfL{$JaPkPM5=C#%IYgNd+BLfb ztGp=V+caD)j*S zJm97bk4mrfNHFa7N)E_`D8*W$zTt`9JnB(@QAk)fD{j2&ekCQs9A9N+HAtcw0HM1~ zyG>^|69Jl4mCg|0tRI4#7|iezWw6Wmd+!g$H<_7YHutm9SY=K3u#9r5TgRedm!~nH zrI~%XGvw~1^`2jcpB&^%cQTB3q!K!z!BR|uGp-Mv@$#`!>b%ktZBn&(NlcjPIf_pNiIE=;ukMFFe$D#`3j zMy;_*)jfhKKchd|`Vuk||5{PYgtwPwKpBY^pjeAROb~jWvzGA>1?ik6%l1iN^@-10 zDOSdw2@eJ6`?;2_3D0Rt0pXCMXRN(VzceD=4n@E)YK>RxF&>@)I|EUpBQmHNhAF-6 zJ*CW&6=utal5S?H#X}Q&k9*=`sH1l(VcSSx>5C%g*QwH;TqEb~3sT$*$Z=Aws|izgVGFYc;ckRR{k~_j#-J zTGPB7Q({|fsRVWaN)xUIdIj12xgueYMrD>~Cq>Eyov&93m7M4pX%E(DyD*96y1K8*RKT$$N7>OaE zU-i0S%UDlT+skIinjPNTE;l;+uJ90!Qb?0Z?-0Pyxm?qUEeVSD%t3Emz7k1amhxt9i+2Q+8eP@tSqw2x+^LGx&pZI>1ERfdo%J5T^ldLQfiGi`Ejy_o2d& zpl;2bCDPQrr-l#_&GL23C(U9DKbd*vEhS+%q;#ApBy@`IjTWTL5?@54Hka}3aoeIM zQ509G&mkfbeFc_k1I6L%Nv?#RdN#;AyBU6|_O(V1US7EyWv;lGbU6)bc}^Qbp>jYW zVzPXs^UP6CQ*!e~*x)>!0|`3KQcLpX6OkbB8z+^)vIl<0-!VhHxM zB$z^K``?M)P!ip+w2amcSu$8_$hKsp2DT(@?_ipR)wE&hSxwznGl4NAkd>^Ogwx5~ zhjIllx7IrKb*tdO(ZM%oqE}O#>U8J3o0KHH%`^u~|4<}Kmo7%{?ID#m06GkO&+3#6kyM zcbfEh(Y9W)!D1nkHoe?z)n{s$hXS5h$-_)!gLPin+G-?RVAH_n@bz#?m5&x(m+#Ld~46)lbL z2*a+AcMd40P?W&(sD)XlSBoiikxAib=kj73k`~}~&%A@l^Clr)Po}@T*Sxz|-f<0_ zT-LT2TBrRWIL%F95?dGgSo(bhgc)#bT~E8b+<-g_tcl=G&NS3YRChG8*dOy#<(O|MAwiNDTr_W$6 z%$5A;Xe8-msW%Vw3n=r&|BkJlW*DbpwH3Bi4juULnETL{X{VIVDst#GgdX+M_`0Fm zDZR|!uDAR~PS6EEtE}wCEt;JQE2q4zX#)s=-iRfo1y>L+2!F_voZF7RWQCi4LuObt z4#{pErS|)J)2dgJK6f;t(rgn7J4wO}v|1wH7S(>0LYXeBgk~A~wWgPdQ$6~xrFgRb z^C|NG-g|Y;iuvTTQ(Qnx?OoW5#kQlN*I^7Fb0RuUraMQd%0Jvb?vqpRo>S>J>zGgj z_hzYEtvlGlDaDRAK8|6GoRFN7Rp0dKwTW0e(0L(+REs|+@Nvt+p#A9#7CVzEJn(5)d(6*nb(daQjaq~X&Xs*u9xnl$XIr`=K)%YA# zb+sY$gyb=oWI{y`-$S9*;lloLEt{(xf2AamH2YmEcS|hjt`nS-;O!;eXHTfSD!p4{ z)qxhw&f}-DZNB0@TzrLe+>s1)4rC6V0Q(A8g^;F^xr8wm4$^f!HJy(f#aQv)!tZ^|;uU>9o$aVlZ*$|zw-;z*|JqQaiJ5~*+$FfR!&Gt zhMW7Ie4aHQI7(oKdpUy=y$6CkVA+DqVYy+mbQpcriQ%fZ#ZM5TC31ELl+ggFr`KMNs-+s`hw)ss5BoK}yEAFQLmRf+ibX+G9d3 z?^z5r@|#}Lk*dtZTmqD&^8MJNabIQzCJ1!TmL*%QOye>gzOeBCOCo3M5Yll8^*zZ* zc&_j3F+(f9r_w7woDSFmHFR!XF12PxQ3!5%L4qmGR)jhYq;d@ZL`?0a0rn0?`g_X}?J2|wW; zfu`Vq&dMz8+J2_DOZfxK(!TIO||&)Zv2W#nQ$6q2m3J2j`2v}(j^HVVtGANJ8h-4*)J?K z0lIa3@J>a>qH%%uS^d|I^m1AUUj_JQt{okDfDh7&W_PyRMkl~1CeFLoWFp&?!o)3% zBPdI#NAYvlldZ+w_CsvVDGDHivIWasBVh(hT#Ku@0v81MhSvjt z#>>K3$yr>2RuU)qTRjZbD*=tK;lg4qKS2JY$zE}6IfO2%&}y*5fFW8s;%j#nY7sI! zJ6-+UWqeNGB+TPJh5@6=_gJIkI%r3E7Nj-(d-7s1A2!pMxW|y!Z1S1i#@^vk zhU2ujpbpNq&~CAv2OW>l53geJ5H1fC%PVhlQ$l+u*^YRQPAd5dx(gTE!<#kCcIi5x zmc~U|qqa5rEnU3*&#y6v^u}B+R=4@CGem&DlBm$^2{ zZ2O+gA&{W^v*!gFZpkcnI$h6j zvx$aZcf14ve_YP-HI>`Q18z6^C_i@1%}&uts}2d_9=7tB)oebq@}6=dDDYuV^l{ep zQ^`UI z5$_+3abj$4Jtr?|^%snQ8v*|AmPv^KE5$mg?n8ku#}6+opNUkiS2+m;M^$#D)bUI% zA9SJ1W7&2wp$9t65OpgB!mzkc%a3dA|W_M zg1dW9e(#)j=J%d?&NK78=Y9S=>yKn+Wo2^DTDj%A?(g?=X+4cnaOkkvSUH}`QpX-4 zj2ca8icl}SL@P7H>ot_eDXNWAZWD!@Cct@(PSf1yAJ^Px;0&>55?SZGCf)O&s8_n! z$a~Ke&&89WgOB=_0r2F|5AysH~axYx=WN>z4D0KA#@C1DW^P>M88wV0qr3X-o9X51H`#xbJ*mO$WnZ_1AVwX^j?{h%Le!FB%eZ6mi$F3B{wexJ?%LIL@ zRo9Qd1iRRgVa`+imc}!XEr`wMuGZI>+~hQ} zC5*Vp;Y19!3)AxWi(lvVV{LS_X`gB;8SMFiu)~(19=8y$j#w)H&0D7iM1PmC$JE#h z9=pyIq~!=o$)>EeBGYXYxk-!h_ez`rGibuZA?%%CKE{M|I0`eY&)&N@$=T>XsGxwIKb zL(p)`q^`cS`dCr9@1s#A`_sH^-2)3&_>d?j4mYlOhZ=-9t410+j)~q?H9cIjQ8{0; zGie)KzRK|-K3O+ApcG>BFTWYzX7+cyc_nD^!6DhWMi>HQKI=u$&54H-E}{I_A*s{IZNcnkxLS8gwSocT z>U>=@|5TZE$Nkz7AJCkTo~s?r61}!Ei%m@N>KlP!T;^wkDn8w$Y5nxbb1rA|>XN4c zYiC3r;3r(5oVt^O0Z)DtNy&})F@EaOYy49K<9wj8I*ruhT0Z`es%p0rD7~C;*qkcc z+nko4^#HtYaOzwS3W!N5)?Cc8oYdZpKJo=N2GA}(t!WiMQ|*?;3|ZpP4B3)p<#r*} zVn9ZP(%juDg9?h2fHggESw+cqB67)ohH`SINZ8x3S{GjDzer-r-)w&n-Pt~bHMuXN z{~kZ&;xE!|3u1b85*uR1titmS+-y3e!mdX=v1aVUJ9o&7uIS+v;`Qq8vo%7^Ckn>7 zlQ?s$@3olKs}x^9gBiN$*Dy>OK)Xy}Y+_eEAs zD)D&&^m*Iw_HVo`saM^{+p72kZc={`(!?pd$GF$>eCar?tsRk_eDRwFAx=_yrgv zixQ;_N@I#m!|hVFW%@9=MS`7)@@UMyp`WB_PJhcQtU1Q-m3XaHqw^_rvSy^w#!T2( zICnCj2D88G&NH*HN0G85s}mtD9Q_{$%Ks?sX3ct(A)QV~L5U^Sax-$gt=veAPKZRD1jr>a!{PWXKmv-F^6i_Hp2v5oTG z!N}5&bvzFsh>!EdfVr8gO}DVTSe$q>X4`c7SFW!6i}k^E7V4Qm5+*G!#Z~$yNPNtx z{x@Got`(IiQsNn-sO%89irb*$f!CI}S1Kya=iD~y!{OS?(q~smCF+okNm>hNp^%hV z_erqBjlDCBp1CwwbMR!LTh9fcPHmPNQEO=3no1eD6_@c-eZ(>MA?r*kr(?H~s2OX6 z_WM!#fspryI?mhbr2Lsq8Cy&jp|A8O%*IuOF}STA-$8>9>q+C+a){tyIgE1`7%7sM zjvXIOoi>K6*KYF#Y)hCN<7Tw5M$sb~=gdmpoTsd%^i-j)9UnMsTrXPiV3NKS&q;=< zf)V{ZTFY$xpYRW(9Z8=~Wwxq@2ktawH-3_P*=01*8{yFD zY9tjqSi@FncZ6cN8e_vGHpV=(QNL&zk=w?S(+hFK1+^O5u-94obF6i4klFa1`1ll@ z85JXZ>co7{gk&b13_SDc72b$VH2!3)T8cW+V_4#8De zSCg3T8;K3eUDHf+^ejLa5{!Y2Jwa~3yl0Wk=`}{Fh6EK^MM@R`4*r4Ltk5k#UeR)K z6W@7VkdO@>!1L92+Rj(T zYV;zW-x*7brMpX=Kf3*@v?!-Ws`IYv}CxADcK(o(7qY6n}%jMmQ){2448O4_V` zu8=lsd??SVbzDO!e3*-FKu-^EIkZi}zxD8lY@A%`C`I^XH`jdoF*x-LQpatmXp5Wk zV9X6|82-=K@KXJkrU-=v;T!AeL)x_biY;{IQj=MQMdF?mW^bz6jNi#7*l_*m)F#!~ zxl6C24!9(^8)mnd;}y6 z0r5fALX!Mb20*r;_g%!~5{70B1X?JtX>D=Rj9TBE+zYMoag=XnZ!Af45W9>XK!?0T zi)9(HcWX}ft+35g-XDm~pwt8i#;!JekGRV1OB@%=0eW;uaX5&YpV8ZO_Q^OA)&bVl zqSeV(BHRcy8&?>LH-WoAP7F>Ntc6MLF&wlNl8A}KmnY|g7@aD-(0d5qmXuOuNm)~T zv=OU$UJ5`-Y_X(Gz*lSXU0`@iW}Hok>V_=Hw7O%LyYOCZzL$m){?18s_xmu9fSoyT zH+IrSCY~N--rFDolGZDq+7MXXtU*lSf)y@6hxcI@v70y2xy_c{{I}ANqi1}!oi`o6 zubcd3$X?Dk!cF7l?HFOavvTwt6(#FLH!Hfi03DJ#&7WW-<{F6d$#ftaLGIc@1S8SURh#DboM>khw(vS)U>_J0#)c79mg zyOhThS|+f?_^qH#O^DF4KbDoe8IrigO*kK?0DcONzK@QFqb-z&b^D@{sGrn%MI&%J zlKV>D$!eOE?`RtC^%K5BBJTn-M5dUDGOgdI{#ZJ|+?@Hkz}^p+3F{ znFi`qZNKlmGc%Kp32WvvZ3b-iwEO!{t_~3#0}YB`Rw^~~jnd^nE$9L>eG@jk97rkR zKM0>$pfdOAlPKneK`ix(*8`pc4DdovuzR~U;`}i_uW0`BhxQ+TO3SL{y1npa<^|$M z#Tw~--+XP+oUp)HM&aXJ`ROAr$7++a(L`)BhEdS5G;2azkg!cZXt|K zB|933>C$A}5oJwNYL5vy=@-vKQ}2dYtN{@3;%gO+O^psL!_Y()vd|CIf zjFRui%8bQ3(RWmO10puus!|i+ffwC@cIbf&N3X=ae%M!!Wy=Af@$ z;zXRl)sJsdu^qphs!QZz)pLWJpFq`5SwIPf8h(y@LE~+Wfc@P0@Ld9vI z*Xxq48KLxqx_P#vLp!s}&gd|RVuL%G>1XGrVFUa7_ZTwCMj^>2_AOt$nsFp~6262Mb^jS#XqOssKgrQM1rik#kB$TUV^{ENJ9ddx4)#Z}-jFCM{sE}s({L-W61z8t8 zkAma0SC%j6Rh0wBvD+$#3B%-hk?69s?+?QohIL*axFRH)iYI$-@?3SjcO5h3;?VQA zC1*b0t74&&2#Nf(ms5f}HvEl=;zPWh-+AS%@DPDgZy;(Dc(H{jc;K1i#gs?W-FDj|3R}K9gZsLCW@)Yr?sJf* zm*mTizD|9!S8Qj_8$0Y<9Y+*JUuyJt+xh`W3T>xBD+G()Ns1^4z|?n+=ZH(cgbre<@K+Vi-fyDjXZV}M z#ot6@ZNG^|e-qtxh_3%6xU(+Lca44%?FnC4DR*`XYFawkmGFDmWHI;*Kh?LDlMvK` z?8dIhNgQ^E=Fy%X$j2P3kLv1zUq=&;mzGR~F; z*Vp47m{0}{WoU-tmHZfoS8^q-z^C8bX?%TlaSbn7leh&B0yV4^1XaJVa1{*;O>_4Z z*lEd7iu5beC;i1@&-FOgx|pBv0(KbP(@Gfg-hrg?>{w#a+esMn^~Q1I&IuF`L4w}c zzut>Ck_7a_`(dyYE|d|p@<$Hh39Ahvqwfd3E?wl*QnQSUq9Q?yjv(y3EK!USgRf*m zC&23`P)x`#=lu8bBH~-?5qI4e%pKRd5W~l!tEt@OBoMpd>)ine8Dl5vwYZFUQGVALNHNyIpr*4dfw0Bg|29 zI8ejXT5pARS;ooQA=L&DitFCUsB^Lxg`D#8NK%22gxRF?I}gh|!hg2RQB@w* znsxDKltr+{RsKHVHk~g?vxnU>JjvpiSxGvt;K(TAsJuEWv9C7A>j_uMJdq>;k!DVf1B+qxld3=x6PlO~Mmhag?=l;EAxcJq z>0gxL*?XM{8{H@?mOjoFt}#e@P8(}`K%J08zxqD7$a~u)hm1N!QAO$qb`Uj(aQA9P zV;VZf-eOdlLSr&Vsh@CC4Kv#=6wy7OKFV#24>bAbt4E^@D7KttLC90=>ko|?6Qgu7 zojG%g*Oytw+`B!e8V*6OKIMBrf9|73IT_LIw@JO`keHrAS2gFDVkH3HS)rYicz*l> z(c8Z*<;z}a5FT$|Erg<8?&Gc2M-XS{akuwYuu^|n;tZ8J$~F`+ef<2NKbLZ$7|dKA zbv++fdp|Ek!>^pb;|Z_5ETFh9#pKoWw~Q8#Fc-N>OyFk<39flL-%5?JG7wX?+{bPv zZj9czur8`1#7f0gDw_J?Oy=Qa_)H%vSwdqvKw+Pve`IcU$ zPu?AT_)YX+f;&c(FwA)^2JPQ%CC69Bgwndx%U^Yz{Zab`d5Tr#pj zignljO>}X7Rg=McI61yNztFbps&Lk$NE!Gm=CW8s;Hq-*uEen~c$s)hw>os(`Zp1& zt@^8&4W6L?cro;U=Im32wzikEguNQuJN)1?6P$cmnsFP-@qH+kw=w->f9q4hUA9kL zhquPHx7bBKIN+A%bpM=PC9442XZ)`g{6Q}J(Xr6#kc#8U zhwDNbq&4($Ha3Cd=?1j6wE^qLmqxSsv`%1&68xvA3C&J_(MDz%^170^G>2--a=zN= z^BN~(8U9xiqm${B(Ag1o{%iM#BGAlPp)jrVsUQ>p)t;!WJX&2rO*=$IVDjdC1`Xv@ zI-I*riy$a+?$#oJorbTQD48z6+3>U3qwM;W80gw@zqRh_MQz7Vdmd^wKc^nGHz9?T z7?Vv}8JCTnIe)(ZlIYLT_D%DxzloA7ABB>J)_)J?EOmyn_+(D<)OAp)GTP9xxQrh6 zWYG0a7R9cQV{(Spk9&p^yI2}o6D293yI{dxFgmo@OB7(*=IO7$$Sk~JJqsYjhNiyG z4BpFo6~h~=#Qk$Vb>20?v}K#~j2cz)>0c{%w2nhN)TraDY7$ef$tmdoa#SOz{XHK2 zvhUw(BV#hEI|c=anMnNP$x|yFFs*$0r4lYNo|lkZe?#m5julEQ_U39$767S_ha#f) zYux6l-uF~b=u5f{L-P3xw)~9V+)71DIo&(Tde(mztZCT*ps$1V3FeRr1SwEW8sbB}0lwYs0`@UHo0bAJLeQ*(L4?AmF; zC!{0Vtsv&*m+_o)cyV=@@>a-WjMt@}aQ3|FW%AX{$x2>PubWPEfF@6V&wW0D+YX)B!3b` zLk8G*#dD?PVvwdG8)Lqt)WEQ#?<|#8R;W#*4Idd9%2)d5Li{f&+HpQ$$<;Ncgjdv2 zE2Y1QEh1C$27!$%jn8=p4qrq#P9u~#kX@Zs2$ zu@%sLd+s--X?j_V9b^jzsxiEg-2rEeqT!Irlp(fc*P0jqjmBvqc@?Vz*z}NRDyKx;^Rcqf&TQWy2IUKpi9d z{qN2_z*6O)ODaIZsy_(GZ#ki;W4RxgVimh#BpHpXQ;Y3H!2@qbC268hmOd;vaCqr{?*A4uwUKt=c6%&p zsKm*a1&hLJmi8Uq?<3c(DGedJt1qSs17H|=s_ z0r(KJ1E*M$mL@bbDl^VMnamb;&Pk>=qWW&Ye8I>Pr_1nF5f=jRC$Jw0`sR`3^Se); zIb6deFTMD`KnKU>631~(HjwxJdrINURI(?J89&&vEX-PDfoSbYRMQbS!2;KW=haau ztQm%O-NNy5+&Gp4gw=j%{hT7Tu6COgtA?0o&+wCqG*QW%svPmAhKsWl#9$Uaa2`8ZS&iPRh{L7+2dno@EzD$z0b7-`bC!I6vMTxz;}k9V3j7 zI*t56?`LkxH^m3U;M;C*6&J}CMAXqGo=Lb=TFEV?KxuN!vzJ-tF6@gT#9iZJybAu} ziE_j5CT?|-8ycAZH2{-f^3-dsLjDK>($yk6%k`DIo@@y;JIlAn}#nd1Kz`ove;v=7!Srp>zWtF6p|L zM!Kck(8ZZC%ebkL%kAxl;pl^fU>I1;R64q$8hnT^Y)&xi=SOV|)PyKqr=j6`0-wig z+Mu$fGuwgG49AD5>otXPmUj!%M&Vk|n8MY&{?)Gk>Txdv80-U@O>0W6#>Hz_)B`(L zxbeVsf^PSL0Zy2`)GVk#Tn%BmLajXTN>46v%hv^fTC#{u8;4X zh9cB=3{=!aDtDcEvJtj46Zj(y)+`2H^qA@z3Td$OaOo?hXr9iVNPY3Oz@z9xvN-p^ zQpdJ_L0$*POl9zVbo=e`IA{6{!b>s}@?i{I{juxEn}N~*9-NT2(ed_VF5G3|8<-_9y9@;RRpn${n$U&DM$(uOl zQu^WTr4iU6-bxw!w7W4L6*lYBtfOkg3OSw{tfLywTI($5R$z=4n@Z|nZ1}hetT^nU zYuiR|H;|NX#ucT$s!`!G<&B``Ar2a`ug5n|AltD!p}hOvhA#=QrC*6%CNlN1^R@Tp zrF^fyi9vAhU8Vrv_L9}=-&F5RaOWz-a%R8ow&e18l!tt$)l)WRNv`VTSvXK9q9862jnj@ zNNko}#Lw;YVu3;zyBe$(MspiBSd>JXWE*99Pp!?m^8r$O4G9zAb%pwa(Tva(Ya5$_ zCP>A+iLT@YGQ?qbLh01XihI>L7jj~7a&y$vV*oA99$J3L$BEWPrxaGQ(X>@J5{GS-ash^T>O`wuBuuQ%TZqmPVy((o(-i|dId-D zPP&t(1wY+6*)E#cEjp!3$)L!h7^n97+(;IZUU^KZYxSc-stdb&t~_6{# zcgiu{qap+ATQV*Mq>MOYTBq+P>nQE6)XXia5;V*L%nzwcP!Z7M25O;#~)7qx(K?fceTQc=AGZ$NZ4{e z)uul!5I7IJX$k&2^pFa9RShA;X{6scJJwH|oqrQ?RS+1;%!+aPp)ij{1X*Yc3)QrJ za+B#!J#9xp5w`k=s6)E6U9d$Xp0mijUzPCzepvl8hwpAsQIv2tn`Uw@$B!UI3}F~q z5;PtZrNY#rXs(R=T@$w1An4M^;9g*JGlDErLXO{cTnPX9v5g|sz+Ya&cw|06 z=(!@E^*fO-`^olQfw|h{mq|j_B=##IgF==^2=_zs>U7%mQ`5#4%e#}VOgryZV++Oq zm)JG!|2=k%31)Db+!G091u9uR@FPP5Dd1wqkCWJDy54s@sC=3#yhcIt0^Y3ggrR|@ z(b=oSmX_VaboH|6g%#8Bcy=aAj~<+>9mBrs#k$&KKiOHazk(j1_ln1uLXE_Sl>8o@ z9dq4qPursBVFi*@s=@%?#_Uo)SD2hWV-JRGTU$}dk}Qyt;s^#bDhf99opttvF4)CI zP?+9bn<<4pU5yAZL3OB0YTPYnN6wlu6Uf*X`U{6Uhx~(=S&cOISa9A~mHHVj7n-L@ zD;Jne5*+Bj)u7U5Cq)V37A0=9(% z_`R&kT|)pRJ->6&qqZC)qrx>wit$`sK0%}Hg8DB?>p2Q1kkAVLPnYQlx0f08VQZej z+D+kCAjHL!jIfLUO-06fEuoKG)1O?eTz7EDayo}*K-~8qFdw+SE32`(TIV|-CS=&k z)t+qBAEqAG{3fc9x29KBLDIDi4o$S}ivK3sdH{2|`{&m1RQ@+nTqs;JafH!Tj&FYZ zZgN82#rv&M>!Y?z{dWYAEuqtIIRvFGylgF|=e!joJvb97plSVF|NXx@$^Tcb|Nm;y zBBIL~7^dH4w>DV@ zZ@F~ev1o>c3CU=S=znSOCPK2#S!(zkX@}P8cpNu{9_-|LphA)Ki4$%Q3ABgwXBRGI zKF(k`t!Tg4F+?$daH*1owzE?<)zb`&SJRqGvots1YSP;?1jat9(G=kY+Jf3ntqZBH zs;IEJf!KiQ>nxp7SDv6_hnYg}2m7;E?c$JU3r#*X0er=572b@uEw3Ma$go8lh@m?k zCNxovyGkyKOwURoP`vhzW^WD9vBAziY?N+=9(|M-4lANlG0bZn3b`98w;kh|8PPdL z=hy2qW~mh?I1JcXuvCUpzbz*|OyBmNs?5=yHaQ~0?VwwPTVI_GPQvCWUWU=9pcWr! z$SSLJiAGyMwEI&=%aVDAVQ15*7sHB<#fC=S*8+YhS_Aq54M zGyKnnKhL-%I4nM!k>Z~j+yB_iHBrDs1KOzwFJ2A%I<0$LPr}IC1kPU8M5WFf34cXX`6oK_bs=125|wyDVLQW0whELGT}Ggn?PpYd3rtr5JBJ~ zYBE#SQc(AinIW>QwXAGE;IXKs&i0+awVmfkM%G=5?tGBHSdJ`)+_zaHre8u(tou5^eIKdnnGUK>18^e5EAV?1$Y+ zw7A$%5~YIZ+p(2uo&=038Xkx2_}0+B@9i~Q=iJ1px?u~J8{i}$Ma-jEW!Z9C+xAJk z-2K%NSMs_$5_^0TX#C73lK*N;j?k|Wzr>d79Ywm0E}l$uK`{>ylYe~L)lG<*%3+7KedISEldBe=J${-aYHPy7$SNG*{?V2R>aE9(Gq8)y4sbIz z|Do71}~EFw*g(no8u*;2PywteBR z_EN2!b~!vBol>j) zhc#j^CtpbAW&Cqf-F{y}_{0q?B zKKQP*k1&lW=z@{npfaC_rdcgM9N$4bB(6@&)mBFCkt}`UYz1%JCR0Db7brh@4ZAjf z>D?I+HTp%c)$D>tF(X=a<(EbuTF8vjT^%+%n-=d4lkkW;Ls1n1*~vG zr_0StjTfB^!iCaJj!%>(mzN!0_C;1}^uIA;J!YlpB=DQOZrVV&-$ajpIKGrqZuDAD z1|!3RT;|LR=gA!)xJ-v6KKC@GYKR)2wf`tH_k$cWH3G24Vx|%_pp1p{rg=?2)b|?H z^T5}DxR+i^p?q>?osU`L194?I7Oe1YUT=&`MT*krt%@ZKe{6Kg*RRMQ;Qq(lkPwV{ zY*_yIkxk0TuVPnD;+#qQ2@4IkgNLJ(9ZQu26GTa8ugmj+*s;PKs9O1wZKknTqdUJc zYx+&+VI6|Yv}`{NuES%&?vnN5%K|(2OB(V={_;8i9vjHFzDS>7BKLOCE_vfzv>)n9 zvruDfQ&5W5pr@qgQ+b76?vMQTUzx-I=e75{o7lXMx}o2S`yuuBl6}uczUt5&F=?96yngs!u9R-ZsSm#@HjJ zLgUaB0MlVB)3u3~b%^#x%|Vo)U8lAwm;p)^fgs-{P5Ym1Wn8DX2;|ecmOc$-jCzAlF~@55YB>Oz z_=MJPLV+7qo%p6cjaIt%FLm!nV{1N{EHU-ePjjHUE69#n-=~@w$B9kubq|0E)vkK2 zYGuDQP?YvTV6}*f)ES8!OY13c(uG^dvG0Yyx7t-4NshL;{p3fJ=11vsu_GaEHjY>N zed?GoTfnd-z17P-E0Y#9ZLoQFor>j}B>T4Tc+b2-g&+oP&OyCs8cjBx(^I9S#Jn@) z(OFrPJ4xX(e?K+82A3*bZVGlvBbMc9OlL?KkD`gKf>=J4QM^-Xezy?_z&nIBSVpm+ zq-Ul?a}qSn$I)8N9{Hw$k_*Zh)K8$ZOMI zbHojy+O;a(57%eQ&iPGbj`0qlv{}|%QXKQNF7JmOIgkhp{ym1^;B}e7ul6n3&TWj` z4|#Pc%RYjy9h%&FKjyo+)cC;EAP^3`W)Ng|n5j!Z563a5mi0OcsY~@VRcnpNf`pO^Qf)d2dFoYUtMsYJx|Ha73>{NDecLQ7*?!Si@h_BWVsRhIyDZx8 zP0@8*i-`L(V!*jlXAT|Hc_&+xX(zcTBLj9ld?ebx*tw8^+mlTc)is4h|80_=SzGw%LZ^M`xY zg+}(SzOMi5k@=efU#lu#`n_&8V^~L_gh}b@dU8KT8VTt?Nn#)HePW02_F1!qVI;oq z&_MLL8h=?&A7{`tWIJGmOR$&}mbjYm z+V5axNYpN3eM~B6`&ygfKcN`kfF#M(ii$VGXTmE1l#9Gu*}k1E`JWzi2qtb=##x;* zHQur!ts3ac^pHc(t{RuxP^}LS?k05Fo-*qXe%(Z}UkE=@SS)&Y8^{v!!DoG+??lro z3w5utE3;FHu}}@;yt#yAhxPT-CH(%Fv{%S)qG95(gWp7_Pd6W)iI0a8>GB}U zLk(nCPH?$5oOX#!pJc*gu|XBpTg3M|jTODf3l`|uJHE2JeL~jy*l}|2jHEoqXQ;i- z;Bhf~F${B-NC{x-d&-NS`Isx_|C?wNkAN4`40SNyBWM@~ThjP?7~B#z{}~p;Fcb|b zBfZ4XO&2lxjWlOHdh`^kYbwOKSymm|qa^g8`Y<$)ZJ1-x)GN^9R9ByE%j}C4OMSGV zF+1kzM}iH*v5Q_h`^0&~%4mUR1VkJwp<~f~%~Owly0o8cT-#F6Qd6b-8FjX0CTb|D z$68*tQzd_gSp|sQd011DGqid|P zvjd89fRcyFM?>J$<%O3KFWhp2CW@^I|805!O(N(SFg?f^-e;Td{+PWtRa^=D#Tl=t zG8I$(QGby=GyYxlL_)tVx4M`zlhTf6^Fx##YB<%Fm6i?bD@3+$3bV5i1`qW+Njh)B zI;Aw~&7*ju%QHkNxMH$xF5o6euSb02sAsS`n`rPPP=n!g$0((oP5*}ozqeNxo101x zAy#BsV89v}=ryuO8*?Pmt|ZbH1QrrNmK*qJWp4CgAN?p(52|lwt&wcVz`#IBo3z*v zHjNac$xIPz69v|eV3egu8ZBZ21jYGp-I=+Hylww7@<04>pilq!Th!3!7d>K6GIW-@ z`thFWygq}iz*ia+(LL|B#l0ly-;9^)J@A|t%`#+Wc+(wSmNOElpQ2oFR2Fkus=lB+ z@!}&OcXvRD4X}lcP}|XAZCpxFps-+rS^<_2fF;V{-s0P<4~OrJz6L230i{j(vUa4O z#+LL>yUvs)mJ2nQj#^99X%Cuulu$e?B{DFvv^ZM>*rk$4Y_^d z;L}5SX=l%T?NQC)>{eTd^stWW4ycsg3=|Eifmm@~5{-+}Sf z*xIOfYzWJ?@mz7a!+`xvmkOKTUXkk&I(+iHxfDw8mOXy{r8?^M^Wj3I<$c!|Xdl z-?qg$Jo(6V{Sr0Nr^_|Ixz0n?k6}wI$41}mb(s39oh5>9AQ|5jUN>rF#vNqTE_?4k zmz5q^=k3v<<=e@n1A=5x9j3uy50lz$@wp}pQ%jW@^r!ST0Sr^y-#0nHg|>RGr*Kj~ z>2bais2rz`YYNN?N+oK3Y1?h*Y{y$ICd#nhj|OU@l)K?YDKy=s{0hhe@KYYP|GAd@ z?|A>;S3&g7Y*Aos%P5#Cr5uaC>O5(q`Q>f|(Q}P*oR!IoZPWbD%9iu)8a3aIa#zT3 zSrZ}`OHxxU_AubPu4!HBAb`Zi2XO=uR>etgYy-`CG#`i&7EufTE%M%#@c-a4pB0N_@U zqbAugOd@g8hd2n;advw)Zw}mkHk&%=$8cNvVVK>cVU(`FR^PnrFjmv$rmh)1sHi|! zHoq!Dr$sC*&dISqVe&`AEh!l7?)EL!(t+TEx@t4q9@h16cM!%k|EaGnk#Sbr#DR#o zR*g4h68a(OkZj9mQ3q6;u(#xtTBCAJo?xBw^-O22Q~P9XO?Y0O9r`fNTB-vu+5@Mj zO#VFe_-!}cPgT1V?`qxqc?0GHRDz;;vIenl_Mbh1_o!1c(6&!YFvR|kC;i9s96j(i z^@FJH^p$-^k!`3RXgj5boN__Jb5c%YYBIo`X=tm4UdLWF!Eild60J}R2oNQG^)O0o zhXbeAVT#1LiorI>%-W=^z;9b_f7bJ93|N*h04Aljy%oEQQ4;GgiBXH1iRBE@te9G5 zT*3@_ifVAiwk|n}OkKv4($ynjLBwN-cC)t-JbNJ0DlqD}#rKSsk(3^L?|mIK+Gb2N zEEFV6iLpqc+C)3YWiR;{8TG$q8$YH3DCx{D6nvG_bm@zAkCi8Di1n4HfNlxYtQ>m7 zR?2XfqoeGqTw|Y7;0kLa6&fO~27-dQc4KNh*MUWW3zc458o^ID?Y9lxX0R=@;=EeU zgKf`tT#h+Wti>s}3HWJx>D9oTS$ewe;|^1T{eC}$XGBkDIIgVCP-5{SEa$}eBIDZr zZX6tX1CV2mCsmW{{7vLo=f0G1fs|E~my#>EHC_o_emDwWcHB+7*4q3{bZ8Lrw=CN= z#cl3%TZGDT%PHH<##PLzEn#COl35uUl~-rAD_;7Ws7v>f=p<=J=Pc0Sj+Qz4cp~Yz za7zFS6~B8KOxMa0G96mGkVmLtr?Pr)Oa~=Dy_@d-c9Uaei zZKg-ma$M)?CEZM^oN^^#4XO)8}(KuQLk@>4^Fj5EohP;wI(#vGr)8)DnN3p}w0jS+kJae{QWdI-xU{Lc{vl%&N}oUcB; zV&}ij8247Sv=nhR3qwP#@5Hzz85+Q+lU@e#8nj%3D@$PvTd(tz)L!UuO?p&E6+}D3 z@*lay*iFANjUeW%-nmpycVS|xL9A9A*@1W_!x<(;snJww_L)XK_nir4v#BZuC{0H- zWKf-ZJrq%Wj$QyknrM)nkkOhd*F@#QrbB|Rd5aeUNYgEPG{6hBd*9hJAUsXabP`*s zutT>u?f2N`pEAvt5M9TEkCsf&d%s;)^r>zd1G3nr6%z&Ll=4|=)AT}WGu3)+$$Iev zVVs(ld`)=7=|U?rXZc5I${@MCv^)xGJulv1aN}S7MwyP*?8W!F;5hFiT?c*2-RYv% zsaLISe|@i+_6D67FiH$~&j7K)fnwZdmotL%A;r3bso>T=Ue6M(RJ$66>LRV`+RAG= zSs-ts;hja&KosMYcn7I!7GMX`Xu8}cAwggQNYM7uqL*I*`*u_8s0(#k6LosO@Sg0J zG`_3Vvvb)~&wR5r0^Ia&<_{PSZ;7mI4ZHNF^K zqMTXdV@?}Ap5#%NDat)U3veMggWQ08j?^3Nls*jddXj~r3@~D9t^o$7BhFhRES z!?7$NGUlnG!OdS4-m6bnL9~%-4SqvK%ML7TvutN#di-jM@S1pNyh9WJRO`p;p`1Ds z_MZU7?B=qZx7aF2pFDD~&*nPM+WD}>A{m)DQ}25F7`6!kEhf{4%X7TZTb3HA zbrUtoW`HGV!rw`$4AYhUf|1s~&Tbsoa}F)d4IRu|=N0eb7X{`rd(P^4))-W=N?Dea zDjS+go!Vt$s``sG8>`JZRHI@uO7{#og;Jxi6k>WJ74SCJ$N689US1N^=LB+(*bCAn z+}BNh5dK{5@~iHqeW43<=-b5)H^apNVm8{SR57g{@~A>BU6BZSSczJ>v3wf5WDp+6 z)H+nFW#cTkofG$avsnhiIfWVG&y}ITJj-g9nfjSE z*bm}D;4E9haRHgG=Rrck&rv?IxR@xLNio3~y)$vUuFSt&MqzB{*W_>i8dps}?5omC zYbKzKRPqNM#Gv$y3S=?xXABPfIW8e`DZXcK^-?5EED;~gwr3g0lzXSLVTGoVu*!=r z>)Cq8SI$G*NpfAyNdpepD5EB|3LVzsOcTbVRyBro$q)cQE`2@wUkjiA>XAy46l62j zoaCMM(M#il^GrnUgqPr$6TtWWR-w6>gGHhsbI12wrVf^Q6R9scsj)frLw^sljp<1> zxk$USa~pcHc9k0VxeBXWn3Xi0ji=4|UY+qs^B{j!UvdCxR0`p9t!bX8MfT=ht?SrM zRy#9FK%EfRs+wuRP}3Dp8SwJv%E5QAgb7Ogm{*@&CRZ6^{c_V9-LDY? zfvFWBQ5#s<*^sz>^3|79x$$h*m7BS`yy>QWdpBS%Bi3h7Nod-U#cSp9d*gJ;qb$9D%1*cwdc-3T>4q z+oy#Ys_JuBrZc^}H7%Z}4kdDmc4q>TQtz$DdrehOexyhdCl)K5E zs?rD;NmOYZ`M(SN0Sr#*8a;+O{9@;Lv9o|gFYLIzc38ylb3wq{4!_4V|EfTg3}dNw z;7Sry_o9FB1C&>bQW5d`A>xusOW<%v8;TjPK@H({P-RIeykGfSLanb#EEf*4C~Kckf-NMky4hc<}-aE)`rtkr12~Cj<*l zklj*T69_Japb3`X-r_-vhhW7WiaYzubKdv;-sg<-;~V3Q@%=dKPv#mcYh`7wIp@0X z>%Q;nTGG?Uf+&ra{sj*xE|KjBjpjn5t~kHInCLlUx%hW8^&Kxanuhw1C+_H}U5-2) zP~qE>PFdYD?ygU^8&VJuFvNHe4M?)SXfbWKSHVUxen4*%k`#QDfu@qlTs&*&*lV)q z6Z>}y=jDvQQ>-9!-%VnI9iDt0V2a@|ugo%j8a+N-9KJiJRj zwk<(1dAo+&>icpV`W00RVh`V?3(vdx%me~rf}~5|FYA}wJi$}5m0otTnlc$u4p+lZ zk4iq_`emWf!O=6GqgB&R&Z}9vz4K0sqVY`=d#76&6grmpvfV^Owh|-TZjv~HMTA$_ zvc#S<+?3G`6wbzm@~C!5bM!n>ELR0NQA^smp?V*P##bT3QL$hOG0!oJKshz&M+`?c zFzD+8wAVe}F9jO=|J)G&+P;+>6>~>67K>_I#%L;Y#?;ZP8!a0WalOxq%@Nu@4x|#K zIGQ864=GmnIzXP)i<(?m!C(XNS{vx4c6@VW^;46fA^CJV%g~=16XQU_5Gc1{RgPz^ za`mb2AwPZ$OX@5)CzATps$*Tf4XG2x#KAn`3Mq*)L3+T_7Nl<}Bk#G0Ys;@TVEdS@ z{f=+C^nLhd;AeqFy(YNyaN%7222zzX>^Br{Ts6;*RL1D3?Kc$@`QCIy#~GoyTahP{ z@fNkg6Z}B4%+sie3ee_a4R_5SDVBy5ctM9Gia1|D(Q0uqq~SS#>8^X+q%*FoRZ62A(rm(u=u#zU$4k2oG!O+Y9QnFh^p2S$Z4rrTQi8m zVwJNyys9F@V%>61snobgRvK;%LVg8%I_j=tcFf{+RbK)I;Aw}Qgr_GMUfJhk4@U&$ z6{n4+M0Li*La(dJ}T_gC2y+MRmBItP#Zj;)9nnk^n!Pi37nw~YWIAt^X_ zI|$O>dA*A99&POUW2-3|2k6L&{EGrhk(RD2elX<3{sGSC z94&0GfwmmiONmouph)?`8T_h;X(OD8UsdR#8D0IDkgmJtB47UOxJSR2RmZCH3@PcC zu^TuWA}#V>m(u#VxNO=(OXQsvCTajYwPGr`RJjzh(V~BN8)D4dq%LbNgzB*i5sL~_(jO`E5+J5!>l9*xCyY2f|0_#8Fp7t58ZPM;Ety8I; z;bMz%;`R!xJ6@y`Gm!VhvuK;id(SLamXjN_BL)l`o#OFqHXDLtJqo(KFN)N)GG$*! z4_a<2v0XP6Zk=riA70$kSFbg>4d&5KL=QlRRZWjyj%Lyfbgx7xx0b2W6D;AW(QuG0 zcgR)HUlBjc#(Qk`Xr}}x_o>7lgs7n;6Q5h+9zctz!_mH-C!NPtYqMi+%%f&Tg$UUR z;E@W^Z!9wFn+c>Q`KkSVMxT|UW7^2qs^&FWjW6dBxu48rY`}J0%k`0BJspN@f)Syt zYS|+8w!gG)rBC>BI2jI+99ccD~o ze*XPOfZSiO_p#K?)UHl{b~RTvJ~)(%n;6>vSz)Xc`&@wLs>DAPXwcmym+^M-dGy$i zc+-jm9aHv2jt{{DqMzUR2dvjdmv=yope~26g=bqasLS-MtKQ>e3G- z726Ocj3l!CM7Up1zfSuDejwG+w+WcFK2`!vzCZqP!WE%q)@jT1;CFY=5PC6{hre27 zb_~eaRaFW(=Vi-QpLOkPH>gYMN!hq8hHf!-z3`k)Q0S9hLAvT728Bc&Dg&9=2%yPk zi*+i5%}yFWh9VbMhz!vn4mc%cCzM+H3J<3TC}pII7ag8xW1UdloJCG0VJ>6-=r*yi&v zwq@*BU~0D@5|V3?UOOOWO7akSy}h_Q9x}r)R#4!XN7iM5g9H@T_{VV+Lw$*K^YHmp zNlK$*NiyUPW)1%#GiLjx-`?s=hmU3Ey#-hozi2C2Z5G#riLpX7mHfwB7(x9!K~VI& zQ;n~K6DZqGrWE&nef!6={zl)Ll)$^&wm4Z3UZHPccu55@s!q|EU%$U6D*4G!H0qNb zkA?L)V2$LodGdLCP^)KV@Gy(X&2^-tpEKlRk(;f}gucC5b88P|xgxWxZHCc9U|4nE zo*pYSYR-DbAX<~3$?786m&fbMB_b(lIZ$JCoCn)-k!lp;0i45K z#l6Q07fi_-PUGtTZc|xeH?K7XT#mA=EQtY>~V(3}VlGDb~cIA4kAVmuY({Ej^V;u)=g7m~eVdQ=c=&e(sU)5ACz}gpx61 zoSI%`b3})b{GgP>=Ver9=(Fplo)VdYk3LN;4me6oWOBl>>2Ur?V?mlAKCiM;vb zbDkYJytnj#driI+P@M@ZQ19#`bJTNT3`mt^EP3EzxL0J!q7$q(W(rZOTrT=lEpp7) zS`8&Z9T+JuWYoXd`IG6=7(Cl_Mn}t~mNguGTuOTlu)zKzbT!T}vv0pIuG)T5hL8GX zUVKjkHB3s`r%WZ4Tn~%)m?g{^0j}#>bawmLs~$v3-WkPeFcqcU39aibRf=W&-W(7K z=2qx1C=_%b6X9x27F3-=2n5*fRN)+qZl9Q2ez&Q*pz%CE00)UjHbta*8wclisXqY! z`n=yBt7y^PSy#A%1^ECU@+{a2MD#*amuia>$)e5%lITPY|DFjthVjb*C6)7Gm2p|4 zrtS$|A?8MxH-Bd>*-Jk=?0P9N+@=Ky5vrp^)5%(s8N-=Hy{ZcZW?s9`meE9p3>cSu zWGk6|QS^w+J@)P;@~iM8o#eWg2dH}YhN47qCcL+lSCi(=DM3#In^5gRvgWgDLggtr zR%SU(U`NC#3vYuQQpuXmIXQ`GpQiyYe|sA&kpSIGu~acuQ31}h6S(aH3X`s?aYVnH zNkj}JN0OSX?^^U@q6I%)TTu_K=M+k@kDm2BwHdQGbgfxosqzfl%gh`E?FWNyKvnlaK^AD7%!jp zhhmM!sCa<{q&Q$JKy8zFEJ;2*ZtZ3=0U#3uu;o;d$HD(pDrz#w8z(pjKRUU`tIJV_?XHC4ka{7iCR|pdtYMbV<)J&z>F}RK&W|nX zjoVjUlgiK3O5IWuh0l2LBXxh)VPb64%na#f$%=Sj@{WS;a!iW@bsRbY&D-Y1P{N$~IZFj9Ccvot)P#%HZgm^VeVoI}9h< z=eBQ4Ky;SqNiQ*{lbKjmd65NboPJhi@EY)j#x{hn1hJ%>GV;S-QSvXo@coU710u7>WYzpyKJBL zsCG}X3~xXUR3*T7TpGV3i)tLGUsS}5F-m#AK;bB?ng2;E~%Lo1|IO01SgE(q*pZ-8&Q1*Zz1q6Ri@=hW!RXorTT3 zLTNSunWsa3kaUC=nZ)y-#jOqGJ?8wg;;GaVOA<^+W*dUNu1SV#eGu_w|YTsQ15-ew}Ry}BTUA6 z8tkrzRjDA`&_7B1d1jliloYGr?Qh|KL96dMNGbhuqlcY|UVcd-><{5+a!up^U)z75 zi|t*gww&O>YOHC1yE$k__IJ-_zW~p@Tne>J%*JMhQUxRe*D^jOudSib@XoRQYb%A~ ztIF1y#icz%qb7+jJ^DCdI=0A(zBfN51ZtYZSM$n#Foicu5X3tu`l?gXdIf|mh=8Uv z*RaAa*M|7}9fQV8MSW@S-m3R~0}uC%4I90kejrB6Y`y5inWe1!M>V72aE8jc(9xp} z=W@uEWOb6{VW3!b51iWwD$9af6Q)pnmmNTwsIAuh4a-L)e-fN&o^UfQ7fp`(!V5d9 z=zfC*+~OeY|LvrOo*21EHVK?%QuS%*-Tp8U>z2Mb9ojhjTDQT3b6`#<(hFBT-k$De zn^0Q3Ab{1Ig-WbR?enEnPN!;%AcxD#9mgXyf7ARsfu25EugbCfidRra-FS$9aX|jC zV|=V%d+YNP7)r8g{6aCkT;?lp;j+pZH)MLdSYr>LYcMqKa|}sQ+UL@I#b5egAO9m< zCUD{tkEv;WwI1(Ke>OH8MvsN5@uX-dg%ghfzD83pgeLP=J~CeaPU(^fwMbkt2pX5n ztDq51D(D-pvrsd&=#o-2LOI$cz4#0QMd5q}>M3*pO*4h-=q?=x6eTr*g0iP@9Q~;* z@-7?nTp+=MW8^*V2m2||l-hQlBN)>NE9@d=Xj6kIt-S80m&p}YzI*Za|Gm@OS+JM8 z0w*QLMO5xsm4=(2tqVkATy*)TOJS4zNs^r|mK6|^p#_K2Vbr|-24kHFPa5_5;(d+K z5B1qU2mXHVJ0O3n+Bzk3GQ&8exnF6ldZ^J5!mtc!0SXCp35M zJ@3Z3mv(&yr+0}}d4g$FTeaRY4p=qZ9=4>VUp-T_hfrmgK$I&>(=S2G6!-QqoL{*L z3dcA12zZ-}0iFau%bUVe%LVs7@@T8F{p!Kgmp)VJl>a>8f{XId$iXmhFL)oe%>y1k zCW#f5EJEg8D(i!TOJX~RLL|uGRDM|vUut+y_qzFOgeD*qyJe6v+;3ys%Ra+B)uwqF z<5hIQ>>%Le7koiq{mwybt9!Md<6y{>; zr0EFSTe<;kEIZj~H{3wsx*mCOx1tF8H_k!L7;A#^mDmy8;x(fZ)UI`@OCA0XLUIa{=vfi&>;+-+7YdP zw=R7`{A)@ru%evTDK=sHRYqxxUW{}N$dbnnO4mj|A8W`f5Sw(W*PmXzjVVOh zEZU96Bj741uPUZsyQD7`daEhEL%N6WEQ+)#a^cNvNi+y07G$76Jij5|kiewS`>4)^g>-eoioCStU zK2D1{Wov+*lLc-O`$~1QOQ6^C*rZ(fj%F#BcL95?0taPYNnACS>$1w&IJS$og%??QzY8FG<^Cd9=U2~w$F zES#JxB3xJsPcIy=q6TSGdgq1GRHj|2s`&81y!V}4zjyUs7fhw4aLCZ|F zT2Sl0Ap5BIx}oH)85w<`|5kg9nP5<2p4ycRpF6Ky*x}AgkqN*G4O+DxK$B*yjj~>WjUgbi6w(x zRNBP6#z$+b;vZC-o`o&D$favb8Pcv^P@~7OH=JZNe@SVMd(E6>X zvf9yBlf?qlP@o%1n=;xzA44XBWaHiUO6>&7a1lyZtReOMN^Vr~h!UX5+M0Qp*X z$oPH^_r#%~=-MzDDmC1v$`?cq58<~gYGNrrnXYAwV9gq#D17-sfjAebz*?W_Jtvp% za%pL<&YH$Df}LRFXj7cOK1JH>h+T#QPpzOpRbc-=@YaV?2!F({LhW0>sH{r<=+v3 zH-kYW>Q3PyTzLMvFWL&TjKs;{TcXQ+e#TL>c1XGtK5~`+r_n@Rx=7B*coz79tOW&h zq`qh?_)eq!pT6-QJ9iATgqtO2OXj3W@U8W=%E6SpEBcnYuHE0E0sJlLEZf+VT34L? zSLuH{^&xO6fum2Ir1Yz-s<-Pk9ml~dVx1Vw8{MGV%EvSHyL^bVd_BI6OZO#GhtoB4 z^a<$Qn-;p%&aS@+hrR8B1&T0nU+tuDPhNiIy5WyjEoR$rk>fHq*F8h^M~d{ulPqwt|f+D({Oy%3z1Fh(Z`AQ^x8IR0KevMzBUJh)!X=Hbg5RC6zAVposX3LTAs|%=T2t=sS^P2TPGUOIYtM_ zEh4N6AbqAt29|HWkNR_*)2x|-=w#iU9uxAARxo)6M6?KK8aZ4YzN9|eDWd#l*%7l= zNSF`aSV>CQ^cb5`--x~!FkizUfJoa+ZcP0gKZM#~MkDP#{L75C@+0)Dt&1Zk_V^>! z;k9SM7DcafHPfu34s%Tk3IX9zuY%$QgU$}nj=55m&$7Sl9CqKY#Q?jqjh^N{9m}n^ z-n$cfkQRx&k{+ptwI%w6kMB+r*x!%>9Gl&2*F9as#u^*kN=(kw{DpI;P4REx0y{Cs zW!lABlz3$6oiS=@)Q%Ztci5TK;pf>(pBsKtGRSMk$bhS9c9t?` z9Xxp#`c%~hMke$cIIQ5j?them?y0C-aeSR}XMx&#zs{$p44MiuNLjO~_~~rSCJ$3- znxhWjW#gVUFT2i^|L|1~XG$;8*2N6ka|^qCmOce$R@iTa_7>y|Ra9+Ki<=MIaM2V` zte`5`&7v#HzaW#WtxT0^I2~!pfYA1VuG>AfnFyylL$P2$&mnO1ETClqDF1%vvU#B= zo%zt-*UuGe{yoXh;g}IK-Kz+=|oLoJ(?>bpTkn)s|2E^v)>dr~bLo`!l#qB{DaZu~wBj_iUy^z?G^DvRysO`Pczs zw`&?#P@Rg3$V|g*(MS2U?sF6}u1_p&QfXLFzvJZLK2kMMNj`f3Yz$0upMs?oq#dIh zCW?#>j?%XuV2el*k~tL*sJJUzqftmPo;lOuJYy)NUu_~DR$tvtDckgDB*#MXmQ zkVqbN)%N&yA$R8xRoZ6VF@qJpMQCA1BDJ1%m|r*NPK2_s#Sef=(Orz~kC6|-A40kg zXhVN!23h`dL$Gg=oLJJ*B|o+Jc^$^Xj(aBBdg!OCL|{WSm-snDWMiEPZK;JtC(k!o zb+jze@I^Q%mdtTp<-hF)GFmB{QB+ivY1;~T^KT2(|D@)tj3AAIjIUj8kf!L$+M`Bx z$~I59o8nBq$MVm$=P!?QuGQ}KD$c}nzP&ksSAQK)uL5wI-zYJxc1rlTDgSjg(Ie;J z;7mej6K=T>ohT*?Q~RxjfC?zROG%~qgi~fa&C%jXoMJLTws(K@KN%~#Nx3~kQ6e1^ zWGGy@RDx=)8u0UO#9AYzVtlc=Mq;c;K5CY^wh2 zRp6F$Q>*MhH`u*YFRZrZOC++o!~%!FSr=4oWSiCWQhPgS)cK&stH6zlEDpWuMb&eSJ5Z6@`#4qE4*jcc)HeNY)+Z{F*li3fw|!n zJ$0vWZq;dn>WF-1^U0lkardlh;K=z%_@(P1X!W|CTure!5%>)L@rdDad*)q0%dzlPCQ-4M`-(;<_vF1+i)VQI#1;HhHJFBFvH0 zBgx5_9!-i1=hAsnE6BIlE~JLLqTO&(SLn1ZwZUk2SqS2j4Zl)j9DnP zuO0(*QD&0nI+}-FZWYZNAWv!cZ`puIFt)zRo+FW~IxqCy1pBgrFLtPKSrJI-Kf7=q zq>^^?zfAN;6>^q-ZcWC`UX>@4BSZFCqUz^>K)2Yr`A3(AffDjl;9ZwRi;=sY|8^!b zCzYn&sHzU7f*xzUHh>~1KgYIH4aOMKsgnJS3#R*wIPfrPm9En@-O7(Mf@dN1-h2$? zKPar6MF_C#(wo;?K2ce3WSjj2Ez2=(+nL zE;c&u?Hx=;z6wF*aO}r}V&C>3VUV!Bk)cOv?z1u2YP-|h4mHOn$7-2IsCz3;blVY; z0wQY31SU>Dw<&I(rA0CeGGJf+-P>uCAyD)RVMEj&@lcR2<3{fWRYj3;m+FbICS5tsL#OU=kjmY?tya+l_$6j?? zj>&YzoufBUgSGlAeNQ>5*3Rs|IF&H(iPOf;KMf6i?&b@USWR;CA@z!CZyOx*=6Hf?TpCqN4p5IS+C`{aOPXl0!Y)#Wz#ly6QYCJ?KY zL*puqy^ri-(5c;5x*6c7Pf>gioi@uTUhY{xGgC8@N^dm+5&BlN4>}H3{Fm{OwmAfrKU^Lo~wHe9OCL+XL{ z_@%d_?wc6Px@559u-olxfFH)=kKv}-^xs)-BbVe#@Pl~RoxX9O0VY>WZ;zDu>jHqD zLMXS#%>DOd-G6SdWM5m_+_-*rafp*-zr|YOP54e~%!SXyRvagIuGJ~lfO&iL3sK&i z)M7acs*Le3#XdRV4f!9Z2%%hl)lTS0NL=b_Fr*!y4i7EW^K9DZV7JOkH+#3TLsboU~N5b&Y5| z=`w1ho_B_V7Gh}A24!&_^ui^p%kw2l2Pgh=dc1;$O#Dc-qvidkec6D9%w@NvBaq%f z%-hp{o4)_EoA+KGLggfyZT;^$u-MlZYTL%lt%MWhenaNIu=4A+WsNq_o%D)c)W19X zlZoNy|M{9F)q3dovJisjJn8`kF)@5!8ju5knFmFKYqDd~xF+X3a!Bv(dlE^LncJF z7+5&6EWx3YnbBanuEe4t^prNg(-YLE7N9AW?K{ykC-7#1@&W)7MPng=o? zHO^Aahp-pv)q8 zQcqHWGC;i)m1P8OUWZSg;uH9TJfCC*^=Mjiog&)pM_9Tz>>`P)yqD=0Ek7ePgJ%!a z$31v1jytNsFDoN*Vf)7p{`EF;O~!vmI!~?2C#9lX#^q#-L@cQIBwbQOvPU%PdO}%Y za(-^>yGx~H*4g@Em{*a!ZjltZ&4<{ow_KB;Bbv5V2m%;$F6>FBotoSRDOmOH*PrAK z;!#;Tto^`Llk-{o4{l<{6=H(<#2@d;@|;n&oy%s;ONu9fiIGyuLcvtCPQy)*h*h_>Nbu z+2TsWMu^GC*ylm;85#@BFi0&+go|;xu}8cdq9${%Q_ar#qIKhe8I8f1Lp%M<K5E`iB@S!l&(ec^$QQPR6jd1b?W z-r|T7gMrTXsvMa0!tid-(vgpcA({cl*1Z0!Ul`>3AFeC0bIUTpji)>@RZH#;Nzn-| zhXPoTZaQ zBQ4UD{gr3?^^0?A(SL4OCkO5^v_#34)kk03GiS?xU|`q@3*?AYy)br^FC}KRv%Jd> z+^Tqd&F-}qT6Ln`($7B1z44c&|Ip(lguT3jW5LlB)oIY0-r!XtnO3{q>H5`iGugq+ z_5FJF2I^eT`tSGee?Ntsz0xOt8a>y^JTXId;aQ?*hJwiO)Q_R;7tQt|kSV;^f2R{s(lKaHk;i*0!-}eB+K_O8Vir@5-&e8Y^a3 zz5lrZSNpSq8KIH0A77UBMzK690)lv^JsPySJyr8V%_NQYWy-_;F2AAX^nS=oyf4l2 zyR_-(#2I5+XjEKI9aR&ge(V{7%vmpMD4$%IE+Ss1{YbX#{)L8%?BTHnbqXn>IK-}O z%qpF&%sHJ1J+1>$GR&|z^X;XN0=2MZo&Zt%al@&?iW2T@X4`wqHfO?&uRZlfwC&Es zAoJqF`wx3CKBj58-8i)zhmZM+dI>TML*iHJMZVjb1#11H{qx&GiR;;55ns>L?xn<# zce!D`&xF2DS{h;uV0h_2WNDwXZHUR<)yMGCFn zxqw{lFhY$!J^KE?`}#jV#?8R(b;vO;ztK=(Y_)_>o}QLuYdAZyF|4PS;1*1=jO9=1 zM=r`4s-xVZsAbaQ&|L!!&XPYR%f`a3HFcdQju}jgdKU{g3MYX}utmH2!l#_;>FQAyur|v#M?ISW+zb zegnuQQq{lieFPk8h?Lk?Y^$Mh64;RhFf-__yl0vv=|f4hybK+ z-2W9JWq$K$GCV~bE1irpuzr+6lY|@WRt2gHnh3DISl0MRWZ?vXmcgite8^v?H<%2k z>eWTBfae*SCud7Sg5r&E>x+TXM}*7`q6VE+1kdm8l*tZs!bsQWyBgFYmN!+B$$Ve^ zn3<_Npi<8hep*MPGB1cP95g+OncemEg3}Ax*3C4QVT}|Y(}Z$%DoK)^J`kg^yWXz%rQHD%8ceP`Lz`u1b*C4JB=qs3%wg&BPKS> zyY{S#NG619H&5Kg^zmVIGPHd>yiEH$JS^soHlOjSEGvc=u4~Ub{H1mbw;CiyBS}AW zyT-qj0sX>7g}TMylm(1pdS$Wx?!H1i)G0>k=rP?&E|glqrY{N>T!uM1*JR6j(%Awk z9J4U^KEYS+T1Z`SH`&g+o#9nXtj*{9$cIMXkg7?vKh$IW^mrs50sqTGklLv4-b0(X zV2gt=*KvPG1_1+U`0SJUKePv zLj5KTpc;AmV0FdMDMdz0AC_ut3;&(w+2GrEIK9fRy<9G5+5=v6e&k@S2J9Y9`WoAB zwZ}KRTt;zsV!`)Qcpxlehn%bY)}kUQ0c1gRG)y^j>QXv%(B?#R z;wiFT7~D`*Mt|DtIFMd@Z*ZYG_AXM!lRWo;KTd-5FDdU?WHMgo5eJ(Mvu1{$cRyL1 z{nyZYf*!TSnp#Geve@m&AmwdfiW}VuQqoqU(%|tybC$bYB-Pu>Vo)!1q5Dv5;cMZM zkLy>{g5_E^t(m!JfPO=^K1Y0AxvasQeL;Al;TV&nL>jBf$lF*Bs zm+3HmkTc2kK~UXp_V#b@*^I+pOhy24-pyeG?Zpz~#e{FUR{}mY7C|va>B(^P{Ut2_Jo!9{vOFOd>XH85a78Z9mH8po=@*Bd?2${&9 zQoU{d;Ig78Qp4fu6Cj&hYoqKjhr?5vuYwd`+4x*FE!al}Ll4p(8gb70t#V0T#8}dH z4!9W^(|EB~Y|%Bv3-Auc4=&^B(!UOXK*$x~bPd1sm~1cqz&4PQvXPCvJ?(uSQxews zvqRTHS(ibrzYl2tsGWFz!Pbde;2Le=u zQYRl=&F{|hyUOq|z-S4lj$7`#7Sg>b>1?X^F?Fmpk3D=Y7^7h-1dB+=kZ+>@nyUYu zfWeJBy-5+4lF!*6a(!m(Qp3A3AN>U<8dkIeBRT{FhsZ$zm-mb9OJc8JtG5M3q)dZu zMUYqjp7F-t%#KDQmX0-aKKzoLqW%jnC!g?i)6<;longQ-uT`)n`~+Ch-j* zRgr;>aREQ50`)0&zF4I0+CwsFfxr9&Z7NHbo-wvX*3MO~zBk?b5dQSqS3J)5ef%@p z8FbfGk@8d}oz|b?_#s>30N!c$9wjJeSqGAx`F22*_bY$Y%@Mn^!ZEi54q7pjd@cGX zM74;>)&hzXjrKdg7i!eU*o`Nw1R0(#g0l5;R9AY8oDyjxsyqQg4_5o)($c*PcJ5KWH#@b|2%pnPbXQ_QEH7RikN(y9`o;F!a8Ps28Yw*bvZv#$$752 z6Qj*~6+5f5!Vpkoufil2)2nZDcV@sMZ`K!oZE%eRHIs#I%!e-WhyJ*f%2nlzeEdrC z!0rdW2+Ei~iB!}w(6E$}yPtEW`!m>_s!eEU;$+a}X zpyuVpo!>aQd8Vj^hPD0YiXSRJ$H~HxPE)F*`eIBpzqg< zc6BwzN~+1OritnYKtUVgm#TWvrl(cw>4SoOYLhzRymck|($edhRk73JQ8aZZTdxgD73M*V$iQlexuL(*plSI9%{xw?Ue*2N zo*gfarmYEyw;}1vENk{?&Q*>oL$}!&IJXU{tU|k5qE=_WN7iTQ__;crk3WZgxA$kl zg%E{*TkTb73G|Gp>a@Yp?x>ZiDGnh$bA4IL?)JJTsstWPgY3_9-s*o!f$t(3~#c#H)uVUijrpX8Ww$)?d*`zXg{C24m*V=XxiwIhy8y4Yd`(2p0SXZb9}6+5n|KA!1L-ABny{;I#pQg#~U}C z%(-g8u*FAt3(eE`X+ANPO#RI~FdqL)Amx|! z%zp6cvrNM{;llzA--(con7J|2_Y9$gMaM(5rBe;6##gPZETMcWvnxuS_ILuZkEiJ^ zA;w1vL|>bR>Bd|ilI;ekpF$h7n&Og9N9u7-$$32^Un*>%l?#pv1(m?k^nBj_VaMv(bN3* zjB8NzRGSrIL@9hwn6F9q#X56n=xhn}r;SbbyFR%;p?RRLL9;t@?J#!w$wc33q)M$9 z)&S9vHCT{CiR7gGUu@X_ns8#+5EDhB$;9lFb7ONU>j&2C=7x^rlM2s0o@*2+6!#Y= zTvXdJaX-DkycK07V*=sLPPvyN_7LpFOaR09kGPGbn#$bOmFnuZgf%@FY#!KfQ-Zca z#vMc*<5i7W9t;D9CM@3S_c!R95uP^jR&!d3aX~@({jZr=ct#&aJPf2g-NbZoHcaG0 zn(3dhy3q-wutTc$8~PGyS;H}dV(ml1gAo8f9HAss|4@9WLWjO|uR>C&LGVMY$vcuK z6Q!7n9(sk8p^xVX;nR2JpAm_Hy+6(folkSaWV$3&rh1DB)9y`a#rSWa{L5|?9}cRt znSGJ2E%A~$%Sys2DL|`cJgifvhcqn!Kx4~ahV)%*&3WM8`7>1^zjsTCX%vXw?S@M+~#+aTd1$E!f^BwMnwkQ~E zo3;3^R*fcKb-n+KJ&8_?reGBGk96T<$2JM@-u_YQOvtU#gy)&#_UWm}Xi;F~X%y*T z>Z+N{N~js6yy0&Io9QCNA_iKaF5uwtJV!3Mv85PmG-Hheu_&HkS=M26VpW-sA;r5( zpQyhg&Nwk$yd5BvZ%_fd1;lzO>mKMKyW?QNqbi{J)Ifae}~GSS{-%{m*VYNhNFtuoe}nSp68 zkgzN|r_d@3`|88j>l+`M*CSxN%1UX(6NFy9<%Dh(9TvI2Tn!?qH3K7Fq8^L#%34N! z>hWiauIcKO1Jqupy2lDI^34g#MX%z=!s1bgaw*4!2EW-^{nyG(8`q;y(Y|9La(7shi5(QY$LnALaZ4IF1gr{;Go^qQx?0wUdA}Rp7n8&^Jz`DfHFQ? zlB%OO(_n$yejK5A2eiB#mBMCBB8tFYwijEOqz~ba@1CqebL*8NlVeNO>Z8aqh!*be z+sEaLCbyEbs;`_*fc1I7s>8F`c*MRU!dj_re5sw7c|VcHcdtsopo8M;iCQV0Q zK8d?6G%ANQ8g;D_^J6w@9w{(4xQyyosw%^*k3FTCiIL=r?M0DQzavI<_-H(fMLYCu z+n%+|#y1L$Ue3=wpRuo57NP{4ccPI^b-n-ly}7@aPsF2h52OVMy<5ZgZvrrEen||=_E)s85T* zGcBSvAd+?tElz$%L_QDaz;EP#xmSqae5nwp$VR8AZ}|RWcz&u?Com@>>w8gLEg=f} zD^JiZ{i7NWhZWQhFIj9!Iry(EdUi`~&;U8(ntnWoEHGOFq{m=eeb-m224H}~Qa2QR zCx9FW;r$&JmWjbMhlOuo*U}HxUxS%5>)FE^r7asIYb=O&VGQ=1E9;pu4i}t|DvoXp zzO|&^Uk6fQ8`rA+6*df9Yq*)5XT)0!Sr*0eBdCBh^NsI!Gt4#_&y^K$q>FPetbB$0 z23H_MJYl@NI1R7xT`Wdzn_v8>yuO<}6u>T*H!0t2;5;*gC>7EuEx&<`Rcc#|T=DuDf;&#b z1k-qLU)yB_?cOdqWqaBoBYCBc%kry`Z^#vjV;yQD|5#)*_PEprB(bo)OPM254_VO` zsE{}6t$_n;G>`sb5P7Cj`C$+ucgs`#<`!gt|ED8Pu4CYAfY5JZ@O3Up@;Wz4TN?Vd zqi7f}4#|QafL{9eoz)VJ=6cR$1q{On>kKnu%cykwaX0ncS@T^6IwXbc%2lz}D|!wo zk}nGxHo2@mnU>_@>n_ zItDXstLUhxU(y)T@_GP=Bs4`s7Co1(T;&;JWAux?i~Zzm_*mPxs+{`g*jb{6n;C@9 zZ(&7eszj#d=KV(A8gq4WfFSHiXU_L}XQw>VJ9g^quWI;UYx7@tudUNO)2Nj+7FRXY zJHZQ_-1(W=3=i*-iOGx|b={#oKJ(a{<4_eMb|OM`6}8#M7DB_1 z>^?dp&$|KGWmp90ATQT=*4~3{$x8ydm5%*O)k}z5Q}e>_L^!dLa$DR?5##1l0yZir znzyEvWPK)8k_CTqn4*40MWMB4?DQz?)ONk>9Zt7%>Wl~h^-DE|w;%r23IgCr4n`%Y zsNU@w2r+s9BBCN&eaFksUBz`M*=pmlzGpMqBzn{M|Do-zgWBA}weRj-7icL3inllf zDNfL~xED!)V1)!I?rwXx#Whgeic1KPgaAQHkwCDb!6_2l9SZH2bLM;BnRm`V?>XOm z&rC8&CeM?9o^@xfdtKM>V&*vfp$=)&%wn4oJ}(0qr2@y?QdZ;EqpM)8Lu@`*AORk} z?2L#mR41_%apYDvx$YlOTWN4gE7kN6?E1dwC9?#GULyI?%DqB5;TViaZ;SGhol_x{ z2Nd(=&}y)Irsqe`a7zTnBNtrUcq&|n8X35KNi0aIMu_twaCK~0rXKto4ncKOHgV&! zT}rtIzA1!t%liA=>>qtJWzHf%fTsC2xW9LbkKZ+H7?GsX6WwK90hC%P3K^8MGd`hs zpQrwic@r;hpN#KRoG{@OG8`a>hYl1}8>WQ5*pVqIJ~4b$Tet;P0>m<4{jTr#Y8>(W z`kO8dA<0{N?pd=(cRoug$uezkO`0u^Fz5?n=oS_>F~e${Ec#Hp9&xCEK2eEf07UvI z?1mBW+-|v(g>;BtNO|XcglVrS8dLf1jgA;fb9$C^O7JR8H7ZfOJ2}5m+}u4D6`KT} z%B*yUIFE^cii_SeADP|h+3Z&tw5WfI+!aYb*t$djfYTiIuopRMi3!gV*vV=P4n)qN z-q{cKja#GaYtN!;@yK?x?b7HrNzh?*rR(^W1B8W36^zaCTw{Va1}bM^Dj4QI=ij<^`Dmy`cT zX}e2Ejfl=o@T3-H8U%|kzEb6fF_w_fUF|g(OaLDZ;&i$ubN?ya&Yerhx@KggpSUtiO0 zBVueie&`o7fxj$82()3SRu6FKzLfITj{C8DoxqSUtNmF7dLVWZ~tpUL#%QS;@GoTJ7#mX{IS zp3Dme{ABy=R|q40QK=kIE&A@!uY=q5NUXAU1aAhXdK!)YJ>NUrRu~d@iiZ-#Pp=0V zeV?qG)fGu71?jx`wQH_SOP|)2xueR39f}l8-ARVcHCS%vblHBAx&j!2a}V#IorKvG zQ8wYZ1x1qX65{EA?vvh+V__i;N@r}`n{GbIUQ$0f5_Cgu>xs|J%W;_^?9`iQ1B?0V zomAhQHW~1&qQp|nxU?GH)k40QF;S0!y*5xzD;R|Yf`Lq`iQ+6@=O#tdofvE-`YE}Yu39y6MHe4pQAYfM%-rU=v@__~ zIy5KbH>_ve2p|J`78%0rHr0RX390_vVS{-X^9_cUoQlTJ^!%bwcOgbh?-WbfLdJhB zs!eoW!+qVxe0_OrN1t^HM|z}3yu^G;ob1&ypp(DL8H7Q z=gV<&g$!v}B~uZ|AT<)%=!K*CkAp5u*YHBkVHHX$lm306{BZ9D=1j? zcNXCME{}CqGmD^eQS%OpiZy2Ke1S zQ>mhBi23Z`qAB?KkD6pf$1IGpI|176i@fR~~1;2`2c)>HuK@8Ae$Y zq9tl`plz|cB|C_5w>L3ve~Sh?Wref$@^moCrAZo{9z0fC^M<&as5gPO9+<`@EDt%z z+&f+wzI079(^&Nh53J(T#Yt+EGuqn&rmT~@NJoZnW!H8ekH}LV;}rqy1kkxyFnzDjyM*3;AJX!d0}qnYpR%=r6i z_ME=vN=$m>sU#Lfhd3FJaCRb4Rv-$Kr|LKdajIc_<(06cFKDgW2nS3-fdQWilEydU zv0=ODXT}$3+&-V}Am{2hY8fkFr+{5q=oU5qzH*diMigecOrQ3cg`<3Nm0oDHc=Vl$ zYY`)~7|AR=p<@YYdw4!8E^*|_8&V?Q$OqKJnC2u3kFe{R#ag#DDladgsyr^)lI6x2 zEF+oZR;!XHzUYW-Av4sMThV&C%Oz@MVL>yHgP>xZBXw5uksofhIS?EL$q97%dBFGl z^gg}qyrQd&V9dj2xv{Og#*N%f+ZVf~PMO`VWlhrBC98;{j60jgvXl?8V;IW2(Y)kmR28gE-klUe|1jT=yYkJ zsXq_x-Zt6x;S_+(y9$Q-S7ZcbD^QG{YEq!$T6{4>O`REm6h|Q`3xdO&7CQ*56ZzEn zUau{xyz)$|>}(k* zk-dF3K11Gd4t!S@tK?Z1;J{zyDm%RnHz1!G6qu;1H!5}8XeErYktF3m_}W=L9aP7K z_vypcA_plE?~9CQCJJCV&-UKGXEc7_Q>izV^yUlTs!9o6nWl85<^8nj^okhys8ri? z>UoYwg045j$h2z9ZJ-nDR*!DDS{2dCX+!~Ev?Zo7`w!G5OW&{h21hhHkO7kF-u~2g z6-&HM`<;!7XnlePGPk}ETE)TIAy^ryE$8xE)yhd&TS#U6zfg5(HMa-%-3$w)~M^q_#NkrEX)NqX@$UzaBOYo_CM< z@s35Y!{?FiUz&0VW>=HrIM2T`2Z<#`aL2$Dx|xqzdF)df9c)Oer<@sksXUb(_Ej3_ zUI4;4yx+;w>M%b-&|XK{T{J96kvKcJn%m~tB4K;ho_BDT08mF#Sy;4u(f1>CKtZ>% zYrV2RvzLIm4@D{LUM^X4Bb-dZ7Lz&IJ=ToXdX3nL)*2@{y7iI{mZ-{ghm^~(F%^(a ze~gISUU*Q5c!HOK5_V5jUi!fpsnBDNK+j9+ZI2J5x}I;Vus2s2MrDzGzcC^Bv`Ji= z@%V!1*NV-Svh(d3F!rE@v+8_Doqrp9>xoG@BcHncCbH*J*UoEtQ`t>1uAY)%!Y>fx z;tb2$bj~ZagWl_zC}PjXIWr0l@*$Pu-8Kkn<=ZgBW4UMv=kNXr%47VP^zos%-AjCw zB}Ie3bV|gQgl;9In*lQ7Jl(qdc4RQUTtM|%orAU`Z(gocq36twM434rQq0(re_&qD zoSrq~I2Dq7VsYdxGtI0`Cls74c|Wb)B#hk@88rkmz*ERN=>$%XALe6jmsJ80jFuL@ zoupww0e5!>RYSSpF7qSPPYoi-9bBU~85IO=tb#x@h_)+iMWas3_bV!umf5<7y5YT4 z?wj$MBv_KsUA3l#iX8o9;G(P5W?e*5OL!h<*>L~jE-{6z*Sb%+snuQ*gUwxfK%)+>K?>1?Q{4*il$l{bs0Ab@>5N(y_ zOGNj-Oaq@I!>#;mcQLXDo3LcBxhAzTIjT`}Xs2ByWsXCZz&v(U+O$eFyjqnqT_YJL z5m!Q@3luc6n?%>Z_I(QDe``GC$B)=dv1vT{MnXPAYdW0bXGE^~H*$wFI*C7cTC+eyW1QLpod4TAltKq>y678h(kVKArO0#&=wN=b?AE{6}d#g7+?Le@& zNET}l8IjoGTgjx|z(ud902WcvvrXJ7vZ#xg7j1;rdDE3N#59_7+lmIr58N5vf5?zD zkeW{+1KR1*Z}Vh!A$cb;QjNp~7py$OLJ*udPCwYZ-0hi~#yVoaqwCN4@ssW%R==Nm zHnA7mYCh?`xt12e@kDd-JjZH-)DFl`wNt%m1J51&b7Q@{p8|HN;;Z|u^H9}LV1eBj z=cpd(YmoE=KvIT|2Wq)p)BB3px#*Lu4N>-S@9NudHayYZ@Z0VnG&bUR)% zPOdbE>CU++J!M9%^ApBS^kt5{`qBe%Bh*yr$4YG3N@i1FV9u|pW`#ZDC{ENTBqcG- zS7fv;GPh~F&%CE93ikEFRHhhQ;L9oG6b8~W;X8AKA8tVp6*WfpvK_zVO#aDfNRN274+s<u_u1~8`<^AF44O4^xcWU7X;+72=CC#)GO0I*xf9+2z_kMn4W zRdtVaMy=c|jvUjwc&tXp^V6PHqiO;!&NJ(o*Ei{w( z{m+eSX9bFvEdiz{&o;?#9{i?!anG2SUh|HZW~OiRx>?^(Bo1U-7RasDXTAm3o#34W zZ~M7*rw9O;6#v}d8QvmJ@M)o#IGm`8!t}B__p`DylmYl|5|5YJnTqsYq>BEKqfD_D zi^l9DLsT-}-*a^nTw4}7W%coqk4s@e0HC-!HIoidsN@Jcifr`+i}NpL?wQ=9>O7NZYj%hd8#pgFiPkaj|Z8+9kF* zSQ}8YxoJ7e0bkz+uboyhvZ$0`p`x7@&Fdy11dhBXj{5BQh z2)g{YQQ1~3TEnm)HK^+GLv|-cE}aMCY&lbEs67*pBW%NjaRdz|#2yzcKV0E;WQ-k0 z?onHJ9v6n2+ub-ftG0=G4D&)uPNU?ooT>io8VR*yHaz3bjl6>LU);arIdKAYK&v|L z`a3^!Wn03{epfRxEDXGD)32@v*|0l|e;B7VMkTt3ndow|iW}*g^KF7bqZht=dBDs$ zk&V>y5oZI|(v9=u()f~Gn=BC@g_mhPa)G}G%6fmxjLfQ?Ho!I^W=%-_L!Ll|Wx{|BT5psv|Uia(& z!D{RO`jnMy;Q3mB+SQ&5E2iXa-J4sF9)F3?Y<^Yy3y^ItCc zZec|CeCZr|{1S6rvZE&)bU#!~r|s;M{S}pP!Ies|COR~zW}&H&-OM7x{QX~?EO8Nd zy8gX<3h0g`=mG!1%+;{W-FXVreI?FlKhMiFsQiU(sIQvk3&p~K|M;=jcJBt^>5T(Y zEBFV^;&qpwg2HmHDbX894Hl9_*HG0`uU3*vrDK4_ce3?*!y${3q1`yAL>0ioVq!x!sGIJaSK&s4>BUs-!+rIbPwxrJf)=Z^u?PIDcWk%R`t)s2<_FpAMo4Y3VS`a| zIQ1G(DSbfckA=_tGOinIztyH3)n<~Gd3y-2VEklpzUcJ9A$C}l^~>)0)kz_th5Pd1CrRh}ALv7u=8SMQsgrhdVU8K0NrL+TwrPbl3?T5!E@^2>WpUQDL zKZUKepq&%>{FD+)%V_q!&IYDS&{(1=qTVUx`o%TH2PMRCMV%- zsqB!bY52(mG%@-^)zdj^HrC6WdS3;{vX`L8B#mEgtQ&ILo1q^>Nay>lu3x7MGCv{FN|YO9He=Ydq6eUr?s# zV_cYH)?}5oIdP}hyEPZ~;-jVDX&2xXr~#yUL2G;=qPtk-2+wVQb~1joKgHh}9Wxu* z=2*DL`uOX)VwGWvO?c|ux5Btyo9~e{lDvg3PW>r&H1aqA*;XygVcy@7Onx?BvNn_m zZ=Y|%u7v32lwIEiY@zFlwj@}!odPU`P1zc`6&`c+W#q&u8{?8?pqz|02_peDAP<}# zBc45

a!2x{H6<-xou;x*pV{TJIZ(<53|kvK|Nzg91a;CV2Q{yWzA$I;DtO9M)q=+6 z;Gw!>C+&|N@Ji8yJB`5`@s#>;%(_mdwgWk^XrmUaNIM!#zr4)LU#TUnO!#x-llU!j zE)c{hL)sKTPdiw$(BC7ezVS-F={#aCU@uz}m|;YX_>r;q%|WbE?aD{4jX}b+@kH%6 zO@Avlz_w?Ankw?by3iuUp7rmQV5yCew$W_gls8en!ZvX(nm}tViSgoN&#(WsF;1?F zugAw%y83!x6Ho$CkR+~iid#-!$wT>nB1B{H;kWEYn>w>tE%W_H$XCet)N=;mZg$hgC^3PsKs@UC$*7V<-BJP0$1 z63uw_s=ISHNu6ba4A%05Q$1S&AskN9c}I|PeW}GTnu_soORKk{ zJ4dd>2r*Q9=m@6zQEpoNB;d3+=Uj5FxOS2!EAjjB<6@c}$+3p|WbNdtWGdfEHQuM` z+{E2gX~)ERoax3gOF6sIy&peX2I~c7N>7DHG5p>#_hZYl*#?FYSYaIlp6Ixrqh9g4 z*;c*H53|8*`m*+Z|86R7zY$!M$cxAUQ9mpczr512^GtbuRjJ=sGpP)PC!w91wg}__ z#YiZae5`xLb}ahZiCVS13u|Moq}=bKW9y;XhApd3pySYc|JBeFbkNFV>ZDR-!DT^Z zO4ACDgSP}mUg}z^6nqX0q&>6Z0mlxjV>~)X*Nr$H^@>sPQfcEXrl53uu$O^4<3d7G zyxOsNe%Ptt0@i2t2!atc=QwpDT&!i9z#JOYZBqu5)Xk?`h5}RO5rp!rlfa&Qq_r^i zML5z9R(SZen(^gF9zMgGv1qA6M`*kR{{g~;QI8rcrSvxIHgCLjVwgw-u!f9n=-yyFI#*RoiwmWG!)dlr?`-Y`E{c8!j%w zIYX}vfYV|XQa*Nd3JNjr3ioMa5VPHSW4&$eZjq5_82v1jb^!DEgA4Q-iFX90ME?aH zrnYtzIW=1PNDHOmory?zx>mZ;W*N{vVqa*^7%;H3A$-uN#c@<(V3F~B6=%Zrm}@3| zl|Rn)%P*R(c4w536PW$jaHi$WdW6Ph-m@s2eR@y|9<`&@`9x4g<^irs$x~G74BR8r z=h@udE_(#_DvM9OPmQBx_Z?E-QhLdv`{AMFVj!D8BIKs2kqsS8E37xx(3)SFU5yud z4*SgZw2XL|X}>bxd}8C4j-iaZ8qp5qzie=+{VDI`+}0N*acv7QdGsh@k>SF_PZF8k zDxT9*Wg<)t*4zu=MjJ*&A2v6ljubo_x+nX*Vt_|oCatijifxgJ!Ys1NU?71x!@;O? zg=0~#oc67(G%D685R_pNtCmy?avIB+deGJQ0F1MWvJ_a!FEOrWeKBkXy(38DvM9oe zvW8WBMY(yIz3?Kw0Z|!7GxVLzCEToAT;FCGgfi!ThvloUlZ3&GO&a|U6)~hC3sp?3 zWMN?@9iQecWRR!`(D;-yz|M_+04m^n8?{uuDEfQ@%-ArSVqala&3&(YwL=uLi^rOB z=!??=3q3ib_TsiZuHMY$ye3!Q|L&n4p=uc$5&P%Hj&t0p0_v9aLBiEQFj@Cj?%1{! z-{3s>IT&=pdg)aClPRCWtaGz%=M6z%tx~i@5MU8XX2z0y_gfdVPkzZojM4Ii^bRx~ z9&J6Ig)Z`!#s_)E2L672K!qvHr49)SFfG_&O;!cDSyFD*dMMmn5|vjGVqU|VZ`Z!x z)fH?GS*>3=K2~&c4Yogj=ssEV=Y|x-MOk=ClP0+FB>#6%evF}>i$-QY( z0?0+(qb}V1^+5{bJNsChDrQG>^#_}je9k;)>51{q??W!%D*u|`&*l1rR>YT6|Baa# zumnb#%zzOuIW9F9HA`A}2CEhyP0e+9Em;C=XI#2`#_5J05HW)C_W%06M_mCnFC&La%ZsS@ zl^YDbtT%JJfz5O!Mr;qeE$lY}uRb-4m22z#GFym6mnfIppZ)H+>+x7eDdpV&!o!8l z`9fLbXCKl+{pRzccNffLyZ&HKi25A$ocQH_%d8Gc;?T7{;_J&e=O2 zKhKWq>!42zii}>(pE!;oTkaP2>3J<;i>-&+O~gG@Dm8%e0C^J{s=g^5yElQKT?M_t z^|>_adBfSF)$V-Li?(bg^QAMqDpe4BpV9_@|wDfDtu%@Euu3%n1Zx;Iuy3 zX=qYK4KKimND05nEDp;enjFfh?PrYS2vJDSEi~rmbRH8lpIYSIrS5BHGXssMX{!- z=RHzF+YvptyMwTv&kD71VYJ>7P(ZtQo)RZb6anEjX^AGIQYBNuabG4C zYebFHC%T5djL0S1mc1`4c)Qf=6|Bo#V1GH06BP$vK4}(Ip!yqCwg7Z6f*F`5f7aQe zbK8LWrmFOocX)e}G5rS^k*(Kc~26R%rp0O}oJ8F+SM6gxuUhd@W zx~2-TOmZSJWEBad($fp3p^>AZ8#Wl8U;ed-1L2r=^gv9R!C}hEi+cJ#WB^YtyDP4NPw7zhy<2nl(3Pe7o zTstyBIXwVoxJKA4ahWoh? zW4q~6VWVHlx0R3-tkI@Ys)wF-htrTAP9VOCL*;*GNFK}+(KzNeWBBEpIj`hRwZc*`FL>P zP%;+IK;AC3LEg~ei}Dh!#ane<{%Cp$cdAMY^)}NQ(wi97hfF1Gw%s*;A?h0T}N&3c4pig~^G=o53 z<<*fDECG{ioCpIj1 zp@KwRuN>=!=Cfy#yHF7w8La9L@Y9cJI^E_&uk&*le|KN#o&;8uj1xmMB7&~PN3Xa` zo;=`x65H)L#$+?!bl8R#UvH7K{8G$%NcZ#nHy!QS;=EbQ`Q!0lHh9lFsBHJlyao*;;VWl{TmH!F72V; zfhclY;-HtuGPy@Q)xJ?6qr2z3Ib0j1de2XH8&#TWG)@b_C$nAx1QgOPiEQgNe?cIs zbVp8H(6KKv%q#GWp8YfDGhjYocBlPIw{QhwdmjR~2ZH7{(RwMcQXxT-QUAYJh@3;5 ze~z~gCbx9%6_6X{&uEBXZ zz%FyY(dtzDD>!V1`y<6T`+n0>OiAN{j>weJ`ka~3*nqvHi*`UO(6**w)hu4!k^_y` z@UHd=o6!zYk+O&J41{#q7cZ$aiTtkd`s75|F)XjQ8qvf2n0!&q>@UF1rl}LQ1BG-; zciIaCzIuzSxZp-uOAl)^0z3bYHfP@z`Hm8=4*PTCayo=Tv1r3}%m6{gPy^1T{(1Sn z$cCSJIDmpob@H|p!EO1df1n6e9`&eoaQYH12Wt7=Z#Pisx|~mAiIvpR%llY7!I0e` zBDhw$(Jf)Po7t-TVE>>rr2bu9RqXNOJEt&-N4slAG8ss7eY-{Xs9Oz_{PRvhjXVnp zZJ7kEal;@(VOK1>KJWWL(%shx^-8Py`Jxqu&B=bBJ5JvBix=ZsT>EWsY*kf@ET>b* zgtD$>?5T4dZAD9xc$?_(#P9m1i1kI_X%>Q9CS$MFy!N)?s@KNTk0ZkJ2D*KZ%kB1C zna*k>j5nN71np#szHs5e^RQknUPlviXAbLLu-Eqe{YskunGmN@u9mt=;; zGa?`Gu*)Pdh+dR*u76Fu_MUGdGhRK$&-|7`;_6gpwI(zCQcE77&lJHO7L|^-$k@}81HWv?Rf;N?f-mRQvpBr?%&$HQHCfMm|J4)98UDdjc0+4`^fh`QpFa{%nAq)fQ{ zh$wG%ro4>2tW-LnyCNybBtKAZz*j(1O&B&Jo-DO~x*-N-8E@j!ej<2}oLZ~TMv+yZ z71*i%%z({4jpaa13(DHhSK_~ll_iToFDi{wO~_)<*$dm0Ee^EYd~?g5XEteV9Auc` z-rWO@=gEZQsTrA^9NZ>^<5W;cr89O&WMm#28_SOi*8j!D`X4Cw{=#HCE?JDOjBR9& zO$JiDOYkssGP(%geP|hV7VXU-wtYANlq5Zm&|r|$D$^BjMC(B51tJP$y|+3`buRyk z&}8IX2=fW7kv5}Ei^-)KfVG%)n_%YVXI0qy9kaN=TQba3VqPzLW}+ObPS^7y27Xo1 z+kCP_?7KAS+u}23(C-N8v7v<)mnY}jK1RGGTzmqf-u2FrRq#~Vc!~gLjMQGowPg4C z>00@BTHAG>--adMYKmfJ*gLXu9iNxul1Ru9+3P8;=Za(tmr}X4a%aqE^v`2w;$!M- zgRPd047AN$^tg#+M#4x+`QEMSfxA1Y|4R{Os2=5P)ZfZ>xD)@^qQrC(fx;trpW$+)xJ2m)v*%f~63L<4e;q-d{4MJs&^(%g%4A zu`h))h1)Ti1Fqo-d(L%f5=vf%=b4VS7+v#xpu|osoyO27RV9Je-j`vnuJ`3(y zQN9TFw@j=ly>)rl>-6WBTJz1O>J?v~zLM$@6*f2*j zAl0IKK;mD2w>aQc5mJLg|0nFuN3VF_QgS8(wf^1y8^VIuIV#l!zMu?3(VG@ueJB5M zq7g5Rm|kS5Ru5lAxVh3hUTStvrVA6pq;~i0vi$q8SvM~i0z#rgiwcbjZM$H{bnG1H z$C7_@AJSNQ{zd&J0<^(-f^v?^xx^;~;g++FJ|Rwj(H zpzd9J+TEtCcuplU?AtKGNnb*3*hQI1%=>&BK;+sTiHB~Hih_?>=Hy2?w~wI62j%E^GsN?qX{w7R1@%V6RyL>1{O zhr2AnL0Eh?tWJhGCxr$Hnh^0U;`OnYf&aPj_aw~Z!^|qu?~n$e?Ol6KtiI1kRFx~0 zi$1Dnz8`N?6+pJ({-zaIm8pl~l~<8c#z=6Gz|G=rxu9x!4GDf_Z7(UU5zhbq-wUJf zxA@lve%L-|h1R-THksCW)$=n<{oSJ(U1}ywPkq815MrHBUR=d71h4bfyp5zk8=lqlvra2pVy!SXX{$8)vs<6@h8?3%mTdaAG2&qgXANGV z)o++xwZd19s%kN)ab_I(s~0(k+vvArclgEqUI+3seaiHeo&1Qrx^>w{kpb(KRp`3_ zE$DL-36JU@LYI_=LgA|3Bg_iiU%l{ZBS)gcm@gC9%ja36%bX|)c~hG7O85yU7LpS6 z(xYif+Mz~mWo^UxESq^5Xka^Y%5;5iyGvIf8Rb(8o?`Mbc~lV{my)%cSAsVXcscQ6rg^93oF0*#x>s5vBeuy-|CU2*tU~wk9DA4Pf%{m-fv)q;!=fx&d`d?!;)FjSF^Dl1>(UIU6h!bvu&a$`O0A_6gu#EaA8V*C19s4%j!#-er0MX2<}MA9mpD;PH20afpno=5wxs_*m44}j7hmMY}mUQ zfT9rY@)ns%@ke)1V>^LD9>MyJppF%{Ate(&)n}l>sJZ$w&0F!v+aGM=`sDm4iac@q zJ#p5Kk~+Dz8-tAI{;UFCAEyjXcFHTby$4=kKLm7a_{6hl+VmSVDf-8JeyF0o-x;-d zur%LakyV);`C^gZ%4vIns)cU$a^Ukuij?hrmed?olt2Xpkx8;1AC4>eYQ5 zV!xt3-upM?W4237guL2ZA2rp6?XQ1-95R}nZILR+`xl*-Q1kfPKyGMJ4(r2Rk-+i7 zxK;>vdQGo%;e`sewepHzCA8HAbkH$5QkU)+vgX;51$9<4hNSiZAn5JW769G!F=A7o89}nM;lki+hKl|0eEw0DoS(p|<5H zAg9tf+1NG6T=f%a%)e`U+la~u9CV_F@8`bxElB;%qvrrVqM zwMj=obCaTRuNu8{M3FK*KlJo_&xFYojm&oZ*!IUe(;vHd%T2KqW}jgBA@o%yyJGWY zKU=*=-)^cfOoWYKY|d&+kHt&AxI9P8qNDNdVLnObI0ps8RD~ZRgs`PV4IT z6OA3HL_g&kC%m%kJ8#?=cDLSDIvz7x<_yMWw103XT%~@y^uSx+QA3ZaH8BDhDwF0l zAYZo8jKhn9x)yYz?1f{LiC!1{u*=}8)x%#}iG8;ph4-v-YC-Lw1@L|q-30=Q5bs1o zFBfUf>AUhG-h^rx)3vM5js#-fkV1AWh+bkoT{)9Iu?Rdr)8OHJd!;-3^_}?z6ITi=mgSCz~Jur+69u zaFDXfV2>?|8m1#JqAC`r3*U4u!L8O+mU-1JWV0pzGf62?H#+l*NVxtt7UXUoFvuo9 zTwF5YEXub!G0`)xHsIYqZO=AX`eJO5S^3G{y{rfa)YuHGQe7oJI{0RlIGW*?xSWxG z)4x5?wR*Tqhj^b<%R~%EvA(QU!xVs{iIWa^L_!eYUC#P+z(jP=D9zX-ahCY)7P-tS z?WxK^mq#h4dL4T1?(H-KAsrdkcIGy98kJqfN=}BwcAh_#;Z#Fj?vb4IWfbE-BP4~) z=w=<90y;$jagbiB%vL<{PzT*!T!;2mmt}JmJQF8>3*Y8O8cYPO>DW$i}9Xp5b zk#(tx-x^YSW$ry{iX;gRgcFusxC~4u0ZMgTov<0|MbBd7D)E#cVI6>XDVY3sNTo~G zpv$^hq~6MFq0C<}d(8--)9kx3^J(&MvNw+;vZEXzN0scOk!T#Yv2g3RVdOk4?x2;| zVjONiQ2ry-u}^x^M;q94t*yYbXrfM_kog^F?9M^*7TMsbLxFK>4HFvAf1_j6Y&H+p z3#_@O#o;wRVewzQEm<;i)W~`2q|xAdR$;*4DOwUpIBz zU-PLP(+0m*^puhPWdFJAfG(H*#9hblQyG17u{O`P%Qh@Xduk@Pr}D$aE#oI%Z@P;& zi^El#yRAarpKwnQweKZRG#Hi8{4ldSInIO7q=C@&ai4uWv~3vK`M`UnlwxTFDTnZ;6@?|VaALXa~R*K2K!-A}XxCwPOLe=<0=sJaaO zMmf2c*^w5YkF=zV#Y0B|!7q{4v%@CHAFk%coeL9L`Nw~5+}Lr{H__LOk;YCj6`;Xd z-2*cMVR2QNJjE#fdVy&yshxT?`rb;orCq6|v>yVmBX`LD+9T9*_u-CXV880>TLlwT zH9h*I_GcUoTl-aQJpSu|N|U)+8V}-$&EwBO+7b4=@$H8P^gnVD-i&3z(wlcR>zEb( zN*?B&JPl-2x_Fi7dW) zHJsd5UG0jDuRx7Itxx9n7!ovMwB}{nBUC;>%xtZS`zdm=_f&lr?}BGkyM-qC-1m84 z<)i2GOS8KD>>(X}uP__@g5KJN#PYkJzNx|F4qi}uwcY@8OG4~-w%<_?TEm2;;h4y( zV|%LYND-Z|cyF>IyVy>$^!WyR0Jp3<4dD>0Cj)cftMJ*GZk7Uh+95^<(ESHOUT*UZ zWXP!J=-g_-j!)+5(VpX0f0u3`-DgFRfBjg~dyhfX?UM2_jk8mD&K#+|}`UwoJam*np-FtD`tE`1Kb@baoS6;n;mJ=q_qK2GBe_3XDplO^p2 zqOa6xjXZ{=Rr?s7Dji*9Vbnt&e&#mTFdv~=oaak10pkp7tVv15m1vncq<6P=>-`6) z{g!mfeTGXvCI|7#fUeoZ##uQ2mOh8vZV>3}#|OhbEAZhyG57w3{E@WGM$9M1i3?2K z*qv{v*VE!+DHNZyy=lx+(^Sk!-C6I|`?^m}&6Shfi*3vTl496jEY36Yjf-GJR6#JQ z-~7^?SZ|`zw=ITvRZF~O*A5ml!8N%Hb1(>&a=XY5z&}dw*RilOF+slqRtEbm8D{}f zVS&c@-KWK%6AO}TBc{T!2%8PVaDM|J)}KWd3RGrk|X;T+yD2OJuAz1gWY zUa=oZj5JWI+j z3?rMoPZk~(ndMq1@NJfrTdUL1v-!EB{etGa=NsQ`sVaG7cGKgEf`Zk?d;mBnTYwb| z-B}MSx>BJNnb1y#ntCW_*4pa=_4%6}ot>wv2DYL$U2gJ@Hc8XH{$xGXfc)U*R0OW7awJh8P_L74RlKq}d2_>{-r`?gi zpS{ci?0)3>c(omq7o-JS`%I#uBR~9=EK{ibboAtv7lD^OABvarbbWgdL$gwre{F_D z{4eC^e{FL8fB)nz$KnuPW<+%@(Cs=$gvRbjGxTfqnd9DqIZBu9_|u4mqKwk*3s^2^$19fNV*iZDimhiSMhs!Ulhi{JqDBfoQerIDJNI4F$`UhE;D?)E_)%AU36<@Qq_(R=} zqo2{NhMaY(EpD#1!GpW6WDPR;=x=z+xU^RpEYs^XT73OtL$Jd@vdY>4il*mv-(VAI z;g{g!cflp#08`XSSLL=lv&Fnn=gbMjc<=r{GMrw8lFDK%2nf4}?R1>nCQT|luyc2GYtJM>vP zRr$U+3$7||fH^8ogb{S@EE?MAX0xu-C)tR zBYVzkN?^8sz&bplasV{7^@uO zxWK4j(`%B4Fz!N+f^>Csifd5fJ<~xv z>1QdA$gke=tB}$X6rm*+#^GNRPF}>(fci)%#s&UrBTZ|6(9u-Rp{{I_Hv9apnzTXl zjT?Wr$$2lx4D-0nWHAh!zQ6dZ0C<;@0Ozo_`fzrj9Fsmt?2fI82YtVzpK=M4^!)^%cRC0F(26A=GZDqh@#|+YdB2~DB|vyVX145XE8uCHwRaAs z%+*La|5D%3YFWI1kH14?S*}xdH9`|~yu2xz9{^wHp}>_p2~)T@6|!aRQoOB1c<%jmaUc@9X-{ISo78IWOXeU)=KRe?Ps`-%dvZC7e z@>%j6Q%pS=Bl#eAG^3t8@Gns*<*y_2xbLmcBZhE!0BwW837|&Ce;4A1eS)7Cqj!$s4dg>g3Nz3jHwuTsCOMO$fi<;@JcR zd@@otpc%U>VhRj;O9t7+d{E&}wmCrR3ZPaN!=@k~5=_gJqqdV$T+ie7RTahhX7W@j z-o*A7+F+80A?sU9=qg9Znl=)VB!%+78!Wts*XDx?@S*qwrB$S5-1K>+1jnbC4r-D1pE*d%6 zAu3@}6&8g)_Z?v{)c$k>FC?-L)s{JA2=~_TA&0aldoVID6kQ?))Qj&M{`@c<1}m*Pche zkWLFeN}9`~zBmP2wrIBECYapl(qPD712s8c4!-8!;+y~D*Wk<0>CH7fwgrZVG5Dj62s3< zp%De+u!CaEDXOl5r|Lk^tAUfsM*z@XEYz9MxXLfj!lK+R7;`k2ZaEBx#~u#%UrIgS zC}{qr5SLE& z@)-AT9QHBEQGSna!9mJyBUzkez(HR-H({jVX+EJv~uu&^7K_L0yG)2)K)$=fl47Ej8!Nsc2v zl75|j1Or^_aW_B!c=N7%xR-NlZ=C%idA77rVy2rL!r>uA8`?au=xq?5QP?b|E-z>N zwNDT-Y%udW(ehX_byr$UlRf|QUKD0+-zpt{Ik7ahs5F-HtYq0GrKBTaWa!BC)3Q=#p&Ja+k$rA z&NMkS=_SVDvRn22xW09D@TFTnX?WJT4AEOfq~|$u|ML*Eu#jV&qoTLv`1DTAFAJN; z#@Jzu2>|$Z(=XW8-D;WL2xdo0yPn3tGd)hz>3`!ql|c`UF5Jp}vc0Ob;jLfX#R5jd z?EHh{4?_mC;AaBmchzRUaTY@^#jd=6;}pdZ_=5i(xhixpdKc`eH!h?%=$_#L%6ieB8SdvdVxY9Qt}PB1+-0I`3UBPn#N zBbYqvbk^vP5tiuyTy(6f>s(V!`0K)d;~aD^ONm|iezNNO)%`3zyJjw$>aawW&;9dn zoMGLPHP;%tYS$zm!hnJjhQ)?_jv|hrLHihFv=qg}HV0Ud z;U;QPLu)?bw9YYKyQWjHLR3)CCH_cn^eyylyz%HklGtU5L^#>o>#kjb>eZqH=s4by zX0eu;!+4)$zFtc;A{9e5z-joIle*uBNze!wodhWEVk+PBI?rj00q%OIW!$`-@ZeA=(I;Fi*C?>^8C#=%)1sgad%)Z^MyswICQAkU41`^=G@iXHe!^s6o)By zxbkA@GV|nBDYlgFyL^^}e;Vt@>$VcVM}cs4LVwL2s|Bv1y-oa;N3M=<{=>-or{nST znyvSE?XrSO!IKrNVy1~E_|Ir3gEcy)#6$oB<``l#Ds*IZP`pYD<#}V1OUzSBH>xHq z89|4I`%_H4^F<_!_?kYuSI6+zvF|Yz%q8y3-ibt1WS_E5SN-JVR>7my9ZURTH?;zI zp(Wfq<(60`9PtDK@Brj=bGZ!kXgU;Dkz_;Jd2;D#tgboRWIqCz^dEKIwWU?)_ND$& zu}iEP-{zZM2lyJzMI55V%u#{`YB^!+uSbtNKJDd;c1f5jjP%Uh?gsH2Lbj5ITjqU( zwOXAqLenJ8h6ieJ*`WaZXj_R)T1{pn?gb?Y(`-(M+fKD>evT`;jS3a#TZYZry1Wr3 zI!L0z^pIhBr+SbuXPNnwPeAtc6tn5%9WZaRaV3BT6lJtGy(2fc{DI~pR_A}zXT`3R zYYa=e2JRnp22aD4S7mUm8efmCrhU8<<+TdqlghB75+=wfK6qmH@sii=izA6z@t#uJ z!ag?K9vr>xnqle`>vHK6dE|V01M8g!Y9*W;Uo2-Q4@+$%>WtAOJ3DWkbXZv%=6a4^ z|G~#fFs(0in*^%n3ywywHpLi@X(g?BP~OU{WTPZILeGmov24Qf4tb!a;NbYf-qg$h!BLLje(k4nH2KG0K5p?` zJ)VwWbJN!Dr4b#(+up=K9o_T7(gtE-7hXuFY`q_9F=N^cVZ<6^`)+k8u}lp;m0Xqa zy{8Vpad3IditM(=6rbe1%VaVTttee(Qp=G8-v_EtO7_fLDqP*VVF`8)qYEuk5taN-ht-C4J3AgvG^ z4lTqtH3%GB-}ZTB$pZ6>FohJ-GvtPu(RsrE{A=hCJYBuP^&)Zs$wEI1J8T~iVuJPKplQf8uo%kB$%F}(Mq;L{?7sKxxxZ4 zD@6YXz+?zn!BtgKh=z=){l?*F#28)Lo6K*(FR93e_6wn4L!Hzmfp!#pyg|$IU{gzf zi(AKV2U+`OTzfFj`K%*miV9y6JsC#xsw~mWy!ov#BC~c2mC!qBjMyF0(OoH?nBK{> z>>_OlMaINCxI(`xeIMnlwOyuid_}v?Bpzv=!m${!0tKd(S1GVp`%GKz!cOsxzt?Oc zdubj%W5j1Ja}V52q+EwrNh9h#0Y&ox%~X~_^^0{NZC8*8}CzU%zP`K6AnF;y8Y^iMbRzr(tTXGb$=O#=J>MFsap z@sBpgt~cfLWlm&KCdo^!CzSpQ#=mitk6xXEk6n^~^|NGX2Jh z<_(s4OCvMwfFYsyk$fzNWgGq^oZUu3&D&`;*2sF^M{wQ1FVwY}IF3WCu`%i6>@#@v zd|Z0e?L*EGUF!fzrSC6H>;1Png&{J}$AO!`ZWSH7k=dZ?DlINq#J+gZ(~Xx{?ivG@)~Jo>R_CzT z=~p2ljew`wYWWr8HR#tDA)I6&b^(!X>D~Hyc<-#AbdzJWa;m@niv#@Ognlc2I+H=5 z*Ut&&WTGN|>$^lpF)1qn&P0e5bxaJ2at8;{Tkj&%>t^3<84+=k)uw8J_=mh?pHAXe z!<7c~`sx!mtC%eTbqi{1irH&b{1pStf-D@y~ANE82SpyO>8)m^)l_3KM&_lBWO_+j52 z|M}!~_HprD7Tu+pPxtfwKe2DdI$Y&17rIch;TQ*|msBJ(YJXx*n)zJAB1O|}zmR!C zyw=*DTA*LYQA$cbi(9O@QW;nmvD|wjFL_#|>tX+cAjeghIwVYD`vYvb4`i%x+SOms-C+KTVcRn`bDY@ELnq7du`MRupgX zN}<*uxQ-(iXzrja8hfz<&5=!vuDbl%X1bpWcGCnt(3UqJ4ByDuBT3eVjx)XISC>?1U;x+9$CJ>*U*-M=Q;CcQZMfibdN_!zSRn+Aand z5E2$1UZxqw6m=-Aly8P5C~gpAjD>Zh&NvV|f1#c=m&;>O&*ULFIXN8nPX8CN%>JR- z|HD83gp>Ub?kg<*#MFxyx8g#qQ}fGM5R1DY?56y)%*}v+TIQWScFDY2{*B|J=Hwhq z@~;Llo(gYYq1Jvrc>;FJj7Jr09R3^Ur^zjq|1D=v2*!9|(D*Kf=7K-#Dm%gr{U9HiH%)fS!2Qj?W)j3#!o-R_w%?!&t8P{94?Sd zEztRb4E&upDuP(%uK){2wx(ma0Q=;K8lq^P-l}UvV7A|ipUdWAwb~eue@4Y zflWuRT5CKZZTU0g;n{y^DcsW5lqY%Xr4^vl8CcrxEfVogU5X^p+}A$n!Lijq(@09^ zX|UQO%e~>lW13PeCb&|8gnYrxfPxg&co-I)QEX1a%y_yv+MC1^j40`Tvc?o!l7?9= zI^&EF5lL}d>KfSlncnNcU{44-%IuloX@~-w&>Gm1YAf0s&5K+B;?&&2K$ z;yBZSS8(NkZrT|quO-n#sm3;}F^JnFVvA`;VBKP+aeE3Yhz-rKK{JawOG?bHq8K{S zhT7e>h{gd|W#Z#|s;H1xWKZn8VDiLbbj<1Q24gO%n%MfzMyLW}FuKgs+?KXXp{&Kt zsJ;Ti?Ws9IX0Dtdq)e8e$#E$Mu)%xG8rhoiN&7Hv?XAgW20&WOB`$R|Uq$^7_v9C* z4H3<2SE-FVjcXko=!7X~Z54m_nz&N2ELV5}Jkj7(k(tXvxb1B`uz8@&NYDed2RzaJ zZlmLuxjB87{3VPLwLRHe!x#^TqoJQBvnFDzA}>lD8SO`nYgdfOJCEECFmfvRL%s#) z@10uXC0N+6LyLO|WSs2v6RhDg;*m9zxiMf^Ppz(GqFe@F@1+-6Ehdl*H{%Ft(c z_-GU}0+&o8)&hd0z>t+)45~@Za%$)w`Hp7S8o7(;4a`Mt(+-=J3bRwgqRo%tA3yJE zpQ=r*n#JnxYrn2js^1QHktONk;RV;>I>RR=NE^4IVTwls?l0~nM+hS9;~eSBSEr^# z%8?NrZ(+!AxtQtCAM6A5^H0#6pq)(`y>Y~V6#>?Qfg@;}SYI^XoV#3w=#H-GIAjOw zYpF_(%1hoJOAUD`3Kg#eg|5RI5wBb%G=RPoqrnGZOu509KX7ogD@Np!IcDBR92icb zbFFCzjhPO+o!^U?{%NUY-eTzzN%Q()n@fULTU9DNhzt$YhH?@6@^rKoxZ2#VA^mSn zMNeCdpp=h%?+hj4?qbp9m_SaBWU@GF^b-C^ZH zKC9lYXA@mUw=XkjpWM{Aeuo@yc1zY_7C5f&-kIR_>|sCVA4i3URyhxe@yzG~Y0pjm zhe={9N2n=A!1J|7@_mU&^jTr_7~^grpdnrsi^6aV8x@-M>w z*E{`FklqXnF#p@w#r@G-P2bEtzV;q0{1Zs#f&^P6HY&Keur`6+W0uRD3$Ei)nh5;s zx4O39G`LA$Y1pXWK6g&BxTv^&NI#6-f{rwW`T}oeSF!InYz<(K$B`g0{1fNiJAZ)8 za>QcH&)}i6bc9^j0rSl;mXmp&pzuHr6>&&)%7eZ=>cCc@MLBy}xc!MoRBSgW>x>_- zSC~nws`f(5VXOX9FLS~`9hM8Z+ZiJ%Xs@O7=4nu7T`m7!ncHJUx1t+~He;FMuu*!1 zDt{Rh*-Aj=S3c6UFV6K`cTT96#H?b;=nR}})+P+#9uLkq;xxI?qO#OiDilTZye7~)Uq>0823(DG@R>ADEEWp2h54ll6La(le?Wgnl_BKbN3UM zz2r)hY^W?7DDqp|72Q%s9sD?tlRxZy5mBiP*Wy;!YiUzdy0GGmYjkFwhFx_LYMHUu zB_tMVXCcK%MJhvc1C#V}j_3rpcsRytpnq|du5c7H+j<8{VMs?iqc}Z=Co`#|zoxjz8~Ouw1wXoBplz|4umi zzsZL8|BLqjQfogX|2(Ni7!2_1A=-H8pe{BJm+pkRpaPLh4t%i9RYH1BBDq#=@}b9j z!JR&(_)NvYmp-s`Pe+ilWbI^slK=|&0zO<0+Y?jbqdr$ZD@j_9g`cB?o0X&d_HXld z5-)7cHr`}#lumGU(C09S85BieEY1f+9;m&al1eAI&xbIa?mOMlO^z9yDAqlis%E%} z{K8Jx%~2E@UaYsPu2SD_dG0rTrZw*oz2BXR)n(H9w?YU5M)0sShT&tZ2t zp7ADJPNT1|91HV;$1eExz(>GUm?y~fFoiRIqPfO$m&MAq6=<+k;(Jil>|;;GWUdK# zM`75at*L}+=qh%YRr+P0BunS*W?K}q#q)C~lBm!4Sxm^}YfQl+i}HYXUea7JV#v&H zHrA&b5v?6g4i0FL53=z4NX&)#_K(@^o_Hqvr#+=ffS>#nm4AknZ)}Ne=PYZ6MH8b% z&wQ7u<6K63i?VzJ;w<80kRkbD96Djro;jO8OWJzhz}TNVa>MfB#8DFcq`TDIK~J_? zpH9%R$!nK`C=ZJ#0^O-_V&u<0>339&Y4JbR`g9K-4A+iyt#}QkmE6=Np7lS>m`Z5{ zbhUAs_OF?&0-Mhr+Hd5D88vklb7M^_6-rqogeSX0T;3U z{-4k*zYsLKgX#LaN`ZyZm`t0`8A7yR^>Oo4f1@lK1%wQaSM#WaXW=CS-D41VDi zTgB7Q^n;Zf4L?`Z?Hs-Q&an7(N4=Ldp0ev9z@6m9;p55A-hh~md=R_{i|{pwaIPf zCSiYiA^g}}owzQnErIW5bg^nDVm)aGW><@ZwmCeqlml8lP^dG?tJ;`Lhm3=AtoVhx zF99{5iN)<%ObsXqO|2-gY`YS=!cQ2M@3%!-_EA~BUnkV(NtF_CO)vh$Q{jqT1hyVF zoGOb=1DH;-8JViX&~H`)Si_K0dx#h$Z6#-;-V6~FXi>hxl(li_nO1{m`ljV^_VDq* z+8X(E6~3KWsxfPHYO%BgJGgP-!B%v*IfOIwegwA-ko60wjy&q?$A8h`fBh3}e25I~ zK7c-Rx8uyU2bev;efOnxj{ZDYMg4K>(D_-(^|FM(1Ks%NI5>|kx84;A7mSYT?Rl$e zjZKO8lC=th)+q>2Z`G{Ebg-N;K$o8p+o5@wGsB@x&ih#{ z*8Cgo`}USLg2-h;)0G9d{+0b4SC+ERvhjVxyV&eSYJl*mi;A|qK3D@tveXcGQ@4!` zYVEE{dG12%wmGtg93vdBvX665btbcqIxY|7f8%UoT^F?rDCz9DwZvOpm(!M^rI^1z z)%LfC=>Kz`$r2Lj>MYLaIoQusBV#8>_^BR|+?imgLOR931YFdsQQ1nD3ep%&pm~mJ zOEx5}w7|c;z|vY^A$A@uTo3g%)aB=Jb;nQKL0TArY9aJ>{@W0_;pyD>Z<<=A3*W12FPDK?skfBpz4Ay; z0~4*qJ}GT_R!<2CJ$oFh`59B9h>sx~*aLI=&LVsFNV5HD4~HJ3>FQKgeX+6r)h&50 zU@5oz+o?uPpataTIDp9(IADri^*Ce9oQ{?QbL7NXidk~~FL;*!Cu8wmiXdS|#)5?D z_tIaLFx`wem19jneCzYXq+pKYQC5_)`E{ydqA^faZA8M)GV;3Din#}4XuXw$twR@{ zI^SvNW^E%icVG#O-gP&YvM3KBh;V!ovs>q8_MTXA{^}&vbiy_r_v@4)<7SIiiJ|O- ztB)RlzP(OoCv$RUHl>N#L)f4eaFbJ=Rx=`B-hD8&+tBQ=)?iueC_Vrs&o&Bxfhk{+ z-7^R``zw0c99kV6ZI=!TEsR+gF=eNCD0UoQ7fu*G+=m?E%lhX+=U8{fPTl)=?%9M{K7|Ax?F%p znRGWC!SSK$$)U(-;%-!wZN@4X*<0b&JP4HD*ovO5hyhpJmLD?~uu^Cojaz-3wVI@O z2=nKR2M^b19j@Af^E8cN_VYQ^Jo_g zi~qBmjy$1R^^T!vnWXqSwdKBU8*jj!*ZJX+f5^PU&Zjd9jt*8*jDJBYHqNkU=6|cn z;TElS+fjFCMW!s{G2xrqEYp5F56=Fnq(}#c{fUFq+rWZP9<@-gE!OSMr4KfeHE-_X zb!XlkCc5l)zPsn+wA|788wZbm(9yfoXU)S-v++u2et%yGd>djC7BbCW-y^erMEdzrP=`B=lCE0*5e}m@^7qB6XQBFWbV@T=Rn2APnW`-tflH7!s44!EqyLN zZX+vb@YNJZTDu9NM5jn8pts2PGEKN{mtKxz4>nsmJo-kxqTCS>$JD_irNtjh_hrU>Tz z8oQC|0p%Yl*R&pPkY|T#l5ntTl{chvaL00#)6xl&d|2JAp6Ulx2ld*C%~UQ|Ug!x! zbveghM243s$BOIbK`U~T5l#HUN0)h^ZW^O=M9BbZxqNkh6lGR|hMZm#X%`!@lw=DY zOHrZ<$JKyjgGSV-oaWw0dF_m6U9)R-y)hL2ceV&@pn?eRH%=V)FfZJ%_^t|K+zox_ zi|_m9uE}PhoT_!{@Hk(Jp3qcQ9ZW0hB>P%omiOiWw7wx z)+TcrxJq<#3@o+3D+knC7YU}@YT}>F7R$%tHe%z>fVloD(VQ^YB~$F)#4wic2(~T; zBr1~!p1dWn&}F1yXMQmc2%LUO-(()y4=%r^;EDi0d6|*mSf!F{?kjsp!dc+gqxjl; zYpXCsC9PuZTf%0s$r)s#n%R~#53WZwr?wEg3#8++kHwVc+w6>=h0?Cei&Rg+@q8SP z3X`O#=;;cg;Hq4zX*2}kx{T%rmsu(UW{JguMy}59S9-!0=+j9x-H{T@W|t6)5J~SD z0zocE=2@U2YoUcZN!iEV;f#bl(AYTB$eKE)I+Ak-Qp|9f#vin2X`^%wFZd8W!T~Ym zJH^*b_p2Tit%6H97ngU{sE5m)I&i$V(V$xxazyYec1R|IYt2hc@!2Nco{Ke)o<@!e z71d5?d3`MCm3cZ*&~=D4>m=#OITnr+vnL|?pEwX`%gN_{$~xN6OzA97gdgk7#J{vXz%Kq zq(gt?!E`x8qx`1YlFc$`CsE3_wpEOx-<2(hLEQPy(3BF3UW;7+G_ncueW^EPBTZyM ze#lWaKJ5EcyldZ z^BAS~4PusJX!;L3fD&U6Oy_`X@203KQ(s_c162Qv4$BeT8bXjB&v98c!=kn*ofy16 zTg$q9^2vkNcWjC5_L;FqaS{EXR!L>uQU8xc@5J&|jS^-L4i47F1V23yXe*}{hKzcw z^3TnIe=KS5_ON^)v0JhY(;ue>Uw(6A0y)Rii1L8OPBvRcmYH5T$2`uU`4Oz$j1u0skpl_(E_>D8*5LP@myU|EmSQZ%S{Q5-)SAVkK0nrka?tr%0GR99Bj`YCVo zhsci`ZKjOx+Og5A8jRz$O0sIm(2P*e#d_qpI8cqqQ;AzqJSXSMshIkB2t9;n_NE_L!K+^2Bj`%uD|kRcr?BKxEDMwT8L!K5giJ4)+)nNG9 z8a^K(k(;Sf_kyP+XVkq;cMwt~ENJf)=~IN1yboCjj|i+5VEiJqx*1U&N#k=xQ- zoO?diUY;>a{2?qe!a}=bAq{uD^Gh>NnC-cArUl1ZUAJ60q}!10!JPlYbA}v_NiPv0 zC@X7cxTHkdI@1xN>bgTl{RVC4hRcfA8D{ytoN<_<1qgWAYpxfbkt2sO@F8Y6SZ_H7 z5}BEn*0?FIgmBa+7koUAp|ic(!sz~)amH$oGTf?_!0pi~F0FGks8tmEvu<2@kU68x z<*|5r4SmL*)whgqxeB}HPxF)x5TgzWr;aYoxo*^V-Qm6FY}ZD)ws?uC<;6xwaw^Mv zB2&%_pY#HxkkI=vI?}}H*q_a$QE33%Tn{Uq+U6m^5AY-cQeT4L)IAb#T4C2mFn{85 zug%}c2Av8iHx8<=iR zspCsp+Lm6~!dD_5a3M!J(TRsqDI6LX&@H}>0&{4%8aaAr`^|y+aCzqLq~Q=1&s<9H zM{edD3;O`x$hxS2S2RG#yep~Gr_DUL0$6xJ$TujOldp>(b*?bTz%sCe>ofg2`9OFo zFjt-R$#@+Pe`38oT6ZhU%{2+7FlHa#Ar|gxr*z)Fj*1g{v1c|KeZ{hi_8qOL32t_f zx4ZtsDb{|r^j&I(oS7>{Tvnyhuhh0f8sh+qSN!Mq2MOK#69BYSZX~brWHdaQSXFAu zLcAu;bq>95DfHrmIXox0(2N{EyT|udrAl6TK~BD{O6W5OBX9Vkwa2MzkzZ$AE(Scv z$MjR*KgKm$0Y*Pcn|NVaqb^1_0T#!iK0j^xV6D{G(S?UBeLRa*K3T{IUnN0)X~ecX~55B~_IM!B&5iAKTax@M9}Tf)bC$17e>Mr4C! zAry+Hcz%9VI{OJ-0X*U#{{8U%ProAsbYw?+(|%7+r!KRkJMzhX&|bNJ`j5Mr0ip=MFQ)48VyDf@OMiL)c94QHDM{CLJcTiV6qnUL}7#H7iJzTv}TxQaZz z{k8t6#!)MC%KH}~W~5P7RYXdvJAA&jwSAfsVL$ggGpDvo0?Nx+z0;@^UmcPFo%iys zAstIHco{X$FQ%yWW{NOZ%EmJ;>w43$D?00^xRtTqRf0_!piyrp3TwlOIH|>wHNIeq zdiyBy6@9HKMtqxm6SpTsjrC1uOXB`Zn!}+l;?(mkq02)r z`S|)E19k`_rJqc-+~SO!n{z|#>GuT%?Q>x6N!ra3XJU_qjKnxJp!{XZGsyL{6iR)V zx}G1%IV7D{dh@n>224~B*O`^Ho6y%=?NtLQPEt(N1aY(Pu&7ej^y#i0B=*+W2#vp* zl+KJv2Z1nxBkZFol=Y{pFFv!~vWYnI)fudfB`o-yZz2ZiOeh{dnJ;8+D>m(!-aK1f z$za<^r+PF&_&t|lQMr7*|f`)S}hP(y$Ng<>1m>RX~Qw=a= z_c8f4C(vT<(9Q#T5WC`{Syvah2pnwdENY%Dq=SWK@IsHLvs`Of*+?{m1mJ>K^(rgU znjnOEFXUrLTUA;LL!h*hkJ*n)l}_Qu8NUj6d<0@LvW4) z85lWlvP%)fi$U-7*=~eESf4@WfN{07=_X?P9HL5^g@BHAQ4MoG$lhssywVXLcX(aDzoI zP9>%7QR)-TWlEIf$JK##s@OWn?behx*l{{*wGU)3&vj-$l{l&cm#l!c016ZL;{del zVt+vr0)Z^5#*doKazO|V?>f~jtwJMegsp7wfZ_u$%(C5U*{AkFG_)T&QHnIwp;+RG zF*!M@3im?o?1VvHU*J@06rs$JAKp~};~h0g{0W;|_0Dx+YnfQ<`MbGd4C|^u!~)RW zaas0w;q%=$Y*s~ZpzjkpyKCvq{cSbJ+hJJR@PZfu%qa4Vy~LYWPJBkcMT#vw{jxzd z?(HkePH>2!@M{g5M*AIGsP{d>Fl7(INNviONu<0TXe6=2g(qj1;l=iy!TUZ9=Fb$_ zMnIrp`}M@0SLOrW2hIB5Q+w7;7F-q0p>|3;4F>M^hq*+i+IFgEt{?_az8tT{;m~k< z<3=r*dao5l3v6cr6+*w>ihC=I1zsa~ym0$BL4Te@+yIvEDLvOAj@8UyY_?+2W<9Gd2CRM4L~+mUn{mQWx}FPh&2u6@PvoAFAHVx~p0HjWhS` z@2bQ5SIrUqU2$@{N4R0LVJqbe$i3U-DmSk>@0pZ3t%5HBm0g{eUk~_zwL0cMR^2Vp z#KLs3PgUx*keWq4<|)FDjC|;1QQ&Y=?$$r$fMCpL zPkCJP?6QEn(IINo6DZ(}Dk0_jF^KZUhMi(N$IdHY9M{cHS@sLgrd1n4EPN*hGZG4V z?PrPG2ZRW|q%*7YJSN{}LPvc`?q;)kL4~f)ru}3UH<)WiyP`PUG=AqfaP$J3**&ML zQ?hqSy0Pms#FNYam|op&q*TY&0Nx?ek*ISj2UI8>=$Zm?W`tsZVH#p!jw`1I&l)%K z&QSsDwjGWmIIHIxH4m^M&-Vd;nhuM$q+OZ}n$5MT^JWdU$Qsp%-sT=Yems}FbS!$) z$tgrNqBcmZGmnY3272xS7(GffK4EL@kTfe@xdobFboD`;RD6>A>UVY$k;`q0vdjiTe&3(w-iPYaEZUZhi&J4Dg}Y2WXnPbZFh1mPrjisZ!>e5cWUdlADZQ23W*O8#%;fF5)*%=qxv*^>Od>NmzF= zR(k~%lfg?p(_$MhNkfMl%oM9Gu{SQu^hn1Ga_7cVy34JyDtQtsuk@G zSX>Q+pmXmS8r_D$4>Xu#wL?^~^sTfZ><4ycqG-iDj&a-B3Zpr|QZ;CdNVm-NF%7pj z*}Ccbrw6@VIxEpSvr}fV;blG!ihMva(&KB>rc>6evLdDm%bF1|{C>Zyi>xHCE3|{l zQO*^r$Y{_F@4?#YW!my9htYt;zv&GJ*W^=fH>W?B$6DjCc0U_tuJ>c{fZA0~4E5Mn z?5e=EYW|TNza0PTpBrL^)ovLzOc|-UizCo@B>A2Aa*32u$4UB|$-1TmyT8CdZ9W|9 zKSkQr>?!emDxxhqXWX0hQAtx!04 zQe7T{SR%df$(OdXDC7>H;HU(#aj9eQ8z*ZvApd0a*NU&P*0=dTddoa(lYf3dQ;``d z0OAPDK@Fm>;?PD}`LuCo04hBDF-KNwXVPgbD3VK?p56w%x{DEu__`T;Et=&W^=xD# zmOtKk*V_aEbmZGsxbYCjPJmGI#DW3??IS$ z5sz{914=AYpwph8ihe6QwBObqqQc%qtCkpgM?c(< z9xx-Wk%~mVrycxZ#)7i{ita^wHT`UP0;0xvxD@txce!&KOvtcJjW9(?<|OhAPANKQ zn|>Kc&1~-#v}=rOGHldhv-|dCFg!pL31q4c9CHGdg~R(2Uw;u5Nz$(jtEy#77ntH2 z2n*waqbjQa8bxtZv7T|ID&9yJGhK5~PA*9Ca29cQYT9!eRc;Ph=cHU`oFC_aA6ph9C)J(>{DEu_*jI=0^PqGFL+UmttT^fuQVI7`4 zKd*_dUGqttGgc{pY-uYIcvKd`>qCVVFMMs?r|N*4ER8OMZJV`Cw^0}tT}JfoNcU>~ zW645sF)hOiMp%QO+C|mb5wKKbFrVIh?OAn13KmC z#h8NBrH;oI&2U`3)=pyebf=$-{wV$v@pa4nETcKBK~g4BT%3VJc6u|39g!bdQpGoC z?(}Yzl+miJoZye@bsjC#q&htwKUs41T(BIH}DFc?WpZV+vi z=lzEi1)_4QY2VT{2C6Wt^}U+YERI$1dd{a_BfXiBF(rXAgWYPpj2h&AY#GQ7N}d>e zVM2)y7*@&LGaOx`_oip6_!42+$fKx6nBZn6#*6!dUf&OQ$Y5j5Z@P}6T2)wGJa#Tcq3#Hq_&)o|^DwC@jgqMECQ=}(jVXvVIke6i)uD9RX>hXoMAz>JIPEAeaF z&l0$X?GPhfp*5O4#qBu{v&m^J4E`oQ34wf=!mF-r{rhes6J&uw>hNs3koOH$S~4HoB%XxX$()hXRH=P|^JyCqIrsaw>sD_RM6n-Mo znxTEBA1WQ^8s#Mc9d$ZSoqOlwd}>F0KVFIr23}d%?3EjUR%RYEPi^(F^o)~+-P&5i zS(UyD_Qpy`u?q-QkLN>(5Be=%Z6{gVgxkjs(*efUn4kk+i3>Zu{5geqsgZ3}qWM1; zWL+0m_J3L2E2I-zbgzwS%tw233hhL%OxY=Fvva?r(G18*I8vC<-9T9K{E)qGYs+Bv>T>2dCsjP_JrYP9gX-#A|#bx!rhVkM#9n`7pL38wN+ zyVmuMEkGH{eWlBbyl%+rI85iS#bS^}URnj2ZmhqhMgv4L;fw3+H=BJ~!epPyCr!Vi2oX`e+1vf`FB%v(0?b$-W7p_Mf`eynS-tJX`)g86&6LYB(P-| zf4v%fJ4Z#mbke*1KN{d2S5$#+@o63wyZ0GG#$dP}+V0Ulgz=JG%3FjhdLK8JA3|fT zn2rq07MW})SXrJWbpoGB8Vh=hRnBY&V-#-Ug@c8Je585ET#`hcDkeBAW@tHz7V@Wi zXIr5b5Q*B31w8Mx&h?)Z{ej~`G#(K19a$rvE;=iVp<#d?Mth*V8;oapB&5+(TeP?u zo#{s#ZAT*BVYYAOqxqHdYwNFnFE{Q3sJ?#9w4Uaro<@$E`Ea0zgn?Kb`-H9O7r7(8 zR7iocg?{E%Xc~8W(TxC~-|o|2n=mL%{RET{Wyz)k!0!5n+f0an)LX|eMOLUw$8hLM zVo^)znb3ShdqK+KgKy(oGD>x-e#-F4o_C>$)E`pAh-2Bz4!N6PnW;Pw@<4id(OuY+ zVR5g}tDhsJ|((HG|K>U?mY+(51*&N5NREU7myU&qv0~F zY6CI>{3(s<;a-3`s9jSr+c4o}4xQb||)-I&Ill%a8BZ;IWKbjU&PbVlG z=ftzI2`20;1Eb=nA5ks3V(E+pDysqHC-RF1J5P62Bw^!c@_Ihk zNw1)wim7t9C*A@J<|<3HelsMRb`fM+!({`Vt9@^yFGlno^by3ODGHR8RZsr>TTi>^ z5*^aSZ`+-T%ZSd59A;|{YkoPSEMK3XAskp_L;5IijE794jrf#tmO?3+Dj8o?0%)SA zb%!gTA|(;7cZePj^9mb#GRHr@=G*Kc*UGK0fl=&7M$IdtmAByVlADtb)MZ zBaewhzWD)@%W?-QaKKnM*`XI+X(24Wn?|8hOsz4I76ms(8buwAAEza+yJVE=?c{EB zD>5`R(PIB5(&8piadmBm&P1c&mdJ3?R7Pk&O8q+a6Mt~y~vbkxc?v(aIc~+Zt z;y?K2`9I}c=p+Y~M+)T9ad(^XzKxnb6ACe%F8Lr}80qKpHK?i;GOp zDf|x=7Wr#Dry)M>*Y$cx!<$8CKTF<+W5AuHJOL^5*6Ajvn?P9gIj7!9dE$5fQZ~g= znx`iQ1}jXiW9gK({9H7XIcd#Kfv!s$j>8F&YQQ)MQR9wcPaWWx3#qD7<76!K^eakQ z^%ZOP2LvQ)TM#njL3+8;t)KL0rCR>1q@^rbJ9R+!qdr-l56PtiGrpahjF=-;I6z3zR7@+fH+H>U@K2q^($*d6ZIrlw4 zc?nW&zs@4P$Z|ekHrS^>#&kxaO?6d8FRR{4FYHJ;H)%_$f^VxA9_nLWlN?3}2Vr3y z1ZX&!!rUdlNZ=J|duyu8$hbdF!q;qvWuCx4bW5u(Kx@TlbQ5k+1Mc_T+cwoAgn#4I z4R`^#64*FX=(NX1>A|V5#uk2XF94FPyv-<2eu&1nsEZZ{gP?}{Tzy&4*}uOCQ!nC>;Rl@>Gw=}|rY zh&G)e(Iq8y7%#!|8cx+Wl_H)iImH7cKTbQ^TYZg559xnr8>Yn?nML)g(801bF_mlF zJduYJGZfcJJiw5n87hj*oU=7U5>H;_!5yAC`g!P{PGTii8AP2ff@j32aO zl5BTXAzG{yOP28^*6E9!b+ujEzPvoI)Z1soYm$#aUtbxbf5lrTK<&zFO^=p1m|@417w^$HM_(3Vw*2MX?MO%rRi+ofi2+b~k+Irz$fZ8u6n$v%$d zY@#eXHJ&>L|HZG3hCc8JSwVzi-bs{!rI1KT|KfuoN^P<)(vl7884Fh)U#8u9T~>~y zBpVYNJ?M;tl4jG+Oq+#Q%f`b(H!c07?LgxFKNT>>ChwCdvMm+F6+Su5@lB5p$97m) zMd#ZWJaGaeIAgz7vn%N1D?c_`RZy7Gm_v|4#XkKv_TDq7t*l$ub$2_oZEQCNOvWY~ zL@;0hBDM`82MZ8FM4M+VxmRjB4K)mn3nIp$)_cRcUm$9LivSgenjdth$mdgPVJO=b#c!qzi_I@C>=RIW^s}?{-{6T|}hn5APMvob*2$A*X3mB=3^cuDlLW z{^I%CA#&siW=#0(A|b|WpO`yAP<)5{Y9VPS`l`y54UGCu$EOeDm#vhjKno;2**VnR zQ>=rfRS=itDiaG7T|(I->dStJ=!|jeWIJ#Jtz0VfNf@-_Jm#4_KGL)aR&5a{t@wSY zymKx-a*F!F4DA3r$JMA>NA&!Nvg{` z60WNJ|GPCdLLwFKX*#=qxesRy8dn=y;Mx5816?RZVa_CT9`*6>X5N##_|ug?TC z89>@ZQ>PP*g~E0xqJGGP1K;yQ?B!Nt#PqN&FnThGH0y)s&MmhqZ2-(MzWf*5ftTdOmLm(y|l_{ zRPeW15%<5Zkom{&=zlwo`1^{LzNKOam{i+w^Ur^78pd8sGt~Jq{nD`sQx^wpAqFxI z`jjsWnF617#>@+LYkWc87BHCQ$sU45cm3MrJxW#DG{k6P?eh6`-yc2Ym_QYfJDXWC zgg+Ngn3%Jb&*Cio7MV+Tl7Uo9e_UJWxZ@sO$Bmj#iT zHodw}r)-A!v?eJfOWc#uA{_ZXp`10}no4X>0fQGdp=AF7SjWVn^PwE8LUS0fYw}rY z2Z_m8rt`FG^Qo~U&tn|Dr=R+ev{_5W0_T^zBC7;Ky#ggMztek{mRN0Qf4)5M!9XkgjF2?I#a%ww`1+JtdgUO@q~}G|$lMZKDXmnP zrUdHOas}Oxh!WBHu}VLzXFkv0aYMJF(NlL^%4Y>)`lGYRG7{CuRP zRNqK_H+xZhn_{vWXX3Q8KRmXXZzmMvGgD$)X7+4jIFu$5*(%#hN%{iQLUcl zWDpYA9ms+AG>;mQ=&_`6YWJ}6hz{4Ym#g>t74|-ANHf@TQ>GG=|j6(4Nn=W`tKsOLuV45054w;KqJpm?|2V%8_rl{ z1H2C~i4F1C{X*UL;E`c9e%Be3)CaA|PIMeRwfU@@+yf9^5H~WvY_+z}vwB_vH1@-2 zV6fQKwM(Z0)dMq6xZ06S*W4$LkwwM4)Q0FL*Dm@j>Dc6e*9fLyYMbFtZHqRLmnq&W zP5YYqFun7vqY$cJ=zidi8>VTZZ#vKAtS~2hw8CnGI^-ZFFE&a45Bh!fEFE@n|So2Mf$IFbYUbTNYxsNiM z4Gc^t%bDFp@Y)ie?&b=nBFZQ18TCf~RD=*WGONDe;*$wUP_;^a=AZLa|l4_@MR zc{LUh(1q;F74*ng>I0N##cdvb>{jmD(i)Hx;-1a9onBLK(qo7=9gQ)TYXdpTGrek9 z$Ez822=7J^{7ZDgJvw#O!ZX%)Dq3Mns*rOi4yQnoxsek303!63jTX~P?tGnN=@}>Z^7Ao2XRn^ZEuAbJ0GJg6+Vg}*?Dd|6li z(mKiC9*W$aaEU!?P?K>_(y^1tY2nbP3tC3PJ(w1x*IFDW1r@{_gQ@^8Mb55~Kf-dSMbh{1; z$%{U>s{~b#e8%tqCCfqC!@AWWrvyz)m%3KoL|ISl{F`J!nr?n$)1U)Z$aNX~P28nzI+zd1Yk)asPA)8YV zrQoeKC~*LQTsfP{rA9rAPmpWzTj(iJC0}s@8WL zOY;eDjlxZ^X~{grc1V)z!Sl!2Z#?W+$nnhNL*LxAhFjLjZ4sB!`^l35zYxZ3g@BuK zOY*J-J1|m3KWb3&9P2BdJjtcaFQ2;LY1}HcsKz@LtJl^4LIjlNZ}pUVPna$e+}L3sA1cS0A0H|=gehI_>p}Zkn?fWd#)hQtRS9)Np+r) zqCJ^j*gLs8H6!!TH98Z!hQ9y0A2xNTu&hnLG!`wy(G0iM3tlnG>ACj(^6s>^?s&uF zQRx`E(fTqsv2E(QC(*z$_#!@sIVsPQZ{KMwK7c5n##53XAoGS~h1d;gpO}xphnCHH zgtR);NF9QfN5w;KBbl3-DjllGLh)mB&vULSX(lZ*uX;}$%+N^mV@|X>{xGk&%G@$< zcFv_MN;WZcwFq_2b5?7`d*Elu-0xS7A>ZWq=bo+a927X3M-SBB)7+2_AsLPmiw;g0 z=%044Nq9$p%q_~3ETuzwGL3ne^s0({)={;!8OMC4QNqG5Q~*Cv$cjlC4lm;+qrvJvaF|e#cq{(+-SL^r|=}p0pb}$juBf=hpGI`r6%Sasn9%bFE+U^v?3ZKNS5g(nCxFe&!_v9Hn2b zx;UP&Yc91+L;C_=Rz5Jkq1fwWQPkl_dsk|&?e_JS+QvkRyy2G`vyhN|!Tou8mxonerzL;P z&nQsWSuMbQyY73yhdY@YSEC^7RHPMp~WzTXskFE2nbG!knJrcOQ;UsqwdRVkR8hwkozm~nN`s-rQfb%!B(0-cCt>E zZAm|tto*@9U7tsaTZ+l_kj%s^=;g!l(WkbxgA>=4RT%bpU?-MOWDO=_9DbK?GA%~I zR@Xyb%*b2#93zf?-KmLVvaqf}da&8Mie7t@uFYw*0mE`ahUCE5X1B?b9;*kFXc=a9 z;kG368aMt|JkHQZu#QS4qS|<8Z(E>wGG^Q}FnhS7-|5Amlv&fOS_MWC^xPoPeJgF9 zl>cWMOVhc?dw{(CD!6A_LCB5$P)D9dP!7ts2 z-za`G0lNTq(8Gnm{DUICSkVuIyp<=yFT*;tV>)`B7z}UQSXYFU_zBliJPj8WhMSTk zo(y@fdI-rgb$c5RIF+1K;L=whTth}ia2vd>LwvE3Un!(-3oETSgv*7H#;P(d|s z7SbF%z@uAC54&I=#lv%nOJ%EyUu5)4drj;ROm@NVtNHT=!TfIQ*8Ww2K<-!BBJVvL zm@Lt_VWu9f{0IHB_i-&!%1QB-gIE)%$w{uF=h_U? zo1JjJn74rMhm)6f360$@k*?B$osn#HTb4Ln`E2t$AmHR3V>nP+}Q6t zNT-Srp8TX2o&PbLfvH=oiHfs-7hU2N^SMk}ZQxCo;vn!s(Bk9J&(kG2j$qY9(@MP( zbxr%tB8d`P^zMU&?1NRBwUxH9K%hwni5^gI-DfKuw56|{oJg>wng$mSW#+r*{_MoH z#KA!2#%~ixN=87vw)AQvpta2U2Qjs)fBt8B`=2*ba?W>hjG(ZjRk7^U%~qgvrO@L1SSn@fq85)UV8r-$vN zwOUydwxoEGEi=cZ4wsNG(;2L8bK=5nr#gD7Q0UQVS;N86o5YL@xi3_p8|61vL1Bj=sT?k$Kia#zoSM3_q6Fn5%2Y%hc*;1M zi2{*DUP^hvQ?IjrT< zg}Ng}Zi-RKyn#unsY~0;c~*DEpo{n%zFr9csE}JD=tpC1H=hqRr1*E&jg0!s@&c6h zsKN0okt3l@Kfx-gX`DqfoKSW&tlSP@&;8?2h0t~Jw6-(R|L-g5c1LAg+b8?5fM8d8 z*p$QPe)j*HFAb;}8jpNESN7<5eMsp)q*LNNd;c|O7q3@T4qthlseWLyFwT$&LNF|rxuJsdz(pHTI_ZYqx2F&f zCQQ-ltyhC@D|1cj0fUmrv=e)2k8Ebw&}(M0Ei|(SsLnC@#i5)GC|-|?W)GADhxl22 zJ1ZP6M%*59n!@fQ8!^@uS95rCQ4xpoak5}F60K*K=&v6joY@(A_a*IdU%$H0o9fW) zRWM_UPi8>s57z~F zyA{f-C5b0@)vSt^+$n}+Li*-2QzWDn$UJqA^D7w~Cxe0%-4F3?(GxtmgL+z^eTC@b zG-I4ZQgpzY960HnoebT~6AQK8@lu_$1$g}jBe2oloOPCz%>~Cj-KXM)R7gScXKR3$ zBoJVk=X%4p6_Hg7wUXIvSSsqvr#Oz2&1>QtEwySe@N5*dQi^~W z#&#czz)-lgG48bZ*v*649;1_cCZ2ka|JSnkh58y6tyWoYRLw5{c`YBzMZSZ;Yu6kN zz5-soxcPWl30|>Sn#NJ1-}}rU>&D|nRc7vQkmu}0eLpG!m2Qid+OH7~AA;gYk(9xt zWS1z|k6w>Dl` z5BtFG{wS8v`F);?42%8HoTi=O8(sDXEjb4JZnBEobb#%wfWd~^?b2{lLNzc5A{_=w zny%_JmMvS_9Hk-f(H=rG7e&|aBe{(mwfL_ek&0@Gvpm3ol^SBTQ?xrpyh|e!A|Yz<}9=vW?j>b>aj5}lcLO6 z4^rE_4(*T*=MF;VX_<`|?*XAwNomej6jSt6F)aImrbV9a-nd!5A4}kQAlKjUDt9n8n-)@Q)8mZjeUp1kK|dfhpq@EZf#>0*ShYgpX4g*9WyRN%ld16rOwbm!J~z8>EaJMK#2DZ3|6(5g6R%}1gd zn7ZthN*Bjd;E`r}TorHHqg)>a_c543o9{iXd$6Q4@+|4l@$hOn9%&&!Ap6iHtZoCA zhYKlGWT>R9*@prc^FklTULA<@hUSxR2TEiJq#vtk*b~oE;nCrIKkrioT3x(N4X>(B zP$D;aF!Z?d#rAi^z1M3D8dT~WhXiTnb^(r=i>8qd4wxQFIh9=b@QG`QmsGs?iHzt9 zy&f8@O8q>*k3_(6gHH~xRZR58U%6m#t-+43Ed}H$u}!`*HLZ7uYzmQ~nJltfZ@k`) z<;b{Jn-^$~R~M5;X?_k(4ADE@oYN0AueRspWtTgv$S{VXZ=e9KDC{#N!q3zyDBfG%0jb6jnhHbSKmm>s9(9 z6PfYRIZrHws?PjN*}2;b^^7&J#|}Lu6889(rUa8p z5z)npA}&;uLx;S?w~GNW-U=`OoZ4##`3WmT<8&oWkxmr~n#6VPJ%c4+E#fL5FU@o|~ zqfbb98L5yM(XpRt912xSL{oslK$lTvJW}HkQjK~ryL;kh!@Nq{HjX6xM%~oG?_Y}w zQmFMqhI+H+)0=rBkPv&x)o3-8v9k>d&Nayqi5I3)#~4z_zV>l7{cf-*a^!kmh0ht? zP;2-KwC`d_nq2DI=?|XX8j+YW8$k)#6daR&hAP%-Z|r*1#zu9>@LEt>e`LRt%PjG5 zr@C9;7Fi6Yl0&sjs=Nip{$pC`WI7ea;R||+<8n%~aig4Rx@kCBKcn)x9dWK|iO(f> z=p`b+e1IfP^*(hb6@RsaIJc#jlp|(kjGfngGQjWDEO9c}OZ5N|?B(GR-B)(Y+ds&e zHPddxBHpBQ74VYRTRuL_?gmpBVe1#okNnb$hP1 zS;icR!Hoal_TYUDvmWW%HAw}9TiYK5e;MjY5#)9cTd`m*QFXl&JsUTN+27)IMr5h@ zmF&82-QVG16>>{i3OR6}`1^`Fvo6)#`RtyK$k(@Oicp6XBO*h=u%NGSM8%-3%uh)5 z(>dYMsA$0f0d=J$1&@7FowBh~pajvFgBgPBNrw^Xx#R82c;OXara?yDDf-${yqV29 z6(~Ytk+W88+%F29M*kMO437QG8LabVk1q1X_HKPH23^0DzH<+5A=xohU6Y!@h6)Fn zU&M@$Y7`DWKHX`k}AIFHd+%k=|%UZnWLA+u&3DV z_e{VEr^8Ecc$h*1D~K$8pfI9q91j)C`%COVXu==byag4Hp{B59u^VDc80?zKf(`YPDssXavkd%cF zZP=&ulnl{h-iwPHURqP&)yOY){`2+x0JQJ0=~Bk$X8;+3D9VN`ou=6x33D(k`LiiC zHa*%!2E>yQNr&C#0@uBGVQ5cP^{`j6pV?6!SvkF(52aZD=&-F(xH#+|t^nyfqLb!I zDtgdV+ebzAs5Bu+$qMdJ#iJ^&F(it2m@lX1#_By?&cWC)L=9h!;cu}e)siEQB|7Et zC{9jc@BD1QAB6Tu$oD6`yMf>!zoD7x>Ci9yE31F-yC|n_Rmsq3HRT5k14DzYaWQVmfCDrw*EBbGw5s zHXcUKFRMpjB(;ruc-N{P-B~7^?3)kS`}YJr&BY2nZWh=%xU;wqyX8lA9&4)Z8E#3|N#4|_JL{Ai zNTGP?(K_v48Oy#>Brt8xeri638gFx+8lQF&^50F#%h zHhF+ z!mhIljbkY0ZEjAv#cY~BEdVq2w0lWZrPt$IjjM3D(3qwWDW$hSK;U5m3Y8Q@h_mdZ zD8Km+W*rH3H%kuwFJxT@6gmj%qp1=)_azJp5KK;xf~($+hGloOP@ic12Smh9HOr$Y z>0If@pQ5B`&Etc%&Ilkq{jJt?$C4h=Xh|i(YR%N3@j0Xn)zJh3}p@uSiA9@t0oNX2r z3pEZ5G93BRMq!(g<3OE!O0>(}8Y})0njfk>^}=-~8Mm|^4AMIB^^XCEE%iv{>@`B< z6X~bh`J|TeJ(;GBYEL0LePVOMKV2*9#c&NEsrD(EcFb+dy(NL<23^^t0>oPP#~Pt_ z?X#OaTS-rsejBy|WxYPE8}nx=jLGIUi%7^aaNn0gJwVLGIND6P#;)z0v&wCT{~j=%^Scd-vmU|crxN~{(AH^h3NA;z8pm!-#k1pjm0g*(KD6psHIc9Mt7SU z1-9h0s}^2m%)b-U{2}41ju!vNPpKOSP1jr%n9UxHqJF(s}}-t~a4`=Bi(tB;1Hen{SdVGuVhb8`V#0`}j8FDcT%|sY=J(zTu!N1|jUfDg+tSOK zupRXm7DQ<3wUTIFEH)MUqtjc=L(oen5EMH1RL@UUwaATYyr5gz*nL8uK{I}Wh}EVe zh?GVt#9ix(Yu38E42p5~N?~>}W41AN`mWf2MB3Hn^;Cc_I^?11H`onU?`1=NM*BCG z4Q!shOC9RI6Lm{Z@jSY&YaQyikxUUDk>*2ZwRs9@Itpj?u-=e>)I25;buu_g53Wyq zjIqvljlR^Sr)MSq9@VaTj${6C6atI)D0*CBrZw#_;!%yCaIX15^%2l-f+z7cMgTcakHnk3V|1E3y8prz{DOalHhgp_`otOpv8s0$d03iQ4*2q1MG}>2Y=X7 zq)gp<*GfNwM(1T>n-&PHI?!7xjHA+bVps~r+>xmyavYucvBUL$pm^lQ%)nz#?mGQP z|GL;akJfG$Uewl3IUg$K;Nb^{66Js_hrOxOI>xwrWdTzw&#O26BNWIWt>Kj{@Wz@WT$jz)YPH5v1c)PQ1lURYGyLe3gi`;PCRIGQC^u&i3I>D!(c)PSf!(me!U4ItXUV%D zkJYW&x>ho!0c zu-MXn$t3>y9H{WWs6np}iR5&wZGNpHR(a*+Dka5#+PG~8N{$}vZ?&CPb}~ll6T%dd0T^Rp!xm{Y9ij-p)nZBq2roXP7c18>Mu3Q%qjZ++Ngq zlwz+^wi@7*zpgjrt>^^zUies(RraI8&%wgQ8|5VZeI7evcGJQh^(}vDGtv$PpIB1P zE)&e@UHZ=0y+j!E!Y_$>Q5IaSG#*&Cp4oqz$udV5y@-d{!kHUFmS2 zarkv%O<|gT_mt6WL1Ad~}i5O^kc`9_oIbvnh*ryE%Gf zoxa7~6PN|OpbK~dt(9rRqP8ZkWNblqg@2W?b2B?%vk!K6%P@UC`s$#X-|CO=&T~$p znM6zfx2WypdK^%kFR$P>o0?oAJ-w_Ry%J5ts;ZwzuS8&*Yb#4vZ`|^nTn5pqCZ(R! zi%`$W0~jE4Sr|)#nm6n=H6+lY@_EJT!;PC_e^w9gI7!Zau*eOg|uRCNFk6*orr|N;uYaV7Fd0xhUgVM}- zuLnIi%+az(7?~XpGG;cV}L-lHsj1E5pqB@slYF2OFXLk8PnG&-^`|NK| zu%or#)Ca{&@EI(Pl`9c^__o7jUxhrRI>&x#DuIjy+v_hCwG=1I=vb@P|9i;(rUxY7 zB`FTg_xu+L!y>Z}I)kC(^mp-6q1G@ji2D5Ss8eGrd6zhPy4g)NNt#P_ao za{Syp?hHLY7@VikRmWCWnpSC+_r9%$6I=-vQ$+Urz)xg`kD*&#ZAWG%>@HQtH-+<@ zKnL?_!_lkIL9Ln2NI;6lT`b$H0VR`fLidM+>;r{svyiyX3vbgHZa!!YFyXnHuvT}0 z-BXe4m3$>xDzCpLnq@x4iVw9qoV=yy8q|+#KgM0!(V8VF+t1}rAniT%E40pHrX!lU zWm?P7jqrB$@PV<0xx z65R1@UQj4^GrA3Jzr$$p2&>w<@UNE(+Ezr9E8%v<%di(-&;zhOSdU3jQPV-~z#OG@ zw5l_~b^P<0xG}c_y?W-tHf!O`vuqYH{zZh zp9V`s##^4$mwqaIQ#|-w+x*k6mNy@RYCE-;|8>^{w;4|%qxSGZ0!-*6BHzQ)z0zOC z+N!q`$I$$25(qlOTn<^)4qRK~;+H%v)Qp&R$nE>EURL(_G`J5XZ>Xhmh0W>% z&nJWRyuTj>13G)@UIX@%29zqngI#4}+9IS(MdPkga{$ESQqvHV8y2k4A*MvFK*=i(LrxKk`wYf0N_hfHTa&uQi2BsZ&dBU~LnDsA1l+4IkQm z*rff<=24Thw|S> zK2DF!VHN81Smp=aiAiqn3!~wGW%~|6wqa`83=2^v`Ob+HHWE^u_u(YDVsn-z%#Wa{ z_2Zn9l4nhWY-5oXJ6fF!aT-&MiPXVBKAV1%L&Z3-)4V6t1ha1xAe@&7(fY9K24&aU z4o)dGR9)#%F_|KjzS2n;16sb$Psh&-Gkl49oGE|kGRaaars&Ajm5h{-Oj88;g|11- zmGw{E@DIYLaHGB&mt`5}rAJm+bDSFohRM%MAnhDY)31|ytsKzIybDf=TYI<>8g*B4 zt!cB6AlRPk38IB#@dR_(Yn0I1@w0eV|$=b-7qnnYsTk+704s zMh+H&b`u-0&z?`q12PH{)X%w}Uqmr0kbM=a*T%BhHI6{$i=jF9aVRRb6buW<{wtsY zT^2}>Y39No-rg_lGFIb}29^O4+F+C6pM%ya3Q>cqG_60c-}6J2%BK>LI6S9y9bp9? z_w0q=!N9i7>ZUesqY{PmRO&Akmsk2#t@vR~VpBI(UN67P2%5(~Ag9l};Jm#JslcNF ztg38%CwQCivBU~LsE2UbvcIa;w-acn%C|DXTL+U*?YPw6aIGA@oI2tyaM&`2-B$Q{ zs6&thbgGwTOwJCZdD&-Ea6sYnY{JPd_VHVd0imppgsI)?E!)O0#AV-I#a@lntr1N? zffJJmXme5C&RVL=1`5HS6OQ)Ayp`zWtZ)cUP_$30Ly}FG8)}`BTyG&*roz^3JN()8 z)-6w7zQas!iYPf?Ds_TC^6xAAKI#x&uZjF8bGCo|TR{E7R(FSY(Bg)(m$>MVkm~j|1AT441 z>AB*Dvs>8%8Qy@!s4d+nXRF;Tg$1M8SSzqy9wU=HU(GA~VuR$;xRP~i86WjG+sH|i zWps7H-fz$Bi(Ur z;gs-%s8oL>eS0U~a>%MK2X44tbg48;Fq1KTaU|AALS%h5j;vdsdTW`4ofNLbYwU`- z-i4FK8|@bv=G#b=drQ?Gkx5=X-(M@(6YeH}t?$hV=k8`leSCUq1Rg(bZa&!_Fz&JS zv@hF%x!OCtpeTKPauUGwUF(&%9>EqYSp^vOFB+Sy&;+ydDms<3Ht!<*ar0@NkO!>& z^3aR!fQyi6rsz{e?EdmPk6@=pc8uL3ny#8h9hdvQvl-g-_Z9ITSgQ*Li@~%9z&uSe zc{Elzw-f!RdYA^?!W$x+Oo%@96FZvDQ3p{5#A7CR+sj1dSHAame1ywhINCi|s7^-1 z>yrw5Ibl*R394O`wsQS)@>)@W^>u0Ww#GO&-_&WY;oYe182ob0$jHdRx^RX#6Um7b zodhXLj1^OPns5e0H|1B#$pDy~2wo1^Q4K#whjxh!DIIOI41VDp)GxG%Qe^%8(4c=i zH$VN;rKD~~>dAFILt%WjWI*JE0%Dfe52d#C0;-DA8Kvl@b(=3=>%8>9V2W30x7GX| z8<;Y(74msEke!#4eLT))oMv>bXSzgU;+UQehCraQ^FvC|`Qcvz=w-c2jh4e1vV}=| z-ElNsULMV&pNvN2VU685zZQBB=rp3UZ=6i=`qJLkRc(!^3 zmAA~^PFls}V6wOF=zk}A1INqndX#--E%Nad2kZ}}=hYs0WX>n{&JU#Qtxm1Kd^?!o z_0MW~w^e4^I#dYsnX?_>*VE1041VdMy7!@cSGG&vSYcpZvGC1mUIvfdju<1A-d5Zr zGT)%cEmVpZBcvpb2^On)#dLi3^vId-ZXk5sc+a}k;k;1TSDJ13NkIFuZ;uPL< zvJ6|6E|`15D#}pITDs^`k%d>4G8cWmL{VPS>MAc7>*s^+^*kZzd zaVoI?x8?kQ#?V!yX~D^MN$^=#wAdm~p6-lyqs;3!g)rrcU2jfOQEtTITodGto7`t7 zY%k`sPSC8nUJ}SNY)LXZ@Z7{}$u;AEW@=E9AYy_i><13t)f;pYC?Zhodk#B>v3ac8 zFXN@+Z9w2%no`Qi4Dh0cD`OjS@LO({WZkNnfQo7R!qb>8kY|3>A#p>(5YDlncVza} zq;}4V%+D&WCnvBL-!}!xexD6$Ok5o{8SGvk0?i=)5R;b zdekn=jLW6S#;NlK^P4s8hRO_LfVWRCqurz8^ko=$2|rj%u#X6rk-CoRImBjIOy=R`DeiT;ra!@5Etk!Kv*xm8N+M zG|RsQ7>k4d)~}9hRfdO5M>S?y)jbS4pZl$KY6!!De8a{7RxB<@XDg&ufi$5WiRdeCW3u*#&@2vX)9o-k9eV-!_u-t@W~@_rKqI}OcZu21W=`J zRks+kVvN%VInmoFBD<$Ur0zsVc@=?%Ml9l%fW@BA5@u|qCWPb%*Sf3+Bj`ggv~4?hFY3!@uK&P z$Dl@o2}Ctst1_jhGC9A9-r;>@pb8`5Rbg1cTmXuRn!Nzsf2=R4 z7&uZoS!62whrVl1)c&Ku9Hz$tX}j$Pg3aM|awQ%r?2{48zzE!00lC&@z$r5GO1T^B zv}pel@KoWi%o05dK(yJ0)WPe@LHhFhccpXgJw2EO?C55imWW-LM}w@cBU`U#@!w&; z!_2uaM^?0G5#A#oU4)*p|G2SGcvm+hbNjN- z#A?ystVU6Xe5JML(M^)Jj}O}c3(Nh(JhR-DEjyD(L_tqKCqZlaxi~qh*MzIjqH`BU zpW~%Dk8z>ufMmTf*Dnv>FTUcLQ@3lw7)RQY^si2MBf9K2yQ6y8UfD7&i+@dNf)>b? zO==8df;VS;XblLymoMI3&wYbOV8y20 zC-6tNjwFjmsyWWdY=`%6NNJi5&$&dbo%yRRLj*V3tj16pR}HMOmImQ94^q$9js#2^ zFvwJKwjd~`Ns0~4x~&dg+frO<%t0T_?=?~m20Pze=nWIJ5+>0)qE*L8l|(mNAs*qp z@d=kDnn9hc$LOI0_Geahl(tJimwAl}p?q+8*7@gsO(wrp>OPJ&HGGAoR?WACN%8EjKGeZBqX0`SYy}joe&$VT_cTf`1yq>;(X*$cbl%f=~ zhqs#-c_Rap7TxZ|HUwM@dIbJ`MGm2qNvf&7vo2~i9NUn`Zc00nl9X#d37j|zD&|4? zADnswUig)NTJ8DrPd0K)QTE=F7G#osZ<|O(0yPdtj$2=*NkbH$b?_A=e+`n#TsSDv zlOelmBTp`s1inhDXjxsGAgo;S1_WAb8pz3uuI@Lyr@@Eem0#9ahC!3LJTeNkks~B5 z4bO5aoHxOyVBtuq-M=01PIg#3{X)ZMO)GM`LfIm%#^avqJPP)T0dOxjwBqmN$^RpUbT=qBhF8X!5dDThi}|Icqi+JaI9ph#(XATgU(L?MzL2EfyrU>; z-I*BD(3v&j9>>hL3uvav-kCot*ccD6i(k7g7hTx- zGg8NHNs+o_h$U&(n~W_d5TiI|D1#5o_ohVh@&EnfS8XpXhMNb|-DxkW)! z9DpsNy3p>rFzHof^jLcfm*v`)r+W@;R|cxruBA4GOQf1|o5<@r?8~pwO`vC=msjqg zyjdm8Ql-M0RQl+eW4nVUu34&Tk(Ir5uF@(rSiIF`G3~YCnHD)frBNSb#YwWO^LgW; zHeiG*SRIkiOESA{-U*5uy9ukX@^>|ezaiEqYKwjI$Nuv+bJ6=lN3|8>$~R|m&gi&U zo2MNk$3Zc%^p*<

;3eE@{2h@BnsEWD`$@H?5i(-xv)7ZkQ(0AY!Psj!J#uA|a|o zEOZtGJ>mhNeixdxxB+ine^7rnMM%(=;QXK`bK04Kb~0*$evk&yG?Do|=}Syh3#6;P zIb|=^||0f+7U+YBk<9GX1Ms|HoV^GHW!k5pproc z3I2G$^@eK@gQe&tqxz6t8X1H8z#h<&+DTNHc#`%M*|KBMrI=041sMzA61&sr>7mnR zN%J!E!X3+pxs7ZeTzA0zI19Vg)}2uYV7(s6Wo$D*$Z~YHvyameH_@ssLMx=7^IGZw z^m(dfx1SmIqJ>K&9+&l{$7ekUxc@761c>{(W0}QEK|nGVUd!>BT>wfHzU~g zuen<0s-mL(bW)1)xQw0?A$J#*p>r9Lp*)qZWAE3NrP_8QR7oJST6VH%q-y)x_9F4Z z@xr35mIW|9?U;P=s^vb{g04)>!q=e{%KNn${Tlw5fZB_ff2tDcU{{Y}$uAJ~p zc*o8702-UfP7QH8l*uS<-=rya>60Op61X7EYTfOseXC&<(z{j{h_juubr(^>G0vpi zMf%2k)flUsn*;3)yEXp+{{Ug!xAl1E?wIahSHNdceiX)5u_7WOSVpWi znu@E!CAbzT)u^hfjC0mBcdE60NTZtQQ1@5MIkRw=n%m!w(yA(FMuvX<cne<&Afie16)H zsdgErY_ZU*O5~(6Br#q)p3-shzG{UjyU1%Sl3qbhs!OKvY~wFK4I*;t(?-7UimS)U zpA{P_r~d$jKfHe%it5cI?T0^yzZ!Ad=Q0;d=&fq^I$UEU<=-lK&rTIp6&$C^lHiY5 zep)wHnaoaRQ+3{%kXJ3NbnQ1B!`Z7OQIsQxG0xjn>J(V%2=``5yHty2wNAEe;G>mb z9br76{{Z@y@wJz_tyex&_c~Qx8mscBbDpTbFU4y<;{9*K^-iH|2(`97lC?Z@-P<*6 za~QJCAELRAY!&Lp_Bl92^Xy8E^>V`RbdyiUjx_3CCF)2GGp1lYgsQ@wXU|!dq zHYbT7l&!AQC{&Tmoq|^l8xg~wDHiRSwPO<+)r353dj_3c^T}dIODnl@{{VTdPIzk* zbZ<7FxD{3yIFsJ|TJC6SV zXUNlr7! literal 0 HcmV?d00001 diff --git a/examples/balance_example.py b/examples/balance_example.py deleted file mode 100644 index b19c2aa0..00000000 --- a/examples/balance_example.py +++ /dev/null @@ -1,45 +0,0 @@ -from print_running_function import print_running_function - -# Hackish method to import from another directory -# Useful while xendit-python isn't released yet to the public -import importlib.machinery - -loader = importlib.machinery.SourceFileLoader("xendit", "../xendit/__init__.py") -xendit = loader.load_module("xendit") - - -class GetBalance: - @staticmethod - def run(xendit_instance, account_type): - try: - balance = xendit_instance.Balance.get(account_type=account_type) - print(balance) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = {"account_type": xendit.BalanceAccountType.CASH} - print_running_function("xendit.Balance.AccountType", args) - GetBalance.run(xendit_instance, **args) - - -def ask_balance_input(): - print("Input the action that you want to use") - print("0. Exit") - print("1. Get Balance") - try: - return int(input()) - except ValueError: - print("Invalid input. Please type a number") - return ask_balance_input() - - -def balance_example(xendit_instance): - balance_input = ask_balance_input() - while balance_input != 0: - if balance_input == 1: - print("Running example of Get Balance") - GetBalance.example(xendit_instance) - balance_input = ask_balance_input() diff --git a/examples/batch_disbursement_example.py b/examples/batch_disbursement_example.py deleted file mode 100644 index e9a5f692..00000000 --- a/examples/batch_disbursement_example.py +++ /dev/null @@ -1,61 +0,0 @@ -import time - -from print_running_function import print_running_function - -# Hackish method to import from another directory -# Useful while xendit-python isn't released yet to the public -import importlib.machinery - -loader = importlib.machinery.SourceFileLoader("xendit", "../xendit/__init__.py") -xendit = loader.load_module("xendit") - - -class CreateBatchDisbursement: - @staticmethod - def run(xendit_instance, **kwargs): - try: - batch_disbursement = xendit_instance.BatchDisbursement.create(**kwargs) - print(batch_disbursement) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - batch_disbursement_items = [] - batch_disbursement_items.append( - { - "amount": 10000, - "bank_code": "BCA", - "bank_account_name": "Adyaksa W", - "bank_account_number": "12345678", - "description": "Sample Batch Disbursement", - "external_id": f"batch-disbursement-item-{int(time.time())}", - } - ) - args = { - "reference": f"batch_disbursement-{int(time.time())}", - "disbursements": batch_disbursement_items, - } - print_running_function("xendit.BatchDisbursement.create", args) - CreateBatchDisbursement.run(xendit_instance, **args) - - -def ask_batch_disbursement_input(): - print("Input the action that you want to use") - print("0. Exit") - print("1. Create Batch Disbursement") - try: - return int(input()) - except ValueError: - print("Invalid input. Please type a number") - return ask_batch_disbursement_input() - - -def batch_disbursement_example(xendit_instance): - batch_disbursement_input = ask_batch_disbursement_input() - while batch_disbursement_input != 0: - if batch_disbursement_input == 1: - print("Running example of Create Batch Disbursement") - CreateBatchDisbursement.example(xendit_instance) - batch_disbursement_input = ask_batch_disbursement_input() diff --git a/examples/cardless_credit_example.py b/examples/cardless_credit_example.py deleted file mode 100644 index 9b76216f..00000000 --- a/examples/cardless_credit_example.py +++ /dev/null @@ -1,123 +0,0 @@ -import time - -from print_running_function import print_running_function - -# Hackish method to import from another directory -# Useful while xendit-python isn't released yet to the public -import importlib.machinery - -loader = importlib.machinery.SourceFileLoader("xendit", "../xendit/__init__.py") -xendit = loader.load_module("xendit") - - -class CreateCardlessCreditPayment: - @staticmethod - def run(xendit_instance, **kwargs): - try: - cardless_credit_payment = xendit_instance.CardlessCredit.create_payment( - **kwargs - ) - print(cardless_credit_payment) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - cardless_credit_items = [] - cardless_credit_items.append( - { - "id": "item-123", - "name": "Phone Case", - "price": 200000, - "type": "Smartphone", - "url": "http://example.com/phone/phone_case", - "quantity": 2, - } - ) - customer_details = { - "first_name": "customer first name", - "last_name": "customer last name", - "email": "customer@email.com", - "phone": "0812332145", - } - shipping_address = { - "first_name": "first name", - "last_name": "last name", - "address": "Jl Teknologi No. 12", - "city": "Jakarta", - "postal_code": "12345", - "phone": "081513114262", - "country_code": "IDN", - } - args = { - "cardless_credit_type": xendit.CardlessCreditType.KREDIVO, - "external_id": f"id-{int(time.time())}", - "amount": 10000, - "payment_type": "3_months", - "items": cardless_credit_items, - "customer_details": customer_details, - "shipping_address": shipping_address, - "redirect_url": "https://my-shop.com/home", - "callback_url": "https://my-shop.com/callback", - } - print_running_function("xendit.CardlessCredit.create_payment", args) - CreateCardlessCreditPayment.run(xendit_instance, **args) - - -class CalculatePaymentType: - @staticmethod - def run(xendit_instance, **kwargs): - try: - cardless_credit_payment_types = xendit_instance.CardlessCredit.calculate_payment_type( - **kwargs - ) - print(cardless_credit_payment_types) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - cardless_credit_items = [] - cardless_credit_items.append( - { - "id": "item-123", - "name": "Phone Case", - "price": 200000, - "type": "Smartphone", - "url": "http://example.com/phone/phone_case", - "quantity": 2, - } - ) - args = { - "cardless_credit_type": xendit.CardlessCreditType.KREDIVO, - "amount": 10000, - "items": cardless_credit_items, - } - print_running_function("xendit.CardlessCredit.calculate_payment_type", args) - CalculatePaymentType.run(xendit_instance, **args) - - -def ask_cardless_credit_input(): - print("Input the action that you want to use") - print("0. Exit") - print("1. Create Payment / Generate Checkout URL") - print("2. Calculate Payment Types") - try: - return int(input()) - except ValueError: - print("Invalid input. Please type a number") - return ask_cardless_credit_input() - - -def cardless_credit_example(xendit_instance): - cardless_credit_input = ask_cardless_credit_input() - while cardless_credit_input != 0: - if cardless_credit_input == 1: - print("Running example of Create Payment / Generate Checkout URL") - CreateCardlessCreditPayment.example(xendit_instance) - elif cardless_credit_input == 2: - print("Running example of Calculate Payment Types") - CalculatePaymentType.example(xendit_instance) - cardless_credit_input = ask_cardless_credit_input() diff --git a/examples/credit_card_example.py b/examples/credit_card_example.py deleted file mode 100644 index 1f10e0cc..00000000 --- a/examples/credit_card_example.py +++ /dev/null @@ -1,210 +0,0 @@ -import time - -from print_running_function import print_running_function - -# Hackish method to import from another directory -# Useful while xendit-python isn't released yet to the public -import importlib.machinery - -loader = importlib.machinery.SourceFileLoader("xendit", "../xendit/__init__.py") -xendit = loader.load_module("xendit") - - -class CreateAuthorization: - @staticmethod - def run(xendit_instance, **kwargs): - try: - charge = xendit_instance.CreditCard.create_authorization(**kwargs) - print(charge) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - token_id = input("Please input your token_id: ") - args = { - "token_id": token_id, - "external_id": f"card_preAuth-{int(time.time())}", - "amount": 75000, - "card_cvn": "123", - } - print_running_function("xendit.CreditCard.create_authorization", args) - CreateAuthorization.run(xendit_instance, **args) - - -class ReverseAuthorization: - @staticmethod - def run(xendit_instance, **kwargs): - try: - reverse_authorization = xendit_instance.CreditCard.reverse_authorization( - **kwargs - ) - print(reverse_authorization) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - credit_card_charge_id = input("Please input your credit_card_charge_id: ") - args = { - "credit_card_charge_id": credit_card_charge_id, - "external_id": f"reverse-authorization-{int(time.time())}", - } - print_running_function("xendit.CreditCard.reverse_authorizatiton", args) - ReverseAuthorization.run(xendit_instance, **args) - - -class CreateCharge: - @staticmethod - def run(xendit_instance, **kwargs): - try: - charge = xendit_instance.CreditCard.create_charge(**kwargs) - print(charge) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - token_id = input("Please input your token_id: ") - args = { - "token_id": token_id, - "external_id": f"card_charge-{int(time.time())}", - "amount": 75000, - "card_cvn": "123", - } - print_running_function("xendit.CreditCard.create_charge", args) - CreateCharge.run(xendit_instance, **args) - - -class CaptureCharge: - @staticmethod - def run(xendit_instance, **kwargs): - try: - charge = xendit_instance.CreditCard.capture_charge(**kwargs) - print(charge) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - credit_card_charge_id = input("Please input your credit_card_charge_id: ") - args = { - "credit_card_charge_id": credit_card_charge_id, - "amount": 75000, - } - print_running_function("xendit.CreditCard.capture_charge", args) - CaptureCharge.run(xendit_instance, **args) - - -class GetCharge: - @staticmethod - def run(xendit_instance, **kwargs): - try: - charge = xendit_instance.CreditCard.get_charge(**kwargs) - print(charge) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - credit_card_charge_id = input("Please input your credit_card_charge_id: ") - args = { - "credit_card_charge_id": credit_card_charge_id, - } - print_running_function("xendit.CreditCard.get_charge", args) - GetCharge.run(xendit_instance, **args) - - -class CreateRefund: - @staticmethod - def run(xendit_instance, **kwargs): - try: - refund = xendit_instance.CreditCard.create_refund(**kwargs) - print(refund) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - credit_card_charge_id = input("Please input your credit_card_charge_id: ") - args = { - "credit_card_charge_id": credit_card_charge_id, - "amount": 10000, - "external_id": f"card_refund-{int(time.time())}", - } - print_running_function("xendit.CreditCard.create_refund", args) - CreateRefund.run(xendit_instance, **args) - - -class CreatePromotion: - @staticmethod - def run(xendit_instance, **kwargs): - try: - credit_card = xendit_instance.CreditCard.create_promotion(**kwargs) - print(credit_card) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "reference_id": f"BRI_20_JAN-{int(time.time())}", - "description": "20% discount applied for all BRI cards", - "discount_amount": 10000, - "bin_list": ["400000", "460000"], - "start_time": "2020-01-01T00:00:00.000Z", - "end_time": "2021-01-01T00:00:00.000Z", - } - print_running_function("xendit.CreditCard.create_promotion", args) - CreatePromotion.run(xendit_instance, **args) - - -def ask_credit_card_input(): - print("Input the action that you want to use") - print("0. Exit") - print("1. Create Authorization") - print("2. Reverse Authorization") - print("3. Create Charge") - print("4. Capture Charge") - print("5. Get Charge") - print("6. Create Refund") - print("7. Create Promotion") - try: - return int(input()) - except ValueError: - print("Invalid input. Please type a number") - return ask_credit_card_input() - - -def credit_card_example(xendit_instance): - credit_card_input = ask_credit_card_input() - while credit_card_input != 0: - if credit_card_input == 1: - print("Running example of Create Authorization") - CreateAuthorization.example(xendit_instance) - elif credit_card_input == 2: - print("Running example of Reverse Authorization") - ReverseAuthorization.example(xendit_instance) - elif credit_card_input == 3: - print("Running example of Create Charge") - CreateCharge.example(xendit_instance) - elif credit_card_input == 4: - print("Running example of Capture Charge") - CaptureCharge.example(xendit_instance) - elif credit_card_input == 5: - print("Running example of Get Charge") - GetCharge.example(xendit_instance) - elif credit_card_input == 6: - print("Running example of Create Refund") - CreateRefund.example(xendit_instance) - elif credit_card_input == 7: - print("Running example of Create Promotion") - CreatePromotion.example(xendit_instance) - credit_card_input = ask_credit_card_input() diff --git a/examples/direct_debit_example.py b/examples/direct_debit_example.py deleted file mode 100644 index bb3e8e5d..00000000 --- a/examples/direct_debit_example.py +++ /dev/null @@ -1,320 +0,0 @@ -from print_running_function import print_running_function - -import time - -# Hackish method to import from another directory -# Useful while xendit-python isn't released yet to the public -import importlib.machinery - -loader = importlib.machinery.SourceFileLoader("xendit", "../xendit/__init__.py") -xendit = loader.load_module("xendit") - - -class CreateCustomer: - @staticmethod - def run(xendit_instance, **kwargs): - try: - customer = xendit_instance.DirectDebit.create_customer(**kwargs) - print(customer) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "reference_id": f"merc-{int(time.time())}", - "email": "t@x.co", - "given_names": "Adyaksa", - } - print_running_function("xendit.DirectDebit.create_customer", args) - CreateCustomer.run(xendit_instance, **args) - - -class GetCustomerByRefID: - @staticmethod - def run(xendit_instance, **kwargs): - try: - customer = xendit_instance.DirectDebit.get_customer_by_ref_id(**kwargs) - print(customer) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - reference_id = input("Please input your reference_id: ") - args = { - "reference_id": reference_id, - } - print_running_function("xendit.DirectDebit.get_customer_by_ref_id", args) - GetCustomerByRefID.run(xendit_instance, **args) - - -class InitializeTokenization: - @staticmethod - def run(xendit_instance, **kwargs): - try: - customer = xendit_instance.DirectDebit.initialize_tokenization(**kwargs) - print(customer) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "customer_id": "ed20b5db-df04-41fc-8018-8ea4ac4d1030", - "channel_code": "DC_BRI", - "properties": { - "account_mobile_number": "+62818555988", - "card_last_four": "8888", - "card_expiry": "06/24", - "account_email": "test.email@xendit.co", - }, - } - print_running_function("xendit.DirectDebit.initialize_tokenization", args) - InitializeTokenization.run(xendit_instance, **args) - - -class ValidateTokenOTP: - @staticmethod - def run(xendit_instance, **kwargs): - try: - linked_account_token = xendit_instance.DirectDebit.validate_token_otp( - **kwargs - ) - print(linked_account_token) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - linked_account_token_id = input("Please input your linked_account_token_id: ") - args = { - "linked_account_token_id": linked_account_token_id, - "otp_code": "333000", - } - print_running_function("xendit.DirectDebit.validate_token_otp", args) - ValidateTokenOTP.run(xendit_instance, **args) - - -class GetAccessibleAccountsByToken: - @staticmethod - def run(xendit_instance, **kwargs): - try: - customer = xendit_instance.DirectDebit.get_accessible_accounts_by_token( - **kwargs - ) - print(customer) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - linked_account_token_id = input("Please input your linked_account_token_id: ") - args = { - "linked_account_token_id": linked_account_token_id, - } - print_running_function( - "xendit.DirectDebit.get_accessible_account_by_token", args - ) - GetAccessibleAccountsByToken.run(xendit_instance, **args) - - -class CreatePaymentMethod: - @staticmethod - def run(xendit_instance, **kwargs): - try: - customer = xendit_instance.DirectDebit.create_payment_method(**kwargs) - print(customer) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - customer_id = input("Please input your customer_id: ") - linked_account_token_id = input("Please input your linked_account_token_id: ") - args = { - "customer_id": customer_id, - "type": xendit.DirectDebitPaymentMethodType.DEBIT_CARD, - "properties": {"id": linked_account_token_id}, - } - print_running_function("xendit.DirectDebit.create_payment_method", args) - CreatePaymentMethod.run(xendit_instance, **args) - - -class GetPaymentMethodsByCustomerID: - @staticmethod - def run(xendit_instance, **kwargs): - try: - customer = xendit_instance.DirectDebit.get_payment_methods_by_customer_id( - **kwargs - ) - print(customer) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - customer_id = input("Please input your customer_id: ") - args = { - "customer_id": customer_id, - } - print_running_function( - "xendit.DirectDebit.get_payment_methods_by_customer_id", args - ) - GetPaymentMethodsByCustomerID.run(xendit_instance, **args) - - -class CreatePayment: - @staticmethod - def run(xendit_instance, **kwargs): - try: - payment = xendit_instance.DirectDebit.create_payment(**kwargs) - print(payment) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - payment_method_id = input("Please input your payment_method_id: ") - args = { - "reference_id": f"direct-debit-ref-{int(time.time())}", - "payment_method_id": payment_method_id, - "currency": "IDR", - "amount": "60000", - "callback_url": "http://webhook.site/", - "enable_otp": True, - "idempotency_key": f"idemp_key-{int(time.time())}", - } - print_running_function("xendit.DirectDebit.create_payment", args) - CreatePayment.run(xendit_instance, **args) - - -class ValidatePaymentOTP: - @staticmethod - def run(xendit_instance, **kwargs): - try: - payment = xendit_instance.DirectDebit.validate_payment_otp(**kwargs) - print(payment) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - direct_debit_id = input("Please input your direct_debit_id: ") - args = { - "direct_debit_id": direct_debit_id, - "otp_code": "222000", - } - print_running_function("xendit.DirectDebit.validate_payment_otp", args) - ValidatePaymentOTP.run(xendit_instance, **args) - - -class GetPaymentStatus: - @staticmethod - def run(xendit_instance, **kwargs): - try: - payment = xendit_instance.DirectDebit.get_payment_status(**kwargs) - print(payment) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - direct_debit_id = input("Please input your direct_debit_id: ") - args = { - "direct_debit_id": direct_debit_id, - } - print_running_function("xendit.DirectDebit.get_payment_status", args) - GetPaymentStatus.run(xendit_instance, **args) - - -class GetPaymentStatusByRefID: - @staticmethod - def run(xendit_instance, **kwargs): - try: - payment = xendit_instance.DirectDebit.get_payment_status_by_ref_id(**kwargs) - print(payment) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - reference_id = input("Please input your reference_id: ") - args = { - "reference_id": reference_id, - } - print_running_function("xendit.DirectDebit.get_payment_status_by_ref_id", args) - GetPaymentStatusByRefID.run(xendit_instance, **args) - - -def ask_direct_debit_input(): - print("Input the action that you want to use") - print("0. Exit") - print("1. Create Customer") - print("2. Get Customer by Reference ID") - print("3. Initialize Linked Account Tokenization") - print("4. Validate OTP for Linked Account Token") - print("5. Retrieve Accessible Accounts by Linked Account Token") - print("6. Create Payment Method") - print("7. Get Payment Methods by Customer ID") - print("8. Create Direct Debit Payment") - print("9. Validate OTP for Direct Debit Payment") - print("10. Get Direct Debit Payment Status by ID") - print("11. Get Direct Debit Payment Status by Reference ID") - try: - return int(input()) - except ValueError: - print("Invalid input. Please type a number") - return ask_direct_debit_input() - - -def direct_debit_example(xendit_instance): - direct_debit_input = ask_direct_debit_input() - while direct_debit_input != 0: - if direct_debit_input == 1: - print("Running example of Create Customer") - CreateCustomer.example(xendit_instance) - elif direct_debit_input == 2: - print("Running example of Get Customer by Reference ID") - GetCustomerByRefID.example(xendit_instance) - elif direct_debit_input == 3: - print("Running example of Initialize Linked Account Tokenization") - InitializeTokenization.example(xendit_instance) - elif direct_debit_input == 4: - print("Running example of Validate OTP for Linked Account Token") - ValidateTokenOTP.example(xendit_instance) - elif direct_debit_input == 5: - print( - "Running example of Retrieve Accessible Accounts by Linked Account Token" - ) - GetAccessibleAccountsByToken.example(xendit_instance) - elif direct_debit_input == 6: - print("Running example of Create Payment Method") - CreatePaymentMethod.example(xendit_instance) - elif direct_debit_input == 7: - print("Running example of Get Payment Methods by Customer ID") - GetPaymentMethodsByCustomerID.example(xendit_instance) - elif direct_debit_input == 8: - print("Running example of Create Direct Debit Payment") - CreatePayment.example(xendit_instance) - elif direct_debit_input == 9: - print("Running example of Validate OTP for Direct Debit Payment") - ValidatePaymentOTP.example(xendit_instance) - elif direct_debit_input == 10: - print("Running example of Get Direct Debit Payment Status by ID") - GetPaymentStatus.example(xendit_instance) - elif direct_debit_input == 11: - print("Running example of Get Direct Debit Payment Status by Reference ID") - GetPaymentStatusByRefID.example(xendit_instance) - direct_debit_input = ask_direct_debit_input() diff --git a/examples/disbursement_example.py b/examples/disbursement_example.py deleted file mode 100644 index 0f61772b..00000000 --- a/examples/disbursement_example.py +++ /dev/null @@ -1,140 +0,0 @@ -from print_running_function import print_running_function - -# Hackish method to import from another directory -# Useful while xendit-python isn't released yet to the public -import importlib.machinery - -loader = importlib.machinery.SourceFileLoader("xendit", "../xendit/__init__.py") -xendit = loader.load_module("xendit") - - -class CreateDisbursement: - @staticmethod - def run( - xendit_instance, - external_id, - bank_code, - account_holder_name, - account_number, - description, - amount, - **kwargs, - ): - try: - disbursement = xendit_instance.Disbursement.create( - external_id=external_id, - bank_code=bank_code, - account_holder_name=account_holder_name, - account_number=account_number, - description=description, - amount=amount, - **kwargs, - ) - print(disbursement) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "external_id": "demo_1475459775872", - "bank_code": "BCA", - "account_holder_name": "Bob Jones", - "account_number": "1231242311", - "description": "Reimbursement for shoes", - "amount": 17000, - } - print_running_function("xendit.Disbursement.create", args) - CreateDisbursement.run(xendit_instance, **args) - - -class GetDisbursementByID: - @staticmethod - def run(xendit_instance, id, **kwargs): - try: - disbursement = xendit_instance.Disbursement.get(id=id, **kwargs,) - print(disbursement) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "id": "5ef1befeecb16100179e1d05", - } - print_running_function("xendit.Disbursement.get", args) - GetDisbursementByID.run(xendit_instance, **args) - - -class GetDisbursementByExternalID: - @staticmethod - def run(xendit_instance, external_id, **kwargs): - try: - disbursement = xendit_instance.Disbursement.get_by_ext_id( - external_id=external_id, **kwargs, - ) - print(disbursement) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "external_id": "demo_1475459775872", - } - print_running_function("xendit.Disbursement.get_by_ext_id", args) - GetDisbursementByExternalID.run(xendit_instance, **args) - - -class GetDisbursementBanks: - @staticmethod - def run(xendit_instance, **kwargs): - try: - disbursement_banks = xendit_instance.Disbursement.get_available_banks( - **kwargs - ) - print(disbursement_banks) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = {} - print_running_function("xendit.Disbursement.get_available_banks", args) - GetDisbursementBanks.run(xendit_instance) - - -def ask_disbursement_input(): - print("Input the action that you want to use") - print("0. Exit") - print("1. Create Disbursement") - print("2. Get Disbursement by ID") - print("3. Get Disbursement by External ID") - print("4. Get Available Banks") - try: - return int(input()) - except ValueError: - print("Invalid input. Please type a number") - return ask_disbursement_input() - - -def disbursement_example(xendit_instance): - disbursement_input = ask_disbursement_input() - while disbursement_input != 0: - if disbursement_input == 1: - print("Running example of Create Disbursement") - CreateDisbursement.example(xendit_instance) - elif disbursement_input == 2: - print("Running example of Get Disbursement by ID") - GetDisbursementByID.example(xendit_instance) - elif disbursement_input == 3: - print("Running example of Get Disbursement by External ID") - GetDisbursementByExternalID.example(xendit_instance) - elif disbursement_input == 4: - print("Running example of Get Available Banks") - GetDisbursementBanks.example(xendit_instance) - disbursement_input = ask_disbursement_input() diff --git a/examples/ewallet_example.py b/examples/ewallet_example.py deleted file mode 100644 index 48ffb260..00000000 --- a/examples/ewallet_example.py +++ /dev/null @@ -1,312 +0,0 @@ -from print_running_function import print_running_function - -import time - -# Hackish method to import from another directory -# Useful while xendit-python isn't released yet to the public -import importlib.machinery - -loader = importlib.machinery.SourceFileLoader("xendit", "../xendit/__init__.py") -xendit = loader.load_module("xendit") - - -class CreateOVOPayment: - @staticmethod - def run(xendit_instance, external_id, amount, phone, **kwargs): - try: - ewallet = xendit_instance.EWallet.create_ovo_payment( - external_id=external_id, amount=amount, phone=phone, - ) - print(ewallet) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "external_id": f"ovo-ewallet-testing-id-{int(time.time())}", - "amount": "80001", - "phone": "08123123123", - } - print_running_function("xendit.EWallet.create_ovo_payment", args) - CreateOVOPayment.run(xendit_instance, **args) - - -class CreateDANAPayment: - @staticmethod - def run(xendit_instance, external_id, amount, callback_url, redirect_url, **kwargs): - try: - ewallet = xendit_instance.EWallet.create_dana_payment( - external_id=external_id, - amount=amount, - callback_url=callback_url, - redirect_url=redirect_url, - **kwargs, - ) - print(ewallet) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "external_id": f"dana-ewallet-test-{int(time.time())}", - "amount": "1001", - "callback_url": "https://my-shop.com/callbacks", - "redirect_url": "https://my-shop.com/home", - } - print_running_function("xendit.EWallet.create_dana_payment", args) - CreateDANAPayment.run(xendit_instance, **args) - - -class CreateLinkAjaPayment: - @staticmethod - def run( - xendit_instance, - external_id, - phone, - amount, - items, - callback_url, - redirect_url, - **kwargs, - ): - try: - ewallet = xendit_instance.EWallet.create_linkaja_payment( - external_id=external_id, - phone=phone, - amount=amount, - items=items, - callback_url=callback_url, - redirect_url=redirect_url, - **kwargs, - ) - print(ewallet) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - items = [] - item = xendit.EWallet.helper_create_linkaja_item( - id="123123", name="Phone Case", price=100000, quantity=1 - ) - items.append(item) - - args = { - "external_id": f"linkaja-ewallet-test-{int(time.time())}", - "phone": "089911111111", - "items": {items}, - "amount": 300000, - "callback_url": "https://my-shop.com/callbacks", - "redirect_url": "https://xendit.co/", - } - print_running_function("xendit.EWallet.create_linkaja_payment", args) - CreateLinkAjaPayment.run(xendit_instance, **args) - - -class GetOVOPaymentStatus: - @staticmethod - def run(xendit_instance, external_id, ewallet_type, **kwargs): - try: - ewallet = xendit_instance.EWallet.get_payment_status( - external_id=external_id, ewallet_type=ewallet_type, **kwargs, - ) - print(ewallet) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "ewallet_type": xendit.EWalletType.OVO, - "external_id": "ovo-ewallet-testing-id-1234", - } - print_running_function("xendit.EWallet.get_payment_status", args) - GetOVOPaymentStatus.run(xendit_instance, **args) - - -class GetDANAPaymentStatus: - @staticmethod - def run(xendit_instance, external_id, ewallet_type, **kwargs): - try: - ewallet = xendit_instance.EWallet.get_payment_status( - external_id=external_id, ewallet_type=ewallet_type, **kwargs, - ) - print(ewallet) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "ewallet_type": xendit.EWalletType.DANA, - "external_id": "dana-ewallet-test-1234", - } - print_running_function("xendit.EWallet.get_payment_status", args) - GetDANAPaymentStatus.run(xendit_instance, **args) - - -class GetLinkAjaPaymentStatus: - @staticmethod - def run(xendit_instance, external_id, ewallet_type, **kwargs): - try: - ewallet = xendit_instance.EWallet.get_payment_status( - external_id=external_id, ewallet_type=ewallet_type, **kwargs, - ) - print(ewallet) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "ewallet_type": xendit.EWalletType.LINKAJA, - "external_id": "linkaja-ewallet-test-123", - } - print_running_function("xendit.EWallet.get_payment_status", args) - GetLinkAjaPaymentStatus.run(xendit_instance, **args) - - -class CreateEWalletCharge: - @staticmethod - def run( - xendit_instance, - reference_id, - currency, - amount, - checkout_method, - channel_code=None, - channel_properties=None, - customer_id=None, - basket=None, - metadata=None, - **kwargs, - ): - try: - ewallet_charge = xendit_instance.EWallet.create_ewallet_charge( - reference_id=reference_id, - currency=currency, - amount=amount, - checkout_method=checkout_method, - channel_code=channel_code, - channel_properties=channel_properties, - customer_id=customer_id, - basket=basket, - metadata=metadata, - **kwargs, - ) - print(ewallet_charge) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - basket = [] - basket_item = xendit.EWallet.helper_create_basket_item( - reference_id="basket-product-ref-id", - name="product_name", - category="mechanics", - currency="IDR", - price=50000, - quantity=5, - type="wht", - sub_category="evr", - metadata={ - "meta": "data" - } - ) - basket.append(basket_item) - - args = { - "reference_id": "test-reference-id", - "currency": "IDR", - "amount": 1688, - "checkout_method": "ONE_TIME_PAYMENT", - "channel_code": "ID_SHOPEEPAY", - "channel_properties": { - "success_redirect_url": "https://yourwebsite.com/order/123", - }, - "basket": basket, - "metadata": { - "meta2": "data2", - }, - } - print_running_function("xendit.EWallet.create_ewallet_charge", args) - CreateEWalletCharge.run(xendit_instance, **args) - - -class GetEWalletChargeStatus: - @staticmethod - def run(xendit_instance, charge_id, **kwargs): - try: - ewallet = xendit_instance.EWallet.get_ewallet_charge_status( - charge_id=charge_id, **kwargs, - ) - print(ewallet) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "charge_id": "ewc_f3925450-5c54-4777-98c1-fcf22b0d1e1c", - } - print_running_function("xendit.EWallet.get_ewallet_charge_status", args) - GetEWalletChargeStatus.run(xendit_instance, **args) - - -def ask_ewallet_input(): - print("Input the action that you want to use") - print("0. Exit") - print("1. Create OVO Payment") - print("2. Create DANA Payment") - print("3. Create LinkAja Payment") - print("4. Get OVO Payment Status") - print("5. Get DANA Payment Status") - print("6. Get LinkAja Payment Status") - print("7. Create E-Wallet Charge") - print("8. Get E-Wallet Charge Status") - try: - return int(input()) - except ValueError: - print("Invalid input. Please type a number") - return ask_ewallet_input() - - -def ewallet_example(xendit_instance): - ewallet_input = ask_ewallet_input() - while ewallet_input != 0: - if ewallet_input == 1: - print("Running example of Create OVO Payment") - CreateOVOPayment.example(xendit_instance) - elif ewallet_input == 2: - print("Running example of Create DANA Payment") - CreateDANAPayment.example(xendit_instance) - elif ewallet_input == 3: - print("Running example of Create LinkAja Payment") - CreateLinkAjaPayment.example(xendit_instance) - elif ewallet_input == 4: - print("Running example of Get Payment Status of OVO") - GetOVOPaymentStatus.example(xendit_instance) - elif ewallet_input == 5: - print("Running example of Get Payment Status of DANA") - GetDANAPaymentStatus.example(xendit_instance) - elif ewallet_input == 6: - print("Running example of Get Payment Status of LinkAja") - GetLinkAjaPaymentStatus.example(xendit_instance) - elif ewallet_input == 7: - print("Running example of Create E-Wallet Charge") - CreateEWalletCharge.example(xendit_instance) - elif ewallet_input == 8: - print("Running example of Get E-Wallet Charge Status") - GetEWalletChargeStatus.example(xendit_instance) - ewallet_input = ask_ewallet_input() diff --git a/examples/invoice_example.py b/examples/invoice_example.py deleted file mode 100644 index 4d21ad99..00000000 --- a/examples/invoice_example.py +++ /dev/null @@ -1,127 +0,0 @@ -from print_running_function import print_running_function - -import time - -# Hackish method to import from another directory -# Useful while xendit-python isn't released yet to the public -import importlib.machinery - -loader = importlib.machinery.SourceFileLoader("xendit", "../xendit/__init__.py") -xendit = loader.load_module("xendit") - - -class CreateInvoice: - @staticmethod - def run(xendit_instance, external_id, amount, payer_email, description, **kwargs): - try: - invoice = xendit_instance.Invoice.create( - external_id=external_id, - amount=amount, - payer_email=payer_email, - description=description, - **kwargs, - ) - print(invoice) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "external_id": f"invoice-{int(time.time())}", - "amount": 20000, - "payer_email": "customer@domain.com", - "description": "Invoice Demo #123", - } - print_running_function("xendit.Invoice.create", args) - CreateInvoice.run(xendit_instance, **args) - - -class GetInvoice: - @staticmethod - def run(xendit_instance, invoice_id, **kwargs): - try: - invoice = xendit_instance.Invoice.get(invoice_id=invoice_id, **kwargs,) - print(invoice) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "invoice_id": "5efda8a20425db620ec35f43", - } - print_running_function("xendit.Invoice.get", args) - GetInvoice.run(xendit_instance, **args) - - -class ExpireInvoice: - @staticmethod - def run(xendit_instance, invoice_id, **kwargs): - try: - invoice = xendit_instance.Invoice.expire(invoice_id=invoice_id, **kwargs,) - print(invoice) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "invoice_id": "5efda8a20425db620ec35f43", - } - print_running_function("xendit.Invoice.expire", args) - ExpireInvoice.run(xendit_instance, **args) - - -class ListAllInvoice: - @staticmethod - def run(xendit_instance, limit, **kwargs): - try: - invoices = xendit_instance.Invoice.list_all(limit=limit, **kwargs,) - print(invoices) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "limit": 3, - } - print_running_function("xendit.Invoice.list_all", args) - ListAllInvoice.run(xendit_instance, **args) - - -def ask_invoice_input(): - print("Input the action that you want to use") - print("0. Exit") - print("1. Create Invoice") - print("2. Get Invoice") - print("3. Expire Invoice") - print("4. List All Invoice") - try: - return int(input()) - except ValueError: - print("Invalid input. Please type a number") - return ask_invoice_input() - - -def invoice_example(xendit_instance): - invoice_input = ask_invoice_input() - while invoice_input != 0: - if invoice_input == 1: - print("Running example of Create Invoice") - CreateInvoice.example(xendit_instance) - elif invoice_input == 2: - print("Running example of Get Invoice") - GetInvoice.example(xendit_instance) - elif invoice_input == 3: - print("Running example of Expire Invoice") - ExpireInvoice.example(xendit_instance) - elif invoice_input == 4: - print("Running example of List All Invoice") - ListAllInvoice.example(xendit_instance) - invoice_input = ask_invoice_input() diff --git a/examples/main_example.py b/examples/main_example.py deleted file mode 100644 index 6732a1f2..00000000 --- a/examples/main_example.py +++ /dev/null @@ -1,85 +0,0 @@ -from balance_example import balance_example -from batch_disbursement_example import batch_disbursement_example -from cardless_credit_example import cardless_credit_example -from credit_card_example import credit_card_example -from direct_debit_example import direct_debit_example -from disbursement_example import disbursement_example -from ewallet_example import ewallet_example -from invoice_example import invoice_example -from payout_example import payout_example -from qrcode_example import qrcode_example -from recurring_payment_example import recurring_payment_example -from retail_outlet_example import retail_outlet_example -from virtual_account_example import virtual_account_example -from xenplatform_example import xenplatform_example - -# Hackish method to import from another directory -# Useful while xendit-python isn't released yet to the public -import importlib.machinery - -loader = importlib.machinery.SourceFileLoader("xendit", "../xendit/__init__.py") -xendit = loader.load_module("xendit") - - -def ask_input(): - print("Please type one of the number below") - print("0. Exit") - print("1. Balance") - print("3. Credit Card") - print("4. eWallet") - print("5. Cardless Credit") - print("6. QR Codes") - print("7. Direct Debit") - print("8. VirtualAccount") - print("9. Retail Outlets") - print("10. Invoice") - print("11. Recurring Payment") - print("12. Payout") - print("13. Disbursement") - print("14. Batch Disbursement") - print("15. xenPlatform") - try: - return int(input()) - except ValueError: - print("Invalid input. Please type a number") - return ask_input() - - -if __name__ == "__main__": - api_key = input("Please paste your SECRET KEY here: ") - xendit_instance = xendit.Xendit(api_key=api_key) - user_choice = ask_input() - while user_choice != 0: - print() - if user_choice == 1: - balance_example(xendit_instance) - elif user_choice == 3: - credit_card_example(xendit_instance) - elif user_choice == 4: - ewallet_example(xendit_instance) - elif user_choice == 5: - cardless_credit_example(xendit_instance) - elif user_choice == 6: - qrcode_example(xendit_instance) - elif user_choice == 7: - direct_debit_example(xendit_instance) - elif user_choice == 8: - virtual_account_example(xendit_instance) - elif user_choice == 9: - retail_outlet_example(xendit_instance) - elif user_choice == 10: - invoice_example(xendit_instance) - elif user_choice == 11: - recurring_payment_example(xendit_instance) - elif user_choice == 12: - payout_example(xendit_instance) - elif user_choice == 13: - disbursement_example(xendit_instance) - elif user_choice == 14: - batch_disbursement_example(xendit_instance) - elif user_choice == 15: - xenplatform_example(xendit_instance) - else: - print("Wrong input, please output number in range [0,15]") - print() - user_choice = ask_input() diff --git a/examples/payment_method_example.py b/examples/payment_method_example.py deleted file mode 100644 index 03548111..00000000 --- a/examples/payment_method_example.py +++ /dev/null @@ -1,53 +0,0 @@ -import xendit - -from xendit.models.paymentmethod import ewallet - -from print_running_function import print_running_function - - -class CreatePaymentMethod: - @staticmethod - def run(xendit_instance, **kwargs): - try: - payment_method = xendit_instance.PaymentMethod.create(**kwargs) - print(payment_method) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "type": "EWALLET", - "reusability": "ONE_TIME_USE", - "ewallet": ewallet.EWallet.Query( - channel_code="PAYMAYA", - channel_properties=ewallet.ChannelProperties.Query( - success_return_url="https://mock-test.co", - failure_return_url="https://mock-test.co", - cancel_return_url="https://mock-test.co", - ), - ), - } - print_running_function("xendit.PaymentMethod.create", args) - CreatePaymentMethod.run(xendit_instance, **args) - - -def ask_payment_method_input(): - print("Input the action that you want to use") - print("0. Exit") - print("1. Create Payment Method") - try: - return int(input()) - except ValueError: - print("Invalid input. Please type a number") - return ask_payment_method_input() - - -def payment_method_example(xendit_instance): - payment_method_input = ask_payment_method_input() - while payment_method_input != 0: - if payment_method_input == 1: - print("Running example of Create Payment Method") - CreatePaymentMethod.example(xendit_instance) - payment_method_input = ask_payment_method_input() diff --git a/examples/payment_request_example.py b/examples/payment_request_example.py deleted file mode 100644 index 61fdf5f8..00000000 --- a/examples/payment_request_example.py +++ /dev/null @@ -1,55 +0,0 @@ -import xendit - -from xendit.models import ewallet, PaymentMethod - -from print_running_function import print_running_function - - -class CreatePaymentRequest: - @staticmethod - def run(xendit_instance, **kwargs): - try: - payment_request = xendit_instance.PaymentRequest.create(**kwargs) - print(payment_request) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "amount": 1500, - "currency": "IDR", - "payment_method": PaymentMethod.Query( - type="EWALLET", - reusability="ONE_TIME_USE", - ewallet=ewallet.EWallet.Query( - channel_code="OVO", - channel_properties=ewallet.ChannelProperties.Query( - mobile_number="+628123123123" - ), - ), - ), - } - print_running_function("xendit.PaymentRequest.create", args) - CreatePaymentRequest.run(xendit_instance, **args) - - -def ask_payment_method_input(): - print("Input the action that you want to use") - print("0. Exit") - print("1. Create Payment Request") - try: - return int(input()) - except ValueError: - print("Invalid input. Please type a number") - return ask_payment_method_input() - - -def payment_method_example(xendit_instance): - payment_method_input = ask_payment_method_input() - while payment_method_input != 0: - if payment_method_input == 1: - print("Running example of Create Payment Method") - CreatePaymentRequest.example(xendit_instance) - payment_method_input = ask_payment_method_input() diff --git a/examples/payout_example.py b/examples/payout_example.py deleted file mode 100644 index 38f5bfad..00000000 --- a/examples/payout_example.py +++ /dev/null @@ -1,99 +0,0 @@ -import time - -from print_running_function import print_running_function - -# Hackish method to import from another directory -# Useful while xendit-python isn't released yet to the public -import importlib.machinery - -loader = importlib.machinery.SourceFileLoader("xendit", "../xendit/__init__.py") -xendit = loader.load_module("xendit") - - -class CreatePayout: - @staticmethod - def run(xendit_instance, **kwargs): - try: - payout = xendit_instance.Payout.create(**kwargs) - print(payout) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "external_id": f"payout-{int(time.time())}", - "amount": 50000, - "email": "test@email.co", - } - print_running_function("xendit.Payout.create", args) - CreatePayout.run(xendit_instance, **args) - - -class GetPayout: - @staticmethod - def run(xendit_instance, **kwargs): - try: - payout = xendit_instance.Payout.get(**kwargs) - print(payout) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - id = input("Please input your id: ") - args = { - "id": id, - } - print_running_function("xendit.Payout.get", args) - GetPayout.run(xendit_instance, **args) - - -class VoidPayout: - @staticmethod - def run(xendit_instance, **kwargs): - try: - payout = xendit_instance.Payout.void(**kwargs) - print(payout) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - id = input("Please input your id: ") - args = { - "id": id, - } - print_running_function("xendit.Payout.void", args) - VoidPayout.run(xendit_instance, **args) - - -def ask_payout_input(): - print("Input the action that you want to use") - print("0. Exit") - print("1. Create Payout") - print("2. Get Payout") - print("3. Void a Payout") - try: - return int(input()) - except ValueError: - print("Invalid input. Please type a number") - return ask_payout_input() - - -def payout_example(xendit_instance): - payout_input = ask_payout_input() - while payout_input != 0: - if payout_input == 1: - print("Running example of Create Payout") - CreatePayout.example(xendit_instance) - elif payout_input == 2: - print("Running example of Get Payout") - GetPayout.example(xendit_instance) - elif payout_input == 3: - print("Running example of Void a Payout") - VoidPayout.example(xendit_instance) - payout_input = ask_payout_input() diff --git a/examples/print_running_function.py b/examples/print_running_function.py deleted file mode 100644 index b0d1dcc2..00000000 --- a/examples/print_running_function.py +++ /dev/null @@ -1,11 +0,0 @@ -def print_running_function(function_name: str, data: dict): - if len(data) == 0: - print(f"Running {function_name}()") - else: - print(f"Running {function_name}(") - for key, value in data.items(): - if isinstance(value, str): - print(f' {key}="{value}",') - else: - print(f" {key}={value},") - print(")") diff --git a/examples/qrcode_example.py b/examples/qrcode_example.py deleted file mode 100644 index 3128bcf0..00000000 --- a/examples/qrcode_example.py +++ /dev/null @@ -1,76 +0,0 @@ -import time - -from print_running_function import print_running_function - -# Hackish method to import from another directory -# Useful while xendit-python isn't released yet to the public -import importlib.machinery - -loader = importlib.machinery.SourceFileLoader("xendit", "../xendit/__init__.py") -xendit = loader.load_module("xendit") - - -class CreateQRCode: - @staticmethod - def run(xendit_instance, **kwargs): - try: - qrcode = xendit_instance.QRCode.create(**kwargs) - print(qrcode) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "external_id": f"qrcode-id-{int(time.time())}", - "type": xendit.QRCodeType.DYNAMIC, - "callback_url": "https://webhook.site", - "amount": 4000, - } - print_running_function("xendit.QRCode.create", args) - CreateQRCode.run(xendit_instance, **args) - - -class GetQRCodeByExtID: - @staticmethod - def run(xendit_instance, **kwargs): - try: - qrcode = xendit_instance.QRCode.get_by_ext_id(**kwargs,) - print(qrcode) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - external_id = input("Please input your external_id: ") - args = { - "external_id": external_id, - } - print_running_function("xendit.QRCode.get_by_ext_id", args) - GetQRCodeByExtID.run(xendit_instance, **args) - - -def ask_qrcode_input(): - print("Input the action that you want to use") - print("0. Exit") - print("1. Create QR Code") - print("2. Get QR Code by External ID") - try: - return int(input()) - except ValueError: - print("Invalid input. Please type a number") - return ask_qrcode_input() - - -def qrcode_example(xendit_instance): - qrcode_input = ask_qrcode_input() - while qrcode_input != 0: - if qrcode_input == 1: - print("Running example of Create QR Code") - CreateQRCode.example(xendit_instance) - elif qrcode_input == 2: - print("Running example of Get QR Code by External ID") - GetQRCodeByExtID.example(xendit_instance) - qrcode_input = ask_qrcode_input() diff --git a/examples/recurring_payment_example.py b/examples/recurring_payment_example.py deleted file mode 100644 index 92db8517..00000000 --- a/examples/recurring_payment_example.py +++ /dev/null @@ -1,173 +0,0 @@ -from print_running_function import print_running_function - -# Hackish method to import from another directory -# Useful while xendit-python isn't released yet to the public -import importlib.machinery - -loader = importlib.machinery.SourceFileLoader("xendit", "../xendit/__init__.py") -xendit = loader.load_module("xendit") - - -class CreateRecurringPayment: - @staticmethod - def run(xendit_instance, **kwargs): - try: - recurring_payment = xendit_instance.RecurringPayment.create(**kwargs) - print(recurring_payment) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "external_id": "recurring_12345", - "payer_email": "test@x.co", - "description": "Test Curring Payment", - "amount": 100000, - "interval": "MONTH", - "interval_count": 1, - } - print_running_function("xendit.RecurringPayment.create", args) - CreateRecurringPayment.run(xendit_instance, **args) - - -class GetRecurringPayment: - @staticmethod - def run(xendit_instance, **kwargs): - try: - recurring_payment = xendit_instance.RecurringPayment.get(**kwargs) - print(recurring_payment) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - id = input("Please input your id: ") - args = { - "id": id, - } - print_running_function("xendit.RecurringPayment.get", args) - GetRecurringPayment.run(xendit_instance, **args) - - -class EditRecurringPayment: - @staticmethod - def run(xendit_instance, **kwargs): - try: - recurring_payment = xendit_instance.RecurringPayment.edit(**kwargs) - print(recurring_payment) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - id = input("Please input your id: ") - args = { - "id": id, - "interval_count": 2, - } - print_running_function("xendit.RecurringPayment.edit", args) - EditRecurringPayment.run(xendit_instance, **args) - - -class StopRecurringPayment: - @staticmethod - def run(xendit_instance, **kwargs): - try: - recurring_payment = xendit_instance.RecurringPayment.stop(**kwargs) - print(recurring_payment) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - id = input("Please input your id: ") - args = { - "id": id, - } - print_running_function("xendit.RecurringPayment.stop", args) - StopRecurringPayment.run(xendit_instance, **args) - - -class PauseRecurringPayment: - @staticmethod - def run(xendit_instance, **kwargs): - try: - recurring_payment = xendit_instance.RecurringPayment.pause(**kwargs) - print(recurring_payment) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - id = input("Please input your id: ") - args = { - "id": id, - } - print_running_function("xendit.RecurringPayment.pause", args) - PauseRecurringPayment.run(xendit_instance, **args) - - -class ResumeRecurringPayment: - @staticmethod - def run(xendit_instance, **kwargs): - try: - recurring_payment = xendit_instance.RecurringPayment.resume(**kwargs) - print(recurring_payment) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - id = input("Please input your id: ") - args = { - "id": id, - } - print_running_function("xendit.RecurringPayment.resume", args) - ResumeRecurringPayment.run(xendit_instance, **args) - - -def ask_recurring_payment_input(): - print("Input the action that you want to use") - print("0. Exit") - print("1. Create Recurring Payment") - print("2. Get Recurring Payment") - print("3. Edit Recurring Payment") - print("4. Stop Recurring Payment") - print("5. Pause Recurring Payment") - print("6. Resume Recurring Payment") - try: - return int(input()) - except ValueError: - print("Invalid input. Please type a number") - return ask_recurring_payment_input() - - -def recurring_payment_example(xendit_instance): - recurring_payment_input = ask_recurring_payment_input() - while recurring_payment_input != 0: - if recurring_payment_input == 1: - print("Running example of Create Recurring Payment") - CreateRecurringPayment.example(xendit_instance) - elif recurring_payment_input == 2: - print("Running example of Get Recurring Payment") - GetRecurringPayment.example(xendit_instance) - elif recurring_payment_input == 3: - print("Running example of Edit Recurring Payment") - EditRecurringPayment.example(xendit_instance) - elif recurring_payment_input == 4: - print("Running example of Stop Recurring Payment") - StopRecurringPayment.example(xendit_instance) - elif recurring_payment_input == 5: - print("Running example of Pause Recurring Payment") - PauseRecurringPayment.example(xendit_instance) - elif recurring_payment_input == 6: - print("Running example of Resume Recurring Payment") - ResumeRecurringPayment.example(xendit_instance) - recurring_payment_input = ask_recurring_payment_input() diff --git a/examples/retail_outlet_example.py b/examples/retail_outlet_example.py deleted file mode 100644 index d23e0a3b..00000000 --- a/examples/retail_outlet_example.py +++ /dev/null @@ -1,113 +0,0 @@ -from print_running_function import print_running_function - -# Hackish method to import from another directory -# Useful while xendit-python isn't released yet to the public -import importlib.machinery - -loader = importlib.machinery.SourceFileLoader("xendit", "../xendit/__init__.py") -xendit = loader.load_module("xendit") - - -class CreateFixedPaymentCode: - @staticmethod - def run( - xendit_instance, - external_id, - retail_outlet_name, - name, - expected_amount, - **kwargs, - ): - try: - retail_outlet = xendit_instance.RetailOutlet.create_fixed_payment_code( - external_id=external_id, - retail_outlet_name=retail_outlet_name, - name=name, - expected_amount=expected_amount, - ) - print(retail_outlet) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "external_id": "demo_fixed_payment_code_123", - "retail_outlet_name": "ALFAMART", - "name": "Rika Sutanto", - "expected_amount": 10000, - } - print_running_function("xendit.RetailOutlet.create_fixed_payment_code", args) - CreateFixedPaymentCode.run(xendit_instance, **args) - - -class UpdateFixedPaymentCode: - @staticmethod - def run(xendit_instance, fixed_payment_code_id, **kwargs): - try: - retail_outlet = xendit_instance.RetailOutlet.update_fixed_payment_code( - fixed_payment_code_id=fixed_payment_code_id, **kwargs - ) - print(retail_outlet) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "fixed_payment_code_id": "5ef2f0f8e7f5c14077275493", - "name": "Joe Contini", - } - print_running_function("xendit.RetailOutlet.update_fixed_payment_code", args) - UpdateFixedPaymentCode.run(xendit_instance, **args) - - -class GetFixedPaymentCode: - @staticmethod - def run(xendit_instance, fixed_payment_code_id, **kwargs): - try: - retail_outlet = xendit_instance.RetailOutlet.get_fixed_payment_code( - fixed_payment_code_id=fixed_payment_code_id, **kwargs, - ) - print(retail_outlet) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "fixed_payment_code_id": "5ef2f0f8e7f5c14077275493", - } - print_running_function("xendit.RetailOutlet.get_fixed_payment_code", args) - GetFixedPaymentCode.run(xendit_instance, **args) - - -def ask_retail_outlet_input(): - print("Input the action that you want to use") - print("0. Exit") - print("1. Create Fixed Payment Code") - print("2. Update Fixed Payment Code") - print("3. Get Fixed Payment Code") - try: - return int(input()) - except ValueError: - print("Invalid input. Please type a number") - return ask_retail_outlet_input() - - -def retail_outlet_example(xendit_instance): - retail_outlet_input = ask_retail_outlet_input() - while retail_outlet_input != 0: - if retail_outlet_input == 1: - print("Running example of Create Fixed Payment Code") - CreateFixedPaymentCode.example(xendit_instance) - elif retail_outlet_input == 2: - print("Running example of Update Fixed Payment Code") - UpdateFixedPaymentCode.example(xendit_instance) - elif retail_outlet_input == 3: - print("Running example of Get Fixed Payment Code") - GetFixedPaymentCode.example(xendit_instance) - retail_outlet_input = ask_retail_outlet_input() diff --git a/examples/virtual_account_example.py b/examples/virtual_account_example.py deleted file mode 100644 index d94c4403..00000000 --- a/examples/virtual_account_example.py +++ /dev/null @@ -1,142 +0,0 @@ -from print_running_function import print_running_function - -# Hackish method to import from another directory -# Useful while xendit-python isn't released yet to the public -import importlib.machinery - -loader = importlib.machinery.SourceFileLoader("xendit", "../xendit/__init__.py") -xendit = loader.load_module("xendit") - - -class CreateVirtualAccount: - @staticmethod - def run(xendit_instance, external_id, bank_code, name, **kwargs): - try: - virtual_account = xendit_instance.VirtualAccount.create( - external_id=external_id, bank_code=bank_code, name=name, **kwargs, - ) - print(virtual_account) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args_1 = { - "external_id": "demo_1475459775872", - "bank_code": "BNI", - "name": "Rika Sutanto", - } - print_running_function("xendit.VirtualAccount.create", args_1) - CreateVirtualAccount.run(xendit_instance, **args_1) - - -class GetVirtualAccountBanks: - @staticmethod - def run(xendit_instance): - try: - virtual_account_banks = xendit_instance.VirtualAccount.get_banks() - print(virtual_account_banks) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = {} - print_running_function("xendit.VirtualAccount.get_banks", args) - GetVirtualAccountBanks.run(xendit_instance) - - -class GetVirtualAccount: - @staticmethod - def run(xendit_instance, id, **kwargs): - try: - virtual_account = xendit_instance.VirtualAccount.get(id=id, **kwargs,) - print(virtual_account) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "id": "5eec3a3e8dd9ea2fc97d6728", - } - print_running_function("xendit.VirtualAccount.get", args) - GetVirtualAccount.run(xendit_instance, **args) - - -class UpdateVirtualAccount: - @staticmethod - def run(xendit_instance, id, **kwargs): - try: - virtual_account = xendit_instance.VirtualAccount.update(id=id, **kwargs,) - print(virtual_account) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "id": "5eec3a3e8dd9ea2fc97d6728", - "is_single_use": True, - } - print_running_function("xendit.VirtualAccount.update", args) - UpdateVirtualAccount.run(xendit_instance, **args) - - -class GetVirtualAccountPayment: - @staticmethod - def run(xendit_instance, payment_id, **kwargs): - try: - virtual_account = xendit_instance.VirtualAccount.get_payment( - payment_id=payment_id, **kwargs, - ) - print(virtual_account) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = {"payment_id": "5ef18efca7d10d1b4d61fb52"} - print_running_function("xendit.VirtualAccount.get_payment", args) - GetVirtualAccountPayment.run(xendit_instance, **args) - - -def ask_virtual_account_input(): - print("Input the action that you want to use") - print("0. Exit") - print("1. Create Virtual Account") - print("2. Get Virtual Account Banks") - print("3. Get Virtual Account") - print("4. Update Virtual Account") - print("5. Get Virtual Account Payment") - try: - return int(input()) - except ValueError: - print("Invalid input. Please type a number") - return ask_virtual_account_input() - - -def virtual_account_example(xendit_instance): - virtual_account_input = ask_virtual_account_input() - while virtual_account_input != 0: - if virtual_account_input == 1: - print("Running example of Create Virtual Account") - CreateVirtualAccount.example(xendit_instance) - elif virtual_account_input == 2: - print("Running example of Get Virtual Account Banks") - GetVirtualAccountBanks.example(xendit_instance) - elif virtual_account_input == 3: - print("Running example of Get Virtual Account") - GetVirtualAccount.example(xendit_instance) - elif virtual_account_input == 4: - print("Running example of Update Virtual Account") - UpdateVirtualAccount.example(xendit_instance) - elif virtual_account_input == 5: - print("Running example of Get Virtual Account Payment") - GetVirtualAccountPayment.example(xendit_instance) - virtual_account_input = ask_virtual_account_input() diff --git a/examples/xenplatform_example.py b/examples/xenplatform_example.py deleted file mode 100644 index bcb07cc3..00000000 --- a/examples/xenplatform_example.py +++ /dev/null @@ -1,105 +0,0 @@ -import time - -from print_running_function import print_running_function - -# Hackish method to import from another directory -# Useful while xendit-python isn't released yet to the public -import importlib.machinery - -loader = importlib.machinery.SourceFileLoader("xendit", "../xendit/__init__.py") -xendit = loader.load_module("xendit") - - -class CreateAccount: - @staticmethod - def run(xendit_instance, **kwargs): - try: - xenplatform_account = xendit_instance.XenPlatform.create_account(**kwargs) - print(xenplatform_account) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "account_email": f"test-xenplatform-{int(time.time())}@pythonxendit.co", - "type": xendit.XenPlatformAccountType.OWNED, - "business_profile": {"business_name": "python-xendit"}, - } - print_running_function("xendit.XenPlatform.create_account", args) - CreateAccount.run(xendit_instance, **args) - - -class SetCallbackURL: - @staticmethod - def run(xendit_instance, **kwargs): - try: - xenplatform_callback_url = xendit_instance.XenPlatform.set_callback_url( - **kwargs - ) - print(xenplatform_callback_url) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - args = { - "type": xendit.XenPlatformURLType.INVOICE, - "url": "https://test-url-invoice.com", - } - print_running_function("xendit.XenPlatform.set_callback_url", args) - SetCallbackURL.run(xendit_instance, **args) - - -class Transfers: - @staticmethod - def run(xendit_instance, **kwargs): - try: - xenplatform_transfers = xendit_instance.XenPlatform.transfers(**kwargs) - print(xenplatform_transfers) - except xendit.XenditError as e: - print("Error status code:", e.status_code) - print("Error message:", e) - - @staticmethod - def example(xendit_instance): - source_user_id = input("Please input your source_user_id: ") - destination_user_id = input("Please input your destination_user_id: ") - args = { - "reference": "123", - "amount": 10000, - "source_user_id": source_user_id, - "destination_user_id": destination_user_id, - } - print_running_function("xendit.XenPlatform.transfers", args) - Transfers.run(xendit_instance, **args) - - -def ask_xenplatform_input(): - print("Input the action that you want to use") - print("0. Exit") - print("1. Create Account") - print("2. Set Callback URLs") - print("3. Transfers") - try: - return int(input()) - except ValueError: - print("Invalid input. Please type a number") - return ask_xenplatform_input() - - -def xenplatform_example(xendit_instance): - xenplatform_input = ask_xenplatform_input() - while xenplatform_input != 0: - if xenplatform_input == 1: - print("Running example of Create Account") - CreateAccount.example(xendit_instance) - elif xenplatform_input == 2: - print("Running example of Set Callback URLs") - SetCallbackURL.example(xendit_instance) - elif xenplatform_input == 3: - print("Running example of Transfers") - Transfers.example(xendit_instance) - xenplatform_input = ask_xenplatform_input() diff --git a/poetry.lock b/poetry.lock deleted file mode 100644 index a4acea94..00000000 --- a/poetry.lock +++ /dev/null @@ -1,828 +0,0 @@ -[[package]] -name = "appdirs" -version = "1.4.4" -description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." -category = "dev" -optional = false -python-versions = "*" - -[[package]] -name = "atomicwrites" -version = "1.4.0" -description = "Atomic file writes." -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" - -[[package]] -name = "attrs" -version = "21.4.0" -description = "Classes Without Boilerplate" -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" - -[package.extras] -dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit", "cloudpickle"] -docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"] -tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "cloudpickle"] -tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "cloudpickle"] - -[[package]] -name = "black" -version = "19.10b0" -description = "The uncompromising code formatter." -category = "dev" -optional = false -python-versions = ">=3.6" - -[package.dependencies] -appdirs = "*" -attrs = ">=18.1.0" -click = ">=6.5" -pathspec = ">=0.6,<1" -regex = "*" -toml = ">=0.9.4" -typed-ast = ">=1.4.0" - -[package.extras] -d = ["aiohttp (>=3.3.2)", "aiohttp-cors"] - -[[package]] -name = "certifi" -version = "2021.10.8" -description = "Python package for providing Mozilla's CA Bundle." -category = "main" -optional = false -python-versions = "*" - -[[package]] -name = "cfgv" -version = "3.3.1" -description = "Validate configuration and produce human readable error messages." -category = "dev" -optional = false -python-versions = ">=3.6.1" - -[[package]] -name = "charset-normalizer" -version = "2.0.12" -description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -category = "main" -optional = false -python-versions = ">=3.5.0" - -[package.extras] -unicode_backport = ["unicodedata2"] - -[[package]] -name = "click" -version = "8.0.4" -description = "Composable command line interface toolkit" -category = "dev" -optional = false -python-versions = ">=3.6" - -[package.dependencies] -colorama = {version = "*", markers = "platform_system == \"Windows\""} -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} - -[[package]] -name = "colorama" -version = "0.4.4" -description = "Cross-platform colored terminal text." -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" - -[[package]] -name = "coverage" -version = "6.3.2" -description = "Code coverage measurement for Python" -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.extras] -toml = ["tomli"] - -[[package]] -name = "distlib" -version = "0.3.4" -description = "Distribution utilities" -category = "dev" -optional = false -python-versions = "*" - -[[package]] -name = "filelock" -version = "3.6.0" -description = "A platform independent file lock." -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.extras] -docs = ["furo (>=2021.8.17b43)", "sphinx (>=4.1)", "sphinx-autodoc-typehints (>=1.12)"] -testing = ["covdefaults (>=1.2.0)", "coverage (>=4)", "pytest (>=4)", "pytest-cov", "pytest-timeout (>=1.4.2)"] - -[[package]] -name = "flake8" -version = "3.9.2" -description = "the modular source code checker: pep8 pyflakes and co" -category = "dev" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" - -[package.dependencies] -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} -mccabe = ">=0.6.0,<0.7.0" -pycodestyle = ">=2.7.0,<2.8.0" -pyflakes = ">=2.3.0,<2.4.0" - -[[package]] -name = "identify" -version = "2.4.11" -description = "File identification library for Python" -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.extras] -license = ["ukkonen"] - -[[package]] -name = "idna" -version = "3.3" -description = "Internationalized Domain Names in Applications (IDNA)" -category = "main" -optional = false -python-versions = ">=3.5" - -[[package]] -name = "importlib-metadata" -version = "4.11.1" -description = "Read metadata from Python packages" -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.dependencies] -typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} -zipp = ">=0.5" - -[package.extras] -docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] -perf = ["ipython"] -testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "packaging", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)", "importlib-resources (>=1.3)"] - -[[package]] -name = "mccabe" -version = "0.6.1" -description = "McCabe checker, plugin for flake8" -category = "dev" -optional = false -python-versions = "*" - -[[package]] -name = "more-itertools" -version = "8.12.0" -description = "More routines for operating on iterables, beyond itertools" -category = "dev" -optional = false -python-versions = ">=3.5" - -[[package]] -name = "nodeenv" -version = "1.6.0" -description = "Node.js virtual environment builder" -category = "dev" -optional = false -python-versions = "*" - -[[package]] -name = "packaging" -version = "21.3" -description = "Core utilities for Python packages" -category = "dev" -optional = false -python-versions = ">=3.6" - -[package.dependencies] -pyparsing = ">=2.0.2,<3.0.5 || >3.0.5" - -[[package]] -name = "pathspec" -version = "0.9.0" -description = "Utility library for gitignore style pattern matching of file paths." -category = "dev" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" - -[[package]] -name = "platformdirs" -version = "2.5.1" -description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.extras] -docs = ["Sphinx (>=4)", "furo (>=2021.7.5b38)", "proselint (>=0.10.2)", "sphinx-autodoc-typehints (>=1.12)"] -test = ["appdirs (==1.4.4)", "pytest (>=6)", "pytest-cov (>=2.7)", "pytest-mock (>=3.6)"] - -[[package]] -name = "pluggy" -version = "0.13.1" -description = "plugin and hook calling mechanisms for python" -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" - -[package.dependencies] -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} - -[package.extras] -dev = ["pre-commit", "tox"] - -[[package]] -name = "pre-commit" -version = "2.17.0" -description = "A framework for managing and maintaining multi-language pre-commit hooks." -category = "dev" -optional = false -python-versions = ">=3.6.1" - -[package.dependencies] -cfgv = ">=2.0.0" -identify = ">=1.0.0" -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} -nodeenv = ">=0.11.1" -pyyaml = ">=5.1" -toml = "*" -virtualenv = ">=20.0.8" - -[[package]] -name = "py" -version = "1.11.0" -description = "library with cross-python path, ini-parsing, io, code, log facilities" -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" - -[[package]] -name = "pycodestyle" -version = "2.7.0" -description = "Python style guide checker" -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" - -[[package]] -name = "pyflakes" -version = "2.3.1" -description = "passive checker of Python programs" -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" - -[[package]] -name = "pyparsing" -version = "3.0.7" -description = "Python parsing module" -category = "dev" -optional = false -python-versions = ">=3.6" - -[package.extras] -diagrams = ["jinja2", "railroad-diagrams"] - -[[package]] -name = "pytest" -version = "5.4.3" -description = "pytest: simple powerful testing with Python" -category = "dev" -optional = false -python-versions = ">=3.5" - -[package.dependencies] -atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""} -attrs = ">=17.4.0" -colorama = {version = "*", markers = "sys_platform == \"win32\""} -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} -more-itertools = ">=4.0.0" -packaging = "*" -pluggy = ">=0.12,<1.0" -py = ">=1.5.0" -wcwidth = "*" - -[package.extras] -checkqa-mypy = ["mypy (==v0.761)"] -testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] - -[[package]] -name = "pytest-cov" -version = "2.12.1" -description = "Pytest plugin for measuring coverage." -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" - -[package.dependencies] -coverage = ">=5.2.1" -pytest = ">=4.6" -toml = "*" - -[package.extras] -testing = ["fields", "hunter", "process-tests", "six", "pytest-xdist", "virtualenv"] - -[[package]] -name = "pytest-mock" -version = "3.7.0" -description = "Thin-wrapper around the mock package for easier use with pytest" -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.dependencies] -pytest = ">=5.0" - -[package.extras] -dev = ["pre-commit", "tox", "pytest-asyncio"] - -[[package]] -name = "pyyaml" -version = "6.0" -description = "YAML parser and emitter for Python" -category = "dev" -optional = false -python-versions = ">=3.6" - -[[package]] -name = "regex" -version = "2022.1.18" -description = "Alternative regular expression module, to replace re." -category = "dev" -optional = false -python-versions = "*" - -[[package]] -name = "requests" -version = "2.27.1" -description = "Python HTTP for Humans." -category = "main" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" - -[package.dependencies] -certifi = ">=2017.4.17" -charset-normalizer = {version = ">=2.0.0,<2.1.0", markers = "python_version >= \"3\""} -idna = {version = ">=2.5,<4", markers = "python_version >= \"3\""} -urllib3 = ">=1.21.1,<1.27" - -[package.extras] -socks = ["PySocks (>=1.5.6,!=1.5.7)", "win-inet-pton"] -use_chardet_on_py3 = ["chardet (>=3.0.2,<5)"] - -[[package]] -name = "responses" -version = "0.10.16" -description = "A utility library for mocking out the `requests` Python library." -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" - -[package.dependencies] -requests = ">=2.0" -six = "*" -urllib3 = ">=1.25.10" - -[package.extras] -tests = ["coverage (>=3.7.1,<5.0.0)", "pytest-cov", "pytest-localserver", "flake8", "pytest (>=4.6,<5.0)", "pytest (>=4.6)"] - -[[package]] -name = "six" -version = "1.16.0" -description = "Python 2 and 3 compatibility utilities" -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" - -[[package]] -name = "toml" -version = "0.10.2" -description = "Python Library for Tom's Obvious, Minimal Language" -category = "dev" -optional = false -python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" - -[[package]] -name = "typed-ast" -version = "1.5.2" -description = "a fork of Python 2 and 3 ast modules with type comment support" -category = "dev" -optional = false -python-versions = ">=3.6" - -[[package]] -name = "typing-extensions" -version = "4.1.1" -description = "Backported and Experimental Type Hints for Python 3.6+" -category = "dev" -optional = false -python-versions = ">=3.6" - -[[package]] -name = "urllib3" -version = "1.26.8" -description = "HTTP library with thread-safe connection pooling, file post, and more." -category = "main" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" - -[package.extras] -brotli = ["brotlipy (>=0.6.0)"] -secure = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "certifi", "ipaddress"] -socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] - -[[package]] -name = "virtualenv" -version = "20.13.1" -description = "Virtual Python Environment builder" -category = "dev" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" - -[package.dependencies] -distlib = ">=0.3.1,<1" -filelock = ">=3.2,<4" -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} -platformdirs = ">=2,<3" -six = ">=1.9.0,<2" - -[package.extras] -docs = ["proselint (>=0.10.2)", "sphinx (>=3)", "sphinx-argparse (>=0.2.5)", "sphinx-rtd-theme (>=0.4.3)", "towncrier (>=21.3)"] -testing = ["coverage (>=4)", "coverage-enable-subprocess (>=1)", "flaky (>=3)", "pytest (>=4)", "pytest-env (>=0.6.2)", "pytest-freezegun (>=0.4.1)", "pytest-mock (>=2)", "pytest-randomly (>=1)", "pytest-timeout (>=1)", "packaging (>=20.0)"] - -[[package]] -name = "wcwidth" -version = "0.2.5" -description = "Measures the displayed width of unicode strings in a terminal" -category = "dev" -optional = false -python-versions = "*" - -[[package]] -name = "zipp" -version = "3.7.0" -description = "Backport of pathlib-compatible object wrapper for zip files" -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.extras] -docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] -testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "jaraco.itertools", "func-timeout", "pytest-black (>=0.3.7)", "pytest-mypy"] - -[metadata] -lock-version = "1.1" -python-versions = "^3.7" -content-hash = "2e89e4b8f1e9dd984f337fa6a27a2e8ebf0497f7f62a2032863b00f589075f82" - -[metadata.files] -appdirs = [ - {file = "appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128"}, - {file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"}, -] -atomicwrites = [ - {file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"}, - {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, -] -attrs = [ - {file = "attrs-21.4.0-py2.py3-none-any.whl", hash = "sha256:2d27e3784d7a565d36ab851fe94887c5eccd6a463168875832a1be79c82828b4"}, - {file = "attrs-21.4.0.tar.gz", hash = "sha256:626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd"}, -] -black = [ - {file = "black-19.10b0-py36-none-any.whl", hash = "sha256:1b30e59be925fafc1ee4565e5e08abef6b03fe455102883820fe5ee2e4734e0b"}, - {file = "black-19.10b0.tar.gz", hash = "sha256:c2edb73a08e9e0e6f65a0e6af18b059b8b1cdd5bef997d7a0b181df93dc81539"}, -] -certifi = [ - {file = "certifi-2021.10.8-py2.py3-none-any.whl", hash = "sha256:d62a0163eb4c2344ac042ab2bdf75399a71a2d8c7d47eac2e2ee91b9d6339569"}, - {file = "certifi-2021.10.8.tar.gz", hash = "sha256:78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872"}, -] -cfgv = [ - {file = "cfgv-3.3.1-py2.py3-none-any.whl", hash = "sha256:c6a0883f3917a037485059700b9e75da2464e6c27051014ad85ba6aaa5884426"}, - {file = "cfgv-3.3.1.tar.gz", hash = "sha256:f5a830efb9ce7a445376bb66ec94c638a9787422f96264c98edc6bdeed8ab736"}, -] -charset-normalizer = [ - {file = "charset-normalizer-2.0.12.tar.gz", hash = "sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597"}, - {file = "charset_normalizer-2.0.12-py3-none-any.whl", hash = "sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df"}, -] -click = [ - {file = "click-8.0.4-py3-none-any.whl", hash = "sha256:6a7a62563bbfabfda3a38f3023a1db4a35978c0abd76f6c9605ecd6554d6d9b1"}, - {file = "click-8.0.4.tar.gz", hash = "sha256:8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb"}, -] -colorama = [ - {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, - {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, -] -coverage = [ - {file = "coverage-6.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9b27d894748475fa858f9597c0ee1d4829f44683f3813633aaf94b19cb5453cf"}, - {file = "coverage-6.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:37d1141ad6b2466a7b53a22e08fe76994c2d35a5b6b469590424a9953155afac"}, - {file = "coverage-6.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f9987b0354b06d4df0f4d3e0ec1ae76d7ce7cbca9a2f98c25041eb79eec766f1"}, - {file = "coverage-6.3.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:26e2deacd414fc2f97dd9f7676ee3eaecd299ca751412d89f40bc01557a6b1b4"}, - {file = "coverage-6.3.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4dd8bafa458b5c7d061540f1ee9f18025a68e2d8471b3e858a9dad47c8d41903"}, - {file = "coverage-6.3.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:46191097ebc381fbf89bdce207a6c107ac4ec0890d8d20f3360345ff5976155c"}, - {file = "coverage-6.3.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:6f89d05e028d274ce4fa1a86887b071ae1755082ef94a6740238cd7a8178804f"}, - {file = "coverage-6.3.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:58303469e9a272b4abdb9e302a780072c0633cdcc0165db7eec0f9e32f901e05"}, - {file = "coverage-6.3.2-cp310-cp310-win32.whl", hash = "sha256:2fea046bfb455510e05be95e879f0e768d45c10c11509e20e06d8fcaa31d9e39"}, - {file = "coverage-6.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:a2a8b8bcc399edb4347a5ca8b9b87e7524c0967b335fbb08a83c8421489ddee1"}, - {file = "coverage-6.3.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:f1555ea6d6da108e1999b2463ea1003fe03f29213e459145e70edbaf3e004aaa"}, - {file = "coverage-6.3.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e5f4e1edcf57ce94e5475fe09e5afa3e3145081318e5fd1a43a6b4539a97e518"}, - {file = "coverage-6.3.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7a15dc0a14008f1da3d1ebd44bdda3e357dbabdf5a0b5034d38fcde0b5c234b7"}, - {file = "coverage-6.3.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21b7745788866028adeb1e0eca3bf1101109e2dc58456cb49d2d9b99a8c516e6"}, - {file = "coverage-6.3.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:8ce257cac556cb03be4a248d92ed36904a59a4a5ff55a994e92214cde15c5bad"}, - {file = "coverage-6.3.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:b0be84e5a6209858a1d3e8d1806c46214e867ce1b0fd32e4ea03f4bd8b2e3359"}, - {file = "coverage-6.3.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:acf53bc2cf7282ab9b8ba346746afe703474004d9e566ad164c91a7a59f188a4"}, - {file = "coverage-6.3.2-cp37-cp37m-win32.whl", hash = "sha256:8bdde1177f2311ee552f47ae6e5aa7750c0e3291ca6b75f71f7ffe1f1dab3dca"}, - {file = "coverage-6.3.2-cp37-cp37m-win_amd64.whl", hash = "sha256:b31651d018b23ec463e95cf10070d0b2c548aa950a03d0b559eaa11c7e5a6fa3"}, - {file = "coverage-6.3.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:07e6db90cd9686c767dcc593dff16c8c09f9814f5e9c51034066cad3373b914d"}, - {file = "coverage-6.3.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:2c6dbb42f3ad25760010c45191e9757e7dce981cbfb90e42feef301d71540059"}, - {file = "coverage-6.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c76aeef1b95aff3905fb2ae2d96e319caca5b76fa41d3470b19d4e4a3a313512"}, - {file = "coverage-6.3.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8cf5cfcb1521dc3255d845d9dca3ff204b3229401994ef8d1984b32746bb45ca"}, - {file = "coverage-6.3.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8fbbdc8d55990eac1b0919ca69eb5a988a802b854488c34b8f37f3e2025fa90d"}, - {file = "coverage-6.3.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ec6bc7fe73a938933d4178c9b23c4e0568e43e220aef9472c4f6044bfc6dd0f0"}, - {file = "coverage-6.3.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:9baff2a45ae1f17c8078452e9e5962e518eab705e50a0aa8083733ea7d45f3a6"}, - {file = "coverage-6.3.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fd9e830e9d8d89b20ab1e5af09b32d33e1a08ef4c4e14411e559556fd788e6b2"}, - {file = "coverage-6.3.2-cp38-cp38-win32.whl", hash = "sha256:f7331dbf301b7289013175087636bbaf5b2405e57259dd2c42fdcc9fcc47325e"}, - {file = "coverage-6.3.2-cp38-cp38-win_amd64.whl", hash = "sha256:68353fe7cdf91f109fc7d474461b46e7f1f14e533e911a2a2cbb8b0fc8613cf1"}, - {file = "coverage-6.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b78e5afb39941572209f71866aa0b206c12f0109835aa0d601e41552f9b3e620"}, - {file = "coverage-6.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4e21876082ed887baed0146fe222f861b5815455ada3b33b890f4105d806128d"}, - {file = "coverage-6.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:34626a7eee2a3da12af0507780bb51eb52dca0e1751fd1471d0810539cefb536"}, - {file = "coverage-6.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1ebf730d2381158ecf3dfd4453fbca0613e16eaa547b4170e2450c9707665ce7"}, - {file = "coverage-6.3.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd6fe30bd519694b356cbfcaca9bd5c1737cddd20778c6a581ae20dc8c04def2"}, - {file = "coverage-6.3.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:96f8a1cb43ca1422f36492bebe63312d396491a9165ed3b9231e778d43a7fca4"}, - {file = "coverage-6.3.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:dd035edafefee4d573140a76fdc785dc38829fe5a455c4bb12bac8c20cfc3d69"}, - {file = "coverage-6.3.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5ca5aeb4344b30d0bec47481536b8ba1181d50dbe783b0e4ad03c95dc1296684"}, - {file = "coverage-6.3.2-cp39-cp39-win32.whl", hash = "sha256:f5fa5803f47e095d7ad8443d28b01d48c0359484fec1b9d8606d0e3282084bc4"}, - {file = "coverage-6.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:9548f10d8be799551eb3a9c74bbf2b4934ddb330e08a73320123c07f95cc2d92"}, - {file = "coverage-6.3.2-pp36.pp37.pp38-none-any.whl", hash = "sha256:18d520c6860515a771708937d2f78f63cc47ab3b80cb78e86573b0a760161faf"}, - {file = "coverage-6.3.2.tar.gz", hash = "sha256:03e2a7826086b91ef345ff18742ee9fc47a6839ccd517061ef8fa1976e652ce9"}, -] -distlib = [ - {file = "distlib-0.3.4-py2.py3-none-any.whl", hash = "sha256:6564fe0a8f51e734df6333d08b8b94d4ea8ee6b99b5ed50613f731fd4089f34b"}, - {file = "distlib-0.3.4.zip", hash = "sha256:e4b58818180336dc9c529bfb9a0b58728ffc09ad92027a3f30b7cd91e3458579"}, -] -filelock = [ - {file = "filelock-3.6.0-py3-none-any.whl", hash = "sha256:f8314284bfffbdcfa0ff3d7992b023d4c628ced6feb957351d4c48d059f56bc0"}, - {file = "filelock-3.6.0.tar.gz", hash = "sha256:9cd540a9352e432c7246a48fe4e8712b10acb1df2ad1f30e8c070b82ae1fed85"}, -] -flake8 = [ - {file = "flake8-3.9.2-py2.py3-none-any.whl", hash = "sha256:bf8fd333346d844f616e8d47905ef3a3384edae6b4e9beb0c5101e25e3110907"}, - {file = "flake8-3.9.2.tar.gz", hash = "sha256:07528381786f2a6237b061f6e96610a4167b226cb926e2aa2b6b1d78057c576b"}, -] -identify = [ - {file = "identify-2.4.11-py2.py3-none-any.whl", hash = "sha256:fd906823ed1db23c7a48f9b176a1d71cb8abede1e21ebe614bac7bdd688d9213"}, - {file = "identify-2.4.11.tar.gz", hash = "sha256:2986942d3974c8f2e5019a190523b0b0e2a07cb8e89bf236727fb4b26f27f8fd"}, -] -idna = [ - {file = "idna-3.3-py3-none-any.whl", hash = "sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff"}, - {file = "idna-3.3.tar.gz", hash = "sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d"}, -] -importlib-metadata = [ - {file = "importlib_metadata-4.11.1-py3-none-any.whl", hash = "sha256:e0bc84ff355328a4adfc5240c4f211e0ab386f80aa640d1b11f0618a1d282094"}, - {file = "importlib_metadata-4.11.1.tar.gz", hash = "sha256:175f4ee440a0317f6e8d81b7f8d4869f93316170a65ad2b007d2929186c8052c"}, -] -mccabe = [ - {file = "mccabe-0.6.1-py2.py3-none-any.whl", hash = "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42"}, - {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, -] -more-itertools = [ - {file = "more-itertools-8.12.0.tar.gz", hash = "sha256:7dc6ad46f05f545f900dd59e8dfb4e84a4827b97b3cfecb175ea0c7d247f6064"}, - {file = "more_itertools-8.12.0-py3-none-any.whl", hash = "sha256:43e6dd9942dffd72661a2c4ef383ad7da1e6a3e968a927ad7a6083ab410a688b"}, -] -nodeenv = [ - {file = "nodeenv-1.6.0-py2.py3-none-any.whl", hash = "sha256:621e6b7076565ddcacd2db0294c0381e01fd28945ab36bcf00f41c5daf63bef7"}, - {file = "nodeenv-1.6.0.tar.gz", hash = "sha256:3ef13ff90291ba2a4a7a4ff9a979b63ffdd00a464dbe04acf0ea6471517a4c2b"}, -] -packaging = [ - {file = "packaging-21.3-py3-none-any.whl", hash = "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"}, - {file = "packaging-21.3.tar.gz", hash = "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"}, -] -pathspec = [ - {file = "pathspec-0.9.0-py2.py3-none-any.whl", hash = "sha256:7d15c4ddb0b5c802d161efc417ec1a2558ea2653c2e8ad9c19098201dc1c993a"}, - {file = "pathspec-0.9.0.tar.gz", hash = "sha256:e564499435a2673d586f6b2130bb5b95f04a3ba06f81b8f895b651a3c76aabb1"}, -] -platformdirs = [ - {file = "platformdirs-2.5.1-py3-none-any.whl", hash = "sha256:bcae7cab893c2d310a711b70b24efb93334febe65f8de776ee320b517471e227"}, - {file = "platformdirs-2.5.1.tar.gz", hash = "sha256:7535e70dfa32e84d4b34996ea99c5e432fa29a708d0f4e394bbcb2a8faa4f16d"}, -] -pluggy = [ - {file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, - {file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, -] -pre-commit = [ - {file = "pre_commit-2.17.0-py2.py3-none-any.whl", hash = "sha256:725fa7459782d7bec5ead072810e47351de01709be838c2ce1726b9591dad616"}, - {file = "pre_commit-2.17.0.tar.gz", hash = "sha256:c1a8040ff15ad3d648c70cc3e55b93e4d2d5b687320955505587fd79bbaed06a"}, -] -py = [ - {file = "py-1.11.0-py2.py3-none-any.whl", hash = "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378"}, - {file = "py-1.11.0.tar.gz", hash = "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719"}, -] -pycodestyle = [ - {file = "pycodestyle-2.7.0-py2.py3-none-any.whl", hash = "sha256:514f76d918fcc0b55c6680472f0a37970994e07bbb80725808c17089be302068"}, - {file = "pycodestyle-2.7.0.tar.gz", hash = "sha256:c389c1d06bf7904078ca03399a4816f974a1d590090fecea0c63ec26ebaf1cef"}, -] -pyflakes = [ - {file = "pyflakes-2.3.1-py2.py3-none-any.whl", hash = "sha256:7893783d01b8a89811dd72d7dfd4d84ff098e5eed95cfa8905b22bbffe52efc3"}, - {file = "pyflakes-2.3.1.tar.gz", hash = "sha256:f5bc8ecabc05bb9d291eb5203d6810b49040f6ff446a756326104746cc00c1db"}, -] -pyparsing = [ - {file = "pyparsing-3.0.7-py3-none-any.whl", hash = "sha256:a6c06a88f252e6c322f65faf8f418b16213b51bdfaece0524c1c1bc30c63c484"}, - {file = "pyparsing-3.0.7.tar.gz", hash = "sha256:18ee9022775d270c55187733956460083db60b37d0d0fb357445f3094eed3eea"}, -] -pytest = [ - {file = "pytest-5.4.3-py3-none-any.whl", hash = "sha256:5c0db86b698e8f170ba4582a492248919255fcd4c79b1ee64ace34301fb589a1"}, - {file = "pytest-5.4.3.tar.gz", hash = "sha256:7979331bfcba207414f5e1263b5a0f8f521d0f457318836a7355531ed1a4c7d8"}, -] -pytest-cov = [ - {file = "pytest-cov-2.12.1.tar.gz", hash = "sha256:261ceeb8c227b726249b376b8526b600f38667ee314f910353fa318caa01f4d7"}, - {file = "pytest_cov-2.12.1-py2.py3-none-any.whl", hash = "sha256:261bb9e47e65bd099c89c3edf92972865210c36813f80ede5277dceb77a4a62a"}, -] -pytest-mock = [ - {file = "pytest-mock-3.7.0.tar.gz", hash = "sha256:5112bd92cc9f186ee96e1a92efc84969ea494939c3aead39c50f421c4cc69534"}, - {file = "pytest_mock-3.7.0-py3-none-any.whl", hash = "sha256:6cff27cec936bf81dc5ee87f07132b807bcda51106b5ec4b90a04331cba76231"}, -] -pyyaml = [ - {file = "PyYAML-6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53"}, - {file = "PyYAML-6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c"}, - {file = "PyYAML-6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:77f396e6ef4c73fdc33a9157446466f1cff553d979bd00ecb64385760c6babdc"}, - {file = "PyYAML-6.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a80a78046a72361de73f8f395f1f1e49f956c6be882eed58505a15f3e430962b"}, - {file = "PyYAML-6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5"}, - {file = "PyYAML-6.0-cp310-cp310-win32.whl", hash = "sha256:2cd5df3de48857ed0544b34e2d40e9fac445930039f3cfe4bcc592a1f836d513"}, - {file = "PyYAML-6.0-cp310-cp310-win_amd64.whl", hash = "sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a"}, - {file = "PyYAML-6.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86"}, - {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:50602afada6d6cbfad699b0c7bb50d5ccffa7e46a3d738092afddc1f9758427f"}, - {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92"}, - {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:98c4d36e99714e55cfbaaee6dd5badbc9a1ec339ebfc3b1f52e293aee6bb71a4"}, - {file = "PyYAML-6.0-cp36-cp36m-win32.whl", hash = "sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293"}, - {file = "PyYAML-6.0-cp36-cp36m-win_amd64.whl", hash = "sha256:07751360502caac1c067a8132d150cf3d61339af5691fe9e87803040dbc5db57"}, - {file = "PyYAML-6.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:819b3830a1543db06c4d4b865e70ded25be52a2e0631ccd2f6a47a2822f2fd7c"}, - {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:473f9edb243cb1935ab5a084eb238d842fb8f404ed2193a915d1784b5a6b5fc0"}, - {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0ce82d761c532fe4ec3f87fc45688bdd3a4c1dc5e0b4a19814b9009a29baefd4"}, - {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:231710d57adfd809ef5d34183b8ed1eeae3f76459c18fb4a0b373ad56bedcdd9"}, - {file = "PyYAML-6.0-cp37-cp37m-win32.whl", hash = "sha256:c5687b8d43cf58545ade1fe3e055f70eac7a5a1a0bf42824308d868289a95737"}, - {file = "PyYAML-6.0-cp37-cp37m-win_amd64.whl", hash = "sha256:d15a181d1ecd0d4270dc32edb46f7cb7733c7c508857278d3d378d14d606db2d"}, - {file = "PyYAML-6.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0b4624f379dab24d3725ffde76559cff63d9ec94e1736b556dacdfebe5ab6d4b"}, - {file = "PyYAML-6.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:213c60cd50106436cc818accf5baa1aba61c0189ff610f64f4a3e8c6726218ba"}, - {file = "PyYAML-6.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9fa600030013c4de8165339db93d182b9431076eb98eb40ee068700c9c813e34"}, - {file = "PyYAML-6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:277a0ef2981ca40581a47093e9e2d13b3f1fbbeffae064c1d21bfceba2030287"}, - {file = "PyYAML-6.0-cp38-cp38-win32.whl", hash = "sha256:d4eccecf9adf6fbcc6861a38015c2a64f38b9d94838ac1810a9023a0609e1b78"}, - {file = "PyYAML-6.0-cp38-cp38-win_amd64.whl", hash = "sha256:1e4747bc279b4f613a09eb64bba2ba602d8a6664c6ce6396a4d0cd413a50ce07"}, - {file = "PyYAML-6.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:055d937d65826939cb044fc8c9b08889e8c743fdc6a32b33e2390f66013e449b"}, - {file = "PyYAML-6.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174"}, - {file = "PyYAML-6.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d67d839ede4ed1b28a4e8909735fc992a923cdb84e618544973d7dfc71540803"}, - {file = "PyYAML-6.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cba8c411ef271aa037d7357a2bc8f9ee8b58b9965831d9e51baf703280dc73d3"}, - {file = "PyYAML-6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:40527857252b61eacd1d9af500c3337ba8deb8fc298940291486c465c8b46ec0"}, - {file = "PyYAML-6.0-cp39-cp39-win32.whl", hash = "sha256:b5b9eccad747aabaaffbc6064800670f0c297e52c12754eb1d976c57e4f74dcb"}, - {file = "PyYAML-6.0-cp39-cp39-win_amd64.whl", hash = "sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c"}, - {file = "PyYAML-6.0.tar.gz", hash = "sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2"}, -] -regex = [ - {file = "regex-2022.1.18-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:34316bf693b1d2d29c087ee7e4bb10cdfa39da5f9c50fa15b07489b4ab93a1b5"}, - {file = "regex-2022.1.18-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:7a0b9f6a1a15d494b35f25ed07abda03209fa76c33564c09c9e81d34f4b919d7"}, - {file = "regex-2022.1.18-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f99112aed4fb7cee00c7f77e8b964a9b10f69488cdff626ffd797d02e2e4484f"}, - {file = "regex-2022.1.18-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9a2bf98ac92f58777c0fafc772bf0493e67fcf677302e0c0a630ee517a43b949"}, - {file = "regex-2022.1.18-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8618d9213a863c468a865e9d2ec50221015f7abf52221bc927152ef26c484b4c"}, - {file = "regex-2022.1.18-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b52cc45e71657bc4743a5606d9023459de929b2a198d545868e11898ba1c3f59"}, - {file = "regex-2022.1.18-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7e12949e5071c20ec49ef00c75121ed2b076972132fc1913ddf5f76cae8d10b4"}, - {file = "regex-2022.1.18-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:b02e3e72665cd02afafb933453b0c9f6c59ff6e3708bd28d0d8580450e7e88af"}, - {file = "regex-2022.1.18-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:abfcb0ef78df0ee9df4ea81f03beea41849340ce33a4c4bd4dbb99e23ec781b6"}, - {file = "regex-2022.1.18-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:6213713ac743b190ecbf3f316d6e41d099e774812d470422b3a0f137ea635832"}, - {file = "regex-2022.1.18-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:61ebbcd208d78658b09e19c78920f1ad38936a0aa0f9c459c46c197d11c580a0"}, - {file = "regex-2022.1.18-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:b013f759cd69cb0a62de954d6d2096d648bc210034b79b1881406b07ed0a83f9"}, - {file = "regex-2022.1.18-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:9187500d83fd0cef4669385cbb0961e227a41c0c9bc39219044e35810793edf7"}, - {file = "regex-2022.1.18-cp310-cp310-win32.whl", hash = "sha256:94c623c331a48a5ccc7d25271399aff29729fa202c737ae3b4b28b89d2b0976d"}, - {file = "regex-2022.1.18-cp310-cp310-win_amd64.whl", hash = "sha256:1a171eaac36a08964d023eeff740b18a415f79aeb212169080c170ec42dd5184"}, - {file = "regex-2022.1.18-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:49810f907dfe6de8da5da7d2b238d343e6add62f01a15d03e2195afc180059ed"}, - {file = "regex-2022.1.18-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0d2f5c3f7057530afd7b739ed42eb04f1011203bc5e4663e1e1d01bb50f813e3"}, - {file = "regex-2022.1.18-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:85ffd6b1cb0dfb037ede50ff3bef80d9bf7fa60515d192403af6745524524f3b"}, - {file = "regex-2022.1.18-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ba37f11e1d020969e8a779c06b4af866ffb6b854d7229db63c5fdddfceaa917f"}, - {file = "regex-2022.1.18-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:637e27ea1ebe4a561db75a880ac659ff439dec7f55588212e71700bb1ddd5af9"}, - {file = "regex-2022.1.18-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:37978254d9d00cda01acc1997513f786b6b971e57b778fbe7c20e30ae81a97f3"}, - {file = "regex-2022.1.18-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:e54a1eb9fd38f2779e973d2f8958fd575b532fe26013405d1afb9ee2374e7ab8"}, - {file = "regex-2022.1.18-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:768632fd8172ae03852e3245f11c8a425d95f65ff444ce46b3e673ae5b057b74"}, - {file = "regex-2022.1.18-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:de2923886b5d3214be951bc2ce3f6b8ac0d6dfd4a0d0e2a4d2e5523d8046fdfb"}, - {file = "regex-2022.1.18-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:1333b3ce73269f986b1fa4d5d395643810074dc2de5b9d262eb258daf37dc98f"}, - {file = "regex-2022.1.18-cp36-cp36m-musllinux_1_1_s390x.whl", hash = "sha256:d19a34f8a3429bd536996ad53597b805c10352a8561d8382e05830df389d2b43"}, - {file = "regex-2022.1.18-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:8d2f355a951f60f0843f2368b39970e4667517e54e86b1508e76f92b44811a8a"}, - {file = "regex-2022.1.18-cp36-cp36m-win32.whl", hash = "sha256:2245441445099411b528379dee83e56eadf449db924648e5feb9b747473f42e3"}, - {file = "regex-2022.1.18-cp36-cp36m-win_amd64.whl", hash = "sha256:25716aa70a0d153cd844fe861d4f3315a6ccafce22b39d8aadbf7fcadff2b633"}, - {file = "regex-2022.1.18-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:7e070d3aef50ac3856f2ef5ec7214798453da878bb5e5a16c16a61edf1817cc3"}, - {file = "regex-2022.1.18-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22709d701e7037e64dae2a04855021b62efd64a66c3ceed99dfd684bfef09e38"}, - {file = "regex-2022.1.18-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c9099bf89078675c372339011ccfc9ec310310bf6c292b413c013eb90ffdcafc"}, - {file = "regex-2022.1.18-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:04611cc0f627fc4a50bc4a9a2e6178a974c6a6a4aa9c1cca921635d2c47b9c87"}, - {file = "regex-2022.1.18-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:552a39987ac6655dad4bf6f17dd2b55c7b0c6e949d933b8846d2e312ee80005a"}, - {file = "regex-2022.1.18-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1e031899cb2bc92c0cf4d45389eff5b078d1936860a1be3aa8c94fa25fb46ed8"}, - {file = "regex-2022.1.18-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:2dacb3dae6b8cc579637a7b72f008bff50a94cde5e36e432352f4ca57b9e54c4"}, - {file = "regex-2022.1.18-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:e5c31d70a478b0ca22a9d2d76d520ae996214019d39ed7dd93af872c7f301e52"}, - {file = "regex-2022.1.18-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:bb804c7d0bfbd7e3f33924ff49757de9106c44e27979e2492819c16972ec0da2"}, - {file = "regex-2022.1.18-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:36b2d700a27e168fa96272b42d28c7ac3ff72030c67b32f37c05616ebd22a202"}, - {file = "regex-2022.1.18-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:16f81025bb3556eccb0681d7946e2b35ff254f9f888cff7d2120e8826330315c"}, - {file = "regex-2022.1.18-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:da80047524eac2acf7c04c18ac7a7da05a9136241f642dd2ed94269ef0d0a45a"}, - {file = "regex-2022.1.18-cp37-cp37m-win32.whl", hash = "sha256:6ca45359d7a21644793de0e29de497ef7f1ae7268e346c4faf87b421fea364e6"}, - {file = "regex-2022.1.18-cp37-cp37m-win_amd64.whl", hash = "sha256:38289f1690a7e27aacd049e420769b996826f3728756859420eeee21cc857118"}, - {file = "regex-2022.1.18-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6014038f52b4b2ac1fa41a58d439a8a00f015b5c0735a0cd4b09afe344c94899"}, - {file = "regex-2022.1.18-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:0b5d6f9aed3153487252d00a18e53f19b7f52a1651bc1d0c4b5844bc286dfa52"}, - {file = "regex-2022.1.18-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a9d24b03daf7415f78abc2d25a208f234e2c585e5e6f92f0204d2ab7b9ab48e3"}, - {file = "regex-2022.1.18-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bf594cc7cc9d528338d66674c10a5b25e3cde7dd75c3e96784df8f371d77a298"}, - {file = "regex-2022.1.18-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fd914db437ec25bfa410f8aa0aa2f3ba87cdfc04d9919d608d02330947afaeab"}, - {file = "regex-2022.1.18-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:90b6840b6448203228a9d8464a7a0d99aa8fa9f027ef95fe230579abaf8a6ee1"}, - {file = "regex-2022.1.18-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:11772be1eb1748e0e197a40ffb82fb8fd0d6914cd147d841d9703e2bef24d288"}, - {file = "regex-2022.1.18-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:a602bdc8607c99eb5b391592d58c92618dcd1537fdd87df1813f03fed49957a6"}, - {file = "regex-2022.1.18-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:7e26eac9e52e8ce86f915fd33380f1b6896a2b51994e40bb094841e5003429b4"}, - {file = "regex-2022.1.18-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:519c0b3a6fbb68afaa0febf0d28f6c4b0a1074aefc484802ecb9709faf181607"}, - {file = "regex-2022.1.18-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:3c7ea86b9ca83e30fa4d4cd0eaf01db3ebcc7b2726a25990966627e39577d729"}, - {file = "regex-2022.1.18-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:51f02ca184518702975b56affde6c573ebad4e411599005ce4468b1014b4786c"}, - {file = "regex-2022.1.18-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:385ccf6d011b97768a640e9d4de25412204fbe8d6b9ae39ff115d4ff03f6fe5d"}, - {file = "regex-2022.1.18-cp38-cp38-win32.whl", hash = "sha256:1f8c0ae0a0de4e19fddaaff036f508db175f6f03db318c80bbc239a1def62d02"}, - {file = "regex-2022.1.18-cp38-cp38-win_amd64.whl", hash = "sha256:760c54ad1b8a9b81951030a7e8e7c3ec0964c1cb9fee585a03ff53d9e531bb8e"}, - {file = "regex-2022.1.18-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:93c20777a72cae8620203ac11c4010365706062aa13aaedd1a21bb07adbb9d5d"}, - {file = "regex-2022.1.18-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6aa427c55a0abec450bca10b64446331b5ca8f79b648531138f357569705bc4a"}, - {file = "regex-2022.1.18-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c38baee6bdb7fe1b110b6b3aaa555e6e872d322206b7245aa39572d3fc991ee4"}, - {file = "regex-2022.1.18-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:752e7ddfb743344d447367baa85bccd3629c2c3940f70506eb5f01abce98ee68"}, - {file = "regex-2022.1.18-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8acef4d8a4353f6678fd1035422a937c2170de58a2b29f7da045d5249e934101"}, - {file = "regex-2022.1.18-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c73d2166e4b210b73d1429c4f1ca97cea9cc090e5302df2a7a0a96ce55373f1c"}, - {file = "regex-2022.1.18-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:24c89346734a4e4d60ecf9b27cac4c1fee3431a413f7aa00be7c4d7bbacc2c4d"}, - {file = "regex-2022.1.18-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:596f5ae2eeddb79b595583c2e0285312b2783b0ec759930c272dbf02f851ff75"}, - {file = "regex-2022.1.18-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ecfe51abf7f045e0b9cdde71ca9e153d11238679ef7b5da6c82093874adf3338"}, - {file = "regex-2022.1.18-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:1d6301f5288e9bdca65fab3de6b7de17362c5016d6bf8ee4ba4cbe833b2eda0f"}, - {file = "regex-2022.1.18-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:93cce7d422a0093cfb3606beae38a8e47a25232eea0f292c878af580a9dc7605"}, - {file = "regex-2022.1.18-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:cf0db26a1f76aa6b3aa314a74b8facd586b7a5457d05b64f8082a62c9c49582a"}, - {file = "regex-2022.1.18-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:defa0652696ff0ba48c8aff5a1fac1eef1ca6ac9c660b047fc8e7623c4eb5093"}, - {file = "regex-2022.1.18-cp39-cp39-win32.whl", hash = "sha256:6db1b52c6f2c04fafc8da17ea506608e6be7086715dab498570c3e55e4f8fbd1"}, - {file = "regex-2022.1.18-cp39-cp39-win_amd64.whl", hash = "sha256:ebaeb93f90c0903233b11ce913a7cb8f6ee069158406e056f884854c737d2442"}, - {file = "regex-2022.1.18.tar.gz", hash = "sha256:97f32dc03a8054a4c4a5ab5d761ed4861e828b2c200febd4e46857069a483916"}, -] -requests = [ - {file = "requests-2.27.1-py2.py3-none-any.whl", hash = "sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d"}, - {file = "requests-2.27.1.tar.gz", hash = "sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61"}, -] -responses = [ - {file = "responses-0.10.16-py2.py3-none-any.whl", hash = "sha256:cf55b7c89fc77b9ebbc5e5924210b6d0ef437061b80f1273d7e202069e43493c"}, - {file = "responses-0.10.16.tar.gz", hash = "sha256:fa125311607ab3e57d8fcc4da20587f041b4485bdfb06dd6bdf19d8b66f870c1"}, -] -six = [ - {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, - {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, -] -toml = [ - {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, - {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, -] -typed-ast = [ - {file = "typed_ast-1.5.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:183b183b7771a508395d2cbffd6db67d6ad52958a5fdc99f450d954003900266"}, - {file = "typed_ast-1.5.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:676d051b1da67a852c0447621fdd11c4e104827417bf216092ec3e286f7da596"}, - {file = "typed_ast-1.5.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bc2542e83ac8399752bc16e0b35e038bdb659ba237f4222616b4e83fb9654985"}, - {file = "typed_ast-1.5.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:74cac86cc586db8dfda0ce65d8bcd2bf17b58668dfcc3652762f3ef0e6677e76"}, - {file = "typed_ast-1.5.2-cp310-cp310-win_amd64.whl", hash = "sha256:18fe320f354d6f9ad3147859b6e16649a0781425268c4dde596093177660e71a"}, - {file = "typed_ast-1.5.2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:31d8c6b2df19a777bc8826770b872a45a1f30cfefcfd729491baa5237faae837"}, - {file = "typed_ast-1.5.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:963a0ccc9a4188524e6e6d39b12c9ca24cc2d45a71cfdd04a26d883c922b4b78"}, - {file = "typed_ast-1.5.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:0eb77764ea470f14fcbb89d51bc6bbf5e7623446ac4ed06cbd9ca9495b62e36e"}, - {file = "typed_ast-1.5.2-cp36-cp36m-win_amd64.whl", hash = "sha256:294a6903a4d087db805a7656989f613371915fc45c8cc0ddc5c5a0a8ad9bea4d"}, - {file = "typed_ast-1.5.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:26a432dc219c6b6f38be20a958cbe1abffcc5492821d7e27f08606ef99e0dffd"}, - {file = "typed_ast-1.5.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c7407cfcad702f0b6c0e0f3e7ab876cd1d2c13b14ce770e412c0c4b9728a0f88"}, - {file = "typed_ast-1.5.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f30ddd110634c2d7534b2d4e0e22967e88366b0d356b24de87419cc4410c41b7"}, - {file = "typed_ast-1.5.2-cp37-cp37m-win_amd64.whl", hash = "sha256:8c08d6625bb258179b6e512f55ad20f9dfef019bbfbe3095247401e053a3ea30"}, - {file = "typed_ast-1.5.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:90904d889ab8e81a956f2c0935a523cc4e077c7847a836abee832f868d5c26a4"}, - {file = "typed_ast-1.5.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:bbebc31bf11762b63bf61aaae232becb41c5bf6b3461b80a4df7e791fabb3aca"}, - {file = "typed_ast-1.5.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c29dd9a3a9d259c9fa19d19738d021632d673f6ed9b35a739f48e5f807f264fb"}, - {file = "typed_ast-1.5.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:58ae097a325e9bb7a684572d20eb3e1809802c5c9ec7108e85da1eb6c1a3331b"}, - {file = "typed_ast-1.5.2-cp38-cp38-win_amd64.whl", hash = "sha256:da0a98d458010bf4fe535f2d1e367a2e2060e105978873c04c04212fb20543f7"}, - {file = "typed_ast-1.5.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:33b4a19ddc9fc551ebabca9765d54d04600c4a50eda13893dadf67ed81d9a098"}, - {file = "typed_ast-1.5.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1098df9a0592dd4c8c0ccfc2e98931278a6c6c53cb3a3e2cf7e9ee3b06153344"}, - {file = "typed_ast-1.5.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42c47c3b43fe3a39ddf8de1d40dbbfca60ac8530a36c9b198ea5b9efac75c09e"}, - {file = "typed_ast-1.5.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f290617f74a610849bd8f5514e34ae3d09eafd521dceaa6cf68b3f4414266d4e"}, - {file = "typed_ast-1.5.2-cp39-cp39-win_amd64.whl", hash = "sha256:df05aa5b241e2e8045f5f4367a9f6187b09c4cdf8578bb219861c4e27c443db5"}, - {file = "typed_ast-1.5.2.tar.gz", hash = "sha256:525a2d4088e70a9f75b08b3f87a51acc9cde640e19cc523c7e41aa355564ae27"}, -] -typing-extensions = [ - {file = "typing_extensions-4.1.1-py3-none-any.whl", hash = "sha256:21c85e0fe4b9a155d0799430b0ad741cdce7e359660ccbd8b530613e8df88ce2"}, - {file = "typing_extensions-4.1.1.tar.gz", hash = "sha256:1a9462dcc3347a79b1f1c0271fbe79e844580bb598bafa1ed208b94da3cdcd42"}, -] -urllib3 = [ - {file = "urllib3-1.26.8-py2.py3-none-any.whl", hash = "sha256:000ca7f471a233c2251c6c7023ee85305721bfdf18621ebff4fd17a8653427ed"}, - {file = "urllib3-1.26.8.tar.gz", hash = "sha256:0e7c33d9a63e7ddfcb86780aac87befc2fbddf46c58dbb487e0855f7ceec283c"}, -] -virtualenv = [ - {file = "virtualenv-20.13.1-py2.py3-none-any.whl", hash = "sha256:45e1d053cad4cd453181ae877c4ffc053546ae99e7dd049b9ff1d9be7491abf7"}, - {file = "virtualenv-20.13.1.tar.gz", hash = "sha256:e0621bcbf4160e4e1030f05065c8834b4e93f4fcc223255db2a823440aca9c14"}, -] -wcwidth = [ - {file = "wcwidth-0.2.5-py2.py3-none-any.whl", hash = "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784"}, - {file = "wcwidth-0.2.5.tar.gz", hash = "sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83"}, -] -zipp = [ - {file = "zipp-3.7.0-py3-none-any.whl", hash = "sha256:b47250dd24f92b7dd6a0a8fc5244da14608f3ca90a5efcd37a3b1642fac9a375"}, - {file = "zipp-3.7.0.tar.gz", hash = "sha256:9f50f446828eb9d45b267433fd3e9da8d801f614129124863f9c51ebceafb87d"}, -] diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 233fcccf..00000000 --- a/pyproject.toml +++ /dev/null @@ -1,34 +0,0 @@ -[tool.poetry] -name = "xendit-python" -version = "0.2.2" -description = "Xendit REST API Client for Python - Card, Virtual Account, Invoice, Disbursement, Recurring Payments, Payout, EWallet, Balance, Retail Outlets, Payments API, Services https://xendit.github.io/apireference/" -authors = ["Maahir Ur Rahman "] -license = "MIT" -repository = "https://github.com/xendit/xendit-python" -readme = "README.md" -keywords = ["xendit", "sdk"] -classifiers = [ - "Intended Audience :: Developers", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", -] -packages = [ - { include = "xendit" } -] -[tool.poetry.dependencies] -python = "^3.7" -requests = "^2.23.0" - -[tool.poetry.dev-dependencies] -black = "^19.10b0" -pytest = "^5.4.3" -flake8 = "^3.8.3" -pytest-mock = "^3.1.1" -pre-commit = "^2.5.1" -responses = "^0.10.15" -pytest-cov = "^2.10.0" - -[build-system] -requires = ["poetry-core>=1.0.0a5"] -build-backend = "poetry.core.masonry.api" diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 2c6d87d5..00000000 --- a/pytest.ini +++ /dev/null @@ -1,3 +0,0 @@ -[pytest] -markers = - oldversion: Test old x_api_version \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..96947f60 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.25.3 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..8eaa24ea --- /dev/null +++ b/setup.py @@ -0,0 +1,37 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +from setuptools import setup, find_packages # noqa: H301 + +NAME = "xendit" +VERSION = "3.0.0" +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = [ + "urllib3 >= 1.25.3", + "python-dateutil", +] + +setup( + name=NAME, + version=VERSION, + description="Payment Method Service v2", + author="OpenAPI Generator community", + author_email="team@openapitools.org", + url="", + keywords=["OpenAPI", "OpenAPI-Generator", "Payment Method Service v2"], + python_requires=">=3.6", + install_requires=REQUIRES, + packages=find_packages(exclude=["test", "tests"]), + include_package_data=True, + long_description="""\ + This API is used for Payment Method Service v2 # noqa: E501 + """ +) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 00000000..bb4f22bb --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +pytest-cov>=2.8.1 diff --git a/examples/__init__.py b/test/__init__.py similarity index 100% rename from examples/__init__.py rename to test/__init__.py diff --git a/test/test_address_object.py b/test/test_address_object.py new file mode 100644 index 00000000..f1621b83 --- /dev/null +++ b/test/test_address_object.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.address_object import AddressObject + + +class TestAddressObject(unittest.TestCase): + """AddressObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAddressObject(self): + """Test AddressObject""" + # FIXME: construct object with mandatory attributes with example values + # model = AddressObject() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_alternative_display_item.py b/test/test_alternative_display_item.py new file mode 100644 index 00000000..4571fe52 --- /dev/null +++ b/test/test_alternative_display_item.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.alternative_display_item import AlternativeDisplayItem + + +class TestAlternativeDisplayItem(unittest.TestCase): + """AlternativeDisplayItem unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAlternativeDisplayItem(self): + """Test AlternativeDisplayItem""" + # FIXME: construct object with mandatory attributes with example values + # model = AlternativeDisplayItem() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_bad_request_error.py b/test/test_bad_request_error.py new file mode 100644 index 00000000..63d0155a --- /dev/null +++ b/test/test_bad_request_error.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.bad_request_error import BadRequestError + + +class TestBadRequestError(unittest.TestCase): + """BadRequestError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBadRequestError(self): + """Test BadRequestError""" + # FIXME: construct object with mandatory attributes with example values + # model = BadRequestError() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_balance.py b/test/test_balance.py new file mode 100644 index 00000000..8d40a80e --- /dev/null +++ b/test/test_balance.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import sys +import unittest + +import xendit +from xendit.balance_and_transaction.model.balance import Balance + + +class TestBalance(unittest.TestCase): + """Balance unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBalance(self): + """Test Balance""" + # FIXME: construct object with mandatory attributes with example values + # model = Balance() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_balance_api.py b/test/test_balance_api.py new file mode 100644 index 00000000..603b8eb7 --- /dev/null +++ b/test/test_balance_api.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import unittest + +import xendit +from balance_and_transaction.balance_api import BalanceApi # noqa: E501 + + +class TestBalanceApi(unittest.TestCase): + """BalanceApi unit test stubs""" + + def setUp(self): + self.api = BalanceApi() # noqa: E501 + + def tearDown(self): + pass + + def test_get_balance(self): + """Test case for get_balance + + Retrieves balances for a business, default to CASH type # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_bank.py b/test/test_bank.py new file mode 100644 index 00000000..40392704 --- /dev/null +++ b/test/test_bank.py @@ -0,0 +1,34 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.alternative_display_item import AlternativeDisplayItem +from xendit.invoice.model.bank_code import BankCode +globals()['AlternativeDisplayItem'] = AlternativeDisplayItem +globals()['BankCode'] = BankCode +from xendit.invoice.model.bank import Bank + + +class TestBank(unittest.TestCase): + """Bank unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBank(self): + """Test Bank""" + # FIXME: construct object with mandatory attributes with example values + # model = Bank() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_bank_code.py b/test/test_bank_code.py new file mode 100644 index 00000000..839c1ec6 --- /dev/null +++ b/test/test_bank_code.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.bank_code import BankCode + + +class TestBankCode(unittest.TestCase): + """BankCode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBankCode(self): + """Test BankCode""" + # FIXME: construct object with mandatory attributes with example values + # model = BankCode() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_billing_information.py b/test/test_billing_information.py new file mode 100644 index 00000000..15cffe8e --- /dev/null +++ b/test/test_billing_information.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.billing_information import BillingInformation + + +class TestBillingInformation(unittest.TestCase): + """BillingInformation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBillingInformation(self): + """Test BillingInformation""" + # FIXME: construct object with mandatory attributes with example values + # model = BillingInformation() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_capture.py b/test/test_capture.py new file mode 100644 index 00000000..04eac828 --- /dev/null +++ b/test/test_capture.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_method import PaymentMethod +globals()['PaymentMethod'] = PaymentMethod +from xendit.payment_request.model.capture import Capture + + +class TestCapture(unittest.TestCase): + """Capture unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCapture(self): + """Test Capture""" + # FIXME: construct object with mandatory attributes with example values + # model = Capture() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_capture_list.py b/test/test_capture_list.py new file mode 100644 index 00000000..3e10f438 --- /dev/null +++ b/test/test_capture_list.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.capture import Capture +globals()['Capture'] = Capture +from xendit.payment_request.model.capture_list import CaptureList + + +class TestCaptureList(unittest.TestCase): + """CaptureList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCaptureList(self): + """Test CaptureList""" + # FIXME: construct object with mandatory attributes with example values + # model = CaptureList() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_capture_list_response.py b/test/test_capture_list_response.py new file mode 100644 index 00000000..0182f177 --- /dev/null +++ b/test/test_capture_list_response.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.capture_list import CaptureList +globals()['CaptureList'] = CaptureList +from xendit.payment_request.model.capture_list_response import CaptureListResponse + + +class TestCaptureListResponse(unittest.TestCase): + """CaptureListResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCaptureListResponse(self): + """Test CaptureListResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = CaptureListResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_capture_parameters.py b/test/test_capture_parameters.py new file mode 100644 index 00000000..258b53e2 --- /dev/null +++ b/test/test_capture_parameters.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.capture_parameters import CaptureParameters + + +class TestCaptureParameters(unittest.TestCase): + """CaptureParameters unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCaptureParameters(self): + """Test CaptureParameters""" + # FIXME: construct object with mandatory attributes with example values + # model = CaptureParameters() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_card.py b/test/test_card.py new file mode 100644 index 00000000..36429d62 --- /dev/null +++ b/test/test_card.py @@ -0,0 +1,36 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.card_channel_properties import CardChannelProperties +from xendit.payment_method.model.card_verification_results import CardVerificationResults +from xendit.payment_method.model.tokenized_card_information import TokenizedCardInformation +globals()['CardChannelProperties'] = CardChannelProperties +globals()['CardVerificationResults'] = CardVerificationResults +globals()['TokenizedCardInformation'] = TokenizedCardInformation +from xendit.payment_method.model.card import Card + + +class TestCard(unittest.TestCase): + """Card unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCard(self): + """Test Card""" + # FIXME: construct object with mandatory attributes with example values + # model = Card() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_card_channel_properties.py b/test/test_card_channel_properties.py new file mode 100644 index 00000000..931903fe --- /dev/null +++ b/test/test_card_channel_properties.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.card_channel_properties import CardChannelProperties + + +class TestCardChannelProperties(unittest.TestCase): + """CardChannelProperties unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCardChannelProperties(self): + """Test CardChannelProperties""" + # FIXME: construct object with mandatory attributes with example values + # model = CardChannelProperties() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_card_information.py b/test/test_card_information.py new file mode 100644 index 00000000..98472f77 --- /dev/null +++ b/test/test_card_information.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.card_information import CardInformation + + +class TestCardInformation(unittest.TestCase): + """CardInformation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCardInformation(self): + """Test CardInformation""" + # FIXME: construct object with mandatory attributes with example values + # model = CardInformation() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_card_parameters.py b/test/test_card_parameters.py new file mode 100644 index 00000000..037fa025 --- /dev/null +++ b/test/test_card_parameters.py @@ -0,0 +1,34 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.card_channel_properties import CardChannelProperties +from xendit.payment_method.model.card_parameters_card_information import CardParametersCardInformation +globals()['CardChannelProperties'] = CardChannelProperties +globals()['CardParametersCardInformation'] = CardParametersCardInformation +from xendit.payment_method.model.card_parameters import CardParameters + + +class TestCardParameters(unittest.TestCase): + """CardParameters unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCardParameters(self): + """Test CardParameters""" + # FIXME: construct object with mandatory attributes with example values + # model = CardParameters() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_card_parameters_card_information.py b/test/test_card_parameters_card_information.py new file mode 100644 index 00000000..0aaf4cc0 --- /dev/null +++ b/test/test_card_parameters_card_information.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.card_parameters_card_information import CardParametersCardInformation + + +class TestCardParametersCardInformation(unittest.TestCase): + """CardParametersCardInformation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCardParametersCardInformation(self): + """Test CardParametersCardInformation""" + # FIXME: construct object with mandatory attributes with example values + # model = CardParametersCardInformation() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_card_verification_results.py b/test/test_card_verification_results.py new file mode 100644 index 00000000..ace611c0 --- /dev/null +++ b/test/test_card_verification_results.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.card_verification_results_three_d_secure import CardVerificationResultsThreeDSecure +globals()['CardVerificationResultsThreeDSecure'] = CardVerificationResultsThreeDSecure +from xendit.payment_method.model.card_verification_results import CardVerificationResults + + +class TestCardVerificationResults(unittest.TestCase): + """CardVerificationResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCardVerificationResults(self): + """Test CardVerificationResults""" + # FIXME: construct object with mandatory attributes with example values + # model = CardVerificationResults() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_card_verification_results_three_d_secure.py b/test/test_card_verification_results_three_d_secure.py new file mode 100644 index 00000000..8104ce56 --- /dev/null +++ b/test/test_card_verification_results_three_d_secure.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.card_verification_results_three_d_secure import CardVerificationResultsThreeDSecure + + +class TestCardVerificationResultsThreeDSecure(unittest.TestCase): + """CardVerificationResultsThreeDSecure unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCardVerificationResultsThreeDSecure(self): + """Test CardVerificationResultsThreeDSecure""" + # FIXME: construct object with mandatory attributes with example values + # model = CardVerificationResultsThreeDSecure() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_channel.py b/test/test_channel.py new file mode 100644 index 00000000..ffcf5251 --- /dev/null +++ b/test/test_channel.py @@ -0,0 +1,34 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import sys +import unittest + +import xendit +from xendit.payout.model.channel_amount_limits import ChannelAmountLimits +from xendit.payout.model.channel_category import ChannelCategory +globals()['ChannelAmountLimits'] = ChannelAmountLimits +globals()['ChannelCategory'] = ChannelCategory +from xendit.payout.model.channel import Channel + + +class TestChannel(unittest.TestCase): + """Channel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testChannel(self): + """Test Channel""" + # FIXME: construct object with mandatory attributes with example values + # model = Channel() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_channel_account_type.py b/test/test_channel_account_type.py new file mode 100644 index 00000000..d18b3c94 --- /dev/null +++ b/test/test_channel_account_type.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import sys +import unittest + +import xendit +from xendit.payout.model.channel_account_type import ChannelAccountType + + +class TestChannelAccountType(unittest.TestCase): + """ChannelAccountType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testChannelAccountType(self): + """Test ChannelAccountType""" + # FIXME: construct object with mandatory attributes with example values + # model = ChannelAccountType() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_channel_amount_limits.py b/test/test_channel_amount_limits.py new file mode 100644 index 00000000..d885eae5 --- /dev/null +++ b/test/test_channel_amount_limits.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.channel_amount_limits_all_of import ChannelAmountLimitsAllOf +globals()['ChannelAmountLimitsAllOf'] = ChannelAmountLimitsAllOf +from xendit.payment_method.model.channel_amount_limits import ChannelAmountLimits + + +class TestChannelAmountLimits(unittest.TestCase): + """ChannelAmountLimits unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testChannelAmountLimits(self): + """Test ChannelAmountLimits""" + # FIXME: construct object with mandatory attributes with example values + # model = ChannelAmountLimits() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_channel_amount_limits_all_of.py b/test/test_channel_amount_limits_all_of.py new file mode 100644 index 00000000..5e3bf4bd --- /dev/null +++ b/test/test_channel_amount_limits_all_of.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.channel_amount_limits_all_of import ChannelAmountLimitsAllOf + + +class TestChannelAmountLimitsAllOf(unittest.TestCase): + """ChannelAmountLimitsAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testChannelAmountLimitsAllOf(self): + """Test ChannelAmountLimitsAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = ChannelAmountLimitsAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_channel_category.py b/test/test_channel_category.py new file mode 100644 index 00000000..16d27f11 --- /dev/null +++ b/test/test_channel_category.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import sys +import unittest + +import xendit +from xendit.payout.model.channel_category import ChannelCategory + + +class TestChannelCategory(unittest.TestCase): + """ChannelCategory unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testChannelCategory(self): + """Test ChannelCategory""" + # FIXME: construct object with mandatory attributes with example values + # model = ChannelCategory() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_channel_property.py b/test/test_channel_property.py new file mode 100644 index 00000000..19a99d32 --- /dev/null +++ b/test/test_channel_property.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.channel_property_all_of import ChannelPropertyAllOf +globals()['ChannelPropertyAllOf'] = ChannelPropertyAllOf +from xendit.payment_method.model.channel_property import ChannelProperty + + +class TestChannelProperty(unittest.TestCase): + """ChannelProperty unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testChannelProperty(self): + """Test ChannelProperty""" + # FIXME: construct object with mandatory attributes with example values + # model = ChannelProperty() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_channel_property_all_of.py b/test/test_channel_property_all_of.py new file mode 100644 index 00000000..61cb7af5 --- /dev/null +++ b/test/test_channel_property_all_of.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.channel_property_all_of import ChannelPropertyAllOf + + +class TestChannelPropertyAllOf(unittest.TestCase): + """ChannelPropertyAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testChannelPropertyAllOf(self): + """Test ChannelPropertyAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = ChannelPropertyAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_channels_categories.py b/test/test_channels_categories.py new file mode 100644 index 00000000..202c7cd5 --- /dev/null +++ b/test/test_channels_categories.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import sys +import unittest + +import xendit +from xendit.balance_and_transaction.model.channels_categories import ChannelsCategories + + +class TestChannelsCategories(unittest.TestCase): + """ChannelsCategories unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testChannelsCategories(self): + """Test ChannelsCategories""" + # FIXME: construct object with mandatory attributes with example values + # model = ChannelsCategories() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_invoice_request.py b/test/test_create_invoice_request.py new file mode 100644 index 00000000..43256f42 --- /dev/null +++ b/test/test_create_invoice_request.py @@ -0,0 +1,38 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.customer_object import CustomerObject +from xendit.invoice.model.invoice_fee import InvoiceFee +from xendit.invoice.model.invoice_item import InvoiceItem +from xendit.invoice.model.notification_preference import NotificationPreference +globals()['CustomerObject'] = CustomerObject +globals()['InvoiceFee'] = InvoiceFee +globals()['InvoiceItem'] = InvoiceItem +globals()['NotificationPreference'] = NotificationPreference +from xendit.invoice.model.create_invoice_request import CreateInvoiceRequest + + +class TestCreateInvoiceRequest(unittest.TestCase): + """CreateInvoiceRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCreateInvoiceRequest(self): + """Test CreateInvoiceRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = CreateInvoiceRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_payment_method409_response.py b/test/test_create_payment_method409_response.py new file mode 100644 index 00000000..7b7db8cb --- /dev/null +++ b/test/test_create_payment_method409_response.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.create_payment_method409_response import CreatePaymentMethod409Response + + +class TestCreatePaymentMethod409Response(unittest.TestCase): + """CreatePaymentMethod409Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCreatePaymentMethod409Response(self): + """Test CreatePaymentMethod409Response""" + # FIXME: construct object with mandatory attributes with example values + # model = CreatePaymentMethod409Response() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_payment_method503_response.py b/test/test_create_payment_method503_response.py new file mode 100644 index 00000000..c6a61a01 --- /dev/null +++ b/test/test_create_payment_method503_response.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.create_payment_method503_response import CreatePaymentMethod503Response + + +class TestCreatePaymentMethod503Response(unittest.TestCase): + """CreatePaymentMethod503Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCreatePaymentMethod503Response(self): + """Test CreatePaymentMethod503Response""" + # FIXME: construct object with mandatory attributes with example values + # model = CreatePaymentMethod503Response() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_payout_request.py b/test/test_create_payout_request.py new file mode 100644 index 00000000..2671837a --- /dev/null +++ b/test/test_create_payout_request.py @@ -0,0 +1,34 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import sys +import unittest + +import xendit +from xendit.payout.model.digital_payout_channel_properties import DigitalPayoutChannelProperties +from xendit.payout.model.receipt_notification import ReceiptNotification +globals()['DigitalPayoutChannelProperties'] = DigitalPayoutChannelProperties +globals()['ReceiptNotification'] = ReceiptNotification +from xendit.payout.model.create_payout_request import CreatePayoutRequest + + +class TestCreatePayoutRequest(unittest.TestCase): + """CreatePayoutRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCreatePayoutRequest(self): + """Test CreatePayoutRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = CreatePayoutRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_refund.py b/test/test_create_refund.py new file mode 100644 index 00000000..05d055b3 --- /dev/null +++ b/test/test_create_refund.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.2.3 +""" + + +import sys +import unittest + +import xendit +from xendit.refund.model.create_refund import CreateRefund + + +class TestCreateRefund(unittest.TestCase): + """CreateRefund unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCreateRefund(self): + """Test CreateRefund""" + # FIXME: construct object with mandatory attributes with example values + # model = CreateRefund() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_refund400_response.py b/test/test_create_refund400_response.py new file mode 100644 index 00000000..9f50ad59 --- /dev/null +++ b/test/test_create_refund400_response.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.2.3 +""" + + +import sys +import unittest + +import xendit +from xendit.refund.model.create_refund400_response import CreateRefund400Response + + +class TestCreateRefund400Response(unittest.TestCase): + """CreateRefund400Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCreateRefund400Response(self): + """Test CreateRefund400Response""" + # FIXME: construct object with mandatory attributes with example values + # model = CreateRefund400Response() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_refund403_response.py b/test/test_create_refund403_response.py new file mode 100644 index 00000000..1f2c111d --- /dev/null +++ b/test/test_create_refund403_response.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.2.3 +""" + + +import sys +import unittest + +import xendit +from xendit.refund.model.create_refund403_response import CreateRefund403Response + + +class TestCreateRefund403Response(unittest.TestCase): + """CreateRefund403Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCreateRefund403Response(self): + """Test CreateRefund403Response""" + # FIXME: construct object with mandatory attributes with example values + # model = CreateRefund403Response() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_refund404_response.py b/test/test_create_refund404_response.py new file mode 100644 index 00000000..8d42efcc --- /dev/null +++ b/test/test_create_refund404_response.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.2.3 +""" + + +import sys +import unittest + +import xendit +from xendit.refund.model.create_refund404_response import CreateRefund404Response + + +class TestCreateRefund404Response(unittest.TestCase): + """CreateRefund404Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCreateRefund404Response(self): + """Test CreateRefund404Response""" + # FIXME: construct object with mandatory attributes with example values + # model = CreateRefund404Response() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_refund409_response.py b/test/test_create_refund409_response.py new file mode 100644 index 00000000..3699c8eb --- /dev/null +++ b/test/test_create_refund409_response.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.2.3 +""" + + +import sys +import unittest + +import xendit +from xendit.refund.model.create_refund409_response import CreateRefund409Response + + +class TestCreateRefund409Response(unittest.TestCase): + """CreateRefund409Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCreateRefund409Response(self): + """Test CreateRefund409Response""" + # FIXME: construct object with mandatory attributes with example values + # model = CreateRefund409Response() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_refund503_response.py b/test/test_create_refund503_response.py new file mode 100644 index 00000000..9a528530 --- /dev/null +++ b/test/test_create_refund503_response.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.2.3 +""" + + +import sys +import unittest + +import xendit +from xendit.refund.model.create_refund503_response import CreateRefund503Response + + +class TestCreateRefund503Response(unittest.TestCase): + """CreateRefund503Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCreateRefund503Response(self): + """Test CreateRefund503Response""" + # FIXME: construct object with mandatory attributes with example values + # model = CreateRefund503Response() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_refund_default_response.py b/test/test_create_refund_default_response.py new file mode 100644 index 00000000..84c65a80 --- /dev/null +++ b/test/test_create_refund_default_response.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.2.3 +""" + + +import sys +import unittest + +import xendit +from xendit.refund.model.create_refund_default_response import CreateRefundDefaultResponse + + +class TestCreateRefundDefaultResponse(unittest.TestCase): + """CreateRefundDefaultResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCreateRefundDefaultResponse(self): + """Test CreateRefundDefaultResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = CreateRefundDefaultResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_currency.py b/test/test_currency.py new file mode 100644 index 00000000..5da63cef --- /dev/null +++ b/test/test_currency.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import sys +import unittest + +import xendit +from xendit.balance_and_transaction.model.currency import Currency + + +class TestCurrency(unittest.TestCase): + """Currency unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCurrency(self): + """Test Currency""" + # FIXME: construct object with mandatory attributes with example values + # model = Currency() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_customer_object.py b/test/test_customer_object.py new file mode 100644 index 00000000..fb8836ff --- /dev/null +++ b/test/test_customer_object.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.address_object import AddressObject +globals()['AddressObject'] = AddressObject +from xendit.invoice.model.customer_object import CustomerObject + + +class TestCustomerObject(unittest.TestCase): + """CustomerObject unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCustomerObject(self): + """Test CustomerObject""" + # FIXME: construct object with mandatory attributes with example values + # model = CustomerObject() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_date_range_filter.py b/test/test_date_range_filter.py new file mode 100644 index 00000000..1a35674e --- /dev/null +++ b/test/test_date_range_filter.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import sys +import unittest + +import xendit +from xendit.balance_and_transaction.model.date_range_filter import DateRangeFilter + + +class TestDateRangeFilter(unittest.TestCase): + """DateRangeFilter unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDateRangeFilter(self): + """Test DateRangeFilter""" + # FIXME: construct object with mandatory attributes with example values + # model = DateRangeFilter() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_digital_payout_channel_properties.py b/test/test_digital_payout_channel_properties.py new file mode 100644 index 00000000..4b79e907 --- /dev/null +++ b/test/test_digital_payout_channel_properties.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import sys +import unittest + +import xendit +from xendit.payout.model.channel_account_type import ChannelAccountType +globals()['ChannelAccountType'] = ChannelAccountType +from xendit.payout.model.digital_payout_channel_properties import DigitalPayoutChannelProperties + + +class TestDigitalPayoutChannelProperties(unittest.TestCase): + """DigitalPayoutChannelProperties unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDigitalPayoutChannelProperties(self): + """Test DigitalPayoutChannelProperties""" + # FIXME: construct object with mandatory attributes with example values + # model = DigitalPayoutChannelProperties() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_direct_debit.py b/test/test_direct_debit.py new file mode 100644 index 00000000..da787ea8 --- /dev/null +++ b/test/test_direct_debit.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.direct_debit_type import DirectDebitType +globals()['DirectDebitType'] = DirectDebitType +from xendit.invoice.model.direct_debit import DirectDebit + + +class TestDirectDebit(unittest.TestCase): + """DirectDebit unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDirectDebit(self): + """Test DirectDebit""" + # FIXME: construct object with mandatory attributes with example values + # model = DirectDebit() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_direct_debit_all_of.py b/test/test_direct_debit_all_of.py new file mode 100644 index 00000000..8325d1c0 --- /dev/null +++ b/test/test_direct_debit_all_of.py @@ -0,0 +1,36 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.direct_debit_bank_account import DirectDebitBankAccount +from xendit.payment_request.model.direct_debit_debit_card import DirectDebitDebitCard +from xendit.payment_request.model.direct_debit_type import DirectDebitType +globals()['DirectDebitBankAccount'] = DirectDebitBankAccount +globals()['DirectDebitDebitCard'] = DirectDebitDebitCard +globals()['DirectDebitType'] = DirectDebitType +from xendit.payment_request.model.direct_debit_all_of import DirectDebitAllOf + + +class TestDirectDebitAllOf(unittest.TestCase): + """DirectDebitAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDirectDebitAllOf(self): + """Test DirectDebitAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = DirectDebitAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_direct_debit_bank_account.py b/test/test_direct_debit_bank_account.py new file mode 100644 index 00000000..2a61a148 --- /dev/null +++ b/test/test_direct_debit_bank_account.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.direct_debit_bank_account import DirectDebitBankAccount + + +class TestDirectDebitBankAccount(unittest.TestCase): + """DirectDebitBankAccount unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDirectDebitBankAccount(self): + """Test DirectDebitBankAccount""" + # FIXME: construct object with mandatory attributes with example values + # model = DirectDebitBankAccount() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_direct_debit_channel_code.py b/test/test_direct_debit_channel_code.py new file mode 100644 index 00000000..9d5d5703 --- /dev/null +++ b/test/test_direct_debit_channel_code.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.direct_debit_channel_code import DirectDebitChannelCode + + +class TestDirectDebitChannelCode(unittest.TestCase): + """DirectDebitChannelCode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDirectDebitChannelCode(self): + """Test DirectDebitChannelCode""" + # FIXME: construct object with mandatory attributes with example values + # model = DirectDebitChannelCode() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_direct_debit_channel_properties.py b/test/test_direct_debit_channel_properties.py new file mode 100644 index 00000000..d03925dc --- /dev/null +++ b/test/test_direct_debit_channel_properties.py @@ -0,0 +1,36 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.direct_debit_channel_properties_bank_account import DirectDebitChannelPropertiesBankAccount +from xendit.payment_request.model.direct_debit_channel_properties_bank_redirect import DirectDebitChannelPropertiesBankRedirect +from xendit.payment_request.model.direct_debit_channel_properties_debit_card import DirectDebitChannelPropertiesDebitCard +globals()['DirectDebitChannelPropertiesBankAccount'] = DirectDebitChannelPropertiesBankAccount +globals()['DirectDebitChannelPropertiesBankRedirect'] = DirectDebitChannelPropertiesBankRedirect +globals()['DirectDebitChannelPropertiesDebitCard'] = DirectDebitChannelPropertiesDebitCard +from xendit.payment_request.model.direct_debit_channel_properties import DirectDebitChannelProperties + + +class TestDirectDebitChannelProperties(unittest.TestCase): + """DirectDebitChannelProperties unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDirectDebitChannelProperties(self): + """Test DirectDebitChannelProperties""" + # FIXME: construct object with mandatory attributes with example values + # model = DirectDebitChannelProperties() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_direct_debit_channel_properties_bank_account.py b/test/test_direct_debit_channel_properties_bank_account.py new file mode 100644 index 00000000..c6059555 --- /dev/null +++ b/test/test_direct_debit_channel_properties_bank_account.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.direct_debit_channel_properties_bank_account import DirectDebitChannelPropertiesBankAccount + + +class TestDirectDebitChannelPropertiesBankAccount(unittest.TestCase): + """DirectDebitChannelPropertiesBankAccount unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDirectDebitChannelPropertiesBankAccount(self): + """Test DirectDebitChannelPropertiesBankAccount""" + # FIXME: construct object with mandatory attributes with example values + # model = DirectDebitChannelPropertiesBankAccount() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_direct_debit_channel_properties_bank_redirect.py b/test/test_direct_debit_channel_properties_bank_redirect.py new file mode 100644 index 00000000..781ce9f5 --- /dev/null +++ b/test/test_direct_debit_channel_properties_bank_redirect.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.direct_debit_channel_properties_bank_redirect import DirectDebitChannelPropertiesBankRedirect + + +class TestDirectDebitChannelPropertiesBankRedirect(unittest.TestCase): + """DirectDebitChannelPropertiesBankRedirect unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDirectDebitChannelPropertiesBankRedirect(self): + """Test DirectDebitChannelPropertiesBankRedirect""" + # FIXME: construct object with mandatory attributes with example values + # model = DirectDebitChannelPropertiesBankRedirect() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_direct_debit_channel_properties_debit_card.py b/test/test_direct_debit_channel_properties_debit_card.py new file mode 100644 index 00000000..f9db474d --- /dev/null +++ b/test/test_direct_debit_channel_properties_debit_card.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.direct_debit_channel_properties_debit_card import DirectDebitChannelPropertiesDebitCard + + +class TestDirectDebitChannelPropertiesDebitCard(unittest.TestCase): + """DirectDebitChannelPropertiesDebitCard unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDirectDebitChannelPropertiesDebitCard(self): + """Test DirectDebitChannelPropertiesDebitCard""" + # FIXME: construct object with mandatory attributes with example values + # model = DirectDebitChannelPropertiesDebitCard() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_direct_debit_debit_card.py b/test/test_direct_debit_debit_card.py new file mode 100644 index 00000000..706c4c05 --- /dev/null +++ b/test/test_direct_debit_debit_card.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.direct_debit_debit_card import DirectDebitDebitCard + + +class TestDirectDebitDebitCard(unittest.TestCase): + """DirectDebitDebitCard unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDirectDebitDebitCard(self): + """Test DirectDebitDebitCard""" + # FIXME: construct object with mandatory attributes with example values + # model = DirectDebitDebitCard() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_direct_debit_parameters.py b/test/test_direct_debit_parameters.py new file mode 100644 index 00000000..0b2a740e --- /dev/null +++ b/test/test_direct_debit_parameters.py @@ -0,0 +1,36 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.direct_debit_channel_code import DirectDebitChannelCode +from xendit.payment_request.model.direct_debit_channel_properties import DirectDebitChannelProperties +from xendit.payment_request.model.direct_debit_type import DirectDebitType +globals()['DirectDebitChannelCode'] = DirectDebitChannelCode +globals()['DirectDebitChannelProperties'] = DirectDebitChannelProperties +globals()['DirectDebitType'] = DirectDebitType +from xendit.payment_request.model.direct_debit_parameters import DirectDebitParameters + + +class TestDirectDebitParameters(unittest.TestCase): + """DirectDebitParameters unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDirectDebitParameters(self): + """Test DirectDebitParameters""" + # FIXME: construct object with mandatory attributes with example values + # model = DirectDebitParameters() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_direct_debit_type.py b/test/test_direct_debit_type.py new file mode 100644 index 00000000..8fee0ba8 --- /dev/null +++ b/test/test_direct_debit_type.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.direct_debit_type import DirectDebitType + + +class TestDirectDebitType(unittest.TestCase): + """DirectDebitType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDirectDebitType(self): + """Test DirectDebitType""" + # FIXME: construct object with mandatory attributes with example values + # model = DirectDebitType() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_e_wallet.py b/test/test_e_wallet.py new file mode 100644 index 00000000..6ebbed14 --- /dev/null +++ b/test/test_e_wallet.py @@ -0,0 +1,40 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.e_wallet_account import EWalletAccount +from xendit.payment_request.model.e_wallet_all_of import EWalletAllOf +from xendit.payment_request.model.e_wallet_channel_code import EWalletChannelCode +from xendit.payment_request.model.e_wallet_channel_properties import EWalletChannelProperties +from xendit.payment_request.model.e_wallet_parameters import EWalletParameters +globals()['EWalletAccount'] = EWalletAccount +globals()['EWalletAllOf'] = EWalletAllOf +globals()['EWalletChannelCode'] = EWalletChannelCode +globals()['EWalletChannelProperties'] = EWalletChannelProperties +globals()['EWalletParameters'] = EWalletParameters +from xendit.payment_request.model.e_wallet import EWallet + + +class TestEWallet(unittest.TestCase): + """EWallet unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEWallet(self): + """Test EWallet""" + # FIXME: construct object with mandatory attributes with example values + # model = EWallet() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_e_wallet_account.py b/test/test_e_wallet_account.py new file mode 100644 index 00000000..1b16cee6 --- /dev/null +++ b/test/test_e_wallet_account.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.e_wallet_account import EWalletAccount + + +class TestEWalletAccount(unittest.TestCase): + """EWalletAccount unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEWalletAccount(self): + """Test EWalletAccount""" + # FIXME: construct object with mandatory attributes with example values + # model = EWalletAccount() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_e_wallet_all_of.py b/test/test_e_wallet_all_of.py new file mode 100644 index 00000000..44f33a9f --- /dev/null +++ b/test/test_e_wallet_all_of.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.e_wallet_account import EWalletAccount +globals()['EWalletAccount'] = EWalletAccount +from xendit.payment_request.model.e_wallet_all_of import EWalletAllOf + + +class TestEWalletAllOf(unittest.TestCase): + """EWalletAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEWalletAllOf(self): + """Test EWalletAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = EWalletAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_e_wallet_channel_code.py b/test/test_e_wallet_channel_code.py new file mode 100644 index 00000000..12859725 --- /dev/null +++ b/test/test_e_wallet_channel_code.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.e_wallet_channel_code import EWalletChannelCode + + +class TestEWalletChannelCode(unittest.TestCase): + """EWalletChannelCode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEWalletChannelCode(self): + """Test EWalletChannelCode""" + # FIXME: construct object with mandatory attributes with example values + # model = EWalletChannelCode() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_e_wallet_channel_properties.py b/test/test_e_wallet_channel_properties.py new file mode 100644 index 00000000..62c703ea --- /dev/null +++ b/test/test_e_wallet_channel_properties.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.e_wallet_channel_properties import EWalletChannelProperties + + +class TestEWalletChannelProperties(unittest.TestCase): + """EWalletChannelProperties unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEWalletChannelProperties(self): + """Test EWalletChannelProperties""" + # FIXME: construct object with mandatory attributes with example values + # model = EWalletChannelProperties() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_e_wallet_parameters.py b/test/test_e_wallet_parameters.py new file mode 100644 index 00000000..e3ea660e --- /dev/null +++ b/test/test_e_wallet_parameters.py @@ -0,0 +1,36 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.e_wallet_account import EWalletAccount +from xendit.payment_method.model.e_wallet_channel_code import EWalletChannelCode +from xendit.payment_method.model.e_wallet_channel_properties import EWalletChannelProperties +globals()['EWalletAccount'] = EWalletAccount +globals()['EWalletChannelCode'] = EWalletChannelCode +globals()['EWalletChannelProperties'] = EWalletChannelProperties +from xendit.payment_method.model.e_wallet_parameters import EWalletParameters + + +class TestEWalletParameters(unittest.TestCase): + """EWalletParameters unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEWalletParameters(self): + """Test EWalletParameters""" + # FIXME: construct object with mandatory attributes with example values + # model = EWalletParameters() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_error.py b/test/test_error.py new file mode 100644 index 00000000..f10ca78c --- /dev/null +++ b/test/test_error.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.error import Error + + +class TestError(unittest.TestCase): + """Error unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testError(self): + """Test Error""" + # FIXME: construct object with mandatory attributes with example values + # model = Error() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_error_errors_inner.py b/test/test_error_errors_inner.py new file mode 100644 index 00000000..910805ab --- /dev/null +++ b/test/test_error_errors_inner.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import sys +import unittest + +import xendit +from xendit.payout.model.error_errors_inner import ErrorErrorsInner + + +class TestErrorErrorsInner(unittest.TestCase): + """ErrorErrorsInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testErrorErrorsInner(self): + """Test ErrorErrorsInner""" + # FIXME: construct object with mandatory attributes with example values + # model = ErrorErrorsInner() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_ewallet.py b/test/test_ewallet.py new file mode 100644 index 00000000..38e2648c --- /dev/null +++ b/test/test_ewallet.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.ewallet_type import EwalletType +globals()['EwalletType'] = EwalletType +from xendit.invoice.model.ewallet import Ewallet + + +class TestEwallet(unittest.TestCase): + """Ewallet unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEwallet(self): + """Test Ewallet""" + # FIXME: construct object with mandatory attributes with example values + # model = Ewallet() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_ewallet_type.py b/test/test_ewallet_type.py new file mode 100644 index 00000000..4744e9f9 --- /dev/null +++ b/test/test_ewallet_type.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.ewallet_type import EwalletType + + +class TestEwalletType(unittest.TestCase): + """EwalletType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEwalletType(self): + """Test EwalletType""" + # FIXME: construct object with mandatory attributes with example values + # model = EwalletType() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_fee_response.py b/test/test_fee_response.py new file mode 100644 index 00000000..f991d607 --- /dev/null +++ b/test/test_fee_response.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import sys +import unittest + +import xendit +from xendit.balance_and_transaction.model.fee_response import FeeResponse + + +class TestFeeResponse(unittest.TestCase): + """FeeResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFeeResponse(self): + """Test FeeResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = FeeResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_forbidden_error.py b/test/test_forbidden_error.py new file mode 100644 index 00000000..0eeeb10f --- /dev/null +++ b/test/test_forbidden_error.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.forbidden_error import ForbiddenError + + +class TestForbiddenError(unittest.TestCase): + """ForbiddenError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testForbiddenError(self): + """Test ForbiddenError""" + # FIXME: construct object with mandatory attributes with example values + # model = ForbiddenError() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_get_all_payment_methods400_response.py b/test/test_get_all_payment_methods400_response.py new file mode 100644 index 00000000..cc708f62 --- /dev/null +++ b/test/test_get_all_payment_methods400_response.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.get_all_payment_methods400_response import GetAllPaymentMethods400Response + + +class TestGetAllPaymentMethods400Response(unittest.TestCase): + """GetAllPaymentMethods400Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGetAllPaymentMethods400Response(self): + """Test GetAllPaymentMethods400Response""" + # FIXME: construct object with mandatory attributes with example values + # model = GetAllPaymentMethods400Response() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_get_all_payment_methods403_response.py b/test/test_get_all_payment_methods403_response.py new file mode 100644 index 00000000..9228392f --- /dev/null +++ b/test/test_get_all_payment_methods403_response.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.get_all_payment_methods403_response import GetAllPaymentMethods403Response + + +class TestGetAllPaymentMethods403Response(unittest.TestCase): + """GetAllPaymentMethods403Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGetAllPaymentMethods403Response(self): + """Test GetAllPaymentMethods403Response""" + # FIXME: construct object with mandatory attributes with example values + # model = GetAllPaymentMethods403Response() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_get_all_payment_methods404_response.py b/test/test_get_all_payment_methods404_response.py new file mode 100644 index 00000000..db98fef0 --- /dev/null +++ b/test/test_get_all_payment_methods404_response.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.get_all_payment_methods404_response import GetAllPaymentMethods404Response + + +class TestGetAllPaymentMethods404Response(unittest.TestCase): + """GetAllPaymentMethods404Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGetAllPaymentMethods404Response(self): + """Test GetAllPaymentMethods404Response""" + # FIXME: construct object with mandatory attributes with example values + # model = GetAllPaymentMethods404Response() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_get_all_payment_methods_default_response.py b/test/test_get_all_payment_methods_default_response.py new file mode 100644 index 00000000..12501870 --- /dev/null +++ b/test/test_get_all_payment_methods_default_response.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.get_all_payment_methods_default_response import GetAllPaymentMethodsDefaultResponse + + +class TestGetAllPaymentMethodsDefaultResponse(unittest.TestCase): + """GetAllPaymentMethodsDefaultResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGetAllPaymentMethodsDefaultResponse(self): + """Test GetAllPaymentMethodsDefaultResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = GetAllPaymentMethodsDefaultResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_get_payouts200_response.py b/test/test_get_payouts200_response.py new file mode 100644 index 00000000..858bf8d5 --- /dev/null +++ b/test/test_get_payouts200_response.py @@ -0,0 +1,34 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import sys +import unittest + +import xendit +from xendit.payout.model.get_payouts200_response_data_inner import GetPayouts200ResponseDataInner +from xendit.payout.model.get_payouts200_response_links import GetPayouts200ResponseLinks +globals()['GetPayouts200ResponseDataInner'] = GetPayouts200ResponseDataInner +globals()['GetPayouts200ResponseLinks'] = GetPayouts200ResponseLinks +from xendit.payout.model.get_payouts200_response import GetPayouts200Response + + +class TestGetPayouts200Response(unittest.TestCase): + """GetPayouts200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGetPayouts200Response(self): + """Test GetPayouts200Response""" + # FIXME: construct object with mandatory attributes with example values + # model = GetPayouts200Response() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_get_payouts200_response_data_inner.py b/test/test_get_payouts200_response_data_inner.py new file mode 100644 index 00000000..fe1fdd61 --- /dev/null +++ b/test/test_get_payouts200_response_data_inner.py @@ -0,0 +1,36 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import sys +import unittest + +import xendit +from xendit.payout.model.digital_payout_channel_properties import DigitalPayoutChannelProperties +from xendit.payout.model.payout import Payout +from xendit.payout.model.receipt_notification import ReceiptNotification +globals()['DigitalPayoutChannelProperties'] = DigitalPayoutChannelProperties +globals()['Payout'] = Payout +globals()['ReceiptNotification'] = ReceiptNotification +from xendit.payout.model.get_payouts200_response_data_inner import GetPayouts200ResponseDataInner + + +class TestGetPayouts200ResponseDataInner(unittest.TestCase): + """GetPayouts200ResponseDataInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGetPayouts200ResponseDataInner(self): + """Test GetPayouts200ResponseDataInner""" + # FIXME: construct object with mandatory attributes with example values + # model = GetPayouts200ResponseDataInner() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_get_payouts200_response_links.py b/test/test_get_payouts200_response_links.py new file mode 100644 index 00000000..eaf32c75 --- /dev/null +++ b/test/test_get_payouts200_response_links.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import sys +import unittest + +import xendit +from xendit.payout.model.get_payouts200_response_links import GetPayouts200ResponseLinks + + +class TestGetPayouts200ResponseLinks(unittest.TestCase): + """GetPayouts200ResponseLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGetPayouts200ResponseLinks(self): + """Test GetPayouts200ResponseLinks""" + # FIXME: construct object with mandatory attributes with example values + # model = GetPayouts200ResponseLinks() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_invoice.py b/test/test_invoice.py new file mode 100644 index 00000000..6222fead --- /dev/null +++ b/test/test_invoice.py @@ -0,0 +1,56 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.bank import Bank +from xendit.invoice.model.customer_object import CustomerObject +from xendit.invoice.model.direct_debit import DirectDebit +from xendit.invoice.model.ewallet import Ewallet +from xendit.invoice.model.invoice_currency import InvoiceCurrency +from xendit.invoice.model.invoice_fee import InvoiceFee +from xendit.invoice.model.invoice_item import InvoiceItem +from xendit.invoice.model.invoice_payment_method import InvoicePaymentMethod +from xendit.invoice.model.invoice_status import InvoiceStatus +from xendit.invoice.model.notification_preference import NotificationPreference +from xendit.invoice.model.paylater import Paylater +from xendit.invoice.model.qr_code import QrCode +from xendit.invoice.model.retail_outlet import RetailOutlet +globals()['Bank'] = Bank +globals()['CustomerObject'] = CustomerObject +globals()['DirectDebit'] = DirectDebit +globals()['Ewallet'] = Ewallet +globals()['InvoiceCurrency'] = InvoiceCurrency +globals()['InvoiceFee'] = InvoiceFee +globals()['InvoiceItem'] = InvoiceItem +globals()['InvoicePaymentMethod'] = InvoicePaymentMethod +globals()['InvoiceStatus'] = InvoiceStatus +globals()['NotificationPreference'] = NotificationPreference +globals()['Paylater'] = Paylater +globals()['QrCode'] = QrCode +globals()['RetailOutlet'] = RetailOutlet +from xendit.invoice.model.invoice import Invoice + + +class TestInvoice(unittest.TestCase): + """Invoice unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInvoice(self): + """Test Invoice""" + # FIXME: construct object with mandatory attributes with example values + # model = Invoice() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_invoice_api.py b/test/test_invoice_api.py new file mode 100644 index 00000000..e609608e --- /dev/null +++ b/test/test_invoice_api.py @@ -0,0 +1,51 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import unittest + +import xendit +from invoice.invoice_api import InvoiceApi # noqa: E501 + + +class TestInvoiceApi(unittest.TestCase): + """InvoiceApi unit test stubs""" + + def setUp(self): + self.api = InvoiceApi() # noqa: E501 + + def tearDown(self): + pass + + def test_create_invoice(self): + """Test case for create_invoice + + Create an invoice # noqa: E501 + """ + pass + + def test_expire_invoice(self): + """Test case for expire_invoice + + Manually expire an invoice # noqa: E501 + """ + pass + + def test_get_invoice_by_id(self): + """Test case for get_invoice_by_id + + Get invoice by invoice id # noqa: E501 + """ + pass + + def test_get_invoices(self): + """Test case for get_invoices + + Get all Invoices # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_invoice_client_type.py b/test/test_invoice_client_type.py new file mode 100644 index 00000000..6963785a --- /dev/null +++ b/test/test_invoice_client_type.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.invoice_client_type import InvoiceClientType + + +class TestInvoiceClientType(unittest.TestCase): + """InvoiceClientType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInvoiceClientType(self): + """Test InvoiceClientType""" + # FIXME: construct object with mandatory attributes with example values + # model = InvoiceClientType() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_invoice_currency.py b/test/test_invoice_currency.py new file mode 100644 index 00000000..efef5f6e --- /dev/null +++ b/test/test_invoice_currency.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.invoice_currency import InvoiceCurrency + + +class TestInvoiceCurrency(unittest.TestCase): + """InvoiceCurrency unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInvoiceCurrency(self): + """Test InvoiceCurrency""" + # FIXME: construct object with mandatory attributes with example values + # model = InvoiceCurrency() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_invoice_error404_response_definition.py b/test/test_invoice_error404_response_definition.py new file mode 100644 index 00000000..922c66d4 --- /dev/null +++ b/test/test_invoice_error404_response_definition.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.invoice_error404_response_definition import InvoiceError404ResponseDefinition + + +class TestInvoiceError404ResponseDefinition(unittest.TestCase): + """InvoiceError404ResponseDefinition unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInvoiceError404ResponseDefinition(self): + """Test InvoiceError404ResponseDefinition""" + # FIXME: construct object with mandatory attributes with example values + # model = InvoiceError404ResponseDefinition() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_invoice_fee.py b/test/test_invoice_fee.py new file mode 100644 index 00000000..944c6f50 --- /dev/null +++ b/test/test_invoice_fee.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.invoice_fee import InvoiceFee + + +class TestInvoiceFee(unittest.TestCase): + """InvoiceFee unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInvoiceFee(self): + """Test InvoiceFee""" + # FIXME: construct object with mandatory attributes with example values + # model = InvoiceFee() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_invoice_item.py b/test/test_invoice_item.py new file mode 100644 index 00000000..e6b4da6d --- /dev/null +++ b/test/test_invoice_item.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.invoice_item import InvoiceItem + + +class TestInvoiceItem(unittest.TestCase): + """InvoiceItem unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInvoiceItem(self): + """Test InvoiceItem""" + # FIXME: construct object with mandatory attributes with example values + # model = InvoiceItem() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_invoice_not_found_error.py b/test/test_invoice_not_found_error.py new file mode 100644 index 00000000..23ad613c --- /dev/null +++ b/test/test_invoice_not_found_error.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.invoice_not_found_error import InvoiceNotFoundError + + +class TestInvoiceNotFoundError(unittest.TestCase): + """InvoiceNotFoundError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInvoiceNotFoundError(self): + """Test InvoiceNotFoundError""" + # FIXME: construct object with mandatory attributes with example values + # model = InvoiceNotFoundError() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_invoice_payment_method.py b/test/test_invoice_payment_method.py new file mode 100644 index 00000000..f999ced6 --- /dev/null +++ b/test/test_invoice_payment_method.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.invoice_payment_method import InvoicePaymentMethod + + +class TestInvoicePaymentMethod(unittest.TestCase): + """InvoicePaymentMethod unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInvoicePaymentMethod(self): + """Test InvoicePaymentMethod""" + # FIXME: construct object with mandatory attributes with example values + # model = InvoicePaymentMethod() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_invoice_status.py b/test/test_invoice_status.py new file mode 100644 index 00000000..6487d319 --- /dev/null +++ b/test/test_invoice_status.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.invoice_status import InvoiceStatus + + +class TestInvoiceStatus(unittest.TestCase): + """InvoiceStatus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInvoiceStatus(self): + """Test InvoiceStatus""" + # FIXME: construct object with mandatory attributes with example values + # model = InvoiceStatus() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_link_item.py b/test/test_link_item.py new file mode 100644 index 00000000..d0eeb6dd --- /dev/null +++ b/test/test_link_item.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import sys +import unittest + +import xendit +from xendit.balance_and_transaction.model.link_item import LinkItem + + +class TestLinkItem(unittest.TestCase): + """LinkItem unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testLinkItem(self): + """Test LinkItem""" + # FIXME: construct object with mandatory attributes with example values + # model = LinkItem() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_notification_channel.py b/test/test_notification_channel.py new file mode 100644 index 00000000..f3682738 --- /dev/null +++ b/test/test_notification_channel.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.notification_channel import NotificationChannel + + +class TestNotificationChannel(unittest.TestCase): + """NotificationChannel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNotificationChannel(self): + """Test NotificationChannel""" + # FIXME: construct object with mandatory attributes with example values + # model = NotificationChannel() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_notification_preference.py b/test/test_notification_preference.py new file mode 100644 index 00000000..0eb96890 --- /dev/null +++ b/test/test_notification_preference.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.notification_channel import NotificationChannel +globals()['NotificationChannel'] = NotificationChannel +from xendit.invoice.model.notification_preference import NotificationPreference + + +class TestNotificationPreference(unittest.TestCase): + """NotificationPreference unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNotificationPreference(self): + """Test NotificationPreference""" + # FIXME: construct object with mandatory attributes with example values + # model = NotificationPreference() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_over_the_counter.py b/test/test_over_the_counter.py new file mode 100644 index 00000000..e6c5f9b3 --- /dev/null +++ b/test/test_over_the_counter.py @@ -0,0 +1,38 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.over_the_counter_channel_code import OverTheCounterChannelCode +from xendit.payment_request.model.over_the_counter_channel_properties import OverTheCounterChannelProperties +from xendit.payment_request.model.over_the_counter_parameters import OverTheCounterParameters +from xendit.payment_request.model.payment_request_currency import PaymentRequestCurrency +globals()['OverTheCounterChannelCode'] = OverTheCounterChannelCode +globals()['OverTheCounterChannelProperties'] = OverTheCounterChannelProperties +globals()['OverTheCounterParameters'] = OverTheCounterParameters +globals()['PaymentRequestCurrency'] = PaymentRequestCurrency +from xendit.payment_request.model.over_the_counter import OverTheCounter + + +class TestOverTheCounter(unittest.TestCase): + """OverTheCounter unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOverTheCounter(self): + """Test OverTheCounter""" + # FIXME: construct object with mandatory attributes with example values + # model = OverTheCounter() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_over_the_counter_channel_code.py b/test/test_over_the_counter_channel_code.py new file mode 100644 index 00000000..e920f6fc --- /dev/null +++ b/test/test_over_the_counter_channel_code.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.over_the_counter_channel_code import OverTheCounterChannelCode + + +class TestOverTheCounterChannelCode(unittest.TestCase): + """OverTheCounterChannelCode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOverTheCounterChannelCode(self): + """Test OverTheCounterChannelCode""" + # FIXME: construct object with mandatory attributes with example values + # model = OverTheCounterChannelCode() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_over_the_counter_channel_properties.py b/test/test_over_the_counter_channel_properties.py new file mode 100644 index 00000000..e768d303 --- /dev/null +++ b/test/test_over_the_counter_channel_properties.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.over_the_counter_channel_properties import OverTheCounterChannelProperties + + +class TestOverTheCounterChannelProperties(unittest.TestCase): + """OverTheCounterChannelProperties unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOverTheCounterChannelProperties(self): + """Test OverTheCounterChannelProperties""" + # FIXME: construct object with mandatory attributes with example values + # model = OverTheCounterChannelProperties() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_over_the_counter_channel_properties_update.py b/test/test_over_the_counter_channel_properties_update.py new file mode 100644 index 00000000..5cd2672a --- /dev/null +++ b/test/test_over_the_counter_channel_properties_update.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.over_the_counter_channel_properties_update import OverTheCounterChannelPropertiesUpdate + + +class TestOverTheCounterChannelPropertiesUpdate(unittest.TestCase): + """OverTheCounterChannelPropertiesUpdate unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOverTheCounterChannelPropertiesUpdate(self): + """Test OverTheCounterChannelPropertiesUpdate""" + # FIXME: construct object with mandatory attributes with example values + # model = OverTheCounterChannelPropertiesUpdate() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_over_the_counter_parameters.py b/test/test_over_the_counter_parameters.py new file mode 100644 index 00000000..50e0ae5d --- /dev/null +++ b/test/test_over_the_counter_parameters.py @@ -0,0 +1,36 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.over_the_counter_channel_code import OverTheCounterChannelCode +from xendit.payment_request.model.over_the_counter_channel_properties import OverTheCounterChannelProperties +from xendit.payment_request.model.payment_request_currency import PaymentRequestCurrency +globals()['OverTheCounterChannelCode'] = OverTheCounterChannelCode +globals()['OverTheCounterChannelProperties'] = OverTheCounterChannelProperties +globals()['PaymentRequestCurrency'] = PaymentRequestCurrency +from xendit.payment_request.model.over_the_counter_parameters import OverTheCounterParameters + + +class TestOverTheCounterParameters(unittest.TestCase): + """OverTheCounterParameters unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOverTheCounterParameters(self): + """Test OverTheCounterParameters""" + # FIXME: construct object with mandatory attributes with example values + # model = OverTheCounterParameters() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_over_the_counter_update_parameters.py b/test/test_over_the_counter_update_parameters.py new file mode 100644 index 00000000..e126dd26 --- /dev/null +++ b/test/test_over_the_counter_update_parameters.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.over_the_counter_channel_properties_update import OverTheCounterChannelPropertiesUpdate +globals()['OverTheCounterChannelPropertiesUpdate'] = OverTheCounterChannelPropertiesUpdate +from xendit.payment_method.model.over_the_counter_update_parameters import OverTheCounterUpdateParameters + + +class TestOverTheCounterUpdateParameters(unittest.TestCase): + """OverTheCounterUpdateParameters unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOverTheCounterUpdateParameters(self): + """Test OverTheCounterUpdateParameters""" + # FIXME: construct object with mandatory attributes with example values + # model = OverTheCounterUpdateParameters() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_paylater.py b/test/test_paylater.py new file mode 100644 index 00000000..365301ea --- /dev/null +++ b/test/test_paylater.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.paylater_type import PaylaterType +globals()['PaylaterType'] = PaylaterType +from xendit.invoice.model.paylater import Paylater + + +class TestPaylater(unittest.TestCase): + """Paylater unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaylater(self): + """Test Paylater""" + # FIXME: construct object with mandatory attributes with example values + # model = Paylater() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_paylater_type.py b/test/test_paylater_type.py new file mode 100644 index 00000000..2a3a8a94 --- /dev/null +++ b/test/test_paylater_type.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.paylater_type import PaylaterType + + +class TestPaylaterType(unittest.TestCase): + """PaylaterType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaylaterType(self): + """Test PaylaterType""" + # FIXME: construct object with mandatory attributes with example values + # model = PaylaterType() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_channel.py b/test/test_payment_channel.py new file mode 100644 index 00000000..72644d56 --- /dev/null +++ b/test/test_payment_channel.py @@ -0,0 +1,36 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.channel_amount_limits import ChannelAmountLimits +from xendit.payment_method.model.channel_property import ChannelProperty +from xendit.payment_method.model.payment_channel_all_of import PaymentChannelAllOf +globals()['ChannelAmountLimits'] = ChannelAmountLimits +globals()['ChannelProperty'] = ChannelProperty +globals()['PaymentChannelAllOf'] = PaymentChannelAllOf +from xendit.payment_method.model.payment_channel import PaymentChannel + + +class TestPaymentChannel(unittest.TestCase): + """PaymentChannel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentChannel(self): + """Test PaymentChannel""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentChannel() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_channel_all_of.py b/test/test_payment_channel_all_of.py new file mode 100644 index 00000000..e15e5fd3 --- /dev/null +++ b/test/test_payment_channel_all_of.py @@ -0,0 +1,34 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.channel_amount_limits import ChannelAmountLimits +from xendit.payment_method.model.channel_property import ChannelProperty +globals()['ChannelAmountLimits'] = ChannelAmountLimits +globals()['ChannelProperty'] = ChannelProperty +from xendit.payment_method.model.payment_channel_all_of import PaymentChannelAllOf + + +class TestPaymentChannelAllOf(unittest.TestCase): + """PaymentChannelAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentChannelAllOf(self): + """Test PaymentChannelAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentChannelAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_channel_list.py b/test/test_payment_channel_list.py new file mode 100644 index 00000000..b534d6da --- /dev/null +++ b/test/test_payment_channel_list.py @@ -0,0 +1,34 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.payment_channel import PaymentChannel +from xendit.payment_method.model.payment_channel_list_links_inner import PaymentChannelListLinksInner +globals()['PaymentChannel'] = PaymentChannel +globals()['PaymentChannelListLinksInner'] = PaymentChannelListLinksInner +from xendit.payment_method.model.payment_channel_list import PaymentChannelList + + +class TestPaymentChannelList(unittest.TestCase): + """PaymentChannelList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentChannelList(self): + """Test PaymentChannelList""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentChannelList() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_channel_list_links_inner.py b/test/test_payment_channel_list_links_inner.py new file mode 100644 index 00000000..9a99d1f1 --- /dev/null +++ b/test/test_payment_channel_list_links_inner.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.payment_channel_list_links_inner_all_of import PaymentChannelListLinksInnerAllOf +globals()['PaymentChannelListLinksInnerAllOf'] = PaymentChannelListLinksInnerAllOf +from xendit.payment_method.model.payment_channel_list_links_inner import PaymentChannelListLinksInner + + +class TestPaymentChannelListLinksInner(unittest.TestCase): + """PaymentChannelListLinksInner unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentChannelListLinksInner(self): + """Test PaymentChannelListLinksInner""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentChannelListLinksInner() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_channel_list_links_inner_all_of.py b/test/test_payment_channel_list_links_inner_all_of.py new file mode 100644 index 00000000..53d0ba63 --- /dev/null +++ b/test/test_payment_channel_list_links_inner_all_of.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.payment_channel_list_links_inner_all_of import PaymentChannelListLinksInnerAllOf + + +class TestPaymentChannelListLinksInnerAllOf(unittest.TestCase): + """PaymentChannelListLinksInnerAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentChannelListLinksInnerAllOf(self): + """Test PaymentChannelListLinksInnerAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentChannelListLinksInnerAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_method.py b/test/test_payment_method.py new file mode 100644 index 00000000..0ebf5d3c --- /dev/null +++ b/test/test_payment_method.py @@ -0,0 +1,48 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.card import Card +from xendit.payment_request.model.direct_debit import DirectDebit +from xendit.payment_request.model.e_wallet import EWallet +from xendit.payment_request.model.over_the_counter import OverTheCounter +from xendit.payment_request.model.payment_method_reusability import PaymentMethodReusability +from xendit.payment_request.model.payment_method_status import PaymentMethodStatus +from xendit.payment_request.model.payment_method_type import PaymentMethodType +from xendit.payment_request.model.qr_code import QRCode +from xendit.payment_request.model.virtual_account import VirtualAccount +globals()['Card'] = Card +globals()['DirectDebit'] = DirectDebit +globals()['EWallet'] = EWallet +globals()['OverTheCounter'] = OverTheCounter +globals()['PaymentMethodReusability'] = PaymentMethodReusability +globals()['PaymentMethodStatus'] = PaymentMethodStatus +globals()['PaymentMethodType'] = PaymentMethodType +globals()['QRCode'] = QRCode +globals()['VirtualAccount'] = VirtualAccount +from xendit.payment_request.model.payment_method import PaymentMethod + + +class TestPaymentMethod(unittest.TestCase): + """PaymentMethod unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentMethod(self): + """Test PaymentMethod""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentMethod() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_method_action.py b/test/test_payment_method_action.py new file mode 100644 index 00000000..41598da6 --- /dev/null +++ b/test/test_payment_method_action.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.payment_method_action import PaymentMethodAction + + +class TestPaymentMethodAction(unittest.TestCase): + """PaymentMethodAction unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentMethodAction(self): + """Test PaymentMethodAction""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentMethodAction() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_method_api.py b/test/test_payment_method_api.py new file mode 100644 index 00000000..718d853a --- /dev/null +++ b/test/test_payment_method_api.py @@ -0,0 +1,86 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import unittest + +import xendit +from payment_method.payment_method_api import PaymentMethodApi # noqa: E501 + + +class TestPaymentMethodApi(unittest.TestCase): + """PaymentMethodApi unit test stubs""" + + def setUp(self): + self.api = PaymentMethodApi() # noqa: E501 + + def tearDown(self): + pass + + def test_auth_payment_method(self): + """Test case for auth_payment_method + + Validate a payment method's linking OTP # noqa: E501 + """ + pass + + def test_create_payment_method(self): + """Test case for create_payment_method + + Creates payment method # noqa: E501 + """ + pass + + def test_expire_payment_method(self): + """Test case for expire_payment_method + + Expires a payment method # noqa: E501 + """ + pass + + def test_get_all_payment_channels(self): + """Test case for get_all_payment_channels + + Get all payment channels # noqa: E501 + """ + pass + + def test_get_all_payment_methods(self): + """Test case for get_all_payment_methods + + Get all payment methods by filters # noqa: E501 + """ + pass + + def test_get_payment_method_by_id(self): + """Test case for get_payment_method_by_id + + Get payment method by ID # noqa: E501 + """ + pass + + def test_get_payments_by_payment_method_id(self): + """Test case for get_payments_by_payment_method_id + + Returns payments with matching PaymentMethodID. # noqa: E501 + """ + pass + + def test_patch_payment_method(self): + """Test case for patch_payment_method + + Patch payment methods # noqa: E501 + """ + pass + + def test_simulate_payment(self): + """Test case for simulate_payment + + Makes payment with matching PaymentMethodID. # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_method_auth_parameters.py b/test/test_payment_method_auth_parameters.py new file mode 100644 index 00000000..71897c11 --- /dev/null +++ b/test/test_payment_method_auth_parameters.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.payment_method_auth_parameters import PaymentMethodAuthParameters + + +class TestPaymentMethodAuthParameters(unittest.TestCase): + """PaymentMethodAuthParameters unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentMethodAuthParameters(self): + """Test PaymentMethodAuthParameters""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentMethodAuthParameters() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_method_country.py b/test/test_payment_method_country.py new file mode 100644 index 00000000..d2abad42 --- /dev/null +++ b/test/test_payment_method_country.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.payment_method_country import PaymentMethodCountry + + +class TestPaymentMethodCountry(unittest.TestCase): + """PaymentMethodCountry unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentMethodCountry(self): + """Test PaymentMethodCountry""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentMethodCountry() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_method_expire_parameters.py b/test/test_payment_method_expire_parameters.py new file mode 100644 index 00000000..00babfb2 --- /dev/null +++ b/test/test_payment_method_expire_parameters.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.payment_method_expire_parameters import PaymentMethodExpireParameters + + +class TestPaymentMethodExpireParameters(unittest.TestCase): + """PaymentMethodExpireParameters unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentMethodExpireParameters(self): + """Test PaymentMethodExpireParameters""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentMethodExpireParameters() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_method_list.py b/test/test_payment_method_list.py new file mode 100644 index 00000000..7ebc5fb2 --- /dev/null +++ b/test/test_payment_method_list.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.payment_method import PaymentMethod +globals()['PaymentMethod'] = PaymentMethod +from xendit.payment_method.model.payment_method_list import PaymentMethodList + + +class TestPaymentMethodList(unittest.TestCase): + """PaymentMethodList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentMethodList(self): + """Test PaymentMethodList""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentMethodList() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_method_parameters.py b/test/test_payment_method_parameters.py new file mode 100644 index 00000000..e58b6e3e --- /dev/null +++ b/test/test_payment_method_parameters.py @@ -0,0 +1,44 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.direct_debit_parameters import DirectDebitParameters +from xendit.payment_request.model.e_wallet_parameters import EWalletParameters +from xendit.payment_request.model.over_the_counter_parameters import OverTheCounterParameters +from xendit.payment_request.model.payment_method_reusability import PaymentMethodReusability +from xendit.payment_request.model.payment_method_type import PaymentMethodType +from xendit.payment_request.model.qr_code_parameters import QRCodeParameters +from xendit.payment_request.model.virtual_account_parameters import VirtualAccountParameters +globals()['DirectDebitParameters'] = DirectDebitParameters +globals()['EWalletParameters'] = EWalletParameters +globals()['OverTheCounterParameters'] = OverTheCounterParameters +globals()['PaymentMethodReusability'] = PaymentMethodReusability +globals()['PaymentMethodType'] = PaymentMethodType +globals()['QRCodeParameters'] = QRCodeParameters +globals()['VirtualAccountParameters'] = VirtualAccountParameters +from xendit.payment_request.model.payment_method_parameters import PaymentMethodParameters + + +class TestPaymentMethodParameters(unittest.TestCase): + """PaymentMethodParameters unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentMethodParameters(self): + """Test PaymentMethodParameters""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentMethodParameters() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_method_reusability.py b/test/test_payment_method_reusability.py new file mode 100644 index 00000000..11be9805 --- /dev/null +++ b/test/test_payment_method_reusability.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_method_reusability import PaymentMethodReusability + + +class TestPaymentMethodReusability(unittest.TestCase): + """PaymentMethodReusability unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentMethodReusability(self): + """Test PaymentMethodReusability""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentMethodReusability() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_method_status.py b/test/test_payment_method_status.py new file mode 100644 index 00000000..b01d87f3 --- /dev/null +++ b/test/test_payment_method_status.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_method_status import PaymentMethodStatus + + +class TestPaymentMethodStatus(unittest.TestCase): + """PaymentMethodStatus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentMethodStatus(self): + """Test PaymentMethodStatus""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentMethodStatus() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_method_type.py b/test/test_payment_method_type.py new file mode 100644 index 00000000..09f7e835 --- /dev/null +++ b/test/test_payment_method_type.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_method_type import PaymentMethodType + + +class TestPaymentMethodType(unittest.TestCase): + """PaymentMethodType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentMethodType(self): + """Test PaymentMethodType""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentMethodType() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_method_update_parameters.py b/test/test_payment_method_update_parameters.py new file mode 100644 index 00000000..dec1bcce --- /dev/null +++ b/test/test_payment_method_update_parameters.py @@ -0,0 +1,38 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.over_the_counter_update_parameters import OverTheCounterUpdateParameters +from xendit.payment_method.model.payment_method_reusability import PaymentMethodReusability +from xendit.payment_method.model.payment_method_status import PaymentMethodStatus +from xendit.payment_method.model.virtual_account_update_parameters import VirtualAccountUpdateParameters +globals()['OverTheCounterUpdateParameters'] = OverTheCounterUpdateParameters +globals()['PaymentMethodReusability'] = PaymentMethodReusability +globals()['PaymentMethodStatus'] = PaymentMethodStatus +globals()['VirtualAccountUpdateParameters'] = VirtualAccountUpdateParameters +from xendit.payment_method.model.payment_method_update_parameters import PaymentMethodUpdateParameters + + +class TestPaymentMethodUpdateParameters(unittest.TestCase): + """PaymentMethodUpdateParameters unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentMethodUpdateParameters(self): + """Test PaymentMethodUpdateParameters""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentMethodUpdateParameters() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_request.py b/test/test_payment_request.py new file mode 100644 index 00000000..8247a1ca --- /dev/null +++ b/test/test_payment_request.py @@ -0,0 +1,50 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_method import PaymentMethod +from xendit.payment_request.model.payment_request_action import PaymentRequestAction +from xendit.payment_request.model.payment_request_basket import PaymentRequestBasket +from xendit.payment_request.model.payment_request_capture_method import PaymentRequestCaptureMethod +from xendit.payment_request.model.payment_request_card_verification_results import PaymentRequestCardVerificationResults +from xendit.payment_request.model.payment_request_country import PaymentRequestCountry +from xendit.payment_request.model.payment_request_currency import PaymentRequestCurrency +from xendit.payment_request.model.payment_request_initiator import PaymentRequestInitiator +from xendit.payment_request.model.payment_request_shipping_information import PaymentRequestShippingInformation +from xendit.payment_request.model.payment_request_status import PaymentRequestStatus +globals()['PaymentMethod'] = PaymentMethod +globals()['PaymentRequestAction'] = PaymentRequestAction +globals()['PaymentRequestBasket'] = PaymentRequestBasket +globals()['PaymentRequestCaptureMethod'] = PaymentRequestCaptureMethod +globals()['PaymentRequestCardVerificationResults'] = PaymentRequestCardVerificationResults +globals()['PaymentRequestCountry'] = PaymentRequestCountry +globals()['PaymentRequestCurrency'] = PaymentRequestCurrency +globals()['PaymentRequestInitiator'] = PaymentRequestInitiator +globals()['PaymentRequestShippingInformation'] = PaymentRequestShippingInformation +globals()['PaymentRequestStatus'] = PaymentRequestStatus +from xendit.payment_request.model.payment_request import PaymentRequest + + +class TestPaymentRequest(unittest.TestCase): + """PaymentRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentRequest(self): + """Test PaymentRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_request_action.py b/test/test_payment_request_action.py new file mode 100644 index 00000000..df289c60 --- /dev/null +++ b/test/test_payment_request_action.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_request_action import PaymentRequestAction + + +class TestPaymentRequestAction(unittest.TestCase): + """PaymentRequestAction unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentRequestAction(self): + """Test PaymentRequestAction""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentRequestAction() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_request_api.py b/test/test_payment_request_api.py new file mode 100644 index 00000000..0a4a2c53 --- /dev/null +++ b/test/test_payment_request_api.py @@ -0,0 +1,72 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import unittest + +import xendit +from payment_request.payment_request_api import PaymentRequestApi # noqa: E501 + + +class TestPaymentRequestApi(unittest.TestCase): + """PaymentRequestApi unit test stubs""" + + def setUp(self): + self.api = PaymentRequestApi() # noqa: E501 + + def tearDown(self): + pass + + def test_authorize_payment_request(self): + """Test case for authorize_payment_request + + Payment Request Authorize # noqa: E501 + """ + pass + + def test_capture_payment_request(self): + """Test case for capture_payment_request + + Payment Request Capture # noqa: E501 + """ + pass + + def test_create_payment_request(self): + """Test case for create_payment_request + + Create Payment Request # noqa: E501 + """ + pass + + def test_get_all_payment_requests(self): + """Test case for get_all_payment_requests + + Get all payment requests by filter # noqa: E501 + """ + pass + + def test_get_payment_request_by_id(self): + """Test case for get_payment_request_by_id + + Get payment request by ID # noqa: E501 + """ + pass + + def test_get_payment_request_captures(self): + """Test case for get_payment_request_captures + + Get Payment Request Capture # noqa: E501 + """ + pass + + def test_resend_payment_request_auth(self): + """Test case for resend_payment_request_auth + + Payment Request Resend Auth # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_request_auth_parameters.py b/test/test_payment_request_auth_parameters.py new file mode 100644 index 00000000..1fa0009d --- /dev/null +++ b/test/test_payment_request_auth_parameters.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_request_auth_parameters import PaymentRequestAuthParameters + + +class TestPaymentRequestAuthParameters(unittest.TestCase): + """PaymentRequestAuthParameters unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentRequestAuthParameters(self): + """Test PaymentRequestAuthParameters""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentRequestAuthParameters() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_request_basket.py b/test/test_payment_request_basket.py new file mode 100644 index 00000000..61cc8e73 --- /dev/null +++ b/test/test_payment_request_basket.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_request_basket_item import PaymentRequestBasketItem +globals()['PaymentRequestBasketItem'] = PaymentRequestBasketItem +from xendit.payment_request.model.payment_request_basket import PaymentRequestBasket + + +class TestPaymentRequestBasket(unittest.TestCase): + """PaymentRequestBasket unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentRequestBasket(self): + """Test PaymentRequestBasket""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentRequestBasket() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_request_basket_item.py b/test/test_payment_request_basket_item.py new file mode 100644 index 00000000..80255a55 --- /dev/null +++ b/test/test_payment_request_basket_item.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_request_basket_item import PaymentRequestBasketItem + + +class TestPaymentRequestBasketItem(unittest.TestCase): + """PaymentRequestBasketItem unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentRequestBasketItem(self): + """Test PaymentRequestBasketItem""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentRequestBasketItem() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_request_capture_method.py b/test/test_payment_request_capture_method.py new file mode 100644 index 00000000..05f2442c --- /dev/null +++ b/test/test_payment_request_capture_method.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_request_capture_method import PaymentRequestCaptureMethod + + +class TestPaymentRequestCaptureMethod(unittest.TestCase): + """PaymentRequestCaptureMethod unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentRequestCaptureMethod(self): + """Test PaymentRequestCaptureMethod""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentRequestCaptureMethod() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_request_card_verification_results.py b/test/test_payment_request_card_verification_results.py new file mode 100644 index 00000000..ca5eb887 --- /dev/null +++ b/test/test_payment_request_card_verification_results.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_request_card_verification_results_three_dee_secure import PaymentRequestCardVerificationResultsThreeDeeSecure +globals()['PaymentRequestCardVerificationResultsThreeDeeSecure'] = PaymentRequestCardVerificationResultsThreeDeeSecure +from xendit.payment_request.model.payment_request_card_verification_results import PaymentRequestCardVerificationResults + + +class TestPaymentRequestCardVerificationResults(unittest.TestCase): + """PaymentRequestCardVerificationResults unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentRequestCardVerificationResults(self): + """Test PaymentRequestCardVerificationResults""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentRequestCardVerificationResults() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_request_card_verification_results_three_dee_secure.py b/test/test_payment_request_card_verification_results_three_dee_secure.py new file mode 100644 index 00000000..54338171 --- /dev/null +++ b/test/test_payment_request_card_verification_results_three_dee_secure.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_request_card_verification_results_three_dee_secure import PaymentRequestCardVerificationResultsThreeDeeSecure + + +class TestPaymentRequestCardVerificationResultsThreeDeeSecure(unittest.TestCase): + """PaymentRequestCardVerificationResultsThreeDeeSecure unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentRequestCardVerificationResultsThreeDeeSecure(self): + """Test PaymentRequestCardVerificationResultsThreeDeeSecure""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentRequestCardVerificationResultsThreeDeeSecure() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_request_channel_properties.py b/test/test_payment_request_channel_properties.py new file mode 100644 index 00000000..3b7d138e --- /dev/null +++ b/test/test_payment_request_channel_properties.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_request_channel_properties import PaymentRequestChannelProperties + + +class TestPaymentRequestChannelProperties(unittest.TestCase): + """PaymentRequestChannelProperties unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentRequestChannelProperties(self): + """Test PaymentRequestChannelProperties""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentRequestChannelProperties() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_request_country.py b/test/test_payment_request_country.py new file mode 100644 index 00000000..3b3d2dd7 --- /dev/null +++ b/test/test_payment_request_country.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_request_country import PaymentRequestCountry + + +class TestPaymentRequestCountry(unittest.TestCase): + """PaymentRequestCountry unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentRequestCountry(self): + """Test PaymentRequestCountry""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentRequestCountry() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_request_currency.py b/test/test_payment_request_currency.py new file mode 100644 index 00000000..bf08d9c2 --- /dev/null +++ b/test/test_payment_request_currency.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_request_currency import PaymentRequestCurrency + + +class TestPaymentRequestCurrency(unittest.TestCase): + """PaymentRequestCurrency unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentRequestCurrency(self): + """Test PaymentRequestCurrency""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentRequestCurrency() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_request_initiator.py b/test/test_payment_request_initiator.py new file mode 100644 index 00000000..6bc686af --- /dev/null +++ b/test/test_payment_request_initiator.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_request_initiator import PaymentRequestInitiator + + +class TestPaymentRequestInitiator(unittest.TestCase): + """PaymentRequestInitiator unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentRequestInitiator(self): + """Test PaymentRequestInitiator""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentRequestInitiator() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_request_list_response.py b/test/test_payment_request_list_response.py new file mode 100644 index 00000000..bb988462 --- /dev/null +++ b/test/test_payment_request_list_response.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_request import PaymentRequest +globals()['PaymentRequest'] = PaymentRequest +from xendit.payment_request.model.payment_request_list_response import PaymentRequestListResponse + + +class TestPaymentRequestListResponse(unittest.TestCase): + """PaymentRequestListResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentRequestListResponse(self): + """Test PaymentRequestListResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentRequestListResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_request_parameters.py b/test/test_payment_request_parameters.py new file mode 100644 index 00000000..69d9015f --- /dev/null +++ b/test/test_payment_request_parameters.py @@ -0,0 +1,44 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_method_parameters import PaymentMethodParameters +from xendit.payment_request.model.payment_request_basket import PaymentRequestBasket +from xendit.payment_request.model.payment_request_capture_method import PaymentRequestCaptureMethod +from xendit.payment_request.model.payment_request_currency import PaymentRequestCurrency +from xendit.payment_request.model.payment_request_initiator import PaymentRequestInitiator +from xendit.payment_request.model.payment_request_parameters_channel_properties import PaymentRequestParametersChannelProperties +from xendit.payment_request.model.payment_request_shipping_information import PaymentRequestShippingInformation +globals()['PaymentMethodParameters'] = PaymentMethodParameters +globals()['PaymentRequestBasket'] = PaymentRequestBasket +globals()['PaymentRequestCaptureMethod'] = PaymentRequestCaptureMethod +globals()['PaymentRequestCurrency'] = PaymentRequestCurrency +globals()['PaymentRequestInitiator'] = PaymentRequestInitiator +globals()['PaymentRequestParametersChannelProperties'] = PaymentRequestParametersChannelProperties +globals()['PaymentRequestShippingInformation'] = PaymentRequestShippingInformation +from xendit.payment_request.model.payment_request_parameters import PaymentRequestParameters + + +class TestPaymentRequestParameters(unittest.TestCase): + """PaymentRequestParameters unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentRequestParameters(self): + """Test PaymentRequestParameters""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentRequestParameters() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_request_parameters_channel_properties.py b/test/test_payment_request_parameters_channel_properties.py new file mode 100644 index 00000000..5727e17f --- /dev/null +++ b/test/test_payment_request_parameters_channel_properties.py @@ -0,0 +1,34 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_request_channel_properties import PaymentRequestChannelProperties +from xendit.payment_request.model.payment_request_parameters_channel_properties_all_of import PaymentRequestParametersChannelPropertiesAllOf +globals()['PaymentRequestChannelProperties'] = PaymentRequestChannelProperties +globals()['PaymentRequestParametersChannelPropertiesAllOf'] = PaymentRequestParametersChannelPropertiesAllOf +from xendit.payment_request.model.payment_request_parameters_channel_properties import PaymentRequestParametersChannelProperties + + +class TestPaymentRequestParametersChannelProperties(unittest.TestCase): + """PaymentRequestParametersChannelProperties unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentRequestParametersChannelProperties(self): + """Test PaymentRequestParametersChannelProperties""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentRequestParametersChannelProperties() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_request_parameters_channel_properties_all_of.py b/test/test_payment_request_parameters_channel_properties_all_of.py new file mode 100644 index 00000000..009bc796 --- /dev/null +++ b/test/test_payment_request_parameters_channel_properties_all_of.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_request_parameters_channel_properties_all_of import PaymentRequestParametersChannelPropertiesAllOf + + +class TestPaymentRequestParametersChannelPropertiesAllOf(unittest.TestCase): + """PaymentRequestParametersChannelPropertiesAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentRequestParametersChannelPropertiesAllOf(self): + """Test PaymentRequestParametersChannelPropertiesAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentRequestParametersChannelPropertiesAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_request_shipping_information.py b/test/test_payment_request_shipping_information.py new file mode 100644 index 00000000..dc4dde01 --- /dev/null +++ b/test/test_payment_request_shipping_information.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_request_shipping_information import PaymentRequestShippingInformation + + +class TestPaymentRequestShippingInformation(unittest.TestCase): + """PaymentRequestShippingInformation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentRequestShippingInformation(self): + """Test PaymentRequestShippingInformation""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentRequestShippingInformation() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payment_request_status.py b/test/test_payment_request_status.py new file mode 100644 index 00000000..a8593617 --- /dev/null +++ b/test/test_payment_request_status.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_request_status import PaymentRequestStatus + + +class TestPaymentRequestStatus(unittest.TestCase): + """PaymentRequestStatus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaymentRequestStatus(self): + """Test PaymentRequestStatus""" + # FIXME: construct object with mandatory attributes with example values + # model = PaymentRequestStatus() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payout.py b/test/test_payout.py new file mode 100644 index 00000000..7def3b20 --- /dev/null +++ b/test/test_payout.py @@ -0,0 +1,38 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import sys +import unittest + +import xendit +from xendit.payout.model.create_payout_request import CreatePayoutRequest +from xendit.payout.model.digital_payout_channel_properties import DigitalPayoutChannelProperties +from xendit.payout.model.payout_all_of import PayoutAllOf +from xendit.payout.model.receipt_notification import ReceiptNotification +globals()['CreatePayoutRequest'] = CreatePayoutRequest +globals()['DigitalPayoutChannelProperties'] = DigitalPayoutChannelProperties +globals()['PayoutAllOf'] = PayoutAllOf +globals()['ReceiptNotification'] = ReceiptNotification +from xendit.payout.model.payout import Payout + + +class TestPayout(unittest.TestCase): + """Payout unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPayout(self): + """Test Payout""" + # FIXME: construct object with mandatory attributes with example values + # model = Payout() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payout_all_of.py b/test/test_payout_all_of.py new file mode 100644 index 00000000..79dcd053 --- /dev/null +++ b/test/test_payout_all_of.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import sys +import unittest + +import xendit +from xendit.payout.model.payout_all_of import PayoutAllOf + + +class TestPayoutAllOf(unittest.TestCase): + """PayoutAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPayoutAllOf(self): + """Test PayoutAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = PayoutAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_payout_api.py b/test/test_payout_api.py new file mode 100644 index 00000000..ea378722 --- /dev/null +++ b/test/test_payout_api.py @@ -0,0 +1,58 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import unittest + +import xendit +from payout.payout_api import PayoutApi # noqa: E501 + + +class TestPayoutApi(unittest.TestCase): + """PayoutApi unit test stubs""" + + def setUp(self): + self.api = PayoutApi() # noqa: E501 + + def tearDown(self): + pass + + def test_cancel_payout(self): + """Test case for cancel_payout + + API to cancel requested payouts that have not yet been sent to partner banks and e-wallets. Cancellation is possible if the payout has not been sent out via our partner and when payout status is ACCEPTED. # noqa: E501 + """ + pass + + def test_create_payout(self): + """Test case for create_payout + + API to send money at scale to bank accounts & eWallets # noqa: E501 + """ + pass + + def test_get_payout_by_id(self): + """Test case for get_payout_by_id + + API to fetch the current status, or details of the payout # noqa: E501 + """ + pass + + def test_get_payout_channels(self): + """Test case for get_payout_channels + + API providing the current list of banks and e-wallets we support for payouts for both regions # noqa: E501 + """ + pass + + def test_get_payouts(self): + """Test case for get_payouts + + API to retrieve all matching payouts with reference ID # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_qr_code.py b/test/test_qr_code.py new file mode 100644 index 00000000..cf770f56 --- /dev/null +++ b/test/test_qr_code.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.qr_code_type import QrCodeType +globals()['QrCodeType'] = QrCodeType +from xendit.invoice.model.qr_code import QrCode + + +class TestQrCode(unittest.TestCase): + """QrCode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testQrCode(self): + """Test QrCode""" + # FIXME: construct object with mandatory attributes with example values + # model = QrCode() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_qr_code_channel_code.py b/test/test_qr_code_channel_code.py new file mode 100644 index 00000000..637db792 --- /dev/null +++ b/test/test_qr_code_channel_code.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.qr_code_channel_code import QRCodeChannelCode + + +class TestQRCodeChannelCode(unittest.TestCase): + """QRCodeChannelCode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testQRCodeChannelCode(self): + """Test QRCodeChannelCode""" + # FIXME: construct object with mandatory attributes with example values + # model = QRCodeChannelCode() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_qr_code_channel_properties.py b/test/test_qr_code_channel_properties.py new file mode 100644 index 00000000..a0427efb --- /dev/null +++ b/test/test_qr_code_channel_properties.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.qr_code_channel_properties import QRCodeChannelProperties + + +class TestQRCodeChannelProperties(unittest.TestCase): + """QRCodeChannelProperties unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testQRCodeChannelProperties(self): + """Test QRCodeChannelProperties""" + # FIXME: construct object with mandatory attributes with example values + # model = QRCodeChannelProperties() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_qr_code_parameters.py b/test/test_qr_code_parameters.py new file mode 100644 index 00000000..038f3d91 --- /dev/null +++ b/test/test_qr_code_parameters.py @@ -0,0 +1,34 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.qr_code_channel_code import QRCodeChannelCode +from xendit.payment_method.model.qr_code_channel_properties import QRCodeChannelProperties +globals()['QRCodeChannelCode'] = QRCodeChannelCode +globals()['QRCodeChannelProperties'] = QRCodeChannelProperties +from xendit.payment_method.model.qr_code_parameters import QRCodeParameters + + +class TestQRCodeParameters(unittest.TestCase): + """QRCodeParameters unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testQRCodeParameters(self): + """Test QRCodeParameters""" + # FIXME: construct object with mandatory attributes with example values + # model = QRCodeParameters() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_qr_code_type.py b/test/test_qr_code_type.py new file mode 100644 index 00000000..31eac111 --- /dev/null +++ b/test/test_qr_code_type.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.qr_code_type import QrCodeType + + +class TestQrCodeType(unittest.TestCase): + """QrCodeType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testQrCodeType(self): + """Test QrCodeType""" + # FIXME: construct object with mandatory attributes with example values + # model = QrCodeType() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_receipt_notification.py b/test/test_receipt_notification.py new file mode 100644 index 00000000..19fb90e0 --- /dev/null +++ b/test/test_receipt_notification.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import sys +import unittest + +import xendit +from xendit.payout.model.receipt_notification import ReceiptNotification + + +class TestReceiptNotification(unittest.TestCase): + """ReceiptNotification unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testReceiptNotification(self): + """Test ReceiptNotification""" + # FIXME: construct object with mandatory attributes with example values + # model = ReceiptNotification() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_refund.py b/test/test_refund.py new file mode 100644 index 00000000..bdc4719b --- /dev/null +++ b/test/test_refund.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.2.3 +""" + + +import sys +import unittest + +import xendit +from xendit.refund.model.refund import Refund + + +class TestRefund(unittest.TestCase): + """Refund unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testRefund(self): + """Test Refund""" + # FIXME: construct object with mandatory attributes with example values + # model = Refund() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_refund_api.py b/test/test_refund_api.py new file mode 100644 index 00000000..229c209d --- /dev/null +++ b/test/test_refund_api.py @@ -0,0 +1,47 @@ +""" + The version of the XENDIT API: 1.2.3 +""" + + +import unittest + +import xendit +from refund.refund_api import RefundApi # noqa: E501 + + +class TestRefundApi(unittest.TestCase): + """RefundApi unit test stubs""" + + def setUp(self): + self.api = RefundApi() # noqa: E501 + + def tearDown(self): + pass + + def test_cancel_refund(self): + """Test case for cancel_refund + + """ + pass + + def test_create_refund(self): + """Test case for create_refund + + """ + pass + + def test_get_all_refunds(self): + """Test case for get_all_refunds + + """ + pass + + def test_get_refund(self): + """Test case for get_refund + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_refund_list.py b/test/test_refund_list.py new file mode 100644 index 00000000..35039690 --- /dev/null +++ b/test/test_refund_list.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 1.2.3 +""" + + +import sys +import unittest + +import xendit +from xendit.refund.model.refund import Refund +globals()['Refund'] = Refund +from xendit.refund.model.refund_list import RefundList + + +class TestRefundList(unittest.TestCase): + """RefundList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testRefundList(self): + """Test RefundList""" + # FIXME: construct object with mandatory attributes with example values + # model = RefundList() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_retail_outlet.py b/test/test_retail_outlet.py new file mode 100644 index 00000000..619ec52f --- /dev/null +++ b/test/test_retail_outlet.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.retail_outlet_name import RetailOutletName +globals()['RetailOutletName'] = RetailOutletName +from xendit.invoice.model.retail_outlet import RetailOutlet + + +class TestRetailOutlet(unittest.TestCase): + """RetailOutlet unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testRetailOutlet(self): + """Test RetailOutlet""" + # FIXME: construct object with mandatory attributes with example values + # model = RetailOutlet() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_retail_outlet_name.py b/test/test_retail_outlet_name.py new file mode 100644 index 00000000..fa80cbe6 --- /dev/null +++ b/test/test_retail_outlet_name.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.retail_outlet_name import RetailOutletName + + +class TestRetailOutletName(unittest.TestCase): + """RetailOutletName unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testRetailOutletName(self): + """Test RetailOutletName""" + # FIXME: construct object with mandatory attributes with example values + # model = RetailOutletName() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_server_error.py b/test/test_server_error.py new file mode 100644 index 00000000..612d228c --- /dev/null +++ b/test/test_server_error.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import sys +import unittest + +import xendit +from xendit.balance_and_transaction.model.server_error import ServerError + + +class TestServerError(unittest.TestCase): + """ServerError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testServerError(self): + """Test ServerError""" + # FIXME: construct object with mandatory attributes with example values + # model = ServerError() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_simulate_payment_request.py b/test/test_simulate_payment_request.py new file mode 100644 index 00000000..a8254354 --- /dev/null +++ b/test/test_simulate_payment_request.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.simulate_payment_request import SimulatePaymentRequest + + +class TestSimulatePaymentRequest(unittest.TestCase): + """SimulatePaymentRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSimulatePaymentRequest(self): + """Test SimulatePaymentRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = SimulatePaymentRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_tokenized_card_information.py b/test/test_tokenized_card_information.py new file mode 100644 index 00000000..effd6a96 --- /dev/null +++ b/test/test_tokenized_card_information.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.tokenized_card_information import TokenizedCardInformation + + +class TestTokenizedCardInformation(unittest.TestCase): + """TokenizedCardInformation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTokenizedCardInformation(self): + """Test TokenizedCardInformation""" + # FIXME: construct object with mandatory attributes with example values + # model = TokenizedCardInformation() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_transaction_api.py b/test/test_transaction_api.py new file mode 100644 index 00000000..a8eabc93 --- /dev/null +++ b/test/test_transaction_api.py @@ -0,0 +1,37 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import unittest + +import xendit +from balance_and_transaction.transaction_api import TransactionApi # noqa: E501 + + +class TestTransactionApi(unittest.TestCase): + """TransactionApi unit test stubs""" + + def setUp(self): + self.api = TransactionApi() # noqa: E501 + + def tearDown(self): + pass + + def test_get_all_transactions(self): + """Test case for get_all_transactions + + Get a list of transactions # noqa: E501 + """ + pass + + def test_get_transaction_by_id(self): + """Test case for get_transaction_by_id + + Get a transaction based on its id # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_transaction_id.py b/test/test_transaction_id.py new file mode 100644 index 00000000..af8f486d --- /dev/null +++ b/test/test_transaction_id.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import sys +import unittest + +import xendit +from xendit.balance_and_transaction.model.transaction_id import TransactionId + + +class TestTransactionId(unittest.TestCase): + """TransactionId unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTransactionId(self): + """Test TransactionId""" + # FIXME: construct object with mandatory attributes with example values + # model = TransactionId() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_transaction_response.py b/test/test_transaction_response.py new file mode 100644 index 00000000..8e11f3f2 --- /dev/null +++ b/test/test_transaction_response.py @@ -0,0 +1,42 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import sys +import unittest + +import xendit +from xendit.balance_and_transaction.model.channels_categories import ChannelsCategories +from xendit.balance_and_transaction.model.currency import Currency +from xendit.balance_and_transaction.model.fee_response import FeeResponse +from xendit.balance_and_transaction.model.transaction_id import TransactionId +from xendit.balance_and_transaction.model.transaction_response_type import TransactionResponseType +from xendit.balance_and_transaction.model.transaction_statuses import TransactionStatuses +globals()['ChannelsCategories'] = ChannelsCategories +globals()['Currency'] = Currency +globals()['FeeResponse'] = FeeResponse +globals()['TransactionId'] = TransactionId +globals()['TransactionResponseType'] = TransactionResponseType +globals()['TransactionStatuses'] = TransactionStatuses +from xendit.balance_and_transaction.model.transaction_response import TransactionResponse + + +class TestTransactionResponse(unittest.TestCase): + """TransactionResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTransactionResponse(self): + """Test TransactionResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = TransactionResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_transaction_response_type.py b/test/test_transaction_response_type.py new file mode 100644 index 00000000..95ed039c --- /dev/null +++ b/test/test_transaction_response_type.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import sys +import unittest + +import xendit +from xendit.balance_and_transaction.model.transaction_types import TransactionTypes +globals()['TransactionTypes'] = TransactionTypes +from xendit.balance_and_transaction.model.transaction_response_type import TransactionResponseType + + +class TestTransactionResponseType(unittest.TestCase): + """TransactionResponseType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTransactionResponseType(self): + """Test TransactionResponseType""" + # FIXME: construct object with mandatory attributes with example values + # model = TransactionResponseType() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_transaction_statuses.py b/test/test_transaction_statuses.py new file mode 100644 index 00000000..36d4908f --- /dev/null +++ b/test/test_transaction_statuses.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import sys +import unittest + +import xendit +from xendit.balance_and_transaction.model.transaction_statuses import TransactionStatuses + + +class TestTransactionStatuses(unittest.TestCase): + """TransactionStatuses unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTransactionStatuses(self): + """Test TransactionStatuses""" + # FIXME: construct object with mandatory attributes with example values + # model = TransactionStatuses() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_transaction_types.py b/test/test_transaction_types.py new file mode 100644 index 00000000..eda4f4e7 --- /dev/null +++ b/test/test_transaction_types.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import sys +import unittest + +import xendit +from xendit.balance_and_transaction.model.transaction_types import TransactionTypes + + +class TestTransactionTypes(unittest.TestCase): + """TransactionTypes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTransactionTypes(self): + """Test TransactionTypes""" + # FIXME: construct object with mandatory attributes with example values + # model = TransactionTypes() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_transactions_response.py b/test/test_transactions_response.py new file mode 100644 index 00000000..aa1d472b --- /dev/null +++ b/test/test_transactions_response.py @@ -0,0 +1,34 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import sys +import unittest + +import xendit +from xendit.balance_and_transaction.model.link_item import LinkItem +from xendit.balance_and_transaction.model.transaction_response import TransactionResponse +globals()['LinkItem'] = LinkItem +globals()['TransactionResponse'] = TransactionResponse +from xendit.balance_and_transaction.model.transactions_response import TransactionsResponse + + +class TestTransactionsResponse(unittest.TestCase): + """TransactionsResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTransactionsResponse(self): + """Test TransactionsResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = TransactionsResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_unauthorized_error.py b/test/test_unauthorized_error.py new file mode 100644 index 00000000..06f6b296 --- /dev/null +++ b/test/test_unauthorized_error.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import sys +import unittest + +import xendit +from xendit.invoice.model.unauthorized_error import UnauthorizedError + + +class TestUnauthorizedError(unittest.TestCase): + """UnauthorizedError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUnauthorizedError(self): + """Test UnauthorizedError""" + # FIXME: construct object with mandatory attributes with example values + # model = UnauthorizedError() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_validation_error.py b/test/test_validation_error.py new file mode 100644 index 00000000..ae172db7 --- /dev/null +++ b/test/test_validation_error.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import sys +import unittest + +import xendit +from xendit.balance_and_transaction.model.validation_error import ValidationError + + +class TestValidationError(unittest.TestCase): + """ValidationError unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testValidationError(self): + """Test ValidationError""" + # FIXME: construct object with mandatory attributes with example values + # model = ValidationError() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_virtual_account.py b/test/test_virtual_account.py new file mode 100644 index 00000000..7ac78875 --- /dev/null +++ b/test/test_virtual_account.py @@ -0,0 +1,42 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_request_currency import PaymentRequestCurrency +from xendit.payment_request.model.virtual_account_all_of import VirtualAccountAllOf +from xendit.payment_request.model.virtual_account_alternative_display import VirtualAccountAlternativeDisplay +from xendit.payment_request.model.virtual_account_channel_code import VirtualAccountChannelCode +from xendit.payment_request.model.virtual_account_channel_properties import VirtualAccountChannelProperties +from xendit.payment_request.model.virtual_account_parameters import VirtualAccountParameters +globals()['PaymentRequestCurrency'] = PaymentRequestCurrency +globals()['VirtualAccountAllOf'] = VirtualAccountAllOf +globals()['VirtualAccountAlternativeDisplay'] = VirtualAccountAlternativeDisplay +globals()['VirtualAccountChannelCode'] = VirtualAccountChannelCode +globals()['VirtualAccountChannelProperties'] = VirtualAccountChannelProperties +globals()['VirtualAccountParameters'] = VirtualAccountParameters +from xendit.payment_request.model.virtual_account import VirtualAccount + + +class TestVirtualAccount(unittest.TestCase): + """VirtualAccount unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testVirtualAccount(self): + """Test VirtualAccount""" + # FIXME: construct object with mandatory attributes with example values + # model = VirtualAccount() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_virtual_account_all_of.py b/test/test_virtual_account_all_of.py new file mode 100644 index 00000000..9d808f9f --- /dev/null +++ b/test/test_virtual_account_all_of.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.virtual_account_alternative_display import VirtualAccountAlternativeDisplay +globals()['VirtualAccountAlternativeDisplay'] = VirtualAccountAlternativeDisplay +from xendit.payment_method.model.virtual_account_all_of import VirtualAccountAllOf + + +class TestVirtualAccountAllOf(unittest.TestCase): + """VirtualAccountAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testVirtualAccountAllOf(self): + """Test VirtualAccountAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = VirtualAccountAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_virtual_account_alternative_display.py b/test/test_virtual_account_alternative_display.py new file mode 100644 index 00000000..b17db390 --- /dev/null +++ b/test/test_virtual_account_alternative_display.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.virtual_account_alternative_display import VirtualAccountAlternativeDisplay + + +class TestVirtualAccountAlternativeDisplay(unittest.TestCase): + """VirtualAccountAlternativeDisplay unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testVirtualAccountAlternativeDisplay(self): + """Test VirtualAccountAlternativeDisplay""" + # FIXME: construct object with mandatory attributes with example values + # model = VirtualAccountAlternativeDisplay() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_virtual_account_channel_code.py b/test/test_virtual_account_channel_code.py new file mode 100644 index 00000000..57d24fa0 --- /dev/null +++ b/test/test_virtual_account_channel_code.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.virtual_account_channel_code import VirtualAccountChannelCode + + +class TestVirtualAccountChannelCode(unittest.TestCase): + """VirtualAccountChannelCode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testVirtualAccountChannelCode(self): + """Test VirtualAccountChannelCode""" + # FIXME: construct object with mandatory attributes with example values + # model = VirtualAccountChannelCode() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_virtual_account_channel_properties.py b/test/test_virtual_account_channel_properties.py new file mode 100644 index 00000000..78b6c5aa --- /dev/null +++ b/test/test_virtual_account_channel_properties.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.virtual_account_channel_properties import VirtualAccountChannelProperties + + +class TestVirtualAccountChannelProperties(unittest.TestCase): + """VirtualAccountChannelProperties unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testVirtualAccountChannelProperties(self): + """Test VirtualAccountChannelProperties""" + # FIXME: construct object with mandatory attributes with example values + # model = VirtualAccountChannelProperties() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_virtual_account_channel_properties_patch.py b/test/test_virtual_account_channel_properties_patch.py new file mode 100644 index 00000000..a967a6f4 --- /dev/null +++ b/test/test_virtual_account_channel_properties_patch.py @@ -0,0 +1,30 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.virtual_account_channel_properties_patch import VirtualAccountChannelPropertiesPatch + + +class TestVirtualAccountChannelPropertiesPatch(unittest.TestCase): + """VirtualAccountChannelPropertiesPatch unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testVirtualAccountChannelPropertiesPatch(self): + """Test VirtualAccountChannelPropertiesPatch""" + # FIXME: construct object with mandatory attributes with example values + # model = VirtualAccountChannelPropertiesPatch() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_virtual_account_parameters.py b/test/test_virtual_account_parameters.py new file mode 100644 index 00000000..99e47bdc --- /dev/null +++ b/test/test_virtual_account_parameters.py @@ -0,0 +1,36 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_request.model.payment_request_currency import PaymentRequestCurrency +from xendit.payment_request.model.virtual_account_channel_code import VirtualAccountChannelCode +from xendit.payment_request.model.virtual_account_channel_properties import VirtualAccountChannelProperties +globals()['PaymentRequestCurrency'] = PaymentRequestCurrency +globals()['VirtualAccountChannelCode'] = VirtualAccountChannelCode +globals()['VirtualAccountChannelProperties'] = VirtualAccountChannelProperties +from xendit.payment_request.model.virtual_account_parameters import VirtualAccountParameters + + +class TestVirtualAccountParameters(unittest.TestCase): + """VirtualAccountParameters unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testVirtualAccountParameters(self): + """Test VirtualAccountParameters""" + # FIXME: construct object with mandatory attributes with example values + # model = VirtualAccountParameters() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_virtual_account_update_parameters.py b/test/test_virtual_account_update_parameters.py new file mode 100644 index 00000000..3ef20d58 --- /dev/null +++ b/test/test_virtual_account_update_parameters.py @@ -0,0 +1,32 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import sys +import unittest + +import xendit +from xendit.payment_method.model.virtual_account_channel_properties_patch import VirtualAccountChannelPropertiesPatch +globals()['VirtualAccountChannelPropertiesPatch'] = VirtualAccountChannelPropertiesPatch +from xendit.payment_method.model.virtual_account_update_parameters import VirtualAccountUpdateParameters + + +class TestVirtualAccountUpdateParameters(unittest.TestCase): + """VirtualAccountUpdateParameters unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testVirtualAccountUpdateParameters(self): + """Test VirtualAccountUpdateParameters""" + # FIXME: construct object with mandatory attributes with example values + # model = VirtualAccountUpdateParameters() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/integration/base_integration_test.py b/tests/integration/base_integration_test.py deleted file mode 100644 index d011dcc1..00000000 --- a/tests/integration/base_integration_test.py +++ /dev/null @@ -1,12 +0,0 @@ -class BaseIntegrationTest: - def assert_returned_object_has_same_key_as_sample_response( - self, returned_object, sample_response - ): - """ - Assert the returned object have the same keys as the given sample response. - The comparison are done with the assumption that both of them doesn't have the same order. - """ - expected_key_list = [*sample_response] - actual_key_list = [*(vars(returned_object))] - - assert set(expected_key_list).issubset(actual_key_list) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py deleted file mode 100644 index 9b405e87..00000000 --- a/tests/integration/conftest.py +++ /dev/null @@ -1,16 +0,0 @@ -import pytest -from xendit import Xendit - - -@pytest.fixture(scope="class") -def xendit_instance(): - return Xendit( - "xnd_development_xRH6Hd5fYBmWWQSM61U5GAM5bTgwKui0AGdKji4FVQQLkovYHsgFm5DdyiNtCi8i" - ) - - -@pytest.fixture(scope="class") -def xendit_instance_cardless_enabled(): - return Xendit( - "xnd_development_s1Y7IemQRBU9IOE2Q0mWshKfcchUBDCHqCeKOBY3BBLwfuD562diFdYjiem7Ek0" - ) diff --git a/tests/integration/test_balance.py b/tests/integration/test_balance.py deleted file mode 100644 index bfbb9bc8..00000000 --- a/tests/integration/test_balance.py +++ /dev/null @@ -1,17 +0,0 @@ -import pytest - -from .base_integration_test import BaseIntegrationTest -from xendit import BalanceAccountType -from tests.sampleresponse.balance import balance_response - - -class TestBalance(BaseIntegrationTest): - @pytest.fixture - def Balance(self, xendit_instance): - return xendit_instance.Balance - - def test_get_balance_return_correct_keys(self, Balance): - balance = Balance.get(account_type=BalanceAccountType.HOLDING) - self.assert_returned_object_has_same_key_as_sample_response( - balance, balance_response() - ) diff --git a/tests/integration/test_batch_disbursement.py b/tests/integration/test_batch_disbursement.py deleted file mode 100644 index 75c133a4..00000000 --- a/tests/integration/test_batch_disbursement.py +++ /dev/null @@ -1,31 +0,0 @@ -import pytest -import time - -from .base_integration_test import BaseIntegrationTest -from tests.sampleresponse.batch_disbursement import batch_disbursement_response - - -class TestBatchDisbursement(BaseIntegrationTest): - @pytest.fixture - def BatchDisbursement(self, xendit_instance): - return xendit_instance.BatchDisbursement - - def test_create_batch_disbursement_return_correct_keys(self, BatchDisbursement): - batch_disbursement_items = [] - batch_disbursement_items.append( - BatchDisbursement.helper_create_batch_item( - amount=10000, - bank_code="BCA", - bank_account_name="Adyaksa W", - bank_account_number="12345678", - description="Sample Batch Disbursement", - external_id=f"batch-disbursement-item-{int(time.time())}", - ) - ) - batch_disbursement = BatchDisbursement.create( - reference=f"batch_disbursement-{int(time.time())}", - disbursements=batch_disbursement_items, - ) - self.assert_returned_object_has_same_key_as_sample_response( - batch_disbursement, batch_disbursement_response() - ) diff --git a/tests/integration/test_cardless_credit.py b/tests/integration/test_cardless_credit.py deleted file mode 100644 index 9d5015b5..00000000 --- a/tests/integration/test_cardless_credit.py +++ /dev/null @@ -1,79 +0,0 @@ -import pytest -import time - -from .base_integration_test import BaseIntegrationTest -from tests.sampleresponse.cardless_credit import ( - cardless_credit_payment_response, - cardless_credit_payment_type_response, -) -from xendit import CardlessCreditType - - -class TestCardlessCredit(BaseIntegrationTest): - @pytest.fixture - def CardlessCredit(self, xendit_instance_cardless_enabled): - return xendit_instance_cardless_enabled.CardlessCredit - - def test_create_payment_return_correct_keys(self, CardlessCredit): - cardless_credit_items = [] - cardless_credit_items.append( - CardlessCredit.helper_create_item( - id=f"item-{int(time.time())}", - name="Phone Case", - price=200000, - type="Smartphone", - url="http://example.com/phone/phone_case", - quantity=2, - ) - ) - customer_details = CardlessCredit.helper_create_customer_details( - first_name="customer first name", - last_name="customer last name", - email="customer@email.com", - phone="0812332145", - ) - shipping_address = CardlessCredit.helper_create_shipping_address( - first_name="first name", - last_name="last name", - address="Jl Teknologi No. 12", - city="Jakarta", - postal_code="12345", - phone="081513114262", - country_code="IDN", - ) - cardless_credit_payment = CardlessCredit.create_payment( - cardless_credit_type=CardlessCreditType.KREDIVO, - external_id=f"ext-id-{int(time.time())}", - amount=10000, - payment_type="3_months", - items=cardless_credit_items, - customer_details=customer_details, - shipping_address=shipping_address, - redirect_url="https://mock-my-shop.com/home", - callback_url="https://mock-my-shop.com/callback", - ) - self.assert_returned_object_has_same_key_as_sample_response( - cardless_credit_payment, cardless_credit_payment_response() - ) - - def test_calculate_payment_type_return_correct_keys(self, CardlessCredit): - cardless_credit_items = [] - cardless_credit_items.append( - CardlessCredit.helper_create_item( - id=f"item-{int(time.time())}", - name="Phone Case", - price=200000, - type="Smartphone", - url="http://example.com/phone/phone_case", - quantity=2, - ) - ) - - cardless_credit_payment_types = CardlessCredit.calculate_payment_type( - cardless_credit_type=CardlessCreditType.KREDIVO, - amount=10000, - items=cardless_credit_items, - ) - self.assert_returned_object_has_same_key_as_sample_response( - cardless_credit_payment_types, cardless_credit_payment_type_response() - ) diff --git a/tests/integration/test_credit_card.py b/tests/integration/test_credit_card.py deleted file mode 100644 index 3225ec05..00000000 --- a/tests/integration/test_credit_card.py +++ /dev/null @@ -1,123 +0,0 @@ -import pytest -import time - -from .base_integration_test import BaseIntegrationTest -from tests.sampleresponse.credit_card import ( - reverse_auth_response, - charge_response, - refund_response, - promotion_response, -) - - -class TestCreditCard(BaseIntegrationTest): - @pytest.fixture - def CreditCard(self, xendit_instance): - return xendit_instance.CreditCard - - def test_create_authorization_return_correct_keys(self, CreditCard): - charge = CreditCard.create_authorization( - token_id="602b9886396b5a001c99b798", - external_id=f"card_preAuth-{int(time.time())}", - amount=75000, - card_cvn="123", - metadata={ - "meta": "data", - }, - ) - - self.assert_returned_object_has_same_key_as_sample_response( - charge, charge_response() - ) - - def test_reverse_authorization_return_correct_keys(self, CreditCard): - charge = CreditCard.create_authorization( - token_id="602b9886396b5a001c99b798", - external_id=f"card_preAuth-{int(time.time())}", - amount=75000, - card_cvn="123", - metadata={ - "meta": "data", - }, - ) - reverse_auth = CreditCard.reverse_authorization( - credit_card_charge_id=charge.id, - external_id=f"reverse-authorization-{int(time.time())}", - ) - - self.assert_returned_object_has_same_key_as_sample_response( - reverse_auth, reverse_auth_response() - ) - - def test_create_charge_return_correct_keys(self, CreditCard): - charge = CreditCard.create_charge( - token_id="602b9886396b5a001c99b798", - external_id=f"card_preAuth-{int(time.time())}", - amount=75000, - card_cvn="123", - metadata={ - "meta": "data", - }, - ) - - self.assert_returned_object_has_same_key_as_sample_response( - charge, charge_response() - ) - - def test_capture_charge_return_correct_keys(self, CreditCard): - charge = CreditCard.create_authorization( - token_id="602b9886396b5a001c99b798", - external_id=f"card_preAuth-{int(time.time())}", - amount=75000, - card_cvn="123", - ) - captured_charge = CreditCard.capture_charge( - credit_card_charge_id=charge.id, amount=75000, - ) - - self.assert_returned_object_has_same_key_as_sample_response( - captured_charge, charge_response() - ) - - def test_get_charge_return_correct_keys(self, CreditCard): - charge = CreditCard.create_charge( - token_id="602b9886396b5a001c99b798", - external_id=f"card_preAuth-{int(time.time())}", - amount=75000, - card_cvn="123", - ) - - charge = CreditCard.get_charge(credit_card_charge_id=charge.id) - self.assert_returned_object_has_same_key_as_sample_response( - charge, charge_response() - ) - - def test_create_refund_return_correct_keys(self, CreditCard): - charge = CreditCard.create_charge( - token_id="602b9886396b5a001c99b798", - external_id=f"card_preAuth-{int(time.time())}", - amount=75000, - card_cvn="123", - ) - - refund = CreditCard.create_refund( - credit_card_charge_id=charge.id, - amount=10000, - external_id=f"card_refund-{int(time.time())}", - ) - self.assert_returned_object_has_same_key_as_sample_response( - refund, refund_response() - ) - - def test_create_promotion_return_correct_keys(self, CreditCard): - promotion = CreditCard.create_promotion( - reference_id=f"BRI_20_JAN-{int(time.time())}", - description="20% discount applied for all BRI cards", - discount_amount=10000, - bin_list=["400000", "460000"], - start_time="2020-01-01T00:00:00.000Z", - end_time="2100-01-01T00:00:00.000Z", - ) - self.assert_returned_object_has_same_key_as_sample_response( - promotion, promotion_response() - ) diff --git a/tests/integration/test_direct_debit.py b/tests/integration/test_direct_debit.py deleted file mode 100644 index 23f50454..00000000 --- a/tests/integration/test_direct_debit.py +++ /dev/null @@ -1,175 +0,0 @@ -import pytest -import time - -from .base_integration_test import BaseIntegrationTest -from tests.sampleresponse.direct_debit import ( - customer_response, - multi_customer_response, - linked_account_response, - accessible_accounts_response, - payment_method_response, - multi_payment_method_response, - payment_response, - multi_payment_response, -) - -from xendit import DirectDebitPaymentMethodType - - -class TestDirectDebit(BaseIntegrationTest): - @pytest.fixture(scope="class") - def DirectDebit(self, xendit_instance): - return xendit_instance.DirectDebit - - @pytest.fixture(scope="class") - def customer_data(self, DirectDebit): - customer = DirectDebit.create_customer( - reference_id=f"merc-{int(time.time())}", - email="t@x.co", - given_names="Adyaksa", - ) - return customer - - @pytest.fixture(scope="class") - def linked_account_data(self, DirectDebit, customer_data): - customer = customer_data - linked_account_token = DirectDebit.initialize_tokenization( - customer_id=customer.id, - channel_code="DC_BRI", - properties={ - "account_mobile_number": "+62818555988", - "card_last_four": "8888", - "card_expiry": "06/24", - "account_email": "test.email@xendit.co", - }, - ) - validated_linked_account_token = DirectDebit.validate_token_otp( - linked_account_token_id=linked_account_token.id, otp_code="333000", - ) - accessible_accounts = DirectDebit.get_accessible_accounts_by_token( - linked_account_token_id=validated_linked_account_token.id - ) - return linked_account_token, validated_linked_account_token, accessible_accounts - - @pytest.fixture(scope="class") - def payment_method_data(self, DirectDebit, linked_account_data): - linked_account_token, _, accessible_accounts = linked_account_data - payment_method = DirectDebit.create_payment_method( - customer_id=linked_account_token.customer_id, - type=DirectDebitPaymentMethodType.DEBIT_CARD, - properties={"id": accessible_accounts[0].id}, - ) - return payment_method - - @pytest.fixture(scope="class") - def payment_data(self, DirectDebit, payment_method_data): - payment_method = payment_method_data - payment = DirectDebit.create_payment( - reference_id=f"direct-debit-ref-{int(time.time())}", - payment_method_id=payment_method.id, - currency="IDR", - amount="60000", - callback_url="http://webhook.site/", - enable_otp=True, - idempotency_key=f"idemp_key-{int(time.time())}", - ) - return payment - - def test_create_customer_return_correct_keys(self, customer_data): - customer = customer_data - self.assert_returned_object_has_same_key_as_sample_response( - customer, customer_response() - ) - - @pytest.mark.skip(reason="Currently not implemented by Direct Debit") - def test_get_customer_by_ref_id_return_correct_keys( - self, DirectDebit, customer_data - ): - customer = customer_data - - tested_customer = DirectDebit.get_customer_by_ref_id( - reference_id=customer.reference_id, - ) - self.assert_returned_object_has_same_key_as_sample_response( - tested_customer[0], multi_customer_response() - ) - - def test_linked_account_token_scheme_return_correct_keys(self, linked_account_data): - ( - linked_account_token, - validated_linked_account_token, - accessible_accounts, - ) = linked_account_data - - self.assert_returned_object_has_same_key_as_sample_response( - linked_account_token, linked_account_response() - ) - - self.assert_returned_object_has_same_key_as_sample_response( - validated_linked_account_token, linked_account_response() - ) - - self.assert_returned_object_has_same_key_as_sample_response( - accessible_accounts[0], accessible_accounts_response()[0] - ) - - def test_create_payment_method_return_correct_keys( - self, DirectDebit, payment_method_data - ): - payment_method = payment_method_data - - self.assert_returned_object_has_same_key_as_sample_response( - payment_method, payment_method_response() - ) - - def test_get_payment_methods_by_ref_id_return_correct_keys( - self, DirectDebit, customer_data - ): - customer = customer_data - - payment_methods = DirectDebit.get_payment_methods_by_customer_id( - customer_id=customer.id, - ) - - self.assert_returned_object_has_same_key_as_sample_response( - payment_methods[0], multi_payment_method_response()[0] - ) - - def test_create_payment_return_correct_keys(self, payment_data): - payment = payment_data - self.assert_returned_object_has_same_key_as_sample_response( - payment, payment_response() - ) - - def test_validate_payment_otp_return_correct_keys(self, DirectDebit, payment_data): - payment = payment_data - - validated_payment = DirectDebit.validate_payment_otp( - direct_debit_id=payment.id, otp_code="222000", - ) - - self.assert_returned_object_has_same_key_as_sample_response( - validated_payment, payment_response() - ) - - def test_get_payment_status_return_correct_keys(self, DirectDebit, payment_data): - payment = payment_data - - payment = DirectDebit.get_payment_status(direct_debit_id=payment.id) - - self.assert_returned_object_has_same_key_as_sample_response( - payment, payment_response() - ) - - def test_get_payment_status_by_ref_id_return_correct_keys( - self, DirectDebit, payment_data - ): - payment = payment_data - - payments = DirectDebit.get_payment_status_by_ref_id( - reference_id=payment.reference_id - ) - - self.assert_returned_object_has_same_key_as_sample_response( - payments[0], multi_payment_response()[0] - ) diff --git a/tests/integration/test_disbursement.py b/tests/integration/test_disbursement.py deleted file mode 100644 index c0e5cfd3..00000000 --- a/tests/integration/test_disbursement.py +++ /dev/null @@ -1,51 +0,0 @@ -import pytest - -from .base_integration_test import BaseIntegrationTest -from tests.sampleresponse.disbursement import disbursement_response -from tests.sampleresponse.disbursement import disbursement_banks_response - - -class TestDisbursement(BaseIntegrationTest): - @pytest.fixture(scope="class") - def Disbursement(self, xendit_instance): - return xendit_instance.Disbursement - - @pytest.fixture(scope="class") - def disbursement_data(self, Disbursement): - disbursement = Disbursement.create( - external_id="demo_1475459775872", - bank_code="BCA", - account_holder_name="Bob Jones", - account_number="1231242311", - description="Reimbursement for shoes", - amount=17000, - ) - return disbursement - - def test_create_disbursement_return_correct_keys(self, disbursement_data): - disbursement = disbursement_data - self.assert_returned_object_has_same_key_as_sample_response( - disbursement, disbursement_response() - ) - - def test_get_disbursement_by_id_return_correct_keys( - self, Disbursement, disbursement_data - ): - disbursement = disbursement_data - - disbursement = Disbursement.get(id=disbursement.id) - self.assert_returned_object_has_same_key_as_sample_response( - disbursement, disbursement_response() - ) - - def test_get_disbursement_by_external_id_return_correct_keys(self, Disbursement): - disbursement = Disbursement.get_by_ext_id(external_id="demo_1475459775872") - self.assert_returned_object_has_same_key_as_sample_response( - disbursement[0], disbursement_response() - ) - - def test_get_disbursement_banks_return_correct_keys(self, Disbursement): - disbursement_banks = Disbursement.get_available_banks() - self.assert_returned_object_has_same_key_as_sample_response( - disbursement_banks[0], disbursement_banks_response()[0] - ) diff --git a/tests/integration/test_ewallet.py b/tests/integration/test_ewallet.py deleted file mode 100644 index c6e3a8b1..00000000 --- a/tests/integration/test_ewallet.py +++ /dev/null @@ -1,170 +0,0 @@ -import pytest -import time -import xendit - -from .base_integration_test import BaseIntegrationTest - -from xendit import EWalletType - -from tests.sampleresponse.ewallet import ovo_payment_response -from tests.sampleresponse.ewallet import ovo_payment_status_response -from tests.sampleresponse.ewallet import dana_payment_response -from tests.sampleresponse.ewallet import dana_payment_status_response -from tests.sampleresponse.ewallet import linkaja_payment_response -from tests.sampleresponse.ewallet import linkaja_payment_status_completed_response -from tests.sampleresponse.ewallet import linkaja_payment_status_expired_response -from tests.sampleresponse.ewallet import ewallet_charge_response - - -class TestEWallet(BaseIntegrationTest): - @pytest.fixture(scope="class") - def EWallet(self, xendit_instance): - return xendit_instance.EWallet - - @pytest.fixture(scope="class") - def ovo_payment_data(self, EWallet): - ovo_payment = EWallet.create_ovo_payment( - external_id=f"ovo-ewallet-testing-id-{int(time.time())}", - amount="80001", - phone="08123123123", - ) - return ovo_payment - - @pytest.fixture(scope="class") - def dana_payment_data(self, EWallet): - dana_payment = EWallet.create_dana_payment( - external_id=f"dana-ewallet-test-{time.time()}", - amount="1001", - callback_url="https://my-shop.com/callbacks", - redirect_url="https://my-shop.com/home", - ) - return dana_payment - - @pytest.fixture(scope="class") - def linkaja_payment_data(self, EWallet): - # Object Creation Test - items = [] - item = xendit.EWallet.helper_create_linkaja_item( - id="123123", name="Phone Case", price=100000, quantity=1 - ) - items.append(item) - - linkaja_payment = EWallet.create_linkaja_payment( - external_id=f"linkaja-ewallet-test-{time.time()}", - phone="089911111111", - amount=300000, - items=items, - callback_url="https://my-shop.com/callbacks", - redirect_url="https://xendit.co/", - ) - return linkaja_payment - - def test_create_ovo_payment_return_correct_keys(self, ovo_payment_data): - ovo_payment = ovo_payment_data - - self.assert_returned_object_has_same_key_as_sample_response( - ovo_payment, ovo_payment_response() - ) - - def test_create_dana_payment_return_correct_keys(self, dana_payment_data): - dana_payment = dana_payment_data - self.assert_returned_object_has_same_key_as_sample_response( - dana_payment, dana_payment_response() - ) - - def test_create_linkaja_payment_return_correct_keys(self, linkaja_payment_data): - linkaja_payment = linkaja_payment_data - self.assert_returned_object_has_same_key_as_sample_response( - linkaja_payment, linkaja_payment_response() - ) - - def test_get_ovo_payment_status_return_correct_keys( - self, EWallet, ovo_payment_data - ): - ovo_payment = ovo_payment_data - - ewallet = EWallet.get_payment_status( - external_id=ovo_payment.external_id, ewallet_type=EWalletType.OVO, - ) - self.assert_returned_object_has_same_key_as_sample_response( - ewallet, ovo_payment_status_response() - ) - - def test_get_dana_payment_return_correct_keys(self, EWallet, dana_payment_data): - dana_payment = dana_payment_data - ewallet = EWallet.get_payment_status( - external_id=dana_payment.external_id, ewallet_type=EWalletType.DANA, - ) - self.assert_returned_object_has_same_key_as_sample_response( - ewallet, dana_payment_status_response() - ) - - def test_get_completed_linkaja_payment_status_return_correct_keys(self, EWallet): - ewallet = EWallet.get_payment_status( - external_id="linkaja-ewallet-test-1234", ewallet_type=EWalletType.LINKAJA, - ) - self.assert_returned_object_has_same_key_as_sample_response( - ewallet, linkaja_payment_status_completed_response() - ) - - def test_get_failed_linkaja_payment_status_return_correct_keys(self, EWallet): - ewallet = EWallet.get_payment_status( - external_id="linkaja-ewallet-test-123", ewallet_type=EWalletType.LINKAJA, - ) - self.assert_returned_object_has_same_key_as_sample_response( - ewallet, linkaja_payment_status_expired_response() - ) - - @pytest.fixture(scope="class") - def ewallet_charge_data(self, EWallet): - # Object Creation Test - basket = [] - basket_item = EWallet.helper_create_basket_item( - reference_id="basket-product-ref-id", - name="product_name", - category="mechanics", - currency="IDR", - price=50000, - quantity=5, - type="wht", - sub_category="evr", - metadata={ - "meta": "data" - } - ) - basket.append(basket_item) - - ewallet_charge = EWallet.create_ewallet_charge( - reference_id="basket-product-ref-id", - currency="IDR", - amount=1688, - checkout_method="ONE_TIME_PAYMENT", - channel_code="ID_SHOPEEPAY", - channel_properties={ - "success_redirect_url": "https://yourwebsite.com/order/123", - }, - basket=basket, - metadata={ - "meta2": "data2", - }, - ) - return ewallet_charge - - def test_create_ewallet_charge_return_correct_keys(self, ewallet_charge_data): - ewallet_charge = ewallet_charge_data - - self.assert_returned_object_has_same_key_as_sample_response( - ewallet_charge, ewallet_charge_response() - ) - - def test_get_ewallet_charge_status_return_correct_keys( - self, EWallet, ewallet_charge_data - ): - ewallet_charge = ewallet_charge_data - - ewallet_charge_status = EWallet.get_ewallet_charge_status( - charge_id=ewallet_charge.id, - ) - self.assert_returned_object_has_same_key_as_sample_response( - ewallet_charge_status, ewallet_charge_response() - ) diff --git a/tests/integration/test_invoice.py b/tests/integration/test_invoice.py deleted file mode 100644 index fe671e26..00000000 --- a/tests/integration/test_invoice.py +++ /dev/null @@ -1,39 +0,0 @@ -import pytest - -from .base_integration_test import BaseIntegrationTest -from tests.sampleresponse.invoice import invoice_response -from tests.sampleresponse.invoice import multiple_invoice_response - - -class TestInvoice(BaseIntegrationTest): - @pytest.fixture - def Invoice(self, xendit_instance): - return xendit_instance.Invoice - - def test_create_and_get_and_expire_invoice_return_correct_keys(self, Invoice): - invoice = Invoice.create( - external_id="invoice-1593766262", - amount=20000, - payer_email="customer@domain.com", - description="Invoice Demo #123", - ) - self.assert_returned_object_has_same_key_as_sample_response( - invoice, invoice_response() - ) - invoice_id = invoice.id - - invoice = Invoice.get(invoice_id=invoice_id,) - self.assert_returned_object_has_same_key_as_sample_response( - invoice, invoice_response() - ) - - invoice = Invoice.expire(invoice_id=invoice_id,) - self.assert_returned_object_has_same_key_as_sample_response( - invoice, invoice_response() - ) - - def test_list_all_invoice_return_correct_keys(self, Invoice): - invoices = Invoice.list_all(limit=3,) - self.assert_returned_object_has_same_key_as_sample_response( - invoices[0], multiple_invoice_response()[0] - ) diff --git a/tests/integration/test_payment_method.py b/tests/integration/test_payment_method.py deleted file mode 100644 index 263c3cb6..00000000 --- a/tests/integration/test_payment_method.py +++ /dev/null @@ -1,206 +0,0 @@ -import pytest -from tests.sampleresponse.payment_method import payment_method_response -from xendit.models.paymentmethod.card.card import Card -from xendit.models.paymentmethod.card.card_information import \ - CardInformation -from xendit.models.paymentmethod.card.channel_properties import \ - ChannelProperties as CardChannelProperties -from xendit.models.paymentmethod.direct_debit.channel_properties import \ - ChannelProperties as DirectDebitChannelProperties -from xendit.models.paymentmethod.direct_debit.direct_debit import \ - DirectDebit -from xendit.models.paymentmethod.ewallet.channel_properties import \ - ChannelProperties as EWalletChannelProperties -from xendit.models.paymentmethod.ewallet.ewallet import EWallet -from xendit.models.paymentmethod.over_the_counter.channel_properties import \ - ChannelProperties as OTCChannelProperties -from xendit.models.paymentmethod.over_the_counter.over_the_counter import \ - OverTheCounter -from xendit.models.paymentmethod.qr_code.qr_code import QRCode -from xendit.models.paymentmethod.virtual_account.channel_properties import \ - ChannelProperties as VAChannelProperties -from xendit.models.paymentmethod.virtual_account.virtual_account import \ - VirtualAccount - -from .base_integration_test import BaseIntegrationTest - - -class TestPaymentMethod(BaseIntegrationTest): - @pytest.fixture - def PaymentMethod(self, xendit_instance): - return xendit_instance.PaymentMethod - - def test_get_return_correct_keys(self, PaymentMethod): - payment_method = PaymentMethod.get(payment_method_id="pm-1c229762-c21a-433d-8da5-f02240387e34") - self.assert_returned_object_has_same_key_as_sample_response( - payment_method, payment_method_response() - ) - - def test_create_ewallet_return_correct_keys(self, PaymentMethod): - payment_method = PaymentMethod.create( - type="EWALLET", - reusability="ONE_TIME_USE", - ewallet=EWallet.Query( - channel_code="PAYMAYA", - channel_properties=EWalletChannelProperties.Query( - cancel_return_url="https://redirect.me/nostuff", - failure_return_url="https://redirect.me/badstuff", - success_return_url="https://redirect.me/goodstuff" - ) - ) - ) - - self.assert_returned_object_has_same_key_as_sample_response( - payment_method, payment_method_response() - ) - - def test_create_direct_debit_return_correct_keys(self, PaymentMethod): - payment_method = PaymentMethod.create( - type="DIRECT_DEBIT", - reusability="MULTIPLE_USE", - customer_id="1c320af8-5b4b-45f8-bffa-9caeacada3a1", - direct_debit=DirectDebit.Query( - channel_code="BPI", - channel_properties=DirectDebitChannelProperties.Query( - failure_return_url="https://redirect.me/badstuff", - success_return_url="https://redirect.me/goodstuff" - ) - ) - ) - - self.assert_returned_object_has_same_key_as_sample_response( - payment_method, payment_method_response() - ) - - def test_create_card_return_correct_keys(self, PaymentMethod): - payment_method = PaymentMethod.create( - type="CARD", - reusability="MULTIPLE_USE", - card=Card.Query( - currency="PHP", - card_information=CardInformation.Query( - card_number="4000000000000002", - expiry_month="12", - expiry_year="2040" - ), - channel_properties=CardChannelProperties.Query( - failure_return_url="https://redirect.me/badstuff", - success_return_url="https://redirect.me/goodstuff" - ) - ) - ) - - self.assert_returned_object_has_same_key_as_sample_response( - payment_method, payment_method_response() - ) - - def test_create_card_return_correct_keys(self, PaymentMethod): - payment_method = PaymentMethod.create( - type="CARD", - reusability="MULTIPLE_USE", - card=Card.Query( - currency="PHP", - card_information=CardInformation.Query( - card_number="4000000000000002", - expiry_month="12", - expiry_year="2040" - ), - channel_properties=CardChannelProperties.Query( - failure_return_url="https://redirect.me/badstuff", - success_return_url="https://redirect.me/goodstuff" - ) - ) - ) - - self.assert_returned_object_has_same_key_as_sample_response( - payment_method, payment_method_response() - ) - - def test_create_over_the_counter_return_correct_keys(self, PaymentMethod): - payment_method = PaymentMethod.create( - type="OVER_THE_COUNTER", - reusability="ONE_TIME_USE", - over_the_counter=OverTheCounter.Query( - amount=50, - currency="PHP", - channel_code="7ELEVEN", - channel_properties=OTCChannelProperties.Query( - customer_name="Test Customer" - ) - ) - ) - - self.assert_returned_object_has_same_key_as_sample_response( - payment_method, payment_method_response() - ) - - def test_create_qr_code_return_correct_keys(self, PaymentMethod): - payment_method = PaymentMethod.create( - type="QR_CODE", - reusability="ONE_TIME_USE", - qr_code=QRCode.Query( - amount=50, - currency="PHP", - channel_code="RCBC", - ) - ) - - self.assert_returned_object_has_same_key_as_sample_response( - payment_method, payment_method_response() - ) - - def test_create_virtual_account_return_correct_keys(self, PaymentMethod): - payment_method = PaymentMethod.create( - type="VIRTUAL_ACCOUNT", - reusability="MULTIPLE_USE", - virtual_account=VirtualAccount.Query( - channel_code="BCA", - channel_properties=VAChannelProperties.Query( - customer_name="Test Customer" - ) - ) - ) - - self.assert_returned_object_has_same_key_as_sample_response( - payment_method, payment_method_response() - ) - - def test_update_return_correct_keys(self, PaymentMethod): - payment_method = PaymentMethod.update( - payment_method_id="pm-1c229762-c21a-433d-8da5-f02240387e34", - status="INACTIVE" - ) - - self.assert_returned_object_has_same_key_as_sample_response( - payment_method, payment_method_response() - ) - - def test_expire_return_correct_keys(self, PaymentMethod): - payment_method = PaymentMethod.create( - type="EWALLET", - reusability="ONE_TIME_USE", - ewallet=EWallet.Query( - channel_code="PAYMAYA", - channel_properties=EWalletChannelProperties.Query( - cancel_return_url="https://redirect.me/nostuff", - failure_return_url="https://redirect.me/badstuff", - success_return_url="https://redirect.me/goodstuff" - ) - ) - ) - - expire_result = PaymentMethod.expire( - payment_method_id=payment_method.id - ) - - self.assert_returned_object_has_same_key_as_sample_response( - payment_method, payment_method_response() - ) - - def test_list_return_correct_keys(self, PaymentMethod): - payment_method_list = PaymentMethod.list(limit=5) - - for payment_method in payment_method_list.data: - self.assert_returned_object_has_same_key_as_sample_response( - payment_method, payment_method_response() - ) diff --git a/tests/integration/test_payment_request.py b/tests/integration/test_payment_request.py deleted file mode 100644 index 11c250ca..00000000 --- a/tests/integration/test_payment_request.py +++ /dev/null @@ -1,48 +0,0 @@ -import pytest -from tests.sampleresponse.payment_request import payment_request_response -from xendit.models.paymentmethod.ewallet.channel_properties import \ - ChannelProperties as EWalletChannelProperties -from xendit.models.paymentmethod.ewallet.ewallet import EWallet -from xendit.models.paymentmethod import PaymentMethod -from .base_integration_test import BaseIntegrationTest - - -class TestPaymentRequest(BaseIntegrationTest): - @pytest.fixture - def PaymentRequest(self, xendit_instance): - return xendit_instance.PaymentRequest - - def test_get_return_correct_keys(self, PaymentRequest): - payment_request = PaymentRequest.get(payment_request_id ="ewc_f02159c3-1e52-48a4-974f-243d906a5da3") - self.assert_returned_object_has_same_key_as_sample_response( - payment_request, payment_request_response() - ) - - # def test_create_paymereturn_correct_keys(self, xendit_instance): - - # payment_request = xendit_instance.PaymentRequest.create( - # amount=1500, - # currency="IDR", - # payment_method=PaymentMethod.Query( - # type="EWALLET", - # reusability="ONE_TIME_USE", - # ewallet=EWallet.Query( - # channel_code="OVO", - # channel_properties=EWalletChannelProperties.Query( - # mobile_number="+628123123123" - # ) - # ) - # ) - # ) - - # self.assert_returned_object_has_same_key_as_sample_response( - # payment_request, payment_request_response() - # ) - - def test_list_return_correct_keys(self, PaymentRequest): - payment_request_list = PaymentRequest.list(limit=5) - - for payment_request in payment_request_list.data: - self.assert_returned_object_has_same_key_as_sample_response( - payment_request, payment_request_response() - ) diff --git a/tests/integration/test_payout.py b/tests/integration/test_payout.py deleted file mode 100644 index ae0fccbf..00000000 --- a/tests/integration/test_payout.py +++ /dev/null @@ -1,41 +0,0 @@ -import pytest -import time - -from .base_integration_test import BaseIntegrationTest -from tests.sampleresponse.payout import payout_response -from tests.sampleresponse.payout import void_payout_response - - -class TestPayout(BaseIntegrationTest): - @pytest.fixture - def Payout(self, xendit_instance): - return xendit_instance.Payout - - @pytest.fixture - def payout_data(self, Payout): - payout = Payout.create( - external_id=f"payout-{int(time.time())}", - amount=50000, - email="test@email.co", - ) - return payout - - def test_create_payout_return_correct_keys(self, payout_data): - payout = payout_data - self.assert_returned_object_has_same_key_as_sample_response( - payout, payout_response() - ) - - def test_get_payout_return_correct_keys(self, Payout, payout_data): - payout = payout_data - payout = Payout.get(id=payout.id) - self.assert_returned_object_has_same_key_as_sample_response( - payout, payout_response() - ) - - def test_void_payout_return_correct_keys(self, Payout, payout_data): - payout = payout_data - void_payout = Payout.void(id=payout.id) - self.assert_returned_object_has_same_key_as_sample_response( - void_payout, void_payout_response() - ) diff --git a/tests/integration/test_qrcode.py b/tests/integration/test_qrcode.py deleted file mode 100644 index 6413a0c9..00000000 --- a/tests/integration/test_qrcode.py +++ /dev/null @@ -1,39 +0,0 @@ -import pytest -import time - -from xendit import QRCodeType - -from .base_integration_test import BaseIntegrationTest -from tests.sampleresponse.qrcode import qrcode_response - - -class TestQRCode(BaseIntegrationTest): - @pytest.fixture - def QRCode(self, xendit_instance): - return xendit_instance.QRCode - - @pytest.fixture - def qrcode_data(self, QRCode): - qrcode = QRCode.create( - external_id=f"qrcode-id-{int(time.time())}", - type=QRCodeType.DYNAMIC, - callback_url="https://webhook.site", - amount=4000, - ) - return qrcode - - def test_create_qrcode(self, qrcode_data): - qrcode = qrcode_data - - self.assert_returned_object_has_same_key_as_sample_response( - qrcode, qrcode_response() - ) - - def test_get_qrcode_by_ext_id(self, QRCode, qrcode_data): - qrcode = qrcode_data - - qrcode = QRCode.get_by_ext_id(external_id=qrcode.external_id) - - self.assert_returned_object_has_same_key_as_sample_response( - qrcode, qrcode_response() - ) diff --git a/tests/integration/test_recurring_payment.py b/tests/integration/test_recurring_payment.py deleted file mode 100644 index 9e61784c..00000000 --- a/tests/integration/test_recurring_payment.py +++ /dev/null @@ -1,87 +0,0 @@ -import pytest -import time - -from .base_integration_test import BaseIntegrationTest -from tests.sampleresponse.recurring_payment import recurring_payment_response - - -class TestRecurringPayment(BaseIntegrationTest): - @pytest.fixture(scope="class") - def RecurringPayment(self, xendit_instance): - return xendit_instance.RecurringPayment - - @pytest.fixture(scope="class") - def recurring_payment_data(self, RecurringPayment): - recurring_payment = RecurringPayment.create( - external_id=f"recurring_{int(time.time())}", - payer_email="test@x.co", - description="Test Curring Payment", - amount=100000, - interval="MONTH", - interval_count=1, - ) - return recurring_payment - - def test_create_recurring_payment_return_correct_keys(self, recurring_payment_data): - recurring_payment = recurring_payment_data - - self.assert_returned_object_has_same_key_as_sample_response( - recurring_payment, recurring_payment_response() - ) - - def test_get_recurring_payment_return_correct_keys( - self, RecurringPayment, recurring_payment_data - ): - recurring_payment = recurring_payment_data - - recurring_payment = RecurringPayment.get(id=recurring_payment.id,) - - self.assert_returned_object_has_same_key_as_sample_response( - recurring_payment, recurring_payment_response() - ) - - def test_edit_recurring_payment_return_correct_keys( - self, RecurringPayment, recurring_payment_data - ): - recurring_payment = recurring_payment_data - - recurring_payment = RecurringPayment.edit( - id=recurring_payment.id, interval_count=2 - ) - - self.assert_returned_object_has_same_key_as_sample_response( - recurring_payment, recurring_payment_response() - ) - - def test_stop_recurring_payment_return_correct_keys(self, RecurringPayment): - recurring_payment = RecurringPayment.create( - external_id=f"recurring_{int(time.time())}", - payer_email="test@x.co", - description="Test Curring Payment", - amount=100000, - interval="MONTH", - interval_count=1, - ) - - recurring_payment = RecurringPayment.stop(id=recurring_payment.id) - - self.assert_returned_object_has_same_key_as_sample_response( - recurring_payment, recurring_payment_response() - ) - - def test_pause_and_resume_recurring_payment_return_correct_keys( - self, RecurringPayment, recurring_payment_data - ): - recurring_payment = recurring_payment_data - - recurring_payment = RecurringPayment.pause(id=recurring_payment.id,) - - self.assert_returned_object_has_same_key_as_sample_response( - recurring_payment, recurring_payment_response() - ) - - recurring_payment = RecurringPayment.resume(id=recurring_payment.id,) - - self.assert_returned_object_has_same_key_as_sample_response( - recurring_payment, recurring_payment_response() - ) diff --git a/tests/integration/test_refund.py b/tests/integration/test_refund.py deleted file mode 100644 index 6f488689..00000000 --- a/tests/integration/test_refund.py +++ /dev/null @@ -1,27 +0,0 @@ -import pytest -from tests.sampleresponse.refund import refund_response -from xendit.models.paymentmethod.ewallet.channel_properties import \ - ChannelProperties as EWalletChannelProperties -from xendit.models.paymentmethod.ewallet.ewallet import EWallet -from xendit.models.paymentmethod import PaymentMethod -from .base_integration_test import BaseIntegrationTest - - -class TestRefund(BaseIntegrationTest): - @pytest.fixture - def Refund(self, xendit_instance): - return xendit_instance.Refund - - def test_get_return_correct_keys(self, Refund): - refund = Refund.get(refund_id ="rfd-48fd6af8-9cf3-471d-9f37-f6d27a829220") - self.assert_returned_object_has_same_key_as_sample_response( - refund, refund_response() - ) - - def test_list_return_correct_keys(self, Refund): - refund_list = Refund.list(limit=5) - - for refund in refund_list.data: - self.assert_returned_object_has_same_key_as_sample_response( - refund, refund_response() - ) diff --git a/tests/integration/test_retail_outlet.py b/tests/integration/test_retail_outlet.py deleted file mode 100644 index ef4c3099..00000000 --- a/tests/integration/test_retail_outlet.py +++ /dev/null @@ -1,49 +0,0 @@ -import pytest - -from .base_integration_test import BaseIntegrationTest -from tests.sampleresponse.retail_outlet import retail_outlet_response -from tests.sampleresponse.retail_outlet import retail_outlet_update_response - - -class TestRetailOutlet(BaseIntegrationTest): - @pytest.fixture(scope="class") - def RetailOutlet(self, xendit_instance): - return xendit_instance.RetailOutlet - - @pytest.fixture(scope="class") - def retail_outlet_data(self, RetailOutlet): - retail_outlet = RetailOutlet.create_fixed_payment_code( - external_id="demo_fixed_payment_code_123", - retail_outlet_name="ALFAMART", - name="Rika Sutanto", - expected_amount=10000, - ) - return retail_outlet - - def test_create_fixed_payment_code_return_correct_keys(self, retail_outlet_data): - retail_outlet = retail_outlet_data - self.assert_returned_object_has_same_key_as_sample_response( - retail_outlet, retail_outlet_response() - ) - - def test_update_fixed_payment_code_return_correct_keys( - self, RetailOutlet, retail_outlet_data - ): - retail_outlet = retail_outlet_data - retail_outlet = RetailOutlet.update_fixed_payment_code( - fixed_payment_code_id=retail_outlet.id, name="Joe Contini", - ) - self.assert_returned_object_has_same_key_as_sample_response( - retail_outlet, retail_outlet_update_response() - ) - - def test_get_fixed_payment_code_return_correct_keys( - self, RetailOutlet, retail_outlet_data - ): - retail_outlet = retail_outlet_data - retail_outlet = RetailOutlet.get_fixed_payment_code( - fixed_payment_code_id=retail_outlet.id - ) - self.assert_returned_object_has_same_key_as_sample_response( - retail_outlet, retail_outlet_response() - ) diff --git a/tests/integration/test_virtual_account.py b/tests/integration/test_virtual_account.py deleted file mode 100644 index bdb86a54..00000000 --- a/tests/integration/test_virtual_account.py +++ /dev/null @@ -1,61 +0,0 @@ -import pytest - -from .base_integration_test import BaseIntegrationTest -from tests.sampleresponse.virtual_account import virtual_account_response -from tests.sampleresponse.virtual_account import virtual_account_banks_response -from tests.sampleresponse.virtual_account import virtual_account_payment_response - - -class TestVirtualAccount(BaseIntegrationTest): - @pytest.fixture(scope="class") - def VirtualAccount(self, xendit_instance): - return xendit_instance.VirtualAccount - - @pytest.fixture(scope="class") - def virtual_account_data(self, VirtualAccount): - virtual_account = VirtualAccount.create( - external_id="demo_1475459775872", - bank_code="BNI", - name="Rika Sutanto", - is_closed=True, - expected_amount=15000, - ) - return virtual_account - - def test_create_virtual_account_return_correct_keys(self, virtual_account_data): - virtual_account = virtual_account_data - self.assert_returned_object_has_same_key_as_sample_response( - virtual_account, virtual_account_response() - ) - - def test_get_virtual_account_bank_return_correct_keys(self, VirtualAccount): - virtual_account_banks = VirtualAccount.get_banks() - self.assert_returned_object_has_same_key_as_sample_response( - virtual_account_banks[0], virtual_account_banks_response()[0] - ) - - def test_get_virtual_account_return_correct_keys( - self, VirtualAccount, virtual_account_data - ): - virtual_account = virtual_account_data - - virtual_account = VirtualAccount.get(id=virtual_account.id) - self.assert_returned_object_has_same_key_as_sample_response( - virtual_account, virtual_account_response() - ) - - def test_update_virtual_account_return_correct_keys(self, VirtualAccount): - virtual_account = VirtualAccount.update( - id="602bafe23ef3e5403c720cf9", expected_amount=20000 - ) - self.assert_returned_object_has_same_key_as_sample_response( - virtual_account, virtual_account_response() - ) - - def test_get_virtual_account_payment_return_correct_keys(self, VirtualAccount): - virtual_account_payment = VirtualAccount.get_payment( - payment_id="5ef18efca7d10d1b4d61fb52" - ) - self.assert_returned_object_has_same_key_as_sample_response( - virtual_account_payment, virtual_account_payment_response() - ) diff --git a/tests/sampleresponse/balance.py b/tests/sampleresponse/balance.py deleted file mode 100644 index 7c64913b..00000000 --- a/tests/sampleresponse/balance.py +++ /dev/null @@ -1,2 +0,0 @@ -def balance_response(): - return {"balance": 1000} diff --git a/tests/sampleresponse/batch_disbursement.py b/tests/sampleresponse/batch_disbursement.py deleted file mode 100644 index dc16b98b..00000000 --- a/tests/sampleresponse/batch_disbursement.py +++ /dev/null @@ -1,9 +0,0 @@ -def batch_disbursement_response(): - return { - "status": "UPLOADING", - "reference": "batch_disbursement-1595326225", - "total_uploaded_amount": 10000, - "total_uploaded_count": 1, - "created": "2020-07-21T10:10:35.782Z", - "id": "5f16bf1bfc70de0017b858bf", - } diff --git a/tests/sampleresponse/cardless_credit.py b/tests/sampleresponse/cardless_credit.py deleted file mode 100644 index c9077e71..00000000 --- a/tests/sampleresponse/cardless_credit.py +++ /dev/null @@ -1,28 +0,0 @@ -def cardless_credit_payment_response(): - return { - "redirect_url": "https://pay-sandbox.kredivo.com/signIn?tk=26458cdf-660c-4491-a1de-bb6e63312d8a", - "order_id": "e8ae4066-7980-499f-b92c-eb3a587782c1", - "external_id": "id-1595923113", - "cardless_credit_type": "KREDIVO", - } - - -def cardless_credit_payment_type_response(): - return { - "message": "Available payment types are listed.", - "payments": [ - { - "raw_monthly_installment": 401000, - "name": "Bayar dalam 30 hari", - "amount": 401000, - "installment_amount": 401000, - "raw_amount": 401000, - "rate": 0, - "down_payment": 0, - "monthly_installment": 401000, - "discounted_monthly_installment": 0, - "tenure": 1, - "id": "30_days", - } - ], - } diff --git a/tests/sampleresponse/credit_card.py b/tests/sampleresponse/credit_card.py deleted file mode 100644 index 08096e4b..00000000 --- a/tests/sampleresponse/credit_card.py +++ /dev/null @@ -1,68 +0,0 @@ -def reverse_auth_response(): - return { - "status": "SUCCEEDED", - "credit_card_charge_id": "5f0421fa8cc1e8001973a1d6", - "business_id": "5ed75086a883856178afc12e", - "external_id": "card_preAuth-1594106356", - "amount": 75000, - "created": "2020-07-07T07:19:48.896Z", - "id": "5f0422148cc1e8001973a1dc", - } - - -def charge_response(): - return { - "status": "AUTHORIZED", - "authorized_amount": 75000, - "capture_amount": 0, - "currency": "IDR", - "business_id": "5ed75086a883856178afc12e", - "merchant_id": "xendit_ctv_agg", - "merchant_reference_code": "5f0421faa98815a4f4c92a0d", - "external_id": "card_preAuth-1594106356", - "eci": "07", - "charge_type": "MULTIPLE_USE_TOKEN", - "masked_card_number": "400000XXXXXX0002", - "card_brand": "VISA", - "card_type": "CREDIT", - "descriptor": "XENDIT*XENDIT&#X27;S INTERN", - "bank_reconciliation_id": "5941063625146828103011", - "approval_code": "831000", - "created": "2020-07-07T07:19:22.921Z", - "id": "5f0421fa8cc1e8001973a1d6", - "metadata": { - "meta": "data", - }, - } - - -def refund_response(): - return { - "status": "REQUESTED", - "currency": "IDR", - "credit_card_charge_id": "5f0422aa2bbbe50019a368c2", - "user_id": "5ed75086a883856178afc12e", - "amount": 10000, - "external_id": "card_refund-1594106755", - "created": "2020-07-07T07:25:56.872Z", - "updated": "2020-07-07T07:25:57.740Z", - "id": "5f0423848bb8da600c57c44f", - "fee_refund_amount": 290, - } - - -def promotion_response(): - return { - "business_id": "5ed75086a883856178afc12e", - "reference_id": "BRI_20_JAN-1594176600", - "description": "20% discount applied for all BRI cards", - "start_time": "2020-01-01T00:00:00.000Z", - "end_time": "2021-01-01T00:00:00.000Z", - "type": "CARD_BIN", - "discount_amount": 10000, - "bin_list": ["400000", "460000"], - "currency": "IDR", - "id": "c65a2ae7-ce75-4a15-bbec-55d076f46bd0", - "created": "2020-07-08T02:50:02.296Z", - "status": "ACTIVE", - } diff --git a/tests/sampleresponse/direct_debit.py b/tests/sampleresponse/direct_debit.py deleted file mode 100644 index 75fb6c84..00000000 --- a/tests/sampleresponse/direct_debit.py +++ /dev/null @@ -1,96 +0,0 @@ -def customer_response(): - return { - "id": "9d72e4bc-a178-4aff-9f63-f20b74532bac", - "reference_id": "merc-1594272368", - "description": None, - "given_names": "Adyaksa", - "middle_name": None, - "surname": None, - "mobile_number": None, - "phone_number": None, - "email": "t@x.co", - "nationality": None, - "addresses": None, - "date_of_birth": None, - "employment": None, - "source_of_wealth": None, - "metadata": None, - } - - -def multi_customer_response(): - return [customer_response(), customer_response()] - - -def linked_account_response(): - return { - "id": "lat-afcfde47-18e0-4d68-bf1b-c729a5d8e54a", - "customer_id": "ed20b5db-df04-41fc-8018-8ea4ac4d1030", - "channel_code": "DC_BRI", - "status": "PENDING", - } - - -def accessible_accounts_response(): - return [ - { - "channel_code": "DC_BRI", - "id": "la-aefbc050-4198-4e30-a925-4bbcf572f20d", - "properties": { - "card_expiry": "06/24", - "card_last_four": "8888", - "currency": "IDR", - "description": "", - }, - "type": "DEBIT_CARD", - } - ] - - -def payment_method_response(): - return { - "customer_id": "ed20b5db-df04-41fc-8018-8ea4ac4d1030", - "type": "DEBIT_CARD", - "properties": { - "id": "la-fac7e744-ab40-4100-a447-cbbb16f29ded", - "currency": "IDR", - "card_expiry": "06/24", - "description": "", - "channel_code": "DC_BRI", - "card_last_four": "8888", - }, - "status": "ACTIVE", - "metadata": {}, - "id": "pm-b6116aea-8c23-42d0-a1e6-33227b52fccd", - "created": "2020-07-13T07:28:57.716Z", - "updated": "2020-07-13T07:28:57.716Z", - } - - -def multi_payment_method_response(): - return [payment_method_response(), payment_method_response()] - - -def payment_response(): - return { - "amount": 60000, - "basket": None, - "channel_code": "DC_BRI", - "created": "2020-07-14T09:04:20.031451Z", - "currency": "IDR", - "description": "", - "failure_code": None, - "id": "ddpy-38ef50a8-00f0-4019-8b28-9bca81f2cbf1", - "is_otp_required": False, - "metadata": None, - "otp_expiration_timestamp": None, - "otp_mobile_number": None, - "payment_method_id": "pm-b6116aea-8c23-42d0-a1e6-33227b52fccd", - "reference_id": "direct-debit-ref-1594717458", - "status": "PENDING", - "updated": "2020-07-14T09:04:20.031451Z", - } - - -def multi_payment_response(): - return [payment_response(), payment_response()] diff --git a/tests/sampleresponse/disbursement.py b/tests/sampleresponse/disbursement.py deleted file mode 100644 index 46c89f56..00000000 --- a/tests/sampleresponse/disbursement.py +++ /dev/null @@ -1,53 +0,0 @@ -def disbursement_response(): - return { - "user_id": "5ed75086a883856178afc12e", - "external_id": "demo_1475459775872", - "amount": 17000, - "bank_code": "BCA", - "account_holder_name": "Bob Jones", - "disbursement_description": "Reimbursement for shoes", - "status": "PENDING", - "id": "5ef1c4f40c2e150017ce3b96", - } - - -def multi_disbursement_response(): - return [ - { - "user_id": "5ed75086a883856178afc12e", - "external_id": "demo_1475459775872", - "amount": 17000, - "bank_code": "BCA", - "account_holder_name": "Bob Jones", - "disbursement_description": "Reimbursement for shoes", - "status": "PENDING", - "id": "5ef1c4f40c2e150017ce3b96", - }, - { - "user_id": "5ed75086a883856178afc12e", - "external_id": "demo_1475459775872", - "amount": 17000, - "bank_code": "BCA", - "account_holder_name": "Bob Jones", - "disbursement_description": "Disbursement from Postman", - "status": "PENDING", - "id": "5ef1befeecb16100179e1d05", - }, - ] - - -def disbursement_banks_response(): - return [ - { - "name": "Mandiri Taspen Pos (formerly Bank Sinar Harapan Bali)", - "code": "MANDIRI_TASPEN", - "can_disburse": True, - "can_name_validate": True, - }, - { - "name": "Bank QNB Indonesia (formerly Bank QNB Kesawan)", - "code": "QNB_INDONESIA", - "can_disburse": True, - "can_name_validate": True, - }, - ] diff --git a/tests/sampleresponse/ewallet.py b/tests/sampleresponse/ewallet.py deleted file mode 100644 index 74fce877..00000000 --- a/tests/sampleresponse/ewallet.py +++ /dev/null @@ -1,117 +0,0 @@ -def ovo_payment_response(x_api_version="2020-02-01"): - if x_api_version == "2020-02-01": - return { - "amount": 80001, - "business_id": "5ed75086a883856178afc12e", - "created": "2020-06-30T10:58:08.648Z", - "ewallet_type": "OVO", - "external_id": "ovo-ewallet-testing-id-123321131114", - "phone": "08183123123", - "status": "PENDING", - } - elif x_api_version == "2019-02-04": - return { - "amount": 80001, - "business_id": "5ed75086a883856178afc12e", - "ewallet_type": "OVO", - "external_id": "ovo-ewallet-testing-id-123321131114", - "phone": "08183123123", - "transaction_date": "2020-07-01T04:40:43.000Z", - "ewallet_transaction_id": "cea4a665-0c91-408b-93a8-7855d2b7ac45", - } - - -def ovo_payment_status_response(): - return { - "amount": "8888", - "business_id": "5ed75086a883856178afc12e", - "ewallet_type": "OVO", - "external_id": "ovo-ewallet-testing-id-1234", - "status": "COMPLETED", - "transaction_date": "2020-06-30T01:32:28.267Z", - } - - -def dana_payment_response(): - return { - "external_id": "dana-ewallet-test-33312", - "amount": 1001, - "checkout_url": "https://sandbox.m.dana.id/m/portal/cashier/checkout?bizNo=20200630111212800110166944200487696×tamp=1593501869722&mid=216620000000261692328&sign=NjoCAHIi7py03bmpNRLztChCD3JyhbHoIjv1zNZhqYRXByYNiCAsXfjNMKcOOEQHQA%2BALYU0estGFaUz60qM4r9LoqVhuEn%2FCqzHzbmHdy54FlBUnwPINBTVIPIGgpLXSEQeUTHFUmU5QcoLelzZgZiPjbZaFdPqTlZtpW1XrovWuad2FslHrpsnscko5yp2A4vpAIIxM3%2BV9c8596B4hmugdEhb4qqJ05XQtOXPI%2Fui8qJG84Pc0ezkjavsMfTbD%2BOjRiLSt4Xowsm3KUe1CadycW3GTx6CTFHeRGaCauyMJR5VxbFsu5dztYpvrr%2FaHiIhk4t2XB%2FbQl1JPfl1NQ%3D%3D", - "ewallet_type": "DANA", - } - - -def dana_payment_status_response(): - return { - "external_id": "dana-ewallet-test-1234", - "business_id": "5ed75086a883856178afc12e", - "amount": "1001.00", - "expiration_date": "2020-12-20T07:00:00+07:00", - "checkout_url": "https://sandbox.m.dana.id/m/portal/cashier/checkout?bizNo=20200630111212800110166293400518907×tamp=1593480789887&mid=216620000000261692328&sign=U4vHxKFRCr4ePrZb8Ym24dfEAJ0v8%2FRXPjYcbBEGgCiRKEFD%2FPhIAF%2FNQLQBiiAXEDEM%2FaRSyL%2FLp1d0kKghxgFuRop4glre6JorCIbi%2FswUfOK7X%2BzEB5mEQZhPbxfEeM7jciHH3Cuk%2BAhZ2TV5M15QxWh5icRN3jeDOBPotVvwwjgSzZXBv6PKrmpdY03hJf%2BkKaGWNiEOUFeaGuBQSIBVQjPraiT3RkLrStwae1C1D8Y%2FNS42NSU7XdtHj41PfKgk89WUSUvqzqJs4Ch20N1ZCoZ4ay5D3Wuv7VzQtA5Agx%2ByuJxdWNUVBZL8dpO8oHcToBQEGtPbeaoD0ftPKw%3D%3D", - "status": "PENDING", - } - - -def linkaja_payment_response(): - return { - "checkout_url": "https://ewallet-linkaja-dev.xendit.co/checkouts/474f2ce2-f991-4fff-b1c2-c92b61d436a4", - "transaction_date": "2020-06-30T08:20:50.426Z", - "amount": 300000, - "external_id": "linkaja-ewallet-test-1593505247", - "ewallet_type": "LINKAJA", - } - - -def linkaja_payment_status_completed_response(): - return { - "business_id": "5ed75086a883856178afc12e", - "external_id": "linkaja-ewallet-test-1234", - "amount": 300000, - "status": "COMPLETED", - "payment_timestamp": "2020-06-30T07:50:10.105Z", - } - - -def linkaja_payment_status_expired_response(): - return { - "business_id": "5ed75086a883856178afc12e", - "external_id": "linkaja-ewallet-test-123", - "amount": 300000, - "status": "EXPIRED", - "expired_at": "2020-06-30T02:03:36.078Z", - "checkout_url": "https://ewallet-linkaja-dev.xendit.co/checkouts/ecae96ff-2e06-4a00-9a42-95e44ba56aca", - } - - -def ewallet_charge_response(): - return { - "id": "ewc_f3925450-5c54-4777-98c1-fcf22b0d1e1c", - "business_id": "business-id-example", - "reference_id": "test-reference-id", - "status": "PENDING", - "currency": "IDR", - "charge_amount": 10000, - "capture_amount": 10000, - "checkout_method": "ONE_TIME_PAYMENT", - "channel_code": "ID_SHOPEEPAY", - "channel_properties": { - "success_redirect_url": "https://yourwebsite.com/order/123", - }, - "actions": { - "desktop_web_checkout_url": None, - "mobile_web_checkout_url": None, - "mobile_deeplink_checkout_url": 'https://mobile.deeplink.checkout.url', - "qr_checkout_string": 'test-qr-string', - }, - "is_redirect_required": True, - "callback_url": "https://yourwebsite.com/order/123", - "created": '2021-02-09T06:22:35.064408Z', - "updated": '2021-02-09T06:22:35.064408Z', - "voided_at": None, - "capture_now": True, - "customer_id": None, - "payment_method_id": None, - "failure_code": None, - "basket": None, - "metadata": None, - } diff --git a/tests/sampleresponse/invoice.py b/tests/sampleresponse/invoice.py deleted file mode 100644 index 95702c17..00000000 --- a/tests/sampleresponse/invoice.py +++ /dev/null @@ -1,298 +0,0 @@ -def invoice_response(): - return { - "id": "5efd97830425db620ec35e22", - "external_id": "invoice-1593677698", - "user_id": "5ed75086a883856178afc12e", - "status": "PENDING", - "merchant_name": "Xendit&#x27;s Intern", - "merchant_profile_picture_url": "https://xnd-companies.s3.amazonaws.com/prod/1591169469152_279.png", - "amount": 20000, - "payer_email": "customer@domain.com", - "description": "Invoice Demo #123", - "expiry_date": "2020-07-03T08:14:59.379Z", - "invoice_url": "https://invoice-staging.xendit.co/web/invoices/5efd97830425db620ec35e22", - "available_banks": [ - { - "bank_code": "MANDIRI", - "collection_type": "POOL", - "bank_account_number": "8860846849727", - "transfer_amount": 20000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0, - }, - { - "bank_code": "BRI", - "collection_type": "POOL", - "bank_account_number": "2621554802920", - "transfer_amount": 20000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0, - }, - { - "bank_code": "BNI", - "collection_type": "POOL", - "bank_account_number": "880854592871", - "transfer_amount": 20000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0, - }, - { - "bank_code": "PERMATA", - "collection_type": "POOL", - "bank_account_number": "821456655233", - "transfer_amount": 20000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0, - }, - { - "bank_code": "BCA", - "collection_type": "POOL", - "bank_account_number": "1076619840767", - "transfer_amount": 20000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0, - }, - ], - "available_retail_outlets": [ - { - "retail_outlet_name": "ALFAMART", - "payment_code": "TEST35284", - "transfer_amount": 1000000, - } - ], - "available_ewallets": [], - "should_exclude_credit_card": False, - "should_send_email": False, - "created": "2020-07-02T08:14:59.460Z", - "updated": "2020-07-02T08:14:59.460Z", - "currency": "IDR", - } - - -def multiple_invoice_response(): - return [ - { - "id": "5efdb0210425db620ec35fb3", - "external_id": "invoice-1593684000", - "user_id": "5ed75086a883856178afc12e", - "status": "PENDING", - "merchant_name": "Xendit&#x27;s Intern", - "merchant_profile_picture_url": "https://xnd-companies.s3.amazonaws.com/prod/1591169469152_279.png", - "amount": 20000, - "payer_email": "customer@domain.com", - "description": "Invoice Demo #123", - "expiry_date": "2020-07-03T10:00:01.148Z", - "invoice_url": "https://invoice-staging.xendit.co/web/invoices/5efdb0210425db620ec35fb3", - "available_banks": [ - { - "bank_code": "MANDIRI", - "collection_type": "POOL", - "bank_account_number": "8860846854335", - "transfer_amount": 20000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0, - }, - { - "bank_code": "BRI", - "collection_type": "POOL", - "bank_account_number": "2621554807492", - "transfer_amount": 20000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0, - }, - { - "bank_code": "BNI", - "collection_type": "POOL", - "bank_account_number": "880854597383", - "transfer_amount": 20000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0, - }, - { - "bank_code": "PERMATA", - "collection_type": "POOL", - "bank_account_number": "821456659745", - "transfer_amount": 20000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0, - }, - { - "bank_code": "BCA", - "collection_type": "POOL", - "bank_account_number": "1076619844859", - "transfer_amount": 20000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0, - }, - ], - "available_retail_outlets": [ - { - "retail_outlet_name": "ALFAMART", - "payment_code": "TEST34956", - "transfer_amount": 20000, - } - ], - "available_ewallets": [], - "should_exclude_credit_card": False, - "should_send_email": False, - "created": "2020-07-02T10:00:01.285Z", - "updated": "2020-07-02T10:00:01.285Z", - "currency": "IDR", - }, - { - "id": "5efdaaf10425db620ec35f68", - "external_id": "invoice-1593682673", - "user_id": "5ed75086a883856178afc12e", - "status": "PENDING", - "merchant_name": "Xendit&#x27;s Intern", - "merchant_profile_picture_url": "https://xnd-companies.s3.amazonaws.com/prod/1591169469152_279.png", - "amount": 1000000, - "payer_email": "customer@domain.com", - "description": "Invoice Demo #123", - "expiry_date": "2020-07-03T09:37:53.334Z", - "invoice_url": "https://invoice-staging.xendit.co/web/invoices/5efdaaf10425db620ec35f68", - "available_banks": [ - { - "bank_code": "MANDIRI", - "collection_type": "POOL", - "bank_account_number": "8860846853555", - "transfer_amount": 1000000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0, - }, - { - "bank_code": "BRI", - "collection_type": "POOL", - "bank_account_number": "2621554806712", - "transfer_amount": 1000000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0, - }, - { - "bank_code": "BNI", - "collection_type": "POOL", - "bank_account_number": "880854596627", - "transfer_amount": 1000000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0, - }, - { - "bank_code": "PERMATA", - "collection_type": "POOL", - "bank_account_number": "821456659001", - "transfer_amount": 1000000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0, - }, - { - "bank_code": "BCA", - "collection_type": "POOL", - "bank_account_number": "1076619844115", - "transfer_amount": 1000000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0, - }, - ], - "available_retail_outlets": [ - { - "retail_outlet_name": "ALFAMART", - "payment_code": "TEST34954", - "transfer_amount": 1000000, - } - ], - "available_ewallets": [], - "should_exclude_credit_card": False, - "should_send_email": False, - "created": "2020-07-02T09:37:53.400Z", - "updated": "2020-07-02T09:37:53.400Z", - "currency": "IDR", - }, - { - "id": "5efdaae80425db620ec35f66", - "external_id": "invoice-1593682664", - "user_id": "5ed75086a883856178afc12e", - "status": "PENDING", - "merchant_name": "Xendit&#x27;s Intern", - "merchant_profile_picture_url": "https://xnd-companies.s3.amazonaws.com/prod/1591169469152_279.png", - "amount": 100000, - "payer_email": "customer@domain.com", - "description": "Invoice Demo #123", - "expiry_date": "2020-07-03T09:37:44.451Z", - "invoice_url": "https://invoice-staging.xendit.co/web/invoices/5efdaae80425db620ec35f66", - "available_banks": [ - { - "bank_code": "MANDIRI", - "collection_type": "POOL", - "bank_account_number": "8860846853531", - "transfer_amount": 100000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0, - }, - { - "bank_code": "BRI", - "collection_type": "POOL", - "bank_account_number": "2621554806688", - "transfer_amount": 100000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0, - }, - { - "bank_code": "BNI", - "collection_type": "POOL", - "bank_account_number": "880854596603", - "transfer_amount": 100000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0, - }, - { - "bank_code": "PERMATA", - "collection_type": "POOL", - "bank_account_number": "821456658977", - "transfer_amount": 100000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0, - }, - { - "bank_code": "BCA", - "collection_type": "POOL", - "bank_account_number": "1076619844091", - "transfer_amount": 100000, - "bank_branch": "Virtual Account", - "account_holder_name": "XENDIT&#X27;S INTERN", - "identity_amount": 0, - }, - ], - "available_retail_outlets": [ - { - "retail_outlet_name": "ALFAMART", - "payment_code": "TEST34953", - "transfer_amount": 100000, - } - ], - "available_ewallets": [], - "should_exclude_credit_card": False, - "should_send_email": False, - "created": "2020-07-02T09:37:44.511Z", - "updated": "2020-07-02T09:37:44.511Z", - "currency": "IDR", - }, - ] diff --git a/tests/sampleresponse/payment_method.py b/tests/sampleresponse/payment_method.py deleted file mode 100644 index 211a8f63..00000000 --- a/tests/sampleresponse/payment_method.py +++ /dev/null @@ -1,80 +0,0 @@ -def payment_method_list_response(): - return { - "has_more": True, - "data": [{ - "id": "pm-1c229762-c21a-433d-8da5-f02240387e34", - "type": "EWALLET", - "country": "PH", - "business_id": "5ed75086a883856178afc12e", - "customer_id": None, - "reference_id": "0724a49f-388f-41d9-9662-7aefad85a02b", - "reusability": "ONE_TIME_USE", - "status": "ACTIVE", - "actions": [], - "description": None, - "created": "2022-10-18T01:31:45.843043772Z", - "updated": "2022-10-18T01:31:45.843043772Z", - "metadata": {}, - "billing_information": None, - "failure_code": None, - "ewallet": { - "channel_code": "PAYMAYA", - "channel_properties": { - "cancel_return_url": "https://redirect.me/nostuff", - "failure_return_url": "https://redirect.me/badstuff", - "success_return_url": "https://redirect.me/goodstuff" - }, - "account": { - "name": None, - "account_details": None, - "balance": None, - "point_balance": None - } - }, - "direct_bank_transfer": None, - "direct_debit": None, - "card": None, - "over_the_counter": None, - "qr_code": None, - "virtual_account": None - }] - } - -def payment_method_response(): - return { - "id": "pm-1c229762-c21a-433d-8da5-f02240387e34", - "type": "EWALLET", - "country": "PH", - "business_id": "5ed75086a883856178afc12e", - "customer_id": None, - "reference_id": "0724a49f-388f-41d9-9662-7aefad85a02b", - "reusability": "ONE_TIME_USE", - "status": "ACTIVE", - "actions": [], - "description": None, - "created": "2022-10-18T01:31:45.843043772Z", - "updated": "2022-10-18T01:31:45.843043772Z", - "metadata": {}, - "billing_information": None, - "failure_code": None, - "ewallet": { - "channel_code": "PAYMAYA", - "channel_properties": { - "cancel_return_url": "https://redirect.me/nostuff", - "failure_return_url": "https://redirect.me/badstuff", - "success_return_url": "https://redirect.me/goodstuff" - }, - "account": { - "name": None, - "account_details": None, - "balance": None, - "point_balance": None - } - }, - "direct_bank_transfer": None, - "direct_debit": None, - "card": None, - "over_the_counter": None, - "qr_code": None, - "virtual_account": None - } \ No newline at end of file diff --git a/tests/sampleresponse/payment_request.py b/tests/sampleresponse/payment_request.py deleted file mode 100644 index 555b3db0..00000000 --- a/tests/sampleresponse/payment_request.py +++ /dev/null @@ -1,69 +0,0 @@ -def payment_request_response(): - return { - "id": "ewc_93f9be97-67dc-47cf-8225-0bb18cb3dfb1", - "reference_id": "ec0aeced-f9cc-407c-a7a7-f78653235185", - "business_id": "1417479e238542429cb891f0", - "currency": "PHP", - "amount": 1500, - "country": "PH", - "payment_method": { - "id": "pm-bdd34ca4-e75d-49a1-86fc-d24090c70f81", - "type": "EWALLET", - "reference_id": "57a8413b-75d1-4611-8585-5fdc33a02b34", - "description": None, - "created": "2022-10-21T02:03:37.569360552Z", - "updated": "2022-10-21T02:03:37.569360552Z", - "card": None, - "ewallet": { - "channel_code": "PAYMAYA", - "channel_properties": { - "cancel_return_url": "https://redirect.me/nostuff", - "failure_return_url": "https://redirect.me/badstuff", - "success_return_url": "https://redirect.me/goodstuff" - }, - "account": { - "name": None, - "account_details": None, - "balance": None, - "point_balance": None - } - }, - "direct_debit": None, - "direct_bank_transfer": None, - "over_the_counter": None, - "virtual_account": None, - "qr_code": None, - "metadata": None, - "reusability": "ONE_TIME_USE", - "status": "ACTIVE" - }, - "description": None, - "metadata": None, - "customer_id": None, - "created": "2022-10-21T02:03:37.583670197Z", - "updated": "2022-10-21T02:03:37.583670197Z", - "status": "REQUIRES_ACTION", - "actions": [ - { - "action": "AUTH", - "url": "https://mock-test.co", - "url_type": "WEB", - "method": "GET", - "qr_code": None - }, - { - "action": "AUTH", - "url": "https://mock-test.co", - "url_type": "MOBILE", - "method": "GET", - "qr_code": None - } - ], - "failure_code": None, - "capture_method": "AUTOMATIC", - "initiator": None, - "card_verification_results": None, - "channel_properties": None, - "shipping_information": None, - "items": None - } diff --git a/tests/sampleresponse/payout.py b/tests/sampleresponse/payout.py deleted file mode 100644 index 9a90a376..00000000 --- a/tests/sampleresponse/payout.py +++ /dev/null @@ -1,25 +0,0 @@ -def payout_response(): - return { - "id": "a6ee1bf1-ffcd-4bda-a7ab-99c1d5cd0472", - "external_id": "payout-1595405117", - "amount": 50000, - "merchant_name": "Xendit&#x27;s Intern", - "status": "PENDING", - "expiration_timestamp": "2020-07-23T08:05:19.815Z", - "created": "2020-07-22T08:05:18.421Z", - "email": "test@email.co", - "payout_url": "https://payout-staging.xendit.co/web/a6ee1bf1-ffcd-4bda-a7ab-99c1d5cd0472", - } - - -def void_payout_response(): - return { - "id": "a6ee1bf1-ffcd-4bda-a7ab-99c1d5cd0472", - "external_id": "payout-1595405117", - "amount": 50000, - "merchant_name": "Xendit&#x27;s Intern", - "status": "VOIDED", - "expiration_timestamp": "2020-07-23T08:05:19.815Z", - "created": "2020-07-22T08:05:18.421Z", - "email": "test@email.co", - } diff --git a/tests/sampleresponse/qrcode.py b/tests/sampleresponse/qrcode.py deleted file mode 100644 index abd3ada4..00000000 --- a/tests/sampleresponse/qrcode.py +++ /dev/null @@ -1,12 +0,0 @@ -def qrcode_response(): - return { - "id": "qr_13c31ddd-9d58-449b-9f52-1bf5123a45b5", - "external_id": "qrcode-id-1594794038", - "amount": 4000, - "qr_string": "00020101021226660014ID.LINKAJA.WWW011893600911002411480002152004230411480010303UME51450015ID.OR.GPNQR.WWW02150000000000000000303UME520454995802ID5920Placeholder merchant6007Jakarta610612345662380115wLoc6DRGwAOgSkZ0715wLoc6DRGwAOgSkZ53033605404400063047668", - "callback_url": "https://webhook.site", - "type": "DYNAMIC", - "status": "ACTIVE", - "created": "2020-07-15T06:20:40.636Z", - "updated": "2020-07-15T06:20:40.636Z", - } diff --git a/tests/sampleresponse/recurring_payment.py b/tests/sampleresponse/recurring_payment.py deleted file mode 100644 index 54ffd9b5..00000000 --- a/tests/sampleresponse/recurring_payment.py +++ /dev/null @@ -1,20 +0,0 @@ -def recurring_payment_response(): - return { - "status": "ACTIVE", - "should_send_email": False, - "missed_payment_action": "IGNORE", - "recurrence_progress": 1, - "recharge": True, - "user_id": "5ed75086a883856178afc12e", - "external_id": "recurring_12345", - "payer_email": "test@x.co", - "description": "Test Curring Payment", - "amount": 100000, - "interval": "MONTH", - "interval_count": 1, - "start_date": "2020-07-08T08:22:55.815Z", - "currency": "IDR", - "created": "2020-07-08T08:22:55.817Z", - "updated": "2020-07-08T08:22:55.994Z", - "id": "5f05825ff9f52d3ed204c687", - } diff --git a/tests/sampleresponse/refund.py b/tests/sampleresponse/refund.py deleted file mode 100644 index 6fd398a1..00000000 --- a/tests/sampleresponse/refund.py +++ /dev/null @@ -1,19 +0,0 @@ -def refund_response(): - return { - "id": "rfd-48fd6af8-9cf3-471d-9f37-f6d27a829220", - "payment_id": "ewc_7827b97c-ac28-4a2e-804a-ac2acec7fd16", - "invoice_id": "624cfc01e44daa21f0430c71", - "amount": 100, - "payment_method_type": "EWALLET", - "channel_code": "SHOPEEPAY", - "country": "ID", - "currency": "IDR", - "status": "PENDING", - "reason": "CANCELLATION", - "reference_id": "403fe54b-2f8d-47bd-9454-41e3e19f5bf0", - "failure_code": None, - "refund_fee_amount": None, - "created": "2022-04-06T02:37:51.420645208Z", - "updated": "2022-04-06T02:37:51.420645388Z", - "metadata": None - } diff --git a/tests/sampleresponse/retail_outlet.py b/tests/sampleresponse/retail_outlet.py deleted file mode 100644 index 1f157eb3..00000000 --- a/tests/sampleresponse/retail_outlet.py +++ /dev/null @@ -1,32 +0,0 @@ -def retail_outlet_response(): - return { - "owner_id": "5ed75086a883856178afc12e", - "external_id": "demo_fixed_payment_code_123", - "retail_outlet_name": "ALFAMART", - "prefix": "TEST", - "name": "Rika Sutanto", - "payment_code": "TEST56147", - "expected_amount": 10000, - "is_single_use": False, - "expiration_date": "2051-06-23T17:00:00.000Z", - "id": "5ef2f0f8e7f5c14077275493", - "status": "ACTIVE", - "type": "USER", - } - - -def retail_outlet_update_response(): - return { - "owner_id": "5ed75086a883856178afc12e", - "external_id": "demo_fixed_payment_code_123", - "retail_outlet_name": "ALFAMART", - "prefix": "TEST", - "name": "Joe Contini", - "payment_code": "TEST56147", - "expected_amount": 10000, - "is_single_use": False, - "expiration_date": "2051-06-23T17:00:00.000Z", - "id": "5ef2f0f8e7f5c14077275493", - "status": "ACTIVE", - "type": "USER", - } diff --git a/tests/sampleresponse/virtual_account.py b/tests/sampleresponse/virtual_account.py deleted file mode 100644 index db9acf8f..00000000 --- a/tests/sampleresponse/virtual_account.py +++ /dev/null @@ -1,40 +0,0 @@ -def virtual_account_response(): - return { - "owner_id": "5ed75086a883856178afc12e", - "external_id": "demo_1475459775872", - "bank_code": "BNI", - "merchant_code": "8808", - "name": "Rika Sutanto", - "account_number": "8808999938311321", - "is_single_use": False, - "status": "PENDING", - "expiration_date": "2051-06-18T17:00:00.000Z", - "is_closed": False, - "id": "5eec6cdc787210324084cff8", - "currency": "IDR", - } - - -def virtual_account_banks_response(): - return [ - {"name": "Bank Mandiri", "code": "MANDIRI"}, - {"name": "Bank Negara Indonesia", "code": "BNI"}, - {"name": "Bank Rakyat Indonesia", "code": "BRI"}, - {"name": "Bank Permata", "code": "PERMATA"}, - {"name": "Bank Central Asia", "code": "BCA"}, - ] - - -def virtual_account_payment_response(): - return { - "id": "598d91b1191029596846047f", - "payment_id": "1502450097080", - "callback_virtual_account_id": "598d5f71bf64853820c49a18", - "external_id": "demo-1502437214715", - "merchant_code": "77517", - "account_number": "1000016980", - "bank_code": "BNI", - "amount": 5000, - "transaction_timestamp": "2017-08-11T11:14:57.080Z", - "currency": "IDR", - } diff --git a/tests/sampleresponse/xenplatform.py b/tests/sampleresponse/xenplatform.py deleted file mode 100644 index 65bb3c5f..00000000 --- a/tests/sampleresponse/xenplatform.py +++ /dev/null @@ -1,30 +0,0 @@ -def xenplatform_account_response(): - return { - "account_email": "test-xenplatform@pythonxendit.co", - "user_id": "5f2132ed172cd67992c402d6", - "created": "2020-07-29T08:27:25.346Z", - "status": "SUCCESSFUL", - "type": "OWNED", - } - - -def xenplatform_callback_url_response(): - return { - "status": "SUCCESSFUL", - "user_id": "5e6b30d967627b957de8c123", - "url": "https://test-url-invoice.com", - "environment": "TEST", - "callback_token": "66a6680348e1c33ed2b9053a8eb9291b9e2230ff4f4d3057c9f4ac26405d2123", - } - - -def xenplatform_transfers_response(): - return { - "created": "2020-01-01T08:51:44.484Z", - "transfer_id": "60b9d810-d9a3-456c-abbf-2786ec7a9651", - "reference": "transfer001", - "source_user_id": "54afeb170a2b18519b1b8768", - "destination_user_id": "5cafeb170a2b1851246b8768", - "status": "SUCCESSFUL", - "amount": 10000, - } diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py deleted file mode 100644 index b0360c03..00000000 --- a/tests/unit/conftest.py +++ /dev/null @@ -1,18 +0,0 @@ -import pytest - - -@pytest.fixture -def mock_correct_response(mocker, request): - resp = mocker.Mock() - resp.status_code = 200 - resp.body = request.param - return resp - - -@pytest.fixture -def mock_error_request_response(mocker): - resp = mocker.Mock() - resp.status_code = 404 - resp.headers = "" - resp.body = {"error_code": "error_code", "message": "Wrong message"} - return resp diff --git a/tests/unit/models/__init__.py b/tests/unit/models/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/unit/models/balance/__init__.py b/tests/unit/models/balance/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/unit/models/balance/test_balance.py b/tests/unit/models/balance/test_balance.py deleted file mode 100644 index ed7893de..00000000 --- a/tests/unit/models/balance/test_balance.py +++ /dev/null @@ -1,58 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.balance import balance_response -from xendit.models import Balance, BalanceAccountType - - -# fmt: off -class TestGetBalance(ModelBaseTest): - @pytest.fixture - def default_balance_data(self): - tested_class = Balance - class_name = "Balance" - method_name = "get" - http_method_name = "get" - args = () - kwargs = { - 'account_type': BalanceAccountType.CASH, - 'for_user_id': 'test-123', - } - params = (args, kwargs) - url = f"/balance?account_type={kwargs['account_type'].value}" - expected_correct_result = balance_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_balance_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_balance_data - headers = {'for-user-id': 'test-123'} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [balance_response()], indirect=True) - def test_return_balance_on_correct_params( - self, mocker, mock_correct_response, default_balance_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_balance_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_balance_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_balance_data) - - @pytest.mark.parametrize("mock_correct_response", [balance_response()], indirect=True) - def test_return_balance_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_balance_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_balance_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_balance_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_balance_data) - - @pytest.mark.parametrize("mock_correct_response", [balance_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) - -# fmt: on diff --git a/tests/unit/models/batchdisbursement/__init__.py b/tests/unit/models/batchdisbursement/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/unit/models/batchdisbursement/test_create_batch_disbursement.py b/tests/unit/models/batchdisbursement/test_create_batch_disbursement.py deleted file mode 100644 index 7095bc83..00000000 --- a/tests/unit/models/batchdisbursement/test_create_batch_disbursement.py +++ /dev/null @@ -1,83 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.batch_disbursement import batch_disbursement_response -from xendit.models import BatchDisbursement - - -# fmt: off -class TestCreateBatchDisbursement(ModelBaseTest): - @pytest.fixture - def default_batch_disbursement_data(self): - tested_class = BatchDisbursement - class_name = "BatchDisbursement" - method_name = "create" - http_method_name = "post" - - batch_disbursement_items = [] - batch_disbursement_items.append( - BatchDisbursement.helper_create_batch_item( - amount=10000, - bank_code="BCA", - bank_account_name="Adyaksa W", - bank_account_number="12345678", - description="Sample Batch Disbursement", - external_id="batch-disbursement-item-12345", - ) - ) - args = () - kwargs = { - "reference": "batch_disbursement-12345", - "disbursements": batch_disbursement_items, - "x_idempotency_key": "test_idemp_123", - } - params = (args, kwargs) - url = "/batch_disbursements" - expected_correct_result = batch_disbursement_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_batch_disbursement_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_batch_disbursement_data - headers = {"X-IDEMPOTENCY-KEY": "test_idemp_123"} - body = { - "reference": "batch_disbursement-12345", - "disbursements": [ - { - "amount": 10000, - "bank_code": "BCA", - "bank_account_name": "Adyaksa W", - "bank_account_number": "12345678", - "description": "Sample Batch Disbursement", - "external_id": "batch-disbursement-item-12345", - } - ] - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [batch_disbursement_response()], indirect=True) - def test_return_batch_disbursement_on_correct_params( - self, mocker, mock_correct_response, default_batch_disbursement_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_batch_disbursement_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_batch_disbursement_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_batch_disbursement_data) - - @pytest.mark.parametrize("mock_correct_response", [batch_disbursement_response()], indirect=True) - def test_return_batch_disbursement_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_batch_disbursement_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_batch_disbursement_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_batch_disbursement_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_batch_disbursement_data) - - @pytest.mark.parametrize("mock_correct_response", [batch_disbursement_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) - -# fmt: on diff --git a/tests/unit/models/cardlesscredit/__init__.py b/tests/unit/models/cardlesscredit/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/unit/models/cardlesscredit/test_calculate_payment_type.py b/tests/unit/models/cardlesscredit/test_calculate_payment_type.py deleted file mode 100644 index 793712b3..00000000 --- a/tests/unit/models/cardlesscredit/test_calculate_payment_type.py +++ /dev/null @@ -1,85 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.cardless_credit import cardless_credit_payment_response -from xendit.models import CardlessCredit, CardlessCreditType - - -# fmt: off -class TestCalculatePaymentType(ModelBaseTest): - @pytest.fixture - def default_cardless_credit_data(self): - tested_class = CardlessCredit - class_name = "CardlessCredit" - method_name = "calculate_payment_type" - http_method_name = "post" - - cardless_credit_items = [] - cardless_credit_items.append( - CardlessCredit.helper_create_item( - id="item-123", - name="Phone Case", - price=200000, - type="Smartphone", - url="http://example.com/phone/phone_case", - quantity=2, - ) - ) - args = () - kwargs = { - "cardless_credit_type": CardlessCreditType.KREDIVO, - "amount": 10000, - "items": cardless_credit_items, - "x_idempotency_key": "test_idemp_123" - } - params = (args, kwargs) - url = "/cardless-credit/payment-types" - expected_correct_result = cardless_credit_payment_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_cardless_credit_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_cardless_credit_data - headers = {"X-IDEMPOTENCY-KEY": "test_idemp_123"} - body = { - "cardless_credit_type": "KREDIVO", - "amount": 10000, - "items": [ - { - "id": "item-123", - "name": "Phone Case", - "price": 200000, - "type": "Smartphone", - "url": "http://example.com/phone/phone_case", - "quantity": 2, - } - ], - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [cardless_credit_payment_response()], indirect=True) - def test_return_cardless_credit_payment_types_on_correct_params( - self, mocker, mock_correct_response, default_cardless_credit_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_cardless_credit_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_cardless_credit_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_cardless_credit_data) - - @pytest.mark.parametrize("mock_correct_response", [cardless_credit_payment_response()], indirect=True) - def test_return_cardless_credit_payment_types_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_cardless_credit_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_cardless_credit_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_cardless_credit_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_cardless_credit_data) - - @pytest.mark.parametrize("mock_correct_response", [cardless_credit_payment_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) - -# fmt: on diff --git a/tests/unit/models/cardlesscredit/test_create_payment.py b/tests/unit/models/cardlesscredit/test_create_payment.py deleted file mode 100644 index 7fc71d74..00000000 --- a/tests/unit/models/cardlesscredit/test_create_payment.py +++ /dev/null @@ -1,125 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.cardless_credit import cardless_credit_payment_response -from xendit.models import CardlessCredit, CardlessCreditType - - -# fmt: off -class TestCreateCardlessCreditPayment(ModelBaseTest): - @pytest.fixture - def default_cardless_credit_data(self): - tested_class = CardlessCredit - class_name = "CardlessCredit" - method_name = "create_payment" - http_method_name = "post" - - cardless_credit_items = [] - cardless_credit_items.append( - CardlessCredit.helper_create_item( - id="item-123", - name="Phone Case", - price=200000, - type="Smartphone", - url="http://example.com/phone/phone_case", - quantity=2, - ) - ) - shipping_address = CardlessCredit.helper_create_shipping_address( - first_name="first name", - last_name="last name", - address="Jl Teknologi No. 12", - city="Jakarta", - postal_code="12345", - phone="081513114262", - country_code="IDN", - ) - customer_details = CardlessCredit.helper_create_customer_details( - first_name="customer first name", - last_name="customer last name", - email="customer@email.com", - phone="0812332145", - ) - args = () - kwargs = { - "cardless_credit_type": CardlessCreditType.KREDIVO, - "external_id": "mock-id-123", - "amount": 10000, - "payment_type": "3_months", - "items": cardless_credit_items, - "customer_details": customer_details, - "shipping_address": shipping_address, - "redirect_url": "https://mock-my-shop.com/home", - "callback_url": "https://mock-my-shop.com/callback", - "x_idempotency_key": "test_idemp_123", - } - params = (args, kwargs) - url = "/cardless-credit" - expected_correct_result = cardless_credit_payment_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_cardless_credit_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_cardless_credit_data - headers = {"X-IDEMPOTENCY-KEY": "test_idemp_123"} - body = { - "cardless_credit_type": "KREDIVO", - "external_id": "mock-id-123", - "amount": 10000, - "payment_type": "3_months", - "items": [ - { - "id": "item-123", - "name": "Phone Case", - "price": 200000, - "type": "Smartphone", - "url": "http://example.com/phone/phone_case", - "quantity": 2, - } - ], - "customer_details": { - "first_name": "customer first name", - "last_name": "customer last name", - "email": "customer@email.com", - "phone": "0812332145", - }, - "shipping_address": { - "first_name": "first name", - "last_name": "last name", - "address": "Jl Teknologi No. 12", - "city": "Jakarta", - "postal_code": "12345", - "phone": "081513114262", - "country_code": "IDN", - }, - "redirect_url": "https://mock-my-shop.com/home", - "callback_url": "https://mock-my-shop.com/callback", - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [cardless_credit_payment_response()], indirect=True) - def test_return_cardless_credit_payment_on_correct_params( - self, mocker, mock_correct_response, default_cardless_credit_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_cardless_credit_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_cardless_credit_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_cardless_credit_data) - - @pytest.mark.parametrize("mock_correct_response", [cardless_credit_payment_response()], indirect=True) - def test_return_cardless_credit_payment_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_cardless_credit_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_cardless_credit_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_cardless_credit_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_cardless_credit_data) - - @pytest.mark.parametrize("mock_correct_response", [cardless_credit_payment_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) - -# fmt: on diff --git a/tests/unit/models/creditcard/__init__.py b/tests/unit/models/creditcard/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/unit/models/creditcard/test_capture_charge.py b/tests/unit/models/creditcard/test_capture_charge.py deleted file mode 100644 index 8afe58b0..00000000 --- a/tests/unit/models/creditcard/test_capture_charge.py +++ /dev/null @@ -1,60 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.credit_card import charge_response -from xendit.models import CreditCard - - -# fmt: off -class TestCaptureCharge(ModelBaseTest): - @pytest.fixture - def default_credit_card_data(self): - tested_class = CreditCard - class_name = "CreditCard" - method_name = "capture_charge" - http_method_name = "post" - args = () - kwargs = { - "credit_card_charge_id": "mock_charge_id-123", - "amount": 75000, - "x_idempotency_key": "test-idemp_123", - } - params = (args, kwargs) - url = f"/credit_card_charges/{kwargs['credit_card_charge_id']}/capture" - expected_correct_result = charge_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_credit_card_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_credit_card_data - headers = {"X-IDEMPOTENCY-KEY": "test-idemp_123"} - body = { - "amount": 75000, - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [charge_response()], indirect=True) - def test_return_charge_on_correct_params( - self, mocker, mock_correct_response, default_credit_card_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_credit_card_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_credit_card_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_credit_card_data) - - @pytest.mark.parametrize("mock_correct_response", [charge_response()], indirect=True) - def test_return_charge_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_credit_card_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_credit_card_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_credit_card_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_credit_card_data) - - @pytest.mark.parametrize("mock_correct_response", [charge_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/creditcard/test_create_authorization.py b/tests/unit/models/creditcard/test_create_authorization.py deleted file mode 100644 index 7656d6e7..00000000 --- a/tests/unit/models/creditcard/test_create_authorization.py +++ /dev/null @@ -1,72 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.credit_card import charge_response -from xendit.models import CreditCard - - -# fmt: off -class TestCreateAuthorization(ModelBaseTest): - @pytest.fixture - def default_credit_card_data(self): - tested_class = CreditCard - class_name = "CreditCard" - method_name = "create_authorization" - http_method_name = "post" - args = () - kwargs = { - "token_id": "mock-token123", - "external_id": "mock_card_preAuth-123", - "amount": 75000, - "card_cvn": "123", - "x_idempotency_key": "test-idemp_123", - "metadata": { - "meta": "data", - }, - } - params = (args, kwargs) - url = "/credit_card_charges" - expected_correct_result = charge_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_credit_card_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_credit_card_data - headers = {"X-IDEMPOTENCY-KEY": "test-idemp_123"} - body = { - "token_id": "mock-token123", - "capture": False, - "external_id": "mock_card_preAuth-123", - "amount": 75000, - "card_cvn": "123", - "metadata": { - "meta": "data", - }, - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [charge_response()], indirect=True) - def test_return_charge_on_correct_params( - self, mocker, mock_correct_response, default_credit_card_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_credit_card_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_credit_card_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_credit_card_data) - - @pytest.mark.parametrize("mock_correct_response", [charge_response()], indirect=True) - def test_return_charge_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_credit_card_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_credit_card_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_credit_card_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_credit_card_data) - - @pytest.mark.parametrize("mock_correct_response", [charge_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/creditcard/test_create_charge.py b/tests/unit/models/creditcard/test_create_charge.py deleted file mode 100644 index a6cce1bc..00000000 --- a/tests/unit/models/creditcard/test_create_charge.py +++ /dev/null @@ -1,101 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.credit_card import charge_response -from xendit.models import CreditCard - - -# fmt: off -class TestCreateCharge(ModelBaseTest): - def helper(self): - address = CreditCard.helper_create_address(country="Indonesia") - billing_details = CreditCard.helper_create_billing_details( - given_names="Adyaksa", address=address - ) - installment = CreditCard.helper_create_installment(count=1, interval="month") - promotion = CreditCard.helper_create_charge_promotion( - reference_id="Xendit-123", original_amount=75000 - ) - return billing_details, installment, promotion - - @pytest.fixture - def default_credit_card_data(self): - tested_class = CreditCard - class_name = "CreditCard" - method_name = "create_charge" - http_method_name = "post" - billing_details, installment, promotion = self.helper() - args = () - kwargs = { - "token_id": "mock_token-id-123", - "external_id": "mock_card_charge-123", - "amount": 75000, - "card_cvn": "123", - "x_idempotency_key": "test-idemp_123", - "billing_details": billing_details, - "installment": installment, - "promotion": promotion, - "metadata": { - "meta": "data", - }, - } - params = (args, kwargs) - url = "/credit_card_charges" - expected_correct_result = charge_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_credit_card_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_credit_card_data - headers = {"X-IDEMPOTENCY-KEY": "test-idemp_123"} - body = { - "token_id": "mock_token-id-123", - "capture": True, - "external_id": "mock_card_charge-123", - "amount": 75000, - "card_cvn": "123", - "billing_details": { - "given_names": "Adyaksa", - "address": { - "country": "Indonesia" - } - }, - "installment": { - "count": 1, - "interval": "month", - }, - "promotion": { - "reference_id": "Xendit-123", - "original_amount": 75000 - }, - "metadata": { - "meta": "data", - }, - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [charge_response()], indirect=True) - def test_return_charge_on_correct_params( - self, mocker, mock_correct_response, default_credit_card_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_credit_card_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_credit_card_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_credit_card_data) - - @pytest.mark.parametrize("mock_correct_response", [charge_response()], indirect=True) - def test_return_charge_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_credit_card_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_credit_card_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_credit_card_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_credit_card_data) - - @pytest.mark.parametrize("mock_correct_response", [charge_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/creditcard/test_create_promotion.py b/tests/unit/models/creditcard/test_create_promotion.py deleted file mode 100644 index 5e44dd0f..00000000 --- a/tests/unit/models/creditcard/test_create_promotion.py +++ /dev/null @@ -1,68 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.credit_card import promotion_response -from xendit.models import CreditCard - - -# fmt: off -class TestCreatePromotion(ModelBaseTest): - @pytest.fixture - def default_credit_card_data(self): - tested_class = CreditCard - class_name = "CreditCard" - method_name = "create_promotion" - http_method_name = "post" - args = () - kwargs = { - "reference_id": "mock_promotion_reference_id-123", - "description": "20% discount applied for all BRI cards", - "discount_amount": 10000, - "bin_list": ["400000", "460000"], - "start_time": "2020-01-01T00:00:00.000Z", - "end_time": "2021-01-01T00:00:00.000Z", - } - params = (args, kwargs) - url = "/promotions" - expected_correct_result = promotion_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_credit_card_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_credit_card_data - headers = {} - body = { - "reference_id": "mock_promotion_reference_id-123", - "description": "20% discount applied for all BRI cards", - "discount_amount": 10000, - "bin_list": ["400000", "460000"], - "start_time": "2020-01-01T00:00:00.000Z", - "end_time": "2021-01-01T00:00:00.000Z", - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [promotion_response()], indirect=True) - def test_return_promotion_on_correct_params( - self, mocker, mock_correct_response, default_credit_card_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_credit_card_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_credit_card_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_credit_card_data) - - @pytest.mark.parametrize("mock_correct_response", [promotion_response()], indirect=True) - def test_return_promotion_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_credit_card_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_credit_card_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_credit_card_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_credit_card_data) - - @pytest.mark.parametrize("mock_correct_response", [promotion_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/creditcard/test_create_refund.py b/tests/unit/models/creditcard/test_create_refund.py deleted file mode 100644 index 8d21fbdb..00000000 --- a/tests/unit/models/creditcard/test_create_refund.py +++ /dev/null @@ -1,61 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.credit_card import charge_response -from xendit.models import CreditCard - - -# fmt: off -class TestCreateRefund(ModelBaseTest): - @pytest.fixture - def default_credit_card_data(self): - tested_class = CreditCard - class_name = "CreditCard" - method_name = "create_refund" - http_method_name = "post" - args = () - kwargs = { - "credit_card_charge_id": "mock-charge-id-123", - "amount": 10000, - "external_id": "mock_card_refund-123", - } - params = (args, kwargs) - url = f"/credit_card_charges/{kwargs['credit_card_charge_id']}/refunds" - expected_correct_result = charge_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_credit_card_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_credit_card_data - headers = {} - body = { - "amount": 10000, - "external_id": "mock_card_refund-123", - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [charge_response()], indirect=True) - def test_return_refund_on_correct_params( - self, mocker, mock_correct_response, default_credit_card_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_credit_card_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_credit_card_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_credit_card_data) - - @pytest.mark.parametrize("mock_correct_response", [charge_response()], indirect=True) - def test_return_refund_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_credit_card_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_credit_card_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_credit_card_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_credit_card_data) - - @pytest.mark.parametrize("mock_correct_response", [charge_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/creditcard/test_get_charge.py b/tests/unit/models/creditcard/test_get_charge.py deleted file mode 100644 index def81d4f..00000000 --- a/tests/unit/models/creditcard/test_get_charge.py +++ /dev/null @@ -1,56 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.credit_card import charge_response -from xendit.models import CreditCard - - -# fmt: off -class TestGetCharge(ModelBaseTest): - @pytest.fixture - def default_credit_card_data(self): - tested_class = CreditCard - class_name = "CreditCard" - method_name = "get_charge" - http_method_name = "get" - args = () - kwargs = { - "credit_card_charge_id": "mock_charge_id-123", - } - params = (args, kwargs) - url = f"/credit_card_charges/{kwargs['credit_card_charge_id']}" - expected_correct_result = charge_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_credit_card_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_credit_card_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [charge_response()], indirect=True) - def test_return_charge_on_correct_params( - self, mocker, mock_correct_response, default_credit_card_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_credit_card_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_credit_card_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_credit_card_data) - - @pytest.mark.parametrize("mock_correct_response", [charge_response()], indirect=True) - def test_return_charge_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_credit_card_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_credit_card_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_credit_card_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_credit_card_data) - - @pytest.mark.parametrize("mock_correct_response", [charge_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/creditcard/test_reverse_authorization.py b/tests/unit/models/creditcard/test_reverse_authorization.py deleted file mode 100644 index 28ca2411..00000000 --- a/tests/unit/models/creditcard/test_reverse_authorization.py +++ /dev/null @@ -1,60 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.credit_card import reverse_auth_response -from xendit.models import CreditCard - - -# fmt: off -class TestReverseAuthorization(ModelBaseTest): - @pytest.fixture - def default_credit_card_data(self): - tested_class = CreditCard - class_name = "CreditCard" - method_name = "reverse_authorization" - http_method_name = "post" - args = () - kwargs = { - "credit_card_charge_id": "mock_token-123", - "external_id": "mock_reverse-authorization-123", - "x_idempotency_key": "test-idemp_123", - } - params = (args, kwargs) - url = f"/credit_card_charges/{kwargs['credit_card_charge_id']}/auth_reversal" - expected_correct_result = reverse_auth_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_credit_card_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_credit_card_data - headers = {"X-IDEMPOTENCY-KEY": "test-idemp_123"} - body = { - "external_id": "mock_reverse-authorization-123", - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [reverse_auth_response()], indirect=True) - def test_return_reverse_authorization_on_correct_params( - self, mocker, mock_correct_response, default_credit_card_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_credit_card_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_credit_card_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_credit_card_data) - - @pytest.mark.parametrize("mock_correct_response", [reverse_auth_response()], indirect=True) - def test_return_reverse_authorization_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_credit_card_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_credit_card_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_credit_card_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_credit_card_data) - - @pytest.mark.parametrize("mock_correct_response", [reverse_auth_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/directdebit/__init__.py b/tests/unit/models/directdebit/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/unit/models/directdebit/test_create_customer.py b/tests/unit/models/directdebit/test_create_customer.py deleted file mode 100644 index 8f0e5136..00000000 --- a/tests/unit/models/directdebit/test_create_customer.py +++ /dev/null @@ -1,72 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.direct_debit import customer_response -from xendit.models import DirectDebit - - -# fmt: off -class TestCreateCustomer(ModelBaseTest): - @pytest.fixture - def default_customer_data(self): - tested_class = DirectDebit - class_name = "DirectDebit" - method_name = "create_customer" - http_method_name = "post" - addresses = [DirectDebit.helper_create_customer_address( - country="ID", - )] - args = () - kwargs = { - "reference_id": "mock-merc-123", - "email": "t@x.co", - "given_names": "Adyaksa", - "x_idempotency_key": "test-idemp_123", - "addresses": addresses, - } - params = (args, kwargs) - url = "/customers" - expected_correct_result = customer_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_customer_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_customer_data - headers = {"X-IDEMPOTENCY-KEY": "test-idemp_123"} - body = { - "reference_id": "mock-merc-123", - "email": "t@x.co", - "given_names": "Adyaksa", - "addresses": [ - { - "country": "ID", - }, - ] - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [customer_response()], indirect=True) - def test_return_customer_on_correct_params( - self, mocker, mock_correct_response, default_customer_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_customer_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_customer_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_customer_data) - - @pytest.mark.parametrize("mock_correct_response", [customer_response()], indirect=True) - def test_return_customer_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_customer_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_customer_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_customer_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_customer_data) - - @pytest.mark.parametrize("mock_correct_response", [customer_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/directdebit/test_create_payment.py b/tests/unit/models/directdebit/test_create_payment.py deleted file mode 100644 index cf5ec7d7..00000000 --- a/tests/unit/models/directdebit/test_create_payment.py +++ /dev/null @@ -1,80 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.direct_debit import payment_response -from xendit.models import DirectDebit - - -# fmt: off -class TestCreatePayment(ModelBaseTest): - @pytest.fixture - def default_direct_debit_payment_data(self): - tested_class = DirectDebit - class_name = "DirectDebit" - method_name = "create_payment" - http_method_name = "post" - basket = DirectDebit.helper_create_basket( - reference_id="mock-basket-123", - name="Mock item", - market="ID", - type="Mock type" - ) - args = () - kwargs = { - "reference_id": "mock-direct-debit-ref-123", - "payment_method_id": "pm-b6116aea-8c23-42d0-a1e6-33227b52fccd", - "currency": "IDR", - "amount": "60000", - "callback_url": "http://webhook.site/", - "idempotency_key": "idemp_key", - "basket": basket, - } - params = (args, kwargs) - url = "/direct_debits" - expected_correct_result = payment_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_direct_debit_payment_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_direct_debit_payment_data - headers = {"Idempotency-key": "idemp_key"} - body = { - "reference_id": "mock-direct-debit-ref-123", - "payment_method_id": "pm-b6116aea-8c23-42d0-a1e6-33227b52fccd", - "currency": "IDR", - "amount": "60000", - "callback_url": "http://webhook.site/", - "basket": { - "reference_id": "mock-basket-123", - "name": "Mock item", - "market": "ID", - "type": "Mock type", - } - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [payment_response()], indirect=True) - def test_return_direct_debit_payment_on_correct_params( - self, mocker, mock_correct_response, default_direct_debit_payment_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_direct_debit_payment_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_direct_debit_payment_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_direct_debit_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_response()], indirect=True) - def test_return_direct_debit_payment_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_direct_debit_payment_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_direct_debit_payment_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_direct_debit_payment_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_direct_debit_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/directdebit/test_create_payment_method.py b/tests/unit/models/directdebit/test_create_payment_method.py deleted file mode 100644 index c5522680..00000000 --- a/tests/unit/models/directdebit/test_create_payment_method.py +++ /dev/null @@ -1,67 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.direct_debit import payment_method_response -from xendit.models import DirectDebit, DirectDebitPaymentMethodType - - -# fmt: off -class TestCreatePaymentMethod(ModelBaseTest): - @pytest.fixture - def default_payment_method_data(self): - tested_class = DirectDebit - class_name = "DirectDebit" - method_name = "create_payment_method" - http_method_name = "post" - properties = DirectDebit.helper_create_payment_method_properties( - id='la-fac7e744-ab40-4100-a447-cbbb16f29ded', - ) - args = () - kwargs = { - "customer_id": "ed20b5db-df04-41fc-8018-8ea4ac4d1030", - "type": DirectDebitPaymentMethodType.DEBIT_CARD, - "properties": properties, - } - params = (args, kwargs) - url = "/payment_methods" - expected_correct_result = payment_method_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_payment_method_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_payment_method_data - headers = {} - body = { - "customer_id": "ed20b5db-df04-41fc-8018-8ea4ac4d1030", - "type": "DEBIT_CARD", - "properties": { - 'id': 'la-fac7e744-ab40-4100-a447-cbbb16f29ded' - }, - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [payment_method_response()], indirect=True) - def test_return_payment_method_on_correct_params( - self, mocker, mock_correct_response, default_payment_method_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_payment_method_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_payment_method_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_payment_method_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_method_response()], indirect=True) - def test_return_payment_method_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_payment_method_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_payment_method_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_payment_method_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_payment_method_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_method_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/directdebit/test_get_accessible_accounts_by_token.py b/tests/unit/models/directdebit/test_get_accessible_accounts_by_token.py deleted file mode 100644 index f492339c..00000000 --- a/tests/unit/models/directdebit/test_get_accessible_accounts_by_token.py +++ /dev/null @@ -1,56 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.direct_debit import accessible_accounts_response -from xendit.models import DirectDebit - - -# fmt: off -class TestGetAccessibleAccountsByToken(ModelBaseTest): - @pytest.fixture - def default_linked_account_token_data(self): - tested_class = DirectDebit - class_name = "DirectDebit" - method_name = "get_accessible_accounts_by_token" - http_method_name = "get" - args = () - kwargs = { - "linked_account_token_id": "lat-afcfde47-18e0-4d68-bf1b-c729a5d8e54a", - } - params = (args, kwargs) - url = f"/linked_account_tokens/{kwargs['linked_account_token_id']}/accounts" - expected_correct_result = accessible_accounts_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_linked_account_token_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_linked_account_token_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [accessible_accounts_response()], indirect=True) - def test_return_accessible_accounts_on_correct_params( - self, mocker, mock_correct_response, default_linked_account_token_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_linked_account_token_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_linked_account_token_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_linked_account_token_data) - - @pytest.mark.parametrize("mock_correct_response", [accessible_accounts_response()], indirect=True) - def test_return_accessible_accounts_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_linked_account_token_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_linked_account_token_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_linked_account_token_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_linked_account_token_data) - - @pytest.mark.parametrize("mock_correct_response", [accessible_accounts_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/directdebit/test_get_customer_by_ref_id.py b/tests/unit/models/directdebit/test_get_customer_by_ref_id.py deleted file mode 100644 index 6050564f..00000000 --- a/tests/unit/models/directdebit/test_get_customer_by_ref_id.py +++ /dev/null @@ -1,56 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.direct_debit import multi_customer_response -from xendit.models import DirectDebit - - -# fmt: off -class TestGetCustomerByRefID(ModelBaseTest): - @pytest.fixture - def default_customer_data(self): - tested_class = DirectDebit - class_name = "DirectDebit" - method_name = "get_customer_by_ref_id" - http_method_name = "get" - args = () - kwargs = { - "reference_id": "mock-merc-123", - } - params = (args, kwargs) - url = f"/customers?reference_id={kwargs['reference_id']}" - expected_correct_result = multi_customer_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_customer_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_customer_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [multi_customer_response()], indirect=True) - def test_return_customer_on_correct_params( - self, mocker, mock_correct_response, default_customer_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_customer_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_customer_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_customer_data) - - @pytest.mark.parametrize("mock_correct_response", [multi_customer_response()], indirect=True) - def test_return_customer_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_customer_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_customer_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_customer_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_customer_data) - - @pytest.mark.parametrize("mock_correct_response", [multi_customer_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/directdebit/test_get_payment_methods_by_customer_id.py b/tests/unit/models/directdebit/test_get_payment_methods_by_customer_id.py deleted file mode 100644 index 13f516e7..00000000 --- a/tests/unit/models/directdebit/test_get_payment_methods_by_customer_id.py +++ /dev/null @@ -1,56 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.direct_debit import multi_payment_method_response -from xendit.models import DirectDebit - - -# fmt: off -class TestCreatePaymentMethod(ModelBaseTest): - @pytest.fixture - def default_payment_method_data(self): - tested_class = DirectDebit - class_name = "DirectDebit" - method_name = "get_payment_methods_by_customer_id" - http_method_name = "get" - args = () - kwargs = { - "customer_id": "ed20b5db-df04-41fc-8018-8ea4ac4d1030", - } - params = (args, kwargs) - url = f"/payment_methods?customer_id={kwargs['customer_id']}" - expected_correct_result = multi_payment_method_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_payment_method_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_payment_method_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [multi_payment_method_response()], indirect=True) - def test_return_payment_method_on_correct_params( - self, mocker, mock_correct_response, default_payment_method_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_payment_method_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_payment_method_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_payment_method_data) - - @pytest.mark.parametrize("mock_correct_response", [multi_payment_method_response()], indirect=True) - def test_return_payment_method_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_payment_method_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_payment_method_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_payment_method_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_payment_method_data) - - @pytest.mark.parametrize("mock_correct_response", [multi_payment_method_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/directdebit/test_get_payment_status.py b/tests/unit/models/directdebit/test_get_payment_status.py deleted file mode 100644 index cbea8e93..00000000 --- a/tests/unit/models/directdebit/test_get_payment_status.py +++ /dev/null @@ -1,56 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.direct_debit import payment_response -from xendit.models import DirectDebit - - -# fmt: off -class TestGetPaymentStatus(ModelBaseTest): - @pytest.fixture - def default_direct_debit_payment_data(self): - tested_class = DirectDebit - class_name = "DirectDebit" - method_name = "get_payment_status" - http_method_name = "get" - args = () - kwargs = { - "direct_debit_id": "mock-direct-debit-ref-123", - } - params = (args, kwargs) - url = f"/direct_debits/{kwargs['direct_debit_id']}/" - expected_correct_result = payment_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_direct_debit_payment_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_direct_debit_payment_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [payment_response()], indirect=True) - def test_return_direct_debit_payment_on_correct_params( - self, mocker, mock_correct_response, default_direct_debit_payment_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_direct_debit_payment_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_direct_debit_payment_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_direct_debit_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_response()], indirect=True) - def test_return_direct_debit_payment_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_direct_debit_payment_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_direct_debit_payment_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_direct_debit_payment_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_direct_debit_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/directdebit/test_get_payment_status_by_ref_id.py b/tests/unit/models/directdebit/test_get_payment_status_by_ref_id.py deleted file mode 100644 index 9f88b479..00000000 --- a/tests/unit/models/directdebit/test_get_payment_status_by_ref_id.py +++ /dev/null @@ -1,56 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.direct_debit import multi_payment_response -from xendit.models import DirectDebit - - -# fmt: off -class TestGetPaymentStatusByRefID(ModelBaseTest): - @pytest.fixture - def default_direct_debit_payment_data(self): - tested_class = DirectDebit - class_name = "DirectDebit" - method_name = "get_payment_status_by_ref_id" - http_method_name = "get" - args = () - kwargs = { - "reference_id": "mock-direct-debit-ref-123", - } - params = (args, kwargs) - url = f"/direct_debits?reference_id={kwargs['reference_id']}" - expected_correct_result = multi_payment_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_direct_debit_payment_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_direct_debit_payment_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [multi_payment_response()], indirect=True) - def test_return_direct_debit_payment_on_correct_params( - self, mocker, mock_correct_response, default_direct_debit_payment_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_direct_debit_payment_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_direct_debit_payment_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_direct_debit_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [multi_payment_response()], indirect=True) - def test_return_direct_debit_payment_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_direct_debit_payment_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_direct_debit_payment_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_direct_debit_payment_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_direct_debit_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [multi_payment_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/directdebit/test_initialize_tokenization.py b/tests/unit/models/directdebit/test_initialize_tokenization.py deleted file mode 100644 index 907d22b7..00000000 --- a/tests/unit/models/directdebit/test_initialize_tokenization.py +++ /dev/null @@ -1,97 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.direct_debit import linked_account_response -from xendit.models import DirectDebit - - -# fmt: off -class TestInitializeTokenization(ModelBaseTest): - @pytest.fixture - def default_linked_account_data(self): - tested_class = DirectDebit - class_name = "DirectDebit" - method_name = "initialize_tokenization" - http_method_name = "post" - card_linking = DirectDebit.helper_create_card_link( - account_mobile_number="+62818555988", - card_last_four="8888", - card_expiry="06/24", - account_email="test.email@xendit.co", - ) - - args = () - kwargs = { - "customer_id": "ed20b5db-df04-41fc-8018-8ea4ac4d1030", - "channel_code": "DC_BRI", - "properties": card_linking, - } - params = (args, kwargs) - url = "/linked_account_tokens/auth" - expected_correct_result = linked_account_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data_card(self, default_linked_account_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_linked_account_data - headers = {} - body = { - "customer_id": "ed20b5db-df04-41fc-8018-8ea4ac4d1030", - "channel_code": "DC_BRI", - "properties": { - "account_mobile_number": "+62818555988", - "card_last_four": "8888", - "card_expiry": "06/24", - "account_email": "test.email@xendit.co", - }, - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.fixture - def api_requestor_request_data_online_bank(self, default_linked_account_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_linked_account_data - online_bank_linking = DirectDebit.helper_create_online_banking_link( - success_redirect_url="https://mock-test.co", - failure_redirect_url="https://mock-test.co", - ) - params[1]['properties'] = online_bank_linking - headers = {} - body = { - "customer_id": "ed20b5db-df04-41fc-8018-8ea4ac4d1030", - "channel_code": "DC_BRI", - "properties": { - "success_redirect_url": "https://mock-test.co", - "failure_redirect_url": "https://mock-test.co", - }, - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [linked_account_response()], indirect=True) - def test_return_linked_account_on_correct_params( - self, mocker, mock_correct_response, default_linked_account_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_linked_account_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_linked_account_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_linked_account_data) - - @pytest.mark.parametrize("mock_correct_response", [linked_account_response()], indirect=True) - def test_return_linked_account_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_linked_account_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_linked_account_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_linked_account_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_linked_account_data) - - @pytest.mark.parametrize("mock_correct_response", [linked_account_response()], indirect=True) - def test_send_correct_card_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data_card): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data_card) - - @pytest.mark.parametrize("mock_correct_response", [linked_account_response()], indirect=True) - def test_send_correct_online_bank_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data_online_bank): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data_online_bank) -# fmt: on diff --git a/tests/unit/models/directdebit/test_validate_payment_otp.py b/tests/unit/models/directdebit/test_validate_payment_otp.py deleted file mode 100644 index cdb0d99d..00000000 --- a/tests/unit/models/directdebit/test_validate_payment_otp.py +++ /dev/null @@ -1,60 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.direct_debit import payment_response -from xendit.models import DirectDebit - - -# fmt: off -class TestValidatePaymentOTP(ModelBaseTest): - @pytest.fixture - def default_direct_debit_payment_data(self): - tested_class = DirectDebit - class_name = "DirectDebit" - method_name = "validate_payment_otp" - http_method_name = "post" - args = () - kwargs = { - "direct_debit_id": "mock-direct-debit-ref-123", - "otp_code": "pm-b6116aea-8c23-42d0-a1e6-33227b52fccd", - "x_idempotency_key": "idemp_key", - } - params = (args, kwargs) - url = f"/direct_debits/{kwargs['direct_debit_id']}/validate_otp/" - expected_correct_result = payment_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_direct_debit_payment_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_direct_debit_payment_data - headers = {"X-IDEMPOTENCY-KEY": "idemp_key"} - body = { - "otp_code": "pm-b6116aea-8c23-42d0-a1e6-33227b52fccd", - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [payment_response()], indirect=True) - def test_return_direct_debit_payment_on_correct_params( - self, mocker, mock_correct_response, default_direct_debit_payment_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_direct_debit_payment_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_direct_debit_payment_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_direct_debit_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_response()], indirect=True) - def test_return_direct_debit_payment_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_direct_debit_payment_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_direct_debit_payment_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_direct_debit_payment_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_direct_debit_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/directdebit/test_validate_token_otp.py b/tests/unit/models/directdebit/test_validate_token_otp.py deleted file mode 100644 index ff2df9f7..00000000 --- a/tests/unit/models/directdebit/test_validate_token_otp.py +++ /dev/null @@ -1,59 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.direct_debit import linked_account_response -from xendit.models import DirectDebit - - -# fmt: off -class TestValidateTokenOTP(ModelBaseTest): - @pytest.fixture - def default_linked_account_token_data(self): - tested_class = DirectDebit - class_name = "DirectDebit" - method_name = "validate_token_otp" - http_method_name = "post" - args = () - kwargs = { - "linked_account_token_id": "lat-afcfde47-18e0-4d68-bf1b-c729a5d8e54a", - "otp_code": "333000" - } - params = (args, kwargs) - url = f"/linked_account_tokens/{kwargs['linked_account_token_id']}/validate_otp" - expected_correct_result = linked_account_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_linked_account_token_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_linked_account_token_data - headers = {} - body = { - "otp_code": "333000", - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [linked_account_response()], indirect=True) - def test_return_linked_account_token_on_correct_params( - self, mocker, mock_correct_response, default_linked_account_token_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_linked_account_token_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_linked_account_token_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_linked_account_token_data) - - @pytest.mark.parametrize("mock_correct_response", [linked_account_response()], indirect=True) - def test_return_linked_account_token_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_linked_account_token_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_linked_account_token_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_linked_account_token_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_linked_account_token_data) - - @pytest.mark.parametrize("mock_correct_response", [linked_account_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/disbursement/__init__.py b/tests/unit/models/disbursement/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/unit/models/disbursement/test_create_disbursement.py b/tests/unit/models/disbursement/test_create_disbursement.py deleted file mode 100644 index 6c99e214..00000000 --- a/tests/unit/models/disbursement/test_create_disbursement.py +++ /dev/null @@ -1,71 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.disbursement import disbursement_response -from xendit.models import Disbursement - - -# fmt: off -class TestCreateDisbursement(ModelBaseTest): - @pytest.fixture - def default_disbursement_data(self): - tested_class = Disbursement - class_name = "Disbursement" - method_name = "create" - http_method_name = "post" - args = () - kwargs = { - "external_id": "demo_1475459775872", - "bank_code": "BCA", - "account_holder_name": "Bob Jones", - "account_number": "1231242311", - "description": "Reimbursement for shoes", - "amount": 17000, - } - params = (args, kwargs) - url = "/disbursements" - expected_correct_result = disbursement_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_disbursement_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_disbursement_data - headers = {} - body = { - "external_id": "demo_1475459775872", - "bank_code": "BCA", - "account_holder_name": "Bob Jones", - "account_number": "1231242311", - "description": "Reimbursement for shoes", - "amount": 17000, - "email_bcc": [], - "email_cc": [], - "email_to": [], - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [disbursement_response()], indirect=True) - def test_return_disbursement_on_correct_params( - self, mocker, mock_correct_response, default_disbursement_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_disbursement_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_disbursement_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_disbursement_data) - - @pytest.mark.parametrize("mock_correct_response", [disbursement_response()], indirect=True) - def test_return_disbursement_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_disbursement_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_disbursement_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_disbursement_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_disbursement_data) - - @pytest.mark.parametrize("mock_correct_response", [disbursement_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/disbursement/test_get_disbursement.py b/tests/unit/models/disbursement/test_get_disbursement.py deleted file mode 100644 index 98620222..00000000 --- a/tests/unit/models/disbursement/test_get_disbursement.py +++ /dev/null @@ -1,54 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.disbursement import disbursement_response -from xendit.models import Disbursement - - -# fmt: off -class TestGetDisbursement(ModelBaseTest): - @pytest.fixture - def default_disbursement_data(self): - tested_class = Disbursement - class_name = "Disbursement" - method_name = "get" - http_method_name = "get" - args = () - kwargs = {"id": "5ef1befeecb16100179e1d05"} - params = (args, kwargs) - url = f"/disbursements/{kwargs['id']}" - expected_correct_result = disbursement_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_disbursement_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_disbursement_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [disbursement_response()], indirect=True) - def test_return_disbursement_on_correct_params( - self, mocker, mock_correct_response, default_disbursement_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_disbursement_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_disbursement_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_disbursement_data) - - @pytest.mark.parametrize("mock_correct_response", [disbursement_response()], indirect=True) - def test_return_disbursement_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_disbursement_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_disbursement_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_disbursement_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_disbursement_data) - - @pytest.mark.parametrize("mock_correct_response", [disbursement_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/disbursement/test_get_disbursement_available_banks.py b/tests/unit/models/disbursement/test_get_disbursement_available_banks.py deleted file mode 100644 index 1ca327ce..00000000 --- a/tests/unit/models/disbursement/test_get_disbursement_available_banks.py +++ /dev/null @@ -1,54 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.disbursement import disbursement_banks_response -from xendit.models import Disbursement - - -# fmt: off -class TestGetDisbursementAvailableBanks(ModelBaseTest): - @pytest.fixture - def default_disbursement_data(self): - tested_class = Disbursement - class_name = "Disbursement" - method_name = "get_available_banks" - http_method_name = "get" - args = () - kwargs = {} - params = (args, kwargs) - url = "/available_disbursements_banks" - expected_correct_result = disbursement_banks_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_disbursement_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_disbursement_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [disbursement_banks_response()], indirect=True) - def test_return_disbursement_on_correct_params( - self, mocker, mock_correct_response, default_disbursement_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_disbursement_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_disbursement_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_disbursement_data) - - @pytest.mark.parametrize("mock_correct_response", [disbursement_banks_response()], indirect=True) - def test_return_disbursement_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_disbursement_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_disbursement_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_disbursement_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_disbursement_data) - - @pytest.mark.parametrize("mock_correct_response", [disbursement_banks_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/disbursement/test_get_disbursement_by_ext_id.py b/tests/unit/models/disbursement/test_get_disbursement_by_ext_id.py deleted file mode 100644 index e38e16a2..00000000 --- a/tests/unit/models/disbursement/test_get_disbursement_by_ext_id.py +++ /dev/null @@ -1,54 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.disbursement import multi_disbursement_response -from xendit.models import Disbursement - - -# fmt: off -class TestGetDisbursementByExtId(ModelBaseTest): - @pytest.fixture - def default_disbursement_data(self): - tested_class = Disbursement - class_name = "Disbursement" - method_name = "get_by_ext_id" - http_method_name = "get" - args = () - kwargs = {"external_id": "demo_1475459775872"} - params = (args, kwargs) - url = f"/disbursements?external_id={kwargs['external_id']}" - expected_correct_result = multi_disbursement_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_disbursement_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_disbursement_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [multi_disbursement_response()], indirect=True) - def test_return_disbursement_on_correct_params( - self, mocker, mock_correct_response, default_disbursement_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_disbursement_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_disbursement_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_disbursement_data) - - @pytest.mark.parametrize("mock_correct_response", [multi_disbursement_response()], indirect=True) - def test_return_disbursement_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_disbursement_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_disbursement_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_disbursement_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_disbursement_data) - - @pytest.mark.parametrize("mock_correct_response", [multi_disbursement_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/ewallet/__init__.py b/tests/unit/models/ewallet/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/unit/models/ewallet/test_create_dana_payment.py b/tests/unit/models/ewallet/test_create_dana_payment.py deleted file mode 100644 index 0116aa16..00000000 --- a/tests/unit/models/ewallet/test_create_dana_payment.py +++ /dev/null @@ -1,66 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.ewallet import dana_payment_response -from xendit.models import EWallet - - -# fmt: off -class TestCreateDANAPayment(ModelBaseTest): - @pytest.fixture - def default_dana_payment_data(self): - tested_class = EWallet - class_name = "EWallet" - method_name = "create_dana_payment" - http_method_name = "post" - args = () - kwargs = { - "external_id": "dana-ewallet-test-123", - "amount": "1001", - "callback_url": "https://my-shop.com/callbacks", - "redirect_url": "https://my-shop.com/home", - "x_idempotency_key": "test-idemp_123", - } - params = (args, kwargs) - url = "/ewallets" - expected_correct_result = dana_payment_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_dana_payment_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_dana_payment_data - headers = {"X-IDEMPOTENCY-KEY": "test-idemp_123"} - body = { - "amount": "1001", - "callback_url": "https://my-shop.com/callbacks", - "ewallet_type": "DANA", - "external_id": "dana-ewallet-test-123", - "redirect_url": "https://my-shop.com/home" - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [dana_payment_response()], indirect=True) - def test_return_dana_payment_on_correct_params( - self, mocker, mock_correct_response, default_dana_payment_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_dana_payment_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_dana_payment_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_dana_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [dana_payment_response()], indirect=True) - def test_return_dana_payment_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_dana_payment_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_dana_payment_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_dana_payment_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_dana_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [dana_payment_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/ewallet/test_create_ewallet_charge.py b/tests/unit/models/ewallet/test_create_ewallet_charge.py deleted file mode 100644 index 19462df6..00000000 --- a/tests/unit/models/ewallet/test_create_ewallet_charge.py +++ /dev/null @@ -1,110 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.ewallet import ewallet_charge_response -from xendit.models import EWallet - - -# fmt: off -class TestCreateEWalletCharge(ModelBaseTest): - @pytest.fixture - def default_ewallet_charge_data(self): - tested_class = EWallet - class_name = "EWallet" - method_name = "create_ewallet_charge" - http_method_name = "post" - basket = [] - basket_item = EWallet.helper_create_basket_item( - reference_id="basket-product-ref-id", - name="product_name", - category="mechanics", - currency="IDR", - price=50000, - quantity=5, - type="wht", - sub_category="evr", - metadata={ - "meta": "data" - } - ) - basket.append(basket_item) - - args = () - kwargs = { - "reference_id": "test-reference-id", - "currency": "IDR", - "amount": 1688, - "checkout_method": "ONE_TIME_PAYMENT", - "channel_code": "ID_SHOPEEPAY", - "channel_properties": { - "success_redirect_url": "https://yourwebsite.com/order/123", - }, - "basket": basket, - "metadata": { - "meta2": "data2", - }, - } - params = (args, kwargs) - url = "/ewallets/charges" - expected_correct_result = ewallet_charge_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_ewallet_charge_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_ewallet_charge_data - headers = {} - body = { - "reference_id": "test-reference-id", - "currency": "IDR", - "amount": 1688, - "checkout_method": "ONE_TIME_PAYMENT", - "channel_code": "ID_SHOPEEPAY", - "channel_properties": { - "success_redirect_url": "https://yourwebsite.com/order/123", - }, - "basket": [ - { - "reference_id": "basket-product-ref-id", - "name": "product_name", - "category": "mechanics", - "currency": "IDR", - "price": 50000, - "quantity": 5, - "type": "wht", - "sub_category": "evr", - "metadata": { - "meta": "data" - }, - }, - ], - "metadata": { - "meta2": "data2", - }, - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [ewallet_charge_response()], indirect=True) - def test_return_ewallet_charge_on_correct_params( - self, mocker, mock_correct_response, default_ewallet_charge_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_ewallet_charge_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_ewallet_charge_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_ewallet_charge_data) - - @pytest.mark.parametrize("mock_correct_response", [ewallet_charge_response()], indirect=True) - def test_return_ewallet_charge_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_ewallet_charge_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_ewallet_charge_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_ewallet_charge_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_ewallet_charge_data) - - @pytest.mark.parametrize("mock_correct_response", [ewallet_charge_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/ewallet/test_create_linkaja_payment.py b/tests/unit/models/ewallet/test_create_linkaja_payment.py deleted file mode 100644 index 690ab180..00000000 --- a/tests/unit/models/ewallet/test_create_linkaja_payment.py +++ /dev/null @@ -1,76 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.ewallet import linkaja_payment_response -from xendit.models import EWallet - - -# fmt: off -class TestCreateLinkAjaPayment(ModelBaseTest): - @pytest.fixture - def default_linkaja_payment_data(self): - tested_class = EWallet - class_name = "EWallet" - method_name = "create_linkaja_payment" - http_method_name = "post" - items = [] - item = EWallet.helper_create_linkaja_item( - id="123123", name="Phone Case", price=100000, quantity=1 - ) - items.append(item) - - args = () - kwargs = { - "external_id": "linkaja-ewallet-test-1593505247", - "phone": "089911111111", - "amount": 300000, - "items": items, - "callback_url": "https://my-shop.com/callbacks", - "redirect_url": "https://xendit.co/", - "x_idempotency_key": "test-idemp_123", - } - params = (args, kwargs) - url = "/ewallets" - expected_correct_result = linkaja_payment_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_linkaja_payment_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_linkaja_payment_data - headers = {"X-IDEMPOTENCY-KEY": "test-idemp_123"} - body = { - "external_id": "linkaja-ewallet-test-1593505247", - "phone": "089911111111", - "amount": 300000, - "items": [{"id": "123123", "name": "Phone Case", "price": 100000, "quantity": 1}], - "callback_url": "https://my-shop.com/callbacks", - "redirect_url": "https://xendit.co/", - "ewallet_type": "LINKAJA" - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [linkaja_payment_response()], indirect=True) - def test_return_linkaja_payment_on_correct_params( - self, mocker, mock_correct_response, default_linkaja_payment_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_linkaja_payment_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_linkaja_payment_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_linkaja_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [linkaja_payment_response()], indirect=True) - def test_return_linkaja_payment_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_linkaja_payment_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_linkaja_payment_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_linkaja_payment_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_linkaja_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [linkaja_payment_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/ewallet/test_create_ovo_payment.py b/tests/unit/models/ewallet/test_create_ovo_payment.py deleted file mode 100644 index 7e9f4990..00000000 --- a/tests/unit/models/ewallet/test_create_ovo_payment.py +++ /dev/null @@ -1,75 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.ewallet import ovo_payment_response -from xendit.models import EWallet - - -# fmt: off -class TestCreateOVOPayment(ModelBaseTest): - @pytest.fixture - def default_ovo_payment_data(self): - tested_class = EWallet - class_name = "EWallet" - method_name = "create_ovo_payment" - http_method_name = "post" - args = () - kwargs = { - "external_id": "ovo-ewallet-testing-id-123321131114", - "amount": "8888", - "phone": "08123123123", - "x_idempotency_key": "test-idemp_123", - } - params = (args, kwargs) - url = "/ewallets" - expected_correct_result = ovo_payment_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_ovo_payment_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_ovo_payment_data - headers = {"X-IDEMPOTENCY-KEY": "test-idemp_123"} - body = { - "external_id": "ovo-ewallet-testing-id-123321131114", - "amount": "8888", - "phone": "08123123123", - "ewallet_type": "OVO", - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [ovo_payment_response()], indirect=True) - def test_return_ovo_payment_on_correct_params( - self, mocker, mock_correct_response, default_ovo_payment_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_ovo_payment_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_ovo_payment_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_ovo_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [ovo_payment_response()], indirect=True) - def test_return_ovo_payment_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_ovo_payment_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_ovo_payment_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_ovo_payment_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_ovo_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [ovo_payment_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) - - @pytest.mark.oldversion - @pytest.mark.parametrize("mock_correct_response", [ovo_payment_response("2019-02-04")], indirect=True) - def test_return_ovo_payment_on_correct_params_and_old_version( - self, mocker, mock_correct_response, default_ovo_payment_data - ): - (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) = default_ovo_payment_data - params[1]["x_api_version"] = "2019-02-04" - expected_correct_result = ovo_payment_response("2019-02-04") - default_ovo_payment_data = (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_ovo_payment_data) -# fmt: on diff --git a/tests/unit/models/ewallet/test_get_dana_payment_status.py b/tests/unit/models/ewallet/test_get_dana_payment_status.py deleted file mode 100644 index e0e7eee2..00000000 --- a/tests/unit/models/ewallet/test_get_dana_payment_status.py +++ /dev/null @@ -1,57 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.ewallet import dana_payment_status_response -from xendit.models import EWallet, EWalletType - - -# fmt: off -class TestGetDANAPaymentStatus(ModelBaseTest): - @pytest.fixture - def default_dana_payment_status_data(self): - tested_class = EWallet - class_name = "EWallet" - method_name = "get_payment_status" - http_method_name = "get" - args = () - kwargs = { - "external_id": "dana-ewallet-test-33312", - "ewallet_type": EWalletType.DANA, - } - params = (args, kwargs) - url = f"/ewallets?external_id={kwargs['external_id']}&ewallet_type={kwargs['ewallet_type'].name}" - expected_correct_result = dana_payment_status_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_dana_payment_status_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_dana_payment_status_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [dana_payment_status_response()], indirect=True) - def test_return_dana_payment_status_on_correct_params( - self, mocker, mock_correct_response, default_dana_payment_status_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_dana_payment_status_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_dana_payment_status_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_dana_payment_status_data) - - @pytest.mark.parametrize("mock_correct_response", [dana_payment_status_response()], indirect=True) - def test_return_dana_payment_status_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_dana_payment_status_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_dana_payment_status_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_dana_payment_status_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_dana_payment_status_data) - - @pytest.mark.parametrize("mock_correct_response", [dana_payment_status_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/ewallet/test_get_ewallet_charge_status.py b/tests/unit/models/ewallet/test_get_ewallet_charge_status.py deleted file mode 100644 index 4cab3490..00000000 --- a/tests/unit/models/ewallet/test_get_ewallet_charge_status.py +++ /dev/null @@ -1,56 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.ewallet import ewallet_charge_response -from xendit.models import EWallet - - -# fmt: off -class TestGetEWalletChargeStatus(ModelBaseTest): - @pytest.fixture - def default_ewallet_charge_data(self): - tested_class = EWallet - class_name = "EWallet" - method_name = "get_ewallet_charge_status" - http_method_name = "get" - args = () - kwargs = { - "charge_id": "ewc_f3925450-5c54-4777-98c1-fcf22b0d1e1c", - } - params = (args, kwargs) - url = f"/ewallets/charges/{kwargs['charge_id']}" - expected_correct_result = ewallet_charge_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_ewallet_charge_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_ewallet_charge_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [ewallet_charge_response()], indirect=True) - def test_return_ewallet_charge_on_correct_params( - self, mocker, mock_correct_response, default_ewallet_charge_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_ewallet_charge_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_ewallet_charge_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_ewallet_charge_data) - - @pytest.mark.parametrize("mock_correct_response", [ewallet_charge_response()], indirect=True) - def test_return_ewallet_charge_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_ewallet_charge_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_ewallet_charge_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_ewallet_charge_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_ewallet_charge_data) - - @pytest.mark.parametrize("mock_correct_response", [ewallet_charge_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/ewallet/test_get_linkaja_payment_status.py b/tests/unit/models/ewallet/test_get_linkaja_payment_status.py deleted file mode 100644 index da9f711f..00000000 --- a/tests/unit/models/ewallet/test_get_linkaja_payment_status.py +++ /dev/null @@ -1,57 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.ewallet import linkaja_payment_status_completed_response -from xendit.models import EWallet, EWalletType - - -# fmt: off -class TestGetLinkAjaPaymentStatus(ModelBaseTest): - @pytest.fixture - def default_linkaja_payment_status_data(self): - tested_class = EWallet - class_name = "EWallet" - method_name = "get_payment_status" - http_method_name = "get" - args = () - kwargs = { - "external_id": "linkaja-ewallet-test-1234", - "ewallet_type": EWalletType.LINKAJA, - } - params = (args, kwargs) - url = f"/ewallets?external_id={kwargs['external_id']}&ewallet_type={kwargs['ewallet_type'].name}" - expected_correct_result = linkaja_payment_status_completed_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_linkaja_payment_status_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_linkaja_payment_status_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [linkaja_payment_status_completed_response()], indirect=True) - def test_return_linkaja_payment_status_on_correct_params( - self, mocker, mock_correct_response, default_linkaja_payment_status_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_linkaja_payment_status_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_linkaja_payment_status_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_linkaja_payment_status_data) - - @pytest.mark.parametrize("mock_correct_response", [linkaja_payment_status_completed_response()], indirect=True) - def test_return_linkaja_payment_status_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_linkaja_payment_status_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_linkaja_payment_status_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_linkaja_payment_status_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_linkaja_payment_status_data) - - @pytest.mark.parametrize("mock_correct_response", [linkaja_payment_status_completed_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/ewallet/test_get_ovo_payment_status.py b/tests/unit/models/ewallet/test_get_ovo_payment_status.py deleted file mode 100644 index c69c1664..00000000 --- a/tests/unit/models/ewallet/test_get_ovo_payment_status.py +++ /dev/null @@ -1,57 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.ewallet import ovo_payment_status_response -from xendit.models import EWallet, EWalletType - - -# fmt: off -class TestGetOVOPaymentStatus(ModelBaseTest): - @pytest.fixture - def default_ovo_payment_status_data(self): - tested_class = EWallet - class_name = "EWallet" - method_name = "get_payment_status" - http_method_name = "get" - args = () - kwargs = { - "external_id": "ovo-ewallet-testing-id-123321131114", - "ewallet_type": EWalletType.OVO, - } - params = (args, kwargs) - url = f"/ewallets?external_id={kwargs['external_id']}&ewallet_type={kwargs['ewallet_type'].name}" - expected_correct_result = ovo_payment_status_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_ovo_payment_status_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_ovo_payment_status_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [ovo_payment_status_response()], indirect=True) - def test_return_ovo_payment_status_on_correct_params( - self, mocker, mock_correct_response, default_ovo_payment_status_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_ovo_payment_status_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_ovo_payment_status_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_ovo_payment_status_data) - - @pytest.mark.parametrize("mock_correct_response", [ovo_payment_status_response()], indirect=True) - def test_return_ovo_payment_status_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_ovo_payment_status_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_ovo_payment_status_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_ovo_payment_status_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_ovo_payment_status_data) - - @pytest.mark.parametrize("mock_correct_response", [ovo_payment_status_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/invoice/__init__.py b/tests/unit/models/invoice/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/unit/models/invoice/test_create_invoice.py b/tests/unit/models/invoice/test_create_invoice.py deleted file mode 100644 index 2f63e1ff..00000000 --- a/tests/unit/models/invoice/test_create_invoice.py +++ /dev/null @@ -1,65 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.invoice import invoice_response -from xendit.models import Invoice - - -# fmt: off -class TestCreateInvoice(ModelBaseTest): - @pytest.fixture - def default_invoice_data(self): - tested_class = Invoice - class_name = "Invoice" - method_name = "create" - http_method_name = "post" - args = () - kwargs = { - "external_id": "invoice-1593677698", - "amount": 20000, - "payer_email": "customer@domain.com", - "description": "Invoice Demo #123", - "x_idempotency_key": "test-idemp_123", - } - params = (args, kwargs) - url = "/v2/invoices" - expected_correct_result = invoice_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_invoice_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_invoice_data - headers = {"X-IDEMPOTENCY-KEY": "test-idemp_123"} - body = { - "external_id": "invoice-1593677698", - "amount": 20000, - "payer_email": "customer@domain.com", - "description": "Invoice Demo #123", - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [invoice_response()], indirect=True) - def test_return_dana_payment_on_correct_params( - self, mocker, mock_correct_response, default_invoice_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_invoice_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_invoice_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_invoice_data) - - @pytest.mark.parametrize("mock_correct_response", [invoice_response()], indirect=True) - def test_return_dana_payment_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_invoice_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_invoice_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_invoice_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_invoice_data) - - @pytest.mark.parametrize("mock_correct_response", [invoice_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/invoice/test_expire_invoice.py b/tests/unit/models/invoice/test_expire_invoice.py deleted file mode 100644 index 8646e6cb..00000000 --- a/tests/unit/models/invoice/test_expire_invoice.py +++ /dev/null @@ -1,57 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.invoice import invoice_response -from xendit.models import Invoice - - -# fmt: off -class TestGetInvoice(ModelBaseTest): - @pytest.fixture - def default_invoice_data(self): - tested_class = Invoice - class_name = "Invoice" - method_name = "expire" - http_method_name = "post" - args = () - kwargs = { - "invoice_id": "5efda8a20425db620ec35f43", - "x_idempotency_key": "test-idemp_123" - } - params = (args, kwargs) - url = f"/invoices/{kwargs['invoice_id']}/expire!" - expected_correct_result = invoice_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_invoice_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_invoice_data - headers = {"X-IDEMPOTENCY-KEY": "test-idemp_123"} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [invoice_response()], indirect=True) - def test_return_dana_payment_on_correct_params( - self, mocker, mock_correct_response, default_invoice_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_invoice_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_invoice_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_invoice_data) - - @pytest.mark.parametrize("mock_correct_response", [invoice_response()], indirect=True) - def test_return_dana_payment_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_invoice_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_invoice_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_invoice_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_invoice_data) - - @pytest.mark.parametrize("mock_correct_response", [invoice_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/invoice/test_get_invoice.py b/tests/unit/models/invoice/test_get_invoice.py deleted file mode 100644 index 87e656d1..00000000 --- a/tests/unit/models/invoice/test_get_invoice.py +++ /dev/null @@ -1,57 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.invoice import invoice_response -from xendit.models import Invoice - - -# fmt: off -class TestGetInvoice(ModelBaseTest): - @pytest.fixture - def default_invoice_data(self): - tested_class = Invoice - class_name = "Invoice" - method_name = "get" - http_method_name = "get" - args = () - kwargs = { - "invoice_id": "5efda8a20425db620ec35f43", - "for_user_id": "test-id123", - } - params = (args, kwargs) - url = f"/v2/invoices/{kwargs['invoice_id']}" - expected_correct_result = invoice_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_invoice_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_invoice_data - headers = {"for-user-id": "test-id123"} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [invoice_response()], indirect=True) - def test_return_dana_payment_on_correct_params( - self, mocker, mock_correct_response, default_invoice_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_invoice_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_invoice_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_invoice_data) - - @pytest.mark.parametrize("mock_correct_response", [invoice_response()], indirect=True) - def test_return_dana_payment_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_invoice_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_invoice_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_invoice_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_invoice_data) - - @pytest.mark.parametrize("mock_correct_response", [invoice_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/invoice/test_list_all_invoice.py b/tests/unit/models/invoice/test_list_all_invoice.py deleted file mode 100644 index 67e36302..00000000 --- a/tests/unit/models/invoice/test_list_all_invoice.py +++ /dev/null @@ -1,57 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.invoice import multiple_invoice_response -from xendit.models import Invoice - - -# fmt: off -class TestGetInvoice(ModelBaseTest): - @pytest.fixture - def default_invoice_data(self): - tested_class = Invoice - class_name = "Invoice" - method_name = "list_all" - http_method_name = "get" - args = () - kwargs = { - "limit": 3, - "for_user_id": "test-id123", - } - params = (args, kwargs) - url = "/v2/invoices" - expected_correct_result = multiple_invoice_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_invoice_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_invoice_data - headers = {"for-user-id": "test-id123"} - body = {"limit": 3} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [multiple_invoice_response()], indirect=True) - def test_return_dana_payment_on_correct_params( - self, mocker, mock_correct_response, default_invoice_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_invoice_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_invoice_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_invoice_data) - - @pytest.mark.parametrize("mock_correct_response", [multiple_invoice_response()], indirect=True) - def test_return_dana_payment_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_invoice_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_invoice_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_invoice_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_invoice_data) - - @pytest.mark.parametrize("mock_correct_response", [multiple_invoice_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/model_base_test.py b/tests/unit/models/model_base_test.py deleted file mode 100644 index d1a439eb..00000000 --- a/tests/unit/models/model_base_test.py +++ /dev/null @@ -1,189 +0,0 @@ -import pytest -from xendit import Xendit, XenditError -from xendit._api_requestor import _APIRequestor - - -# fmt: off -class ModelBaseTest: - def base_test_return_class_on_correct_params( - self, tested_class_name, tested_method_name, params, expected_result - ): - xendit = Xendit(api_key="mock_key") - args, kwargs = params - tested_object = getattr(xendit, tested_class_name) - tested_method = getattr(tested_object, tested_method_name) - returned_object = tested_method(*args, **kwargs) - try: - assert vars(returned_object) == expected_result - except TypeError: - for idx, singular_data in enumerate(returned_object): - assert vars(singular_data) == expected_result[idx] - - def base_test_raises_error_on_response_error( - self, tested_class_name, tested_method_name, params - ): - xendit = Xendit(api_key="mock_key") - args, kwargs = params - tested_object = getattr(xendit, tested_class_name) - tested_method = getattr(tested_object, tested_method_name) - with pytest.raises(XenditError): - print(tested_method(*args, **kwargs)) - - def run_success_return_test_on_xendit_instance(self, mocker, mock_correct_response, default_tested_class_data): - """Using xendit instance for API key and receive result from API, it should return correct result - - Args: - mocker (fixture): Default mocker fixture - mock_correct_response (function): Mock correct response that sent by APIRequestor - default_tested_class_data (tuple): Tuple with 7 item that contain: - - tested_class (class): Class that will be tested - - class_name (str): String representation for the class - - method_name (str): Method name that will be tested - - http_method_name (str): HTTP Method name that will be used in the API Requestor - - url (str): URL for the request - - params (tuple): Params with format (args, kwargs) - - expected_correct_result (dict): Expected Correct Result - """ - tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result = default_tested_class_data - mocker.patch.object(_APIRequestor, http_method_name) - api_requestor_used_method = getattr(_APIRequestor, http_method_name) - setattr(api_requestor_used_method, "return_value", mock_correct_response) - self.base_test_return_class_on_correct_params( - tested_method_name=method_name, - tested_class_name=class_name, - params=params, - expected_result=expected_correct_result, - ) - - def run_raises_error_test_on_xendit_instance(self, mocker, mock_error_request_response, default_tested_class_data): - """Using xendit instance for API key and receive error from API, it should return XenditError - - Args: - mocker (fixture): Default mocker fixture - mock_correct_response (function): Mock correct response that sent by APIRequestor - default_tested_class_data (tuple): Tuple with 7 item that contain: - - tested_class (class): Class that will be tested - - class_name (str): String representation for the class - - method_name (str): Method name that will be tested - - http_method_name (str): HTTP Method name that will be used in the API Requestor - - url (str): URL for the request - - params (tuple): Params with format (args, kwargs) - - expected_correct_result (dict): Expected Correct Result - """ - tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result = default_tested_class_data - mocker.patch.object(_APIRequestor, http_method_name) - api_requestor_used_method = getattr(_APIRequestor, http_method_name) - setattr(api_requestor_used_method, "return_value", mock_error_request_response) - self.base_test_raises_error_on_response_error( - tested_class_name=class_name, - tested_method_name=method_name, - params=params, - ) - - def run_success_return_test_on_global_config(self, mocker, mock_correct_response, default_tested_class_data): - """Using global config for API key and receive result from API, it should return the correct result - - Args: - mocker (fixture): Default mocker fixture - mock_correct_response (function): Mock correct response that sent by APIRequestor - default_tested_class_data (tuple): Tuple with 7 item that contain: - - tested_class (class): Class that will be tested - - class_name (str): String representation for the class - - method_name (str): Method name that will be tested - - http_method_name (str): HTTP Method name that will be used in the API Requestor - - url (str): URL for the request - - params (tuple): Params with format (args, kwargs) - - expected_correct_result (dict): Expected Correct Result - """ - tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result = default_tested_class_data - args, kwargs = params - mocker.patch.object(_APIRequestor, http_method_name) - api_requestor_used_method = getattr(_APIRequestor, http_method_name) - setattr(api_requestor_used_method, "return_value", mock_correct_response) - returned_object = getattr(tested_class, method_name)(*args, **kwargs) - - try: - assert vars(returned_object) == expected_correct_result - except TypeError: - for idx, singular_data in enumerate(returned_object): - assert vars(singular_data) == expected_correct_result[idx] - - def run_raises_error_test_on_global_config(self, mocker, mock_error_request_response, default_tested_class_data): - """Using global config for API key and receive error from API, it should return XenditError - - Args: - mocker (fixture): Default mocker fixture - mock_correct_response (function): Mock correct response that sent by APIRequestor - default_tested_class_data (tuple): Tuple with 7 item that contain: - - tested_class (class): Class that will be tested - - class_name (str): String representation for the class - - method_name (str): Method name that will be tested - - http_method_name (str): HTTP Method name that will be used in the API Requestor - - url (str): URL for the request - - params (tuple): Params with format (args, kwargs) - - expected_correct_result (dict): Expected Correct Result - """ - tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result = default_tested_class_data - args, kwargs = params - mocker.patch.object(_APIRequestor, http_method_name) - api_requestor_used_method = getattr(_APIRequestor, http_method_name) - setattr(api_requestor_used_method, "return_value", mock_error_request_response) - with pytest.raises(XenditError): - returned_object = getattr(tested_class, method_name)(*args, **kwargs) - print(returned_object) - - def run_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - """It should send correct request to API Requestor - - Args: - mocker (fixture): Default mocker fixture - mock_correct_response (function): Mock correct response that sent by APIRequestor - api_requestor_request_data (tuple): Tuple with 8 items that contain: - - tested_class (class): Class that will be tested - - class_name (str): String representation for the class - - method_name (str): Method name that will be tested - - http_method_name (str): HTTP Method name that will be used in the API Requestor - - url (str): URL for the request - - params (tuple): Params with format (args, kwargs) - - headers (dict): headers that will be sent - - body (dict): body that will be sent (if http_method_name == 'get' then it's parameters of the request) - """ - tested_class, class_name, method_name, http_method_name, url, params, headers, body = api_requestor_request_data - args, kwargs = params - - mocker.patch.object(_APIRequestor, http_method_name) - tested_apirequestor_method = getattr(_APIRequestor, http_method_name) - setattr(tested_apirequestor_method, "return_value", mock_correct_response) - - tested_method = getattr(tested_class, method_name) - tested_method(*args, **kwargs) - self.assert_apirequestor_method(tested_apirequestor_method, http_method_name, url, headers, body) - - def assert_apirequestor_method(self, tested_apirequestor_method, http_method_name, url, headers, body): - """Assert that tested_apirequestor_method is called with the specified parameters. - If the body is empty, we should give the freedom to not attach the body in the parameters - - Args: - tested_apirequestor_method (Mock function): Function that will be tested - http_method_name (str): HTTP Method - url (str): URL for the request - headers (dict): Headers for the request - body (dict): Body/params of the request - """ - if(http_method_name == "get"): - if(body != {} and '?' not in url): - tested_apirequestor_method.assert_called_with(url, headers=headers, params=body) - else: - try: - tested_apirequestor_method.assert_called_with(url, headers=headers) - except AssertionError: - tested_apirequestor_method.assert_called_with(url, headers=headers, params=body) - else: - if(body != {}): - tested_apirequestor_method.assert_called_with(url, headers=headers, body=body) - else: - try: - tested_apirequestor_method.assert_called_with(url, headers=headers) - except AssertionError: - tested_apirequestor_method.assert_called_with(url, headers=headers, body=body) -# fmt: on diff --git a/tests/unit/models/paymentmethod/__init__.py b/tests/unit/models/paymentmethod/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/unit/models/paymentmethod/test_authorize_payment_method.py b/tests/unit/models/paymentmethod/test_authorize_payment_method.py deleted file mode 100644 index 55fef3e1..00000000 --- a/tests/unit/models/paymentmethod/test_authorize_payment_method.py +++ /dev/null @@ -1,56 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.payment_method import payment_method_response -from xendit.models import PaymentMethod - -class TestAuthorizePaymentMethod(ModelBaseTest): - @pytest.fixture - def default_payment_method_data(self): - tested_class = PaymentMethod - class_name = "PaymentMethod" - method_name = "authorize" - http_method_name = "post" - args = () - kwargs = { - "payment_method_id": "pm-1c229762-c21a-433d-8da5-f02240387e34", - "auth_code": "222000" - } - params = (args, kwargs) - url = f"/v2/payment_methods/{kwargs['payment_method_id']}/auth" - expected_correct_result = payment_method_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_payment_method_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_payment_method_data - headers = {} - body = { - "auth_code": "222000" - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [payment_method_response()], indirect=True) - def test_return_payment_method_on_correct_params( - self, mocker, mock_correct_response, default_payment_method_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_payment_method_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_payment_method_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_payment_method_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_method_response()], indirect=True) - def test_return_payment_method_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_payment_method_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_payment_method_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_payment_method_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_payment_method_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_method_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) \ No newline at end of file diff --git a/tests/unit/models/paymentmethod/test_create_payment_method.py b/tests/unit/models/paymentmethod/test_create_payment_method.py deleted file mode 100644 index b69f3d47..00000000 --- a/tests/unit/models/paymentmethod/test_create_payment_method.py +++ /dev/null @@ -1,73 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.payment_method import payment_method_response -from xendit.models import PaymentMethod - -class TestCreatePaymentMethod(ModelBaseTest): - @pytest.fixture - def default_payment_method_data(self): - tested_class = PaymentMethod - class_name = "PaymentMethod" - method_name = "create" - http_method_name = "post" - args = () - kwargs = { - "type": "EWALLET", - "reusability": "ONE_TIME_USE", - "ewallet": { - "channel_code": "PAYMAYA", - "channel_properties": { - "success_return_url": "https://redirect.me/goodstuff", - "failure_return_url": "https://redirect.me/badstuff", - "cancel_return_url": "https://redirect.me/nostuff" - } - }, - } - params = (args, kwargs) - url = "/v2/payment_methods" - expected_correct_result = payment_method_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_payment_method_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_payment_method_data - headers = {} - body = { - "type": "EWALLET", - "ewallet": { - "channel_code": "PAYMAYA", - "channel_properties": { - "success_return_url": "https://redirect.me/goodstuff", - "failure_return_url": "https://redirect.me/badstuff", - "cancel_return_url": "https://redirect.me/nostuff" - } - }, - "reusability": "ONE_TIME_USE", - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [payment_method_response()], indirect=True) - def test_return_payment_method_on_correct_params( - self, mocker, mock_correct_response, default_payment_method_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_payment_method_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_payment_method_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_payment_method_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_method_response()], indirect=True) - def test_return_payment_method_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_payment_method_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_payment_method_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_payment_method_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_payment_method_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_method_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) \ No newline at end of file diff --git a/tests/unit/models/paymentmethod/test_expire_payment_method.py b/tests/unit/models/paymentmethod/test_expire_payment_method.py deleted file mode 100644 index cfc59baf..00000000 --- a/tests/unit/models/paymentmethod/test_expire_payment_method.py +++ /dev/null @@ -1,53 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.payment_method import payment_method_response -from xendit.models import PaymentMethod - -class TestExpirePaymentMethod(ModelBaseTest): - @pytest.fixture - def default_payment_method_data(self): - tested_class = PaymentMethod - class_name = "PaymentMethod" - method_name = "expire" - http_method_name = "post" - args = () - kwargs = { - "payment_method_id": "pm-1c229762-c21a-433d-8da5-f02240387e34", - } - params = (args, kwargs) - url = f"/v2/payment_methods/{kwargs['payment_method_id']}/expire" - expected_correct_result = payment_method_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_payment_method_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_payment_method_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [payment_method_response()], indirect=True) - def test_return_payment_method_on_correct_params( - self, mocker, mock_correct_response, default_payment_method_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_payment_method_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_payment_method_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_payment_method_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_method_response()], indirect=True) - def test_return_payment_method_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_payment_method_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_payment_method_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_payment_method_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_payment_method_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_method_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) \ No newline at end of file diff --git a/tests/unit/models/paymentmethod/test_get_payment_method.py b/tests/unit/models/paymentmethod/test_get_payment_method.py deleted file mode 100644 index 6e74ae81..00000000 --- a/tests/unit/models/paymentmethod/test_get_payment_method.py +++ /dev/null @@ -1,53 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.payment_method import payment_method_response -from xendit.models import PaymentMethod - -class TestGetPaymentMethod(ModelBaseTest): - @pytest.fixture - def default_payment_method_data(self): - tested_class = PaymentMethod - class_name = "PaymentMethod" - method_name = "get" - http_method_name = "get" - args = () - kwargs = { - "payment_method_id": "pm-1c229762-c21a-433d-8da5-f02240387e34" - } - params = (args, kwargs) - url = f"/v2/payment_methods/{kwargs['payment_method_id']}" - expected_correct_result = payment_method_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_payment_method_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_payment_method_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [payment_method_response()], indirect=True) - def test_return_payment_method_on_correct_params( - self, mocker, mock_correct_response, default_payment_method_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_payment_method_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_payment_method_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_payment_method_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_method_response()], indirect=True) - def test_return_payment_method_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_payment_method_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_payment_method_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_payment_method_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_payment_method_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_method_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) \ No newline at end of file diff --git a/tests/unit/models/paymentmethod/test_update_payment_method.py b/tests/unit/models/paymentmethod/test_update_payment_method.py deleted file mode 100644 index fb93fe9a..00000000 --- a/tests/unit/models/paymentmethod/test_update_payment_method.py +++ /dev/null @@ -1,56 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.payment_method import payment_method_response -from xendit.models import PaymentMethod - -class TestUpdatePaymentMethod(ModelBaseTest): - @pytest.fixture - def default_payment_method_data(self): - tested_class = PaymentMethod - class_name = "PaymentMethod" - method_name = "update" - http_method_name = "patch" - args = () - kwargs = { - "payment_method_id": "pm-1c229762-c21a-433d-8da5-f02240387e34", - "status": "ACTIVE" - } - params = (args, kwargs) - url = f"/v2/payment_methods/{kwargs['payment_method_id']}" - expected_correct_result = payment_method_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_payment_method_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_payment_method_data - headers = {} - body = { - "status": "ACTIVE" - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [payment_method_response()], indirect=True) - def test_return_payment_method_on_correct_params( - self, mocker, mock_correct_response, default_payment_method_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_payment_method_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_payment_method_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_payment_method_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_method_response()], indirect=True) - def test_return_payment_method_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_payment_method_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_payment_method_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_payment_method_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_payment_method_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_method_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) \ No newline at end of file diff --git a/tests/unit/models/paymentrequests/__init__.py b/tests/unit/models/paymentrequests/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/unit/models/paymentrequests/test_confirm_payment_request.py b/tests/unit/models/paymentrequests/test_confirm_payment_request.py deleted file mode 100644 index 5f4577f2..00000000 --- a/tests/unit/models/paymentrequests/test_confirm_payment_request.py +++ /dev/null @@ -1,56 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.payment_request import payment_request_response -from xendit.models import PaymentRequest - -class TestGetPaymentRequest(ModelBaseTest): - @pytest.fixture - def default_payment_method_data(self): - tested_class = PaymentRequest - class_name = "PaymentRequest" - method_name = "confirm" - http_method_name = "post" - args = () - kwargs = { - "payment_request_id": "pr-1c229762-c21a-433d-8da5-f02240387e34", - "auth_code": "00000" - } - params = (args, kwargs) - url = f"/payment_requests/{kwargs['payment_request_id']}/auth" - expected_correct_result = payment_request_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_payment_method_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_payment_method_data - headers = {} - body = { - "auth_code": "00000" - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [payment_request_response()], indirect=True) - def test_return_payment_method_on_correct_params( - self, mocker, mock_correct_response, default_payment_method_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_payment_method_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_payment_method_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_payment_method_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_request_response()], indirect=True) - def test_return_payment_method_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_payment_method_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_payment_method_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_payment_method_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_payment_method_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_request_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) \ No newline at end of file diff --git a/tests/unit/models/paymentrequests/test_create_payment_request.py b/tests/unit/models/paymentrequests/test_create_payment_request.py deleted file mode 100644 index e28a80da..00000000 --- a/tests/unit/models/paymentrequests/test_create_payment_request.py +++ /dev/null @@ -1,82 +0,0 @@ -import pytest -from tests.sampleresponse.payment_request import payment_request_response -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.payment_request import payment_request_response -from xendit.models import PaymentRequest - -class TestCreatePaymentRequest(ModelBaseTest): - @pytest.fixture - def default_payment_request_data(self): - tested_class = PaymentRequest - class_name = "PaymentRequest" - method_name = "create" - http_method_name = "post" - args = () - kwargs = { - "amount": 1500, - "currency": "PHP", - "payment_method": { - "type": "EWALLET", - "ewallet": { - "channel_code" :"PAYMAYA", - "channel_properties": { - "success_return_url" : "https://redirect.me/goodstuff", - "failure_return_url" : "https://redirect.me/badstuff", - "cancel_return_url" : "https://redirect.me/nostuff" - } - }, - "reusability": "ONE_TIME_USE" - } - } - params = (args, kwargs) - url = "/payment_requests" - expected_correct_result = payment_request_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_payment_request_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_payment_request_data - headers = {} - body = { - "amount": 1500, - "currency": "PHP", - "payment_method": { - "type": "EWALLET", - "ewallet": { - "channel_code" :"PAYMAYA", - "channel_properties": { - "success_return_url" : "https://redirect.me/goodstuff", - "failure_return_url" : "https://redirect.me/badstuff", - "cancel_return_url" : "https://redirect.me/nostuff" - } - }, - "reusability": "ONE_TIME_USE" - } - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [payment_request_response()], indirect=True) - def test_return_payment_method_on_correct_params( - self, mocker, mock_correct_response, default_payment_request_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_payment_request_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_payment_request_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_payment_request_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_request_response()], indirect=True) - def test_return_payment_method_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_payment_request_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_payment_request_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_payment_request_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_payment_request_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_request_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) \ No newline at end of file diff --git a/tests/unit/models/paymentrequests/test_get_payment_request.py b/tests/unit/models/paymentrequests/test_get_payment_request.py deleted file mode 100644 index 035438e0..00000000 --- a/tests/unit/models/paymentrequests/test_get_payment_request.py +++ /dev/null @@ -1,53 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.payment_request import payment_request_response -from xendit.models import PaymentRequest - -class TestGetPaymentRequest(ModelBaseTest): - @pytest.fixture - def default_payment_method_data(self): - tested_class = PaymentRequest - class_name = "PaymentRequest" - method_name = "get" - http_method_name = "get" - args = () - kwargs = { - "payment_request_id": "pr-1c229762-c21a-433d-8da5-f02240387e34" - } - params = (args, kwargs) - url = f"/payment_requests/{kwargs['payment_request_id']}" - expected_correct_result = payment_request_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_payment_method_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_payment_method_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [payment_request_response()], indirect=True) - def test_return_payment_method_on_correct_params( - self, mocker, mock_correct_response, default_payment_method_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_payment_method_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_payment_method_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_payment_method_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_request_response()], indirect=True) - def test_return_payment_method_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_payment_method_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_payment_method_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_payment_method_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_payment_method_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_request_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) \ No newline at end of file diff --git a/tests/unit/models/paymentrequests/test_resend_auth_for_payment_request.py b/tests/unit/models/paymentrequests/test_resend_auth_for_payment_request.py deleted file mode 100644 index b5161c5f..00000000 --- a/tests/unit/models/paymentrequests/test_resend_auth_for_payment_request.py +++ /dev/null @@ -1,53 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.payment_request import payment_request_response -from xendit.models import PaymentRequest - -class TestResendAuthPaymentRequest(ModelBaseTest): - @pytest.fixture - def default_payment_method_data(self): - tested_class = PaymentRequest - class_name = "PaymentRequest" - method_name = "resend_auth" - http_method_name = "post" - args = () - kwargs = { - "payment_request_id": "pr-1c229762-c21a-433d-8da5-f02240387e34", - } - params = (args, kwargs) - url = f"/payment_requests/{kwargs['payment_request_id']}/resend" - expected_correct_result = payment_request_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_payment_method_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_payment_method_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [payment_request_response()], indirect=True) - def test_return_payment_method_on_correct_params( - self, mocker, mock_correct_response, default_payment_method_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_payment_method_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_payment_method_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_payment_method_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_request_response()], indirect=True) - def test_return_payment_method_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_payment_method_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_payment_method_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_payment_method_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_payment_method_data) - - @pytest.mark.parametrize("mock_correct_response", [payment_request_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) \ No newline at end of file diff --git a/tests/unit/models/payout/__init__.py b/tests/unit/models/payout/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/unit/models/payout/test_create_payout.py b/tests/unit/models/payout/test_create_payout.py deleted file mode 100644 index c3d7abcd..00000000 --- a/tests/unit/models/payout/test_create_payout.py +++ /dev/null @@ -1,64 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.payout import payout_response -from xendit.models import Payout - - -# fmt: off -class TestCreatePayout(ModelBaseTest): - @pytest.fixture - def default_payout_data(self): - tested_class = Payout - class_name = "Payout" - method_name = "create" - http_method_name = "post" - args = () - kwargs = { - "external_id": "payout-1595405117", - "amount": 50000, - "email": "test@email.co", - "x_idempotency_key": "test_idemp_123", - } - params = (args, kwargs) - url = "/payouts" - expected_correct_result = payout_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_payout_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_payout_data - headers = {"X-IDEMPOTENCY-KEY": "test_idemp_123"} - body = { - "external_id": "payout-1595405117", - "amount": 50000, - "email": "test@email.co", - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [payout_response()], indirect=True) - def test_return_payout_on_correct_params( - self, mocker, mock_correct_response, default_payout_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_payout_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_payout_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_payout_data) - - @pytest.mark.parametrize("mock_correct_response", [payout_response()], indirect=True) - def test_return_payout_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_payout_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_payout_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_payout_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_payout_data) - - @pytest.mark.parametrize("mock_correct_response", [payout_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) - -# fmt: on diff --git a/tests/unit/models/payout/test_get_payout.py b/tests/unit/models/payout/test_get_payout.py deleted file mode 100644 index b192e6c1..00000000 --- a/tests/unit/models/payout/test_get_payout.py +++ /dev/null @@ -1,57 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.payout import payout_response -from xendit.models import Payout - - -# fmt: off -class TestGetPayout(ModelBaseTest): - @pytest.fixture - def default_payout_data(self): - tested_class = Payout - class_name = "Payout" - method_name = "get" - http_method_name = "get" - args = () - kwargs = { - "id": "a6ee1bf1-ffcd-4bda-a7ab-99c1d5cd0472", - } - params = (args, kwargs) - url = f"/payouts/{kwargs['id']}" - expected_correct_result = payout_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_payout_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_payout_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [payout_response()], indirect=True) - def test_return_payout_on_correct_params( - self, mocker, mock_correct_response, default_payout_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_payout_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_payout_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_payout_data) - - @pytest.mark.parametrize("mock_correct_response", [payout_response()], indirect=True) - def test_return_payout_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_payout_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_payout_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_payout_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_payout_data) - - @pytest.mark.parametrize("mock_correct_response", [payout_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) - -# fmt: on diff --git a/tests/unit/models/payout/test_void_payout.py b/tests/unit/models/payout/test_void_payout.py deleted file mode 100644 index 54b5a8d8..00000000 --- a/tests/unit/models/payout/test_void_payout.py +++ /dev/null @@ -1,57 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.payout import void_payout_response -from xendit.models import Payout - - -# fmt: off -class TestVoidPayout(ModelBaseTest): - @pytest.fixture - def default_payout_data(self): - tested_class = Payout - class_name = "Payout" - method_name = "void" - http_method_name = "post" - args = () - kwargs = { - "id": "a6ee1bf1-ffcd-4bda-a7ab-99c1d5cd0472", - } - params = (args, kwargs) - url = f"/payouts/{kwargs['id']}/void" - expected_correct_result = void_payout_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_payout_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_payout_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [void_payout_response()], indirect=True) - def test_return_payout_on_correct_params( - self, mocker, mock_correct_response, default_payout_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_payout_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_payout_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_payout_data) - - @pytest.mark.parametrize("mock_correct_response", [void_payout_response()], indirect=True) - def test_return_payout_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_payout_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_payout_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_payout_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_payout_data) - - @pytest.mark.parametrize("mock_correct_response", [void_payout_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) - -# fmt: on diff --git a/tests/unit/models/qrcode/__init__.py b/tests/unit/models/qrcode/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/unit/models/qrcode/test_create_qrcode.py b/tests/unit/models/qrcode/test_create_qrcode.py deleted file mode 100644 index 7aa13e57..00000000 --- a/tests/unit/models/qrcode/test_create_qrcode.py +++ /dev/null @@ -1,65 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.qrcode import qrcode_response -from xendit.models import QRCode, QRCodeType - - -# fmt: off -class TestCreateQRCode(ModelBaseTest): - @pytest.fixture - def default_qrcode_data(self): - tested_class = QRCode - class_name = "QRCode" - method_name = "create" - http_method_name = "post" - args = () - kwargs = { - "external_id": "mock-qrcode-id-1594794038", - "type": QRCodeType.DYNAMIC, - "callback_url": "https://mock-site.site", - "amount": 4000, - "x_idempotency_key": "test-idemp_123", - } - params = (args, kwargs) - url = "/qr_codes" - expected_correct_result = qrcode_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_qrcode_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_qrcode_data - headers = {"X-IDEMPOTENCY-KEY": "test-idemp_123"} - body = { - "external_id": "mock-qrcode-id-1594794038", - "type": "DYNAMIC", - "callback_url": "https://mock-site.site", - "amount": 4000, - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [qrcode_response()], indirect=True) - def test_return_qrcode_on_correct_params( - self, mocker, mock_correct_response, default_qrcode_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_qrcode_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_qrcode_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_qrcode_data) - - @pytest.mark.parametrize("mock_correct_response", [qrcode_response()], indirect=True) - def test_return_qrcode_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_qrcode_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_qrcode_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_qrcode_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_qrcode_data) - - @pytest.mark.parametrize("mock_correct_response", [qrcode_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/qrcode/test_get_qrcode_by_ext_id.py b/tests/unit/models/qrcode/test_get_qrcode_by_ext_id.py deleted file mode 100644 index 2bdacbb3..00000000 --- a/tests/unit/models/qrcode/test_get_qrcode_by_ext_id.py +++ /dev/null @@ -1,56 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.qrcode import qrcode_response -from xendit.models import QRCode - - -# fmt: off -class TestGetQRCodeByExtID(ModelBaseTest): - @pytest.fixture - def default_qrcode_data(self): - tested_class = QRCode - class_name = "QRCode" - method_name = "get_by_ext_id" - http_method_name = "get" - args = () - kwargs = { - "external_id": "mock-qrcode-id-1594794038", - } - params = (args, kwargs) - url = f"/qr_codes/{kwargs['external_id']}" - expected_correct_result = qrcode_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_qrcode_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_qrcode_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [qrcode_response()], indirect=True) - def test_return_qrcode_on_correct_params( - self, mocker, mock_correct_response, default_qrcode_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_qrcode_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_qrcode_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_qrcode_data) - - @pytest.mark.parametrize("mock_correct_response", [qrcode_response()], indirect=True) - def test_return_qrcode_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_qrcode_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_qrcode_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_qrcode_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_qrcode_data) - - @pytest.mark.parametrize("mock_correct_response", [qrcode_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/recurringpayment/__init__.py b/tests/unit/models/recurringpayment/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/unit/models/recurringpayment/test_create_recurring_payment.py b/tests/unit/models/recurringpayment/test_create_recurring_payment.py deleted file mode 100644 index 34733c63..00000000 --- a/tests/unit/models/recurringpayment/test_create_recurring_payment.py +++ /dev/null @@ -1,69 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.recurring_payment import recurring_payment_response -from xendit.models import RecurringPayment - - -# fmt: off -class TestCreateRecurringPayment(ModelBaseTest): - @pytest.fixture - def default_recurring_payment_data(self): - tested_class = RecurringPayment - class_name = "RecurringPayment" - method_name = "create" - http_method_name = "post" - args = () - kwargs = { - "external_id": "recurring_12345", - "payer_email": "test@x.co", - "description": "Test Curring Payment", - "amount": 100000, - "interval": "MONTH", - "interval_count": 1, - "x_idempotency_key": "test-idemp_123", - } - params = (args, kwargs) - url = "/recurring_payments" - expected_correct_result = recurring_payment_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_recurring_payment_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_recurring_payment_data - headers = {"X-IDEMPOTENCY-KEY": "test-idemp_123"} - body = { - "external_id": "recurring_12345", - "payer_email": "test@x.co", - "description": "Test Curring Payment", - "amount": 100000, - "interval": "MONTH", - "interval_count": 1, - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [recurring_payment_response()], indirect=True) - def test_return_recurring_payment_on_correct_params( - self, mocker, mock_correct_response, default_recurring_payment_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_recurring_payment_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_recurring_payment_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_recurring_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [recurring_payment_response()], indirect=True) - def test_return_recurring_payment_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_recurring_payment_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_recurring_payment_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_recurring_payment_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_recurring_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [recurring_payment_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/recurringpayment/test_edit_recurring_payment.py b/tests/unit/models/recurringpayment/test_edit_recurring_payment.py deleted file mode 100644 index 53d5931a..00000000 --- a/tests/unit/models/recurringpayment/test_edit_recurring_payment.py +++ /dev/null @@ -1,59 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.recurring_payment import recurring_payment_response -from xendit.models import RecurringPayment - - -# fmt: off -class TestEditRecurringPayment(ModelBaseTest): - @pytest.fixture - def default_recurring_payment_data(self): - tested_class = RecurringPayment - class_name = "RecurringPayment" - method_name = "edit" - http_method_name = "patch" - args = () - kwargs = { - "id": "mock_id-123", - "interval_count": 2, - } - params = (args, kwargs) - url = f"/recurring_payments/{kwargs['id']}" - expected_correct_result = recurring_payment_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_recurring_payment_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_recurring_payment_data - headers = {} - body = { - "interval_count": 2, - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [recurring_payment_response()], indirect=True) - def test_return_recurring_payment_on_correct_params( - self, mocker, mock_correct_response, default_recurring_payment_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_recurring_payment_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_recurring_payment_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_recurring_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [recurring_payment_response()], indirect=True) - def test_return_recurring_payment_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_recurring_payment_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_recurring_payment_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_recurring_payment_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_recurring_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [recurring_payment_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/recurringpayment/test_get_recurring_payment.py b/tests/unit/models/recurringpayment/test_get_recurring_payment.py deleted file mode 100644 index 8f66d65e..00000000 --- a/tests/unit/models/recurringpayment/test_get_recurring_payment.py +++ /dev/null @@ -1,56 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.recurring_payment import recurring_payment_response -from xendit.models import RecurringPayment - - -# fmt: off -class TestGetRecurringPayment(ModelBaseTest): - @pytest.fixture - def default_recurring_payment_data(self): - tested_class = RecurringPayment - class_name = "RecurringPayment" - method_name = "get" - http_method_name = "get" - args = () - kwargs = { - "id": "mock_id-123", - } - params = (args, kwargs) - url = f"/recurring_payments/{kwargs['id']}" - expected_correct_result = recurring_payment_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_recurring_payment_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_recurring_payment_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [recurring_payment_response()], indirect=True) - def test_return_recurring_payment_on_correct_params( - self, mocker, mock_correct_response, default_recurring_payment_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_recurring_payment_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_recurring_payment_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_recurring_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [recurring_payment_response()], indirect=True) - def test_return_recurring_payment_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_recurring_payment_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_recurring_payment_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_recurring_payment_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_recurring_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [recurring_payment_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/recurringpayment/test_pause_recurring_payment.py b/tests/unit/models/recurringpayment/test_pause_recurring_payment.py deleted file mode 100644 index 91c455e1..00000000 --- a/tests/unit/models/recurringpayment/test_pause_recurring_payment.py +++ /dev/null @@ -1,56 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.recurring_payment import recurring_payment_response -from xendit.models import RecurringPayment - - -# fmt: off -class TestPauseRecurringPayment(ModelBaseTest): - @pytest.fixture - def default_recurring_payment_data(self): - tested_class = RecurringPayment - class_name = "RecurringPayment" - method_name = "pause" - http_method_name = "post" - args = () - kwargs = { - "id": "mock_id-123", - } - params = (args, kwargs) - url = f"/recurring_payments/{kwargs['id']}/pause!" - expected_correct_result = recurring_payment_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_recurring_payment_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_recurring_payment_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [recurring_payment_response()], indirect=True) - def test_return_recurring_payment_on_correct_params( - self, mocker, mock_correct_response, default_recurring_payment_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_recurring_payment_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_recurring_payment_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_recurring_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [recurring_payment_response()], indirect=True) - def test_return_recurring_payment_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_recurring_payment_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_recurring_payment_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_recurring_payment_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_recurring_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [recurring_payment_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/recurringpayment/test_resume_recurring_payment.py b/tests/unit/models/recurringpayment/test_resume_recurring_payment.py deleted file mode 100644 index 81d74c31..00000000 --- a/tests/unit/models/recurringpayment/test_resume_recurring_payment.py +++ /dev/null @@ -1,56 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.recurring_payment import recurring_payment_response -from xendit.models import RecurringPayment - - -# fmt: off -class TestResumeRecurringPayment(ModelBaseTest): - @pytest.fixture - def default_recurring_payment_data(self): - tested_class = RecurringPayment - class_name = "RecurringPayment" - method_name = "resume" - http_method_name = "post" - args = () - kwargs = { - "id": "mock_id-123", - } - params = (args, kwargs) - url = f"/recurring_payments/{kwargs['id']}/resume!" - expected_correct_result = recurring_payment_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_recurring_payment_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_recurring_payment_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [recurring_payment_response()], indirect=True) - def test_return_recurring_payment_on_correct_params( - self, mocker, mock_correct_response, default_recurring_payment_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_recurring_payment_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_recurring_payment_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_recurring_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [recurring_payment_response()], indirect=True) - def test_return_recurring_payment_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_recurring_payment_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_recurring_payment_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_recurring_payment_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_recurring_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [recurring_payment_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/recurringpayment/test_stop_recurring_payment.py b/tests/unit/models/recurringpayment/test_stop_recurring_payment.py deleted file mode 100644 index 34c50281..00000000 --- a/tests/unit/models/recurringpayment/test_stop_recurring_payment.py +++ /dev/null @@ -1,56 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.recurring_payment import recurring_payment_response -from xendit.models import RecurringPayment - - -# fmt: off -class TestStopRecurringPayment(ModelBaseTest): - @pytest.fixture - def default_recurring_payment_data(self): - tested_class = RecurringPayment - class_name = "RecurringPayment" - method_name = "stop" - http_method_name = "post" - args = () - kwargs = { - "id": "mock_id-123", - } - params = (args, kwargs) - url = f"/recurring_payments/{kwargs['id']}/stop!" - expected_correct_result = recurring_payment_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_recurring_payment_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_recurring_payment_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [recurring_payment_response()], indirect=True) - def test_return_recurring_payment_on_correct_params( - self, mocker, mock_correct_response, default_recurring_payment_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_recurring_payment_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_recurring_payment_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_recurring_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [recurring_payment_response()], indirect=True) - def test_return_recurring_payment_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_recurring_payment_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_recurring_payment_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_recurring_payment_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_recurring_payment_data) - - @pytest.mark.parametrize("mock_correct_response", [recurring_payment_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/refund/__init__.py b/tests/unit/models/refund/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/unit/models/refund/test_create_refund.py b/tests/unit/models/refund/test_create_refund.py deleted file mode 100644 index 41b80a97..00000000 --- a/tests/unit/models/refund/test_create_refund.py +++ /dev/null @@ -1,61 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.refund import refund_response -from xendit.models import Refund - -class TestCreateRefund(ModelBaseTest): - @pytest.fixture - def default_refund_data(self): - tested_class = Refund - class_name = "Refund" - method_name = "create" - http_method_name = "post" - args = () - kwargs = { - "payment_request_id": "pr-6e9778ea-7d62-40fe-8b25-a4d740754c5f", - "reference_id": "b2756a1e-e6cd-4352-9a68-0483aa2b6a2f", - "currency":"PHP", - "reason":"CANCELLATION" - } - params = (args, kwargs) - url = "/refunds" - expected_correct_result = refund_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_refund_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_refund_data - headers = {} - body = { - "payment_request_id": "pr-6e9778ea-7d62-40fe-8b25-a4d740754c5f", - "reference_id": "b2756a1e-e6cd-4352-9a68-0483aa2b6a2f", - "currency":"PHP", - "reason":"CANCELLATION" - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [refund_response()], indirect=True) - def test_return_payment_method_on_correct_params( - self, mocker, mock_correct_response, default_refund_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_refund_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_refund_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_refund_data) - - @pytest.mark.parametrize("mock_correct_response", [refund_response()], indirect=True) - def test_return_payment_method_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_refund_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_refund_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_refund_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_refund_data) - - @pytest.mark.parametrize("mock_correct_response", [refund_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) \ No newline at end of file diff --git a/tests/unit/models/refund/test_get_refund.py b/tests/unit/models/refund/test_get_refund.py deleted file mode 100644 index ecf37715..00000000 --- a/tests/unit/models/refund/test_get_refund.py +++ /dev/null @@ -1,53 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.refund import refund_response -from xendit.models import Refund - -class TestCreateRefund(ModelBaseTest): - @pytest.fixture - def default_refund_data(self): - tested_class = Refund - class_name = "Refund" - method_name = "get" - http_method_name = "get" - args = () - kwargs = { - "refund_id": "rfd-6f4a377d-a201-437f-9119-f8b00cbbe857" - } - params = (args, kwargs) - url = f"/refunds/{kwargs['refund_id']}" - expected_correct_result = refund_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_refund_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_refund_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [refund_response()], indirect=True) - def test_return_payment_method_on_correct_params( - self, mocker, mock_correct_response, default_refund_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_refund_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_refund_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_refund_data) - - @pytest.mark.parametrize("mock_correct_response", [refund_response()], indirect=True) - def test_return_payment_method_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_refund_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_refund_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_refund_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_refund_data) - - @pytest.mark.parametrize("mock_correct_response", [refund_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) \ No newline at end of file diff --git a/tests/unit/models/retailoutlet/__init__.py b/tests/unit/models/retailoutlet/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/unit/models/retailoutlet/test_create_fixed_payment_code.py b/tests/unit/models/retailoutlet/test_create_fixed_payment_code.py deleted file mode 100644 index 92cd9520..00000000 --- a/tests/unit/models/retailoutlet/test_create_fixed_payment_code.py +++ /dev/null @@ -1,65 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.retail_outlet import retail_outlet_response -from xendit.models import RetailOutlet - - -# fmt: off -class TestCreateFixedPaymentCode(ModelBaseTest): - @pytest.fixture - def default_retail_outlet_data(self): - tested_class = RetailOutlet - class_name = "RetailOutlet" - method_name = "create_fixed_payment_code" - http_method_name = "post" - args = () - kwargs = { - "external_id": "demo_fixed_payment_code_123", - "retail_outlet_name": "ALFAMART", - "name": "Rika Sutanto", - "expected_amount": 10000, - "x_idempotency_key": "test-idemp_123", - } - params = (args, kwargs) - url = "/fixed_payment_code" - expected_correct_result = retail_outlet_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_retail_outlet_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_retail_outlet_data - headers = {"X-IDEMPOTENCY-KEY": "test-idemp_123"} - body = { - "expected_amount": 10000, - "external_id": "demo_fixed_payment_code_123", - "name": "Rika Sutanto", - "retail_outlet_name": "ALFAMART", - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [retail_outlet_response()], indirect=True) - def test_return_retail_outlet_on_correct_params( - self, mocker, mock_correct_response, default_retail_outlet_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_retail_outlet_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_retail_outlet_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_retail_outlet_data) - - @pytest.mark.parametrize("mock_correct_response", [retail_outlet_response()], indirect=True) - def test_return_retail_outlet_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_retail_outlet_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_retail_outlet_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_retail_outlet_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_retail_outlet_data) - - @pytest.mark.parametrize("mock_correct_response", [retail_outlet_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/retailoutlet/test_get_fixed_payment_code.py b/tests/unit/models/retailoutlet/test_get_fixed_payment_code.py deleted file mode 100644 index 48b615d7..00000000 --- a/tests/unit/models/retailoutlet/test_get_fixed_payment_code.py +++ /dev/null @@ -1,54 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.retail_outlet import retail_outlet_response -from xendit.models import RetailOutlet - - -# fmt: off -class TestGetFixedPaymentCode(ModelBaseTest): - @pytest.fixture - def default_retail_outlet_data(self): - tested_class = RetailOutlet - class_name = "RetailOutlet" - method_name = "get_fixed_payment_code" - http_method_name = "get" - args = () - kwargs = {"fixed_payment_code_id": "5ef2f0f8e7f5c14077275493"} - params = (args, kwargs) - url = f"/fixed_payment_code/{kwargs['fixed_payment_code_id']}" - expected_correct_result = retail_outlet_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_retail_outlet_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_retail_outlet_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [retail_outlet_response()], indirect=True) - def test_return_retail_outlet_on_correct_params( - self, mocker, mock_correct_response, default_retail_outlet_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_retail_outlet_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_retail_outlet_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_retail_outlet_data) - - @pytest.mark.parametrize("mock_correct_response", [retail_outlet_response()], indirect=True) - def test_return_retail_outlet_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_retail_outlet_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_retail_outlet_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_retail_outlet_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_retail_outlet_data) - - @pytest.mark.parametrize("mock_correct_response", [retail_outlet_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/retailoutlet/test_update_fixed_payment_code.py b/tests/unit/models/retailoutlet/test_update_fixed_payment_code.py deleted file mode 100644 index cdd819e0..00000000 --- a/tests/unit/models/retailoutlet/test_update_fixed_payment_code.py +++ /dev/null @@ -1,61 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.retail_outlet import retail_outlet_update_response -from xendit.models import RetailOutlet - - -# fmt: off -class TestUpdateFixedPaymentCode(ModelBaseTest): - @pytest.fixture - def default_retail_outlet_data(self): - tested_class = RetailOutlet - class_name = "RetailOutlet" - method_name = "update_fixed_payment_code" - http_method_name = "patch" - args = () - kwargs = { - "fixed_payment_code_id": "5ef2f0f8e7f5c14077275493", - "name": "Joe Contini", - "x_idempotency_key": "test-idemp_123", - } - params = (args, kwargs) - url = f"/fixed_payment_code/{kwargs['fixed_payment_code_id']}" - expected_correct_result = retail_outlet_update_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_retail_outlet_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_retail_outlet_data - headers = {"X-IDEMPOTENCY-KEY": "test-idemp_123"} - body = { - "fixed_payment_code_id": "5ef2f0f8e7f5c14077275493", - "name": "Joe Contini", - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [retail_outlet_update_response()], indirect=True) - def test_return_retail_outlet_on_correct_params( - self, mocker, mock_correct_response, default_retail_outlet_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_retail_outlet_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_retail_outlet_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_retail_outlet_data) - - @pytest.mark.parametrize("mock_correct_response", [retail_outlet_update_response()], indirect=True) - def test_return_retail_outlet_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_retail_outlet_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_retail_outlet_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_retail_outlet_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_retail_outlet_data) - - @pytest.mark.parametrize("mock_correct_response", [retail_outlet_update_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/virtualaccount/__init__.py b/tests/unit/models/virtualaccount/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/unit/models/virtualaccount/test_create_virtual_account.py b/tests/unit/models/virtualaccount/test_create_virtual_account.py deleted file mode 100644 index 84fa0b58..00000000 --- a/tests/unit/models/virtualaccount/test_create_virtual_account.py +++ /dev/null @@ -1,59 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.virtual_account import virtual_account_response -from xendit.models import VirtualAccount - - -# fmt: off -class TestCreateVirtualAccount(ModelBaseTest): - @pytest.fixture - def default_virtual_account_data(self): - tested_class = VirtualAccount - class_name = "VirtualAccount" - method_name = "create" - http_method_name = "post" - args = () - kwargs = { - "external_id": "demo_1475459775872", - "bank_code": "BNI", - "name": "Rika Sutanto", - "x_idempotency_key": "test-idemp_123" - } - params = (args, kwargs) - url = "/callback_virtual_accounts" - expected_correct_result = virtual_account_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_virtual_account_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_virtual_account_data - headers = {'X-IDEMPOTENCY-KEY': 'test-idemp_123'} - body = {'bank_code': 'BNI', 'external_id': 'demo_1475459775872', 'name': 'Rika Sutanto'} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [virtual_account_response()], indirect=True) - def test_return_virtual_account_on_correct_params( - self, mocker, mock_correct_response, default_virtual_account_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_virtual_account_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_virtual_account_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_virtual_account_data) - - @pytest.mark.parametrize("mock_correct_response", [virtual_account_response()], indirect=True) - def test_return_virtual_account_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_virtual_account_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_virtual_account_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_virtual_account_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_virtual_account_data) - - @pytest.mark.parametrize("mock_correct_response", [virtual_account_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/virtualaccount/test_get_virtual_account.py b/tests/unit/models/virtualaccount/test_get_virtual_account.py deleted file mode 100644 index e3c40858..00000000 --- a/tests/unit/models/virtualaccount/test_get_virtual_account.py +++ /dev/null @@ -1,54 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.virtual_account import virtual_account_response -from xendit.models import VirtualAccount - - -# fmt: off -class TestGetVirtualAccount(ModelBaseTest): - @pytest.fixture - def default_virtual_account_data(self): - tested_class = VirtualAccount - class_name = "VirtualAccount" - method_name = "get" - http_method_name = "get" - args = () - kwargs = {"id": "5eec3a3e8dd9ea2fc97d6728"} - params = (args, kwargs) - url = f"/callback_virtual_accounts/{kwargs['id']}" - expected_correct_result = virtual_account_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_virtual_account_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_virtual_account_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [virtual_account_response()], indirect=True) - def test_return_virtual_account_on_correct_params( - self, mocker, mock_correct_response, default_virtual_account_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_virtual_account_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_virtual_account_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_virtual_account_data) - - @pytest.mark.parametrize("mock_correct_response", [virtual_account_response()], indirect=True) - def test_return_virtual_account_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_virtual_account_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_virtual_account_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_virtual_account_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_virtual_account_data) - - @pytest.mark.parametrize("mock_correct_response", [virtual_account_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/virtualaccount/test_get_virtual_account_banks.py b/tests/unit/models/virtualaccount/test_get_virtual_account_banks.py deleted file mode 100644 index 24fad47a..00000000 --- a/tests/unit/models/virtualaccount/test_get_virtual_account_banks.py +++ /dev/null @@ -1,54 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.virtual_account import virtual_account_banks_response -from xendit.models import VirtualAccount - - -# fmt: off -class TestGetVirtualAccountBanks(ModelBaseTest): - @pytest.fixture - def default_virtual_account_data(self): - tested_class = VirtualAccount - class_name = "VirtualAccount" - method_name = "get_banks" - http_method_name = "get" - args = () - kwargs = {} - params = (args, kwargs) - url = "/available_virtual_account_banks" - expected_correct_result = virtual_account_banks_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_virtual_account_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_virtual_account_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [virtual_account_banks_response()], indirect=True) - def test_return_virtual_account_banks_on_correct_params( - self, mocker, mock_correct_response, default_virtual_account_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_virtual_account_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_virtual_account_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_virtual_account_data) - - @pytest.mark.parametrize("mock_correct_response", [virtual_account_banks_response()], indirect=True) - def test_return_virtual_account_banks_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_virtual_account_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_virtual_account_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_virtual_account_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_virtual_account_data) - - @pytest.mark.parametrize("mock_correct_response", [virtual_account_banks_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/virtualaccount/test_get_virtual_account_payment.py b/tests/unit/models/virtualaccount/test_get_virtual_account_payment.py deleted file mode 100644 index 9501933e..00000000 --- a/tests/unit/models/virtualaccount/test_get_virtual_account_payment.py +++ /dev/null @@ -1,54 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.virtual_account import virtual_account_payment_response -from xendit.models import VirtualAccount - - -# fmt: off -class TestGetVirtualAccountPayment(ModelBaseTest): - @pytest.fixture - def default_virtual_account_data(self): - tested_class = VirtualAccount - class_name = "VirtualAccount" - method_name = "get_payment" - http_method_name = "get" - args = () - kwargs = {"payment_id": "5ef18efca7d10d1b4d61fb52"} - params = (args, kwargs) - url = f"/callback_virtual_account_payments/payment_id={kwargs['payment_id']}" - expected_correct_result = virtual_account_payment_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_virtual_account_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_virtual_account_data - headers = {} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [virtual_account_payment_response()], indirect=True) - def test_return_virtual_account_on_correct_params( - self, mocker, mock_correct_response, default_virtual_account_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_virtual_account_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_virtual_account_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_virtual_account_data) - - @pytest.mark.parametrize("mock_correct_response", [virtual_account_payment_response()], indirect=True) - def test_return_virtual_account_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_virtual_account_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_virtual_account_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_virtual_account_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_virtual_account_data) - - @pytest.mark.parametrize("mock_correct_response", [virtual_account_payment_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/virtualaccount/test_update_virtual_account.py b/tests/unit/models/virtualaccount/test_update_virtual_account.py deleted file mode 100644 index f552d466..00000000 --- a/tests/unit/models/virtualaccount/test_update_virtual_account.py +++ /dev/null @@ -1,57 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.virtual_account import virtual_account_response -from xendit.models import VirtualAccount - - -# fmt: off -class TestUpdateVirtualAccount(ModelBaseTest): - @pytest.fixture - def default_virtual_account_data(self): - tested_class = VirtualAccount - class_name = "VirtualAccount" - method_name = "update" - http_method_name = "patch" - args = () - kwargs = { - "id": "5eec3a3e8dd9ea2fc97d6728", - "x_idempotency_key": "test-idemp_123", - } - params = (args, kwargs) - url = f"/callback_virtual_accounts/{kwargs['id']}" - expected_correct_result = virtual_account_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_virtual_account_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_virtual_account_data - headers = {'X-IDEMPOTENCY-KEY': 'test-idemp_123'} - body = {} - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [virtual_account_response()], indirect=True) - def test_return_virtual_account_on_correct_params( - self, mocker, mock_correct_response, default_virtual_account_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_virtual_account_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_virtual_account_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_virtual_account_data) - - @pytest.mark.parametrize("mock_correct_response", [virtual_account_response()], indirect=True) - def test_return_virtual_account_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_virtual_account_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_virtual_account_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_virtual_account_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_virtual_account_data) - - @pytest.mark.parametrize("mock_correct_response", [virtual_account_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) -# fmt: on diff --git a/tests/unit/models/xenplatform/__init__.py b/tests/unit/models/xenplatform/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/unit/models/xenplatform/test_create_account.py b/tests/unit/models/xenplatform/test_create_account.py deleted file mode 100644 index 3421513d..00000000 --- a/tests/unit/models/xenplatform/test_create_account.py +++ /dev/null @@ -1,70 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.xenplatform import xenplatform_account_response -from xendit.models import XenPlatform, XenPlatformAccountType - - -# fmt: off -class TestCreateAccount(ModelBaseTest): - @pytest.fixture - def default_xenplatform_data(self): - tested_class = XenPlatform - class_name = "XenPlatform" - method_name = "create_account" - http_method_name = "post" - - business_profile = XenPlatform.helper_create_business_profile( - business_name="python-xendit", - ) - args = () - kwargs = { - "account_email": "test-xenplatform@pythonxendit.co", - "type": XenPlatformAccountType.OWNED, - "business_profile": business_profile, - "x_idempotency_key": "test_idemp_123", - } - params = (args, kwargs) - url = "/accounts" - expected_correct_result = xenplatform_account_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_xenplatform_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_xenplatform_data - headers = {"X-IDEMPOTENCY-KEY": "test_idemp_123"} - body = { - "account_email": "test-xenplatform@pythonxendit.co", - "type": "OWNED", - "business_profile": { - "business_name": "python-xendit" - }, - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [xenplatform_account_response()], indirect=True) - def test_return_xenplatform_account_on_correct_params( - self, mocker, mock_correct_response, default_xenplatform_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_xenplatform_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_xenplatform_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_xenplatform_data) - - @pytest.mark.parametrize("mock_correct_response", [xenplatform_account_response()], indirect=True) - def test_return_xenplatform_account_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_xenplatform_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_xenplatform_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_xenplatform_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_xenplatform_data) - - @pytest.mark.parametrize("mock_correct_response", [xenplatform_account_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) - -# fmt: on diff --git a/tests/unit/models/xenplatform/test_set_callback_url.py b/tests/unit/models/xenplatform/test_set_callback_url.py deleted file mode 100644 index 034f7e57..00000000 --- a/tests/unit/models/xenplatform/test_set_callback_url.py +++ /dev/null @@ -1,62 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.xenplatform import xenplatform_callback_url_response -from xendit.models import XenPlatform, XenPlatformURLType - - -# fmt: off -class TestSetCallbackURL(ModelBaseTest): - @pytest.fixture - def default_xenplatform_data(self): - tested_class = XenPlatform - class_name = "XenPlatform" - method_name = "set_callback_url" - http_method_name = "post" - - args = () - kwargs = { - "type": XenPlatformURLType.INVOICE, - "url": "https://test-url-invoice.com", - "x_idempotency_key": "test_idemp_123", - } - params = (args, kwargs) - url = "/callback_urls/invoice" - expected_correct_result = xenplatform_callback_url_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_xenplatform_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_xenplatform_data - headers = {"X-IDEMPOTENCY-KEY": "test_idemp_123"} - body = { - "url": "https://test-url-invoice.com", - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [xenplatform_callback_url_response()], indirect=True) - def test_return_xenplatform_callback_url_on_correct_params( - self, mocker, mock_correct_response, default_xenplatform_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_xenplatform_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_xenplatform_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_xenplatform_data) - - @pytest.mark.parametrize("mock_correct_response", [xenplatform_callback_url_response()], indirect=True) - def test_return_xenplatform_callback_url_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_xenplatform_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_xenplatform_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_xenplatform_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_xenplatform_data) - - @pytest.mark.parametrize("mock_correct_response", [xenplatform_callback_url_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) - -# fmt: on diff --git a/tests/unit/models/xenplatform/test_transfers.py b/tests/unit/models/xenplatform/test_transfers.py deleted file mode 100644 index 98938cde..00000000 --- a/tests/unit/models/xenplatform/test_transfers.py +++ /dev/null @@ -1,67 +0,0 @@ -import pytest -from ..model_base_test import ModelBaseTest -from tests.sampleresponse.xenplatform import xenplatform_transfers_response -from xendit.models import XenPlatform - - -# fmt: off -class TestTransfers(ModelBaseTest): - @pytest.fixture - def default_xenplatform_data(self): - tested_class = XenPlatform - class_name = "XenPlatform" - method_name = "transfers" - http_method_name = "post" - - args = () - kwargs = { - "reference": "123", - "amount": 10000, - "source_user_id": "54afeb170a2b18519b1b8768", - "destination_user_id": "5cafeb170a2b1851246b8768", - "x_idempotency_key": "test_idemp_123", - } - params = (args, kwargs) - url = "/transfers" - expected_correct_result = xenplatform_transfers_response() - return (tested_class, class_name, method_name, http_method_name, url, params, expected_correct_result) - - @pytest.fixture - def api_requestor_request_data(self, default_xenplatform_data): - tested_class, class_name, method_name, http_method_name, url, params, _ = default_xenplatform_data - headers = {"X-IDEMPOTENCY-KEY": "test_idemp_123"} - body = { - "reference": "123", - "amount": 10000, - "source_user_id": "54afeb170a2b18519b1b8768", - "destination_user_id": "5cafeb170a2b1851246b8768", - } - return (tested_class, class_name, method_name, http_method_name, url, params, headers, body) - - @pytest.mark.parametrize("mock_correct_response", [xenplatform_transfers_response()], indirect=True) - def test_return_xenplatform_transfers_on_correct_params( - self, mocker, mock_correct_response, default_xenplatform_data - ): - self.run_success_return_test_on_xendit_instance(mocker, mock_correct_response, default_xenplatform_data) - - def test_raise_xendit_error_on_response_error( - self, mocker, mock_error_request_response, default_xenplatform_data - ): - self.run_raises_error_test_on_xendit_instance(mocker, mock_error_request_response, default_xenplatform_data) - - @pytest.mark.parametrize("mock_correct_response", [xenplatform_transfers_response()], indirect=True) - def test_return_xenplatform_transfers_on_correct_params_and_global_xendit( - self, mocker, mock_correct_response, default_xenplatform_data - ): - self.run_success_return_test_on_global_config(mocker, mock_correct_response, default_xenplatform_data) - - def test_raise_xendit_error_on_response_error_and_global_xendit( - self, mocker, mock_error_request_response, default_xenplatform_data - ): - self.run_raises_error_test_on_global_config(mocker, mock_error_request_response, default_xenplatform_data) - - @pytest.mark.parametrize("mock_correct_response", [xenplatform_transfers_response()], indirect=True) - def test_send_correct_request_to_api_requestor(self, mocker, mock_correct_response, api_requestor_request_data): - self.run_send_correct_request_to_api_requestor(mocker, mock_correct_response, api_requestor_request_data) - -# fmt: on diff --git a/tests/unit/test_api_requestor.py b/tests/unit/test_api_requestor.py deleted file mode 100644 index 8fd37361..00000000 --- a/tests/unit/test_api_requestor.py +++ /dev/null @@ -1,108 +0,0 @@ -import base64 -import json -import pytest -import requests -import responses -import xendit - -from xendit._api_requestor import _APIRequestor - - -def generate_auth(api_key): - auth_pair = api_key + ":" - auth_base64 = base64.b64encode(auth_pair.encode()) - return f'Basic {auth_base64.decode("utf-8")}' - - -def substitute_callback(request): - resp_body = {"method": request.method} - return (200, request.headers, json.dumps(resp_body)) - - -@pytest.fixture -def default_params(): - api_key = "test-123" - base_url = "https://mock-url.xendit.co" - section = "/balance" - http_client = requests - url = base_url + section - custom_headers = { - "X-IDEMPOTENCY-KEY": "key-123", - "for-user-id": "id-123", - } - return api_key, base_url, section, http_client, url, custom_headers - - -@responses.activate -def test_get_call_get_method(default_params): - api_key, base_url, section, http_client, url, custom_headers = default_params - responses.add_callback(method="GET", url=url, callback=substitute_callback) - - _APIRequestor.get( - section, api_key=api_key, base_url=base_url, http_client=http_client, - ) - - -@responses.activate -def test_post_call_post_method(default_params): - api_key, base_url, section, http_client, url, custom_headers = default_params - responses.add_callback(method="POST", url=url, callback=substitute_callback) - - _APIRequestor.post( - section, api_key=api_key, base_url=base_url, http_client=http_client, - ) - - -@responses.activate -def test_patch_call_patch_method(default_params): - api_key, base_url, section, http_client, url, custom_headers = default_params - responses.add_callback(method="PATCH", url=url, callback=substitute_callback) - - _APIRequestor.patch( - section, api_key=api_key, base_url=base_url, http_client=http_client, - ) - - -@responses.activate -def test_request_send_correct_params_on_given_params(default_params): - api_key, base_url, section, http_client, url, custom_headers = default_params - responses.add_callback(method="GET", url=url, callback=substitute_callback) - - xendit_response = _APIRequestor._request( - "GET", section, api_key=api_key, base_url=base_url, http_client=http_client, - ) - - assert xendit_response.headers["Authorization"] == generate_auth(api_key) - - -@responses.activate -def test_request_send_default_config_on_empty_params(default_params): - api_key, base_url, section, http_client, url, custom_headers = default_params - xendit.api_key = api_key - xendit.base_url = base_url - responses.add_callback(method="GET", url=url, callback=substitute_callback) - - xendit_response = _APIRequestor._request("GET", section, http_client=http_client,) - - assert xendit_response.headers["Authorization"] == generate_auth(api_key) - - -@responses.activate -def test_request_header_have_custom_header_when_inserted(default_params): - api_key, base_url, section, http_client, url, custom_headers = default_params - - responses.add_callback(method="POST", url=url, callback=substitute_callback) - xendit_response = _APIRequestor._request( - "POST", - section, - api_key=api_key, - base_url=base_url, - http_client=http_client, - headers=custom_headers, - ) - - assert ( - xendit_response.headers["X-IDEMPOTENCY-KEY"] - == custom_headers["X-IDEMPOTENCY-KEY"] - ) - assert xendit_response.headers["for-user-id"] == custom_headers["for-user-id"] diff --git a/tests/unit/test_xendit_param_injector.py b/tests/unit/test_xendit_param_injector.py deleted file mode 100644 index e11ade00..00000000 --- a/tests/unit/test_xendit_param_injector.py +++ /dev/null @@ -1,22 +0,0 @@ -from xendit._xendit_param_injector import _XenditParamInjector - - -class SampleMockClass: - @staticmethod - def mock_function(*args, **kwargs): - return kwargs - - -def test_method_correctly_injected(mocker): - api_key = "test-123" - base_url = "https://mock-url.xendit.co" - http_client = mocker.Mock() - params = (api_key, base_url, http_client) - - param_injector = _XenditParamInjector(params) - MockInjectedClass = param_injector.instantiate(SampleMockClass) - - received_args = MockInjectedClass.mock_function() - assert received_args["api_key"] == api_key - assert received_args["base_url"] == base_url - assert received_args["http_client"] == http_client diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..c6471efc --- /dev/null +++ b/tox.ini @@ -0,0 +1,9 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + pytest --cov=xendit diff --git a/xendit/__init__.py b/xendit/__init__.py index 63e599cd..9666f7e5 100644 --- a/xendit/__init__.py +++ b/xendit/__init__.py @@ -1,6 +1,23 @@ -from .models import * -from .network import * - -from . import _config -from .xendit_error import XenditError -from .xendit import Xendit +# flake8: noqa + +""" + The version of the XENDIT API: 2.87.2 +""" + + +__version__ = "3.0.0" + +# import ApiClient +from xendit.api_client import ApiClient + +# import Configuration +from xendit.configuration import set_api_key +from xendit.configuration import Configuration + +# import exceptions +from xendit.exceptions import OpenApiException +from xendit.exceptions import ApiAttributeError +from xendit.exceptions import ApiTypeError +from xendit.exceptions import ApiValueError +from xendit.exceptions import ApiKeyError +from xendit.exceptions import ApiException diff --git a/xendit/_api_requestor.py b/xendit/_api_requestor.py deleted file mode 100644 index 3ebc3275..00000000 --- a/xendit/_api_requestor.py +++ /dev/null @@ -1,74 +0,0 @@ -import base64 -import requests -import xendit -import sys -from xendit.network import XenditResponse - -if sys.version_info[1] < 8: - from importlib_metadata import version -else: - from importlib.metadata import version - - -class _APIRequestor: - @staticmethod - def get(url, **kwargs): - return _APIRequestor._request("GET", url, **kwargs) - - @staticmethod - def post(url, **kwargs): - return _APIRequestor._request("POST", url, **kwargs) - - @staticmethod - def patch(url, **kwargs): - return _APIRequestor._request("PATCH", url, **kwargs) - - @staticmethod - def _request( - method, - url, - api_key=None, - base_url=None, - http_client=requests, - headers={}, - body={}, - params={}, - ): - """Send HTTP Method to given url - - Args: - - method (str): HTTP Method that will be send - - url (str): URL Directory that will be searched (not including base_url) - - **api_key (string): API Key from xendit instance. Default to config if not provided - - **base_url (string): Base url of the API. Default to config if not provided - - **http_client (HTTPClientInterface): HTTP Client that adhere to HTTPClientInterface. Default to config if not provided - - **headers: Headers of the request - - **body: Body of the request. Only used on POST and PATCH request - - **params: Parameters of the request. Only used on GET request - """ - if api_key is None: - api_key = xendit.api_key - if base_url is None: - base_url = xendit.base_url - url = base_url + url - - headers = _APIRequestor._add_default_headers(api_key, headers) - if method == "GET": - resp = http_client.request(method, url, headers=headers, params=params) - else: - resp = http_client.request(method, url, headers=headers, json=body) - return XenditResponse(resp.status_code, resp.headers, resp.json()) - - @staticmethod - def _add_default_headers(api_key, headers): - headers["Content-type"] = "application/json" - headers["Authorization"] = f"Basic {_APIRequestor._generate_auth(api_key)}" - headers["xendit-lib"] = "python" - headers["xendit-lib-ver"] = version("xendit-python") - return headers - - @staticmethod - def _generate_auth(api_key): - auth_pair = api_key + ":" - auth_base64 = base64.b64encode(auth_pair.encode()) - return auth_base64.decode("utf-8") diff --git a/xendit/_config.py b/xendit/_config.py deleted file mode 100644 index 9498c43f..00000000 --- a/xendit/_config.py +++ /dev/null @@ -1,6 +0,0 @@ -import xendit - -# Global variable that could be changed by user -# This is an alternative if user choose to not use Xendit class -xendit.api_key = "" -xendit.base_url = "https://api.xendit.co/" diff --git a/xendit/_extract_params.py b/xendit/_extract_params.py deleted file mode 100644 index 8c34cb4b..00000000 --- a/xendit/_extract_params.py +++ /dev/null @@ -1,33 +0,0 @@ -import inspect - - -def _extract_params(function_locals, func_object, headers_params=[], ignore_params=[]): - """Extract data from function_locals to headers and body of the request - - Args: - - function_locals (dict): locals() of the function - - func_object (function): Function that will be analyzed the parameter list - - **headers_params (list): List of headers parameter. Defaults to []. - - **ignore_params (list): List of params that won't be used on headers and body. Default to [] - - Returns: - dict, dict: headers and body of the request - """ - body = dict() - headers = dict() - map_headers_key = { - "for_user_id": "for-user-id", - "x_api_version": "X-API-VERSION", - "x_idempotency_key": "X-IDEMPOTENCY-KEY", - "idempotency_key": "Idempotency-key", - "with_fee_rule": "with-fee-rule", - } - for param in inspect.getfullargspec(func_object)[4]: - value = function_locals.get(param, None) - if value is not None and param not in ignore_params: - if param in headers_params: - mapped_param = map_headers_key[param] - headers[mapped_param] = function_locals[param] - else: - body[param] = function_locals[param] - return headers, body diff --git a/xendit/_xendit_param_injector.py b/xendit/_xendit_param_injector.py deleted file mode 100644 index 2ac4964d..00000000 --- a/xendit/_xendit_param_injector.py +++ /dev/null @@ -1,118 +0,0 @@ -from inspect import signature - - - -from .models import Balance -from .models import BatchDisbursement -from .models import CardlessCredit -from .models import CreditCard -from .models import DirectDebit -from .models import Disbursement -from .models.ewallet import EWallet -from .models import Invoice -from .models import PaymentMethod -from .models import PaymentRequest -from .models import Payout -from .models import QRCode -from .models import RecurringPayment -from .models import Refund -from .models import RetailOutlet -from .models import VirtualAccount -from .models import XenPlatform - - -class _XenditParamInjector: - """Builder class to inject parameters (api_key, base_url, http_client) to feature class""" - - def __init__(self, params): - self.params = params - - def instantiate_balance(self) -> Balance: - return self.instantiate(Balance) - - def instantiate_batch_disbursement(self) -> BatchDisbursement: - return self.instantiate(BatchDisbursement) - - def instantiate_cardless_credit(self) -> CardlessCredit: - return self.instantiate(CardlessCredit) - - def instantiate_credit_card(self) -> CreditCard: - return self.instantiate(CreditCard) - - def instantiate_direct_debit(self) -> DirectDebit: - return self.instantiate(DirectDebit) - - def instantiate_disbursement(self) -> Disbursement: - return self.instantiate(Disbursement) - - def instantiate_ewallet(self) -> EWallet: - return self.instantiate(EWallet) - - def instantiate_invoice(self) -> Invoice: - return self.instantiate(Invoice) - - def instantiate_payment_method(self) -> PaymentMethod: - return self.instantiate(PaymentMethod) - - def instantiate_payment_request(self) -> PaymentRequest: - return self.instantiate(PaymentRequest) - - def instantiate_payout(self) -> Payout: - return self.instantiate(Payout) - - def instantiate_qrcode(self) -> QRCode: - return self.instantiate(QRCode) - - def instantiate_recurring_payment(self) -> RecurringPayment: - return self.instantiate(RecurringPayment) - - def instantiate_refund(self) -> Refund: - return self.instantiate(Refund) - - def instantiate_retail_outlet(self) -> RetailOutlet: - return self.instantiate(RetailOutlet) - - def instantiate_virtual_account(self) -> VirtualAccount: - return self.instantiate(VirtualAccount) - - def instantiate_xenplatform(self) -> XenPlatform: - return self.instantiate(XenPlatform) - - def instantiate(self, injected_class): - """Inject every static method in `injected_class` with provided parameters. - - Args: - - injected_class (class): Class that will be injected - - Return: - injected_class - """ - params = self.params - - injected_class = type( - injected_class.__name__, - injected_class.__bases__, - dict(injected_class.__dict__), - ) - for keys, value in vars(injected_class).items(): - if type(value) == staticmethod and not keys.startswith("_"): - _XenditParamInjector._inject_function( - injected_class, params, keys, value - ) - return injected_class - - @staticmethod - def _inject_function(injected_class, params, func_name, func_value): - """Inject `func_name` function with params""" - api_key, base_url, http_client = params - attr = func_value.__func__ - - def inject_func_with_api_key(*args, **kwargs): - kwargs["api_key"] = api_key - kwargs["base_url"] = base_url - kwargs["http_client"] = http_client - result = attr(*args, **kwargs) - return result - - inject_func_with_api_key.__signature__ = signature(attr) - setattr(injected_class, func_name, staticmethod(inject_func_with_api_key)) diff --git a/xendit/api_client.py b/xendit/api_client.py new file mode 100644 index 00000000..06bc5479 --- /dev/null +++ b/xendit/api_client.py @@ -0,0 +1,901 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import json +import atexit +import mimetypes +from multiprocessing.pool import ThreadPool +import io +import os +import re +import typing +import base64 +from urllib.parse import quote +from urllib3.fields import RequestField + + +from xendit import rest +from xendit.configuration import Configuration +from xendit.exceptions import ApiTypeError, ApiValueError, ApiException +from xendit.model_utils import ( + ModelNormal, + ModelSimple, + ModelComposed, + check_allowed_values, + check_validations, + date, + datetime, + deserialize_file, + file_type, + model_to_dict, + none_type, + validate_and_convert_types +) + + +class ApiClient(object): + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + :param pool_threads: The number of threads to use for async requests + to the API. More threads means more concurrent API requests. + """ + + _pool = None + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None, pool_threads=1): + if configuration is None: + configuration = Configuration.get_default_copy() + self.configuration = configuration + self.pool_threads = pool_threads + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + + + # XENDIT headers + self.default_headers['xendit-lib'] = 'python' + self.default_headers['xendit-lib-version'] = '3.0.0' + + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-Generator/3.0.0/python' + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + self.close() + + def close(self): + if self._pool: + self._pool.close() + self._pool.join() + self._pool = None + if hasattr(atexit, 'unregister'): + atexit.unregister(self.close) + + @property + def pool(self): + """Create thread pool on first request + avoids instantiating unused threadpool for blocking clients. + """ + if self._pool is None: + atexit.register(self.close) + self._pool = ThreadPool(self.pool_threads) + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def auth(self, apikey): + return "Basic " + base64.b64encode((apikey + ":").encode('utf-8')).decode('utf-8') + + def __call_api( + self, + resource_path: str, + method: str, + path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + body: typing.Optional[typing.Any] = None, + post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, + response_type: typing.Optional[typing.Tuple[typing.Any]] = None, + auth_settings: typing.Optional[typing.List[str]] = None, + _return_http_data_only: typing.Optional[bool] = None, + collection_formats: typing.Optional[typing.Dict[str, str]] = None, + _preload_content: bool = True, + _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, + _host: typing.Optional[str] = None, + _check_type: typing.Optional[bool] = None, + _content_type: typing.Optional[str] = None, + _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None + ): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + post_params.extend(self.files_parameters(files)) + if header_params['Content-Type'].startswith("multipart"): + post_params = self.parameters_to_multipart(post_params, + (dict)) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # auth setting + header_params['Authorization'] = self.auth(config.api_key) + + # request url + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + try: + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + except ApiException as e: + e.body = e.body.decode('utf-8') + raise e + + self.last_response = response_data + + return_data = response_data + + if not _preload_content: + return (return_data) + return return_data + + # deserialize response data + if response_type: + if response_type != (file_type,): + encoding = "utf-8" + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) + if match: + encoding = match.group(1) + response_data.data = response_data.data.decode(encoding) + + return_data = self.deserialize( + response_data, + response_type, + _check_type + ) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def parameters_to_multipart(self, params, collection_types): + """Get parameters as list of tuples, formatting as json if value is collection_types + + :param params: Parameters as list of two-tuples + :param dict collection_types: Parameter collection types + :return: Parameters as list of tuple or urllib3.fields.RequestField + """ + new_params = [] + if collection_types is None: + collection_types = (dict) + for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 + if isinstance( + v, collection_types): # v is instance of collection_type, formatting as application/json + v = json.dumps(v, ensure_ascii=False).encode("utf-8") + field = RequestField(k, v) + field.make_multipart(content_type="application/json; charset=utf-8") + new_params.append(field) + else: + new_params.append((k, v)) + return new_params + + @classmethod + def sanitize_for_serialization(cls, obj): + """Prepares data for transmission before it is sent with the rest client + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + If obj is io.IOBase, return the bytes + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if isinstance(obj, (ModelNormal, ModelComposed)): + return { + key: cls.sanitize_for_serialization(val) for key, + val in model_to_dict( + obj, + serialize=True).items()} + elif isinstance(obj, io.IOBase): + return cls.get_file_data_and_close_file(obj) + elif isinstance(obj, (str, int, float, none_type, bool)): + return obj + elif isinstance(obj, (datetime, date)): + return obj.isoformat() + elif isinstance(obj, ModelSimple): + return cls.sanitize_for_serialization(obj.value) + elif isinstance(obj, list): + return [cls.sanitize_for_serialization(item) for item in obj] + elif isinstance(obj, tuple): + return tuple(cls.sanitize_for_serialization(item) for item in obj) + if isinstance(obj, dict): + return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} + raise ApiValueError( + 'Unable to prepare type {} for serialization'.format( + obj.__class__.__name__)) + + def deserialize(self, response, response_type, _check_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: For the response, a tuple containing: + valid classes + a list containing valid classes (for list schemas) + a dict containing a tuple of valid classes as the value + Example values: + (str,) + (Pet,) + (float, none_type) + ([int, none_type],) + ({str: (bool, str, int, float, date, datetime, str, none_type)},) + :param _check_type: boolean, whether to check the types of the data + received from the server + :type _check_type: bool + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == (file_type,): + content_disposition = response.getheader("Content-Disposition") + return deserialize_file(response.data, self.configuration, + content_disposition=content_disposition) + + # fetch data from response object + try: + received_data = json.loads(response.data) + except ValueError: + received_data = response.data + + # store our data under the key of 'received_data' so users have some + # context if they are deserializing a string and the data type is wrong + deserialized_data = validate_and_convert_types( + received_data, + response_type, + ['received_data'], + True, + _check_type, + configuration=self.configuration + ) + return deserialized_data + + def call_api( + self, + resource_path: str, + method: str, + path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + body: typing.Optional[typing.Any] = None, + post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, + response_type: typing.Optional[typing.Tuple[typing.Any]] = None, + auth_settings: typing.Optional[typing.List[str]] = None, + async_req: typing.Optional[bool] = None, + _return_http_data_only: typing.Optional[bool] = None, + collection_formats: typing.Optional[typing.Dict[str, str]] = None, + _preload_content: bool = True, + _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, + _host: typing.Optional[str] = None, + _check_type: typing.Optional[bool] = None, + _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None + ): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async_req request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response_type: For the response, a tuple containing: + valid classes + a list containing valid classes (for list schemas) + a dict containing a tuple of valid classes as the value + Example values: + (str,) + (Pet,) + (float, none_type) + ([int, none_type],) + ({str: (bool, str, int, float, date, datetime, str, none_type)},) + :param files: key -> field name, value -> a list of open file + objects for `multipart/form-data`. + :type files: dict + :param async_req bool: execute request asynchronously + :type async_req: bool, optional + :param _return_http_data_only: response data without head status code + and headers + :type _return_http_data_only: bool, optional + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :type collection_formats: dict, optional + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :type _preload_content: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _check_type: boolean describing if the data back from the server + should have its type checked. + :type _check_type: bool, optional + :param _request_auths: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auths: list, optional + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout, _host, + _check_type, _request_auths=_request_auths) + + return self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, + query_params, + header_params, body, + post_params, files, + response_type, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host, _check_type, None, _request_auths)) + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ApiValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + @staticmethod + def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: + file_data = file_instance.read() + file_instance.close() + return file_data + + def files_parameters(self, + files: typing.Optional[typing.Dict[str, + typing.List[io.IOBase]]] = None): + """Builds form parameters. + + :param files: None or a dict with key=param_name and + value is a list of open file objects + :return: List of tuples of form parameters with file data + """ + if files is None: + return [] + + params = [] + for param_name, file_instances in files.items(): + if file_instances is None: + # if the file field is nullable, skip None values + continue + for file_instance in file_instances: + if file_instance is None: + # if the file field is nullable, skip None values + continue + if file_instance.closed is True: + raise ApiValueError( + "Cannot read a closed file. The passed in file_type " + "for %s must be open." % param_name + ) + filename = os.path.basename(file_instance.name) + filedata = self.get_file_data_and_close_file(file_instance) + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([param_name, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types, method=None, body=None): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + content_types = [x.lower() for x in content_types] + + if (method == 'PATCH' and + 'application/json-patch+json' in content_types and + isinstance(body, list)): + return 'application/json-patch+json' + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, queries, auth_settings, + resource_path, method, body, request_auths=None): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :param resource_path: A string representation of the HTTP request resource path. + :param method: A string representation of the HTTP request method. + :param body: A object representing the body of the HTTP request. + The object type is the return value of _encoder.default(). + :param request_auths: if set, the provided settings will + override the token in the configuration. + """ + if not auth_settings: + return + + if request_auths: + for auth_setting in request_auths: + self._apply_auth_params( + headers, queries, resource_path, method, body, auth_setting) + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, queries, resource_path, method, body, auth_setting) + + def _apply_auth_params(self, headers, queries, resource_path, method, body, auth_setting): + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['key'] + "=" + auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + +class Endpoint(object): + def __init__(self, settings=None, params_map=None, root_map=None, + headers_map=None, api_client=None, callable=None): + """Creates an endpoint + + Args: + settings (dict): see below key value pairs + 'response_type' (tuple/None): response type + 'auth' (list): a list of auth type keys + 'endpoint_path' (str): the endpoint path + 'operation_id' (str): endpoint string identifier + 'http_method' (str): POST/PUT/PATCH/GET etc + 'servers' (list): list of str servers that this endpoint is at + params_map (dict): see below key value pairs + 'all' (list): list of str endpoint parameter names + 'required' (list): list of required parameter names + 'nullable' (list): list of nullable parameter names + 'enum' (list): list of parameters with enum values + 'validation' (list): list of parameters with validations + root_map + 'validations' (dict): the dict mapping endpoint parameter tuple + paths to their validation dictionaries + 'allowed_values' (dict): the dict mapping endpoint parameter + tuple paths to their allowed_values (enum) dictionaries + 'openapi_types' (dict): param_name to openapi type + 'attribute_map' (dict): param_name to camelCase name + 'location_map' (dict): param_name to 'body', 'file', 'form', + 'header', 'path', 'query' + collection_format_map (dict): param_name to `csv` etc. + headers_map (dict): see below key value pairs + 'accept' (list): list of Accept header strings + 'content_type' (list): list of Content-Type header strings + api_client (ApiClient) api client instance + callable (function): the function which is invoked when the + Endpoint is called + """ + self.settings = settings + self.params_map = params_map + self.params_map['all'].extend([ + 'async_req', + '_host_index', + '_preload_content', + '_request_timeout', + '_return_http_data_only', + '_check_input_type', + '_check_return_type', + '_content_type', + '_spec_property_naming', + '_request_auths' + ]) + self.params_map['nullable'].extend(['_request_timeout']) + self.validations = root_map['validations'] + self.allowed_values = root_map['allowed_values'] + self.openapi_types = root_map['openapi_types'] + extra_types = { + 'async_req': (bool,), + '_host_index': (none_type, int), + '_preload_content': (bool,), + '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), + '_return_http_data_only': (bool,), + '_check_input_type': (bool,), + '_check_return_type': (bool,), + '_spec_property_naming': (bool,), + '_content_type': (none_type, str), + '_request_auths': (none_type, list) + } + self.openapi_types.update(extra_types) + self.attribute_map = root_map['attribute_map'] + self.location_map = root_map['location_map'] + self.collection_format_map = root_map['collection_format_map'] + self.headers_map = headers_map + self.api_client = api_client + self.callable = callable + + def __validate_inputs(self, kwargs): + for param in self.params_map['enum']: + if param in kwargs: + check_allowed_values( + self.allowed_values, + (param,), + kwargs[param] + ) + + for param in self.params_map['validation']: + if param in kwargs: + check_validations( + self.validations, + (param,), + kwargs[param], + configuration=self.api_client.configuration + ) + + if kwargs['_check_input_type'] is False: + return + + for key, value in kwargs.items(): + fixed_val = validate_and_convert_types( + value, + self.openapi_types[key], + [key], + kwargs['_spec_property_naming'], + kwargs['_check_input_type'], + configuration=self.api_client.configuration + ) + kwargs[key] = fixed_val + + def __gather_params(self, kwargs): + params = { + 'body': None, + 'collection_format': {}, + 'file': {}, + 'form': [], + 'header': {}, + 'path': {}, + 'query': [] + } + + for param_name, param_value in kwargs.items(): + param_location = self.location_map.get(param_name) + if param_location is None: + continue + if param_location: + if param_location == 'body': + params['body'] = param_value + continue + base_name = self.attribute_map[param_name] + if (param_location == 'form' and + self.openapi_types[param_name] == (file_type,)): + params['file'][base_name] = [param_value] + elif (param_location == 'form' and + self.openapi_types[param_name] == ([file_type],)): + # param_value is already a list + params['file'][base_name] = param_value + elif param_location in {'form', 'query'}: + param_value_full = (base_name, param_value) + params[param_location].append(param_value_full) + if param_location not in {'form', 'query'}: + params[param_location][base_name] = param_value + collection_format = self.collection_format_map.get(param_name) + if collection_format: + params['collection_format'][base_name] = collection_format + + return params + + def __call__(self, *args, **kwargs): + """ This method is invoked when endpoints are called + Example: + + api_instance = PaymentMethodApi() + api_instance.auth_payment_method # this is an instance of the class Endpoint + api_instance.auth_payment_method() # this invokes api_instance.auth_payment_method.__call__() + which then invokes the callable functions stored in that endpoint at + api_instance.auth_payment_method.callable or self.callable in this class + + """ + return self.callable(self, *args, **kwargs) + + def call_with_http_info(self, **kwargs): + + try: + index = self.api_client.configuration.server_operation_index.get( + self.settings['operation_id'], self.api_client.configuration.server_index + ) if kwargs['_host_index'] is None else kwargs['_host_index'] + server_variables = self.api_client.configuration.server_operation_variables.get( + self.settings['operation_id'], self.api_client.configuration.server_variables + ) + _host = self.api_client.configuration.get_host_from_settings( + index, variables=server_variables, servers=self.settings['servers'] + ) + except IndexError: + if self.settings['servers']: + raise ApiValueError( + "Invalid host index. Must be 0 <= index < %s" % + len(self.settings['servers']) + ) + _host = None + + for key, value in kwargs.items(): + if key not in self.params_map['all']: + raise ApiTypeError( + "Got an unexpected parameter '%s'" + " to method `%s`" % + (key, self.settings['operation_id']) + ) + # only throw this nullable ApiValueError if _check_input_type + # is False, if _check_input_type==True we catch this case + # in self.__validate_inputs + if (key not in self.params_map['nullable'] and value is None + and kwargs['_check_input_type'] is False): + raise ApiValueError( + "Value may not be None for non-nullable parameter `%s`" + " when calling `%s`" % + (key, self.settings['operation_id']) + ) + + for key in self.params_map['required']: + if key not in kwargs.keys(): + raise ApiValueError( + "Missing the required parameter `%s` when calling " + "`%s`" % (key, self.settings['operation_id']) + ) + + self.__validate_inputs(kwargs) + + params = self.__gather_params(kwargs) + + accept_headers_list = self.headers_map['accept'] + if accept_headers_list: + params['header']['Accept'] = self.api_client.select_header_accept( + accept_headers_list) + + if kwargs.get('_content_type'): + params['header']['Content-Type'] = kwargs['_content_type'] + else: + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + if params['body'] != "": + content_types_list = self.api_client.select_header_content_type( + content_type_headers_list, self.settings['http_method'], + params['body']) + if content_types_list: + params['header']['Content-Type'] = content_types_list + + return self.api_client.call_api( + self.settings['endpoint_path'], self.settings['http_method'], + params['path'], + params['query'], + params['header'], + body=params['body'], + post_params=params['form'], + files=params['file'], + response_type=self.settings['response_type'], + auth_settings=self.settings['auth'], + async_req=kwargs['async_req'], + _check_type=kwargs['_check_return_type'], + _return_http_data_only=kwargs['_return_http_data_only'], + _preload_content=kwargs['_preload_content'], + _request_timeout=kwargs['_request_timeout'], + _host=_host, + _request_auths=kwargs['_request_auths'], + collection_formats=params['collection_format']) diff --git a/xendit/apis/__init__.py b/xendit/apis/__init__.py new file mode 100644 index 00000000..327b007d --- /dev/null +++ b/xendit/apis/__init__.py @@ -0,0 +1,7 @@ +from xendit.balance_and_transaction.balance_api import BalanceApi +from xendit.balance_and_transaction.transaction_api import TransactionApi +from xendit.invoice.invoice_api import InvoiceApi +from xendit.payment_method.payment_method_api import PaymentMethodApi +from xendit.payment_request.payment_request_api import PaymentRequestApi +from xendit.payout.payout_api import PayoutApi +from xendit.refund.refund_api import RefundApi diff --git a/xendit/balance_and_transaction/__init__.py b/xendit/balance_and_transaction/__init__.py new file mode 100644 index 00000000..91a20f88 --- /dev/null +++ b/xendit/balance_and_transaction/__init__.py @@ -0,0 +1,2 @@ +from xendit.balance_and_transaction.balance_api import BalanceApi +from xendit.balance_and_transaction.transaction_api import TransactionApi diff --git a/xendit/balance_and_transaction/balance_api.py b/xendit/balance_and_transaction/balance_api.py new file mode 100644 index 00000000..99bd8c88 --- /dev/null +++ b/xendit/balance_and_transaction/balance_api.py @@ -0,0 +1,179 @@ +""" + Transaction Service V4 API + + # Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint # noqa: E501 + + The version of the OpenAPI document: 3.4.2 +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.api_client import ApiClient, Endpoint as _Endpoint +from xendit.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) + +from xendit.balance_and_transaction.model import * # noqa: F401,E501 + +class BalanceApi(object): + """NOTE: This class is auto generated by the OpenAPI Generator. + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.get_balance_endpoint = _Endpoint( + settings={ + 'response_type': (Balance,), + 'auth': [], + 'endpoint_path': '/balance', + 'operation_id': 'get_balance', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'account_type', + 'currency', + 'for_user_id', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + 'account_type', + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + ('account_type',): { + + "CASH": "CASH", + "HOLDING": "HOLDING", + "TAX": "TAX" + }, + }, + 'openapi_types': { + 'account_type': + (str,), + 'currency': + (str,), + 'for_user_id': + (str,), + }, + 'attribute_map': { + 'account_type': 'account_type', + 'currency': 'currency', + 'for_user_id': 'for-user-id', + }, + 'location_map': { + 'account_type': 'query', + 'currency': 'query', + 'for_user_id': 'header', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + + def get_balance( + self, + **kwargs + ): + """Retrieves balances for a business, default to CASH type # noqa: E501 + + Retrieves balance for your business, defaults to CASH type # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_balance(async_req=True) + >>> result = thread.get() + + + Keyword Args: + account_type (str): The selected balance type. [optional] if omitted the server will use the default value of "CASH" + currency (str): Currency for filter for customers with multi currency accounts. [optional] + for_user_id (str): The sub-account user-id that you want to make this transaction for. This header is only used if you have access to xenPlatform. See xenPlatform for more information. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + Balance + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + return self.get_balance_endpoint.call_with_http_info(**kwargs) + diff --git a/xendit/balance_and_transaction/model/__init__.py b/xendit/balance_and_transaction/model/__init__.py new file mode 100644 index 00000000..309cb530 --- /dev/null +++ b/xendit/balance_and_transaction/model/__init__.py @@ -0,0 +1,25 @@ +# flake8: noqa + +# import all models into this package +# if you have many models here with many references from one model to another this may +# raise a RecursionError +# to avoid this, import only the models that you directly need like: +# from xendit.balance_and_transaction.model.pet import Pet +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + +from xendit.balance_and_transaction.model.balance import Balance +from xendit.balance_and_transaction.model.channels_categories import ChannelsCategories +from xendit.balance_and_transaction.model.currency import Currency +from xendit.balance_and_transaction.model.date_range_filter import DateRangeFilter +from xendit.balance_and_transaction.model.fee_response import FeeResponse +from xendit.balance_and_transaction.model.link_item import LinkItem +from xendit.balance_and_transaction.model.server_error import ServerError +from xendit.balance_and_transaction.model.transaction_id import TransactionId +from xendit.balance_and_transaction.model.transaction_response import TransactionResponse +from xendit.balance_and_transaction.model.transaction_response_type import TransactionResponseType +from xendit.balance_and_transaction.model.transaction_statuses import TransactionStatuses +from xendit.balance_and_transaction.model.transaction_types import TransactionTypes +from xendit.balance_and_transaction.model.transactions_response import TransactionsResponse +from xendit.balance_and_transaction.model.validation_error import ValidationError diff --git a/xendit/balance_and_transaction/model/balance.py b/xendit/balance_and_transaction/model/balance.py new file mode 100644 index 00000000..3c8c4fa5 --- /dev/null +++ b/xendit/balance_and_transaction/model/balance.py @@ -0,0 +1,268 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class Balance(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'balance': (float,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'balance': 'balance', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, balance, *args, **kwargs): # noqa: E501 + """Balance - a model defined in OpenAPI + + Args: + balance (float): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.balance = balance + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, balance, *args, **kwargs): # noqa: E501 + """Balance - a model defined in OpenAPI + + Args: + balance (float): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.balance = balance + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/balance_and_transaction/model/channels_categories.py b/xendit/balance_and_transaction/model/channels_categories.py new file mode 100644 index 00000000..ea12b357 --- /dev/null +++ b/xendit/balance_and_transaction/model/channels_categories.py @@ -0,0 +1,301 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class ChannelsCategories(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'BANK': "BANK", + 'CARDLESS_CREDIT': "CARDLESS_CREDIT", + 'PAYLATER': "PAYLATER", + 'CARDS': "CARDS", + 'CASH': "CASH", + 'DIRECT_DEBIT': "DIRECT_DEBIT", + 'EWALLET': "EWALLET", + 'INVOICE': "INVOICE", + 'QR_CODE': "QR_CODE", + 'RETAIL_OUTLET': "RETAIL_OUTLET", + 'VIRTUAL_ACCOUNT': "VIRTUAL_ACCOUNT", + 'XENPLATFORM': "XENPLATFORM", + 'DIRECT_BANK_TRANSFER': "DIRECT_BANK_TRANSFER", + 'OTHER': "OTHER", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """ChannelsCategories - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["BANK", "CARDLESS_CREDIT", "PAYLATER", "CARDS", "CASH", "DIRECT_DEBIT", "EWALLET", "INVOICE", "QR_CODE", "RETAIL_OUTLET", "VIRTUAL_ACCOUNT", "XENPLATFORM", "DIRECT_BANK_TRANSFER", "OTHER", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["BANK", "CARDLESS_CREDIT", "PAYLATER", "CARDS", "CASH", "DIRECT_DEBIT", "EWALLET", "INVOICE", "QR_CODE", "RETAIL_OUTLET", "VIRTUAL_ACCOUNT", "XENPLATFORM", "DIRECT_BANK_TRANSFER", "OTHER", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ChannelsCategories - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["BANK", "CARDLESS_CREDIT", "PAYLATER", "CARDS", "CASH", "DIRECT_DEBIT", "EWALLET", "INVOICE", "QR_CODE", "RETAIL_OUTLET", "VIRTUAL_ACCOUNT", "XENPLATFORM", "DIRECT_BANK_TRANSFER", "OTHER", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["BANK", "CARDLESS_CREDIT", "PAYLATER", "CARDS", "CASH", "DIRECT_DEBIT", "EWALLET", "INVOICE", "QR_CODE", "RETAIL_OUTLET", "VIRTUAL_ACCOUNT", "XENPLATFORM", "DIRECT_BANK_TRANSFER", "OTHER", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/balance_and_transaction/model/currency.py b/xendit/balance_and_transaction/model/currency.py new file mode 100644 index 00000000..73a8bd5d --- /dev/null +++ b/xendit/balance_and_transaction/model/currency.py @@ -0,0 +1,449 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class Currency(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'IDR': "IDR", + 'PHP': "PHP", + 'USD': "USD", + 'JPY': "JPY", + 'VND': "VND", + 'SGD': "SGD", + 'AED': "AED", + 'AFN': "AFN", + 'ALL': "ALL", + 'AMD': "AMD", + 'ANG': "ANG", + 'AOA': "AOA", + 'ARS': "ARS", + 'AUD': "AUD", + 'AWG': "AWG", + 'AZN': "AZN", + 'BAM': "BAM", + 'BBD': "BBD", + 'BDT': "BDT", + 'BGN': "BGN", + 'BHD': "BHD", + 'BIF': "BIF", + 'BMD': "BMD", + 'BND': "BND", + 'BOB': "BOB", + 'BRL': "BRL", + 'BSD': "BSD", + 'BTN': "BTN", + 'BWP': "BWP", + 'BYN': "BYN", + 'BZD': "BZD", + 'CAD': "CAD", + 'CDF': "CDF", + 'CHF': "CHF", + 'CLP': "CLP", + 'CNY': "CNY", + 'COP': "COP", + 'CRC': "CRC", + 'CUC': "CUC", + 'CUP': "CUP", + 'CVE': "CVE", + 'CZK': "CZK", + 'DJF': "DJF", + 'DKK': "DKK", + 'DOP': "DOP", + 'DZD': "DZD", + 'EGP': "EGP", + 'ERN': "ERN", + 'ETB': "ETB", + 'EUR': "EUR", + 'FJD': "FJD", + 'FKP': "FKP", + 'GBP': "GBP", + 'GEL': "GEL", + 'GGP': "GGP", + 'GHS': "GHS", + 'GIP': "GIP", + 'GMD': "GMD", + 'GNF': "GNF", + 'GTQ': "GTQ", + 'GYD': "GYD", + 'HKD': "HKD", + 'HNL': "HNL", + 'HRK': "HRK", + 'HTG': "HTG", + 'HUF': "HUF", + 'ILS': "ILS", + 'IMP': "IMP", + 'INR': "INR", + 'IQD': "IQD", + 'IRR': "IRR", + 'ISK': "ISK", + 'JEP': "JEP", + 'JMD': "JMD", + 'JOD': "JOD", + 'KES': "KES", + 'KGS': "KGS", + 'KHR': "KHR", + 'KMF': "KMF", + 'KPW': "KPW", + 'KRW': "KRW", + 'KWD': "KWD", + 'KYD': "KYD", + 'KZT': "KZT", + 'LAK': "LAK", + 'LBP': "LBP", + 'LKR': "LKR", + 'LRD': "LRD", + 'LSL': "LSL", + 'LYD': "LYD", + 'MAD': "MAD", + 'MDL': "MDL", + 'MGA': "MGA", + 'MKD': "MKD", + 'MMK': "MMK", + 'MNT': "MNT", + 'MOP': "MOP", + 'MRU': "MRU", + 'MUR': "MUR", + 'MVR': "MVR", + 'MWK': "MWK", + 'MXN': "MXN", + 'MYR': "MYR", + 'MZN': "MZN", + 'NAD': "NAD", + 'NGN': "NGN", + 'NIO': "NIO", + 'NOK': "NOK", + 'NPR': "NPR", + 'NZD': "NZD", + 'OMR': "OMR", + 'PAB': "PAB", + 'PEN': "PEN", + 'PGK': "PGK", + 'PKR': "PKR", + 'PLN': "PLN", + 'PYG': "PYG", + 'QAR': "QAR", + 'RON': "RON", + 'RSD': "RSD", + 'RUB': "RUB", + 'RWF': "RWF", + 'SAR': "SAR", + 'SBD': "SBD", + 'SCR': "SCR", + 'SDG': "SDG", + 'SEK': "SEK", + 'SHP': "SHP", + 'SLL': "SLL", + 'SOS': "SOS", + 'SPL': "SPL", + 'SRD': "SRD", + 'STN': "STN", + 'SVC': "SVC", + 'SYP': "SYP", + 'SZL': "SZL", + 'THB': "THB", + 'TJS': "TJS", + 'TMT': "TMT", + 'TND': "TND", + 'TOP': "TOP", + 'TRY': "TRY", + 'TTD': "TTD", + 'TVD': "TVD", + 'TWD': "TWD", + 'TZS': "TZS", + 'UAH': "UAH", + 'UGX': "UGX", + 'UYU': "UYU", + 'UZS': "UZS", + 'VEF': "VEF", + 'VUV': "VUV", + 'WST': "WST", + 'XAF': "XAF", + 'XCD': "XCD", + 'XDR': "XDR", + 'XOF': "XOF", + 'XPF': "XPF", + 'YER': "YER", + 'ZAR': "ZAR", + 'ZMW': "ZMW", + 'ZWD': "ZWD", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """Currency - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["IDR", "PHP", "USD", "JPY", "VND", "SGD", "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "ILS", "IMP", "INR", "IQD", "IRR", "ISK", "JEP", "JMD", "JOD", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SHP", "SLL", "SOS", "SPL", "SRD", "STN", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TVD", "TWD", "TZS", "UAH", "UGX", "UYU", "UZS", "VEF", "VUV", "WST", "XAF", "XCD", "XDR", "XOF", "XPF", "YER", "ZAR", "ZMW", "ZWD", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["IDR", "PHP", "USD", "JPY", "VND", "SGD", "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "ILS", "IMP", "INR", "IQD", "IRR", "ISK", "JEP", "JMD", "JOD", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SHP", "SLL", "SOS", "SPL", "SRD", "STN", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TVD", "TWD", "TZS", "UAH", "UGX", "UYU", "UZS", "VEF", "VUV", "WST", "XAF", "XCD", "XDR", "XOF", "XPF", "YER", "ZAR", "ZMW", "ZWD", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """Currency - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["IDR", "PHP", "USD", "JPY", "VND", "SGD", "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "ILS", "IMP", "INR", "IQD", "IRR", "ISK", "JEP", "JMD", "JOD", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SHP", "SLL", "SOS", "SPL", "SRD", "STN", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TVD", "TWD", "TZS", "UAH", "UGX", "UYU", "UZS", "VEF", "VUV", "WST", "XAF", "XCD", "XDR", "XOF", "XPF", "YER", "ZAR", "ZMW", "ZWD", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["IDR", "PHP", "USD", "JPY", "VND", "SGD", "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "ILS", "IMP", "INR", "IQD", "IRR", "ISK", "JEP", "JMD", "JOD", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SHP", "SLL", "SOS", "SPL", "SRD", "STN", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TVD", "TWD", "TZS", "UAH", "UGX", "UYU", "UZS", "VEF", "VUV", "WST", "XAF", "XCD", "XDR", "XOF", "XPF", "YER", "ZAR", "ZMW", "ZWD", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/balance_and_transaction/model/date_range_filter.py b/xendit/balance_and_transaction/model/date_range_filter.py new file mode 100644 index 00000000..27f832b2 --- /dev/null +++ b/xendit/balance_and_transaction/model/date_range_filter.py @@ -0,0 +1,266 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class DateRangeFilter(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'gte': (datetime,), # noqa: E501 + 'lte': (datetime,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'gte': 'gte', # noqa: E501 + 'lte': 'lte', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DateRangeFilter - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + gte (datetime): Start time of transaction. If not specified will list all dates.. [optional] # noqa: E501 + lte (datetime): End time of transaction. If not specified will list all dates.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """DateRangeFilter - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + gte (datetime): Start time of transaction. If not specified will list all dates.. [optional] # noqa: E501 + lte (datetime): End time of transaction. If not specified will list all dates.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/balance_and_transaction/model/fee_response.py b/xendit/balance_and_transaction/model/fee_response.py new file mode 100644 index 00000000..14a83e6a --- /dev/null +++ b/xendit/balance_and_transaction/model/fee_response.py @@ -0,0 +1,292 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class FeeResponse(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('status',): { + 'PENDING': "PENDING", + 'COMPLETED': "COMPLETED", + 'CANCELED': "CANCELED", + 'REVERSED': "REVERSED", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'xendit_fee': (float,), # noqa: E501 + 'value_added_tax': (float,), # noqa: E501 + 'xendit_withholding_tax': (float,), # noqa: E501 + 'third_party_withholding_tax': (float,), # noqa: E501 + 'status': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'xendit_fee': 'xendit_fee', # noqa: E501 + 'value_added_tax': 'value_added_tax', # noqa: E501 + 'xendit_withholding_tax': 'xendit_withholding_tax', # noqa: E501 + 'third_party_withholding_tax': 'third_party_withholding_tax', # noqa: E501 + 'status': 'status', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, xendit_fee, value_added_tax, *args, **kwargs): # noqa: E501 + """FeeResponse - a model defined in OpenAPI + + Args: + xendit_fee (float): Amount of the Xendit fee for this transaction. + value_added_tax (float): Amount of the VAT for this transaction. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + xendit_withholding_tax (float): Amount of the Xendit Withholding Tax for this transaction if applicable. See [Tax Documentation](https://docs.xendit.co/fees-and-vat#vat) for more information.. [optional] # noqa: E501 + third_party_withholding_tax (float): Amount of the 3rd Party Withholding Tax for this transaction if applicable. 3rd party example: Bank . [optional] # noqa: E501 + status (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.xendit_fee = xendit_fee + self.value_added_tax = value_added_tax + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, xendit_fee, value_added_tax, *args, **kwargs): # noqa: E501 + """FeeResponse - a model defined in OpenAPI + + Args: + xendit_fee (float): Amount of the Xendit fee for this transaction. + value_added_tax (float): Amount of the VAT for this transaction. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + xendit_withholding_tax (float): Amount of the Xendit Withholding Tax for this transaction if applicable. See [Tax Documentation](https://docs.xendit.co/fees-and-vat#vat) for more information.. [optional] # noqa: E501 + third_party_withholding_tax (float): Amount of the 3rd Party Withholding Tax for this transaction if applicable. 3rd party example: Bank . [optional] # noqa: E501 + status (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.xendit_fee = xendit_fee + self.value_added_tax = value_added_tax + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/balance_and_transaction/model/link_item.py b/xendit/balance_and_transaction/model/link_item.py new file mode 100644 index 00000000..1b68c7b5 --- /dev/null +++ b/xendit/balance_and_transaction/model/link_item.py @@ -0,0 +1,280 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class LinkItem(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'href': (str,), # noqa: E501 + 'rel': (str,), # noqa: E501 + 'method': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'href': 'href', # noqa: E501 + 'rel': 'rel', # noqa: E501 + 'method': 'method', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, href, rel, method, *args, **kwargs): # noqa: E501 + """LinkItem - a model defined in OpenAPI + + Args: + href (str): URI of target, this will be to the next link. + rel (str): The relationship between source and target. The value will be `next`. + method (str): The HTTP method, the value will be `GET`. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.href = href + self.rel = rel + self.method = method + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, href, rel, method, *args, **kwargs): # noqa: E501 + """LinkItem - a model defined in OpenAPI + + Args: + href (str): URI of target, this will be to the next link. + rel (str): The relationship between source and target. The value will be `next`. + method (str): The HTTP method, the value will be `GET`. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.href = href + self.rel = rel + self.method = method + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/balance_and_transaction/model/server_error.py b/xendit/balance_and_transaction/model/server_error.py new file mode 100644 index 00000000..c98e56d8 --- /dev/null +++ b/xendit/balance_and_transaction/model/server_error.py @@ -0,0 +1,280 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class ServerError(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'status_code': (float,), # noqa: E501 + 'error': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'status_code': 'status_code', # noqa: E501 + 'error': 'error', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, status_code, error, message, *args, **kwargs): # noqa: E501 + """ServerError - a model defined in OpenAPI + + Args: + status_code (float): + error (str): + message (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.status_code = status_code + self.error = error + self.message = message + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, status_code, error, message, *args, **kwargs): # noqa: E501 + """ServerError - a model defined in OpenAPI + + Args: + status_code (float): + error (str): + message (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.status_code = status_code + self.error = error + self.message = message + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/balance_and_transaction/model/transaction_id.py b/xendit/balance_and_transaction/model/transaction_id.py new file mode 100644 index 00000000..d3c837ae --- /dev/null +++ b/xendit/balance_and_transaction/model/transaction_id.py @@ -0,0 +1,290 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class TransactionId(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('value',): { + 'regex': { + 'pattern': r'', # noqa: E501 + }, + }, + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """TransactionId - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The unique id of a transaction. It will have `txn_` as prefix. # noqa: E501 + + Keyword Args: + value (str): The unique id of a transaction. It will have `txn_` as prefix. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """TransactionId - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The unique id of a transaction. It will have `txn_` as prefix. # noqa: E501 + + Keyword Args: + value (str): The unique id of a transaction. It will have `txn_` as prefix. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/balance_and_transaction/model/transaction_response.py b/xendit/balance_and_transaction/model/transaction_response.py new file mode 100644 index 00000000..4df17f7f --- /dev/null +++ b/xendit/balance_and_transaction/model/transaction_response.py @@ -0,0 +1,385 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.balance_and_transaction.model.channels_categories import ChannelsCategories + from xendit.balance_and_transaction.model.currency import Currency + from xendit.balance_and_transaction.model.fee_response import FeeResponse + from xendit.balance_and_transaction.model.transaction_id import TransactionId + from xendit.balance_and_transaction.model.transaction_response_type import TransactionResponseType + from xendit.balance_and_transaction.model.transaction_statuses import TransactionStatuses + globals()['ChannelsCategories'] = ChannelsCategories + globals()['Currency'] = Currency + globals()['FeeResponse'] = FeeResponse + globals()['TransactionId'] = TransactionId + globals()['TransactionResponseType'] = TransactionResponseType + globals()['TransactionStatuses'] = TransactionStatuses + + +class TransactionResponse(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('cashflow',): { + 'IN': "MONEY_IN", + 'OUT': "MONEY_OUT", + }, + ('settlement_status',): { + 'None': None, + 'PENDING': "PENDING", + 'SETTLED': "SETTLED", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'id': (TransactionId,), # noqa: E501 + 'product_id': (str,), # noqa: E501 + 'type': (TransactionResponseType,), # noqa: E501 + 'status': (TransactionStatuses,), # noqa: E501 + 'channel_category': (ChannelsCategories,), # noqa: E501 + 'channel_code': (str, none_type,), # noqa: E501 + 'account_identifier': (str, none_type,), # noqa: E501 + 'reference_id': (str,), # noqa: E501 + 'currency': (Currency,), # noqa: E501 + 'amount': (float,), # noqa: E501 + 'cashflow': (str,), # noqa: E501 + 'business_id': (str,), # noqa: E501 + 'fee': (FeeResponse,), # noqa: E501 + 'created': (datetime,), # noqa: E501 + 'updated': (datetime,), # noqa: E501 + 'settlement_status': (str, none_type,), # noqa: E501 + 'estimated_settlement_time': (datetime, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'product_id': 'product_id', # noqa: E501 + 'type': 'type', # noqa: E501 + 'status': 'status', # noqa: E501 + 'channel_category': 'channel_category', # noqa: E501 + 'channel_code': 'channel_code', # noqa: E501 + 'account_identifier': 'account_identifier', # noqa: E501 + 'reference_id': 'reference_id', # noqa: E501 + 'currency': 'currency', # noqa: E501 + 'amount': 'amount', # noqa: E501 + 'cashflow': 'cashflow', # noqa: E501 + 'business_id': 'business_id', # noqa: E501 + 'fee': 'fee', # noqa: E501 + 'created': 'created', # noqa: E501 + 'updated': 'updated', # noqa: E501 + 'settlement_status': 'settlement_status', # noqa: E501 + 'estimated_settlement_time': 'estimated_settlement_time', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, product_id, type, status, channel_category, channel_code, account_identifier, reference_id, currency, amount, cashflow, business_id, fee, created, updated, *args, **kwargs): # noqa: E501 + """TransactionResponse - a model defined in OpenAPI + + Args: + id (TransactionId): + product_id (str): The product_id of the transaction. Product id will have a different prefix for each product. You can use this id to match the transaction from this API to each product API. + type (TransactionResponseType): + status (TransactionStatuses): + channel_category (ChannelsCategories): + channel_code (str, none_type): The channel of the transaction that is used. See [channel codes](https://docs.xendit.co/xendisburse/channel-codes) for the list of available per channel categories. + account_identifier (str, none_type): Account identifier of transaction. The format will be different from each channel. + reference_id (str): customer supplied reference/external_id + currency (Currency): + amount (float): The transaction amount. The number of decimal places will be different for each currency according to ISO 4217. + cashflow (str): Representing whether the transaction is money in or money out For transfer, the transfer out side it will shows up as money out and on transfer in side in will shows up as money-in. Available values are `MONEY_IN` for money in and `MONEY_OUT` for money out. + business_id (str): The id of business where this transaction belong to + fee (FeeResponse): + created (datetime): Transaction created timestamp (UTC+0) + updated (datetime): Transaction updated timestamp (UTC+0) + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + settlement_status (str, none_type): The settlement status of the transaction. `PENDING` - Transaction amount has not been settled to merchant's balance. `SETTLED` - Transaction has been settled to merchant's balance. [optional] # noqa: E501 + estimated_settlement_time (datetime, none_type): Estimated settlement time will only apply to money-in transactions. For money-out transaction, the value will be `NULL`. Estimated settlement time in which transaction amount will be settled to merchant's balance.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.product_id = product_id + self.type = type + self.status = status + self.channel_category = channel_category + self.channel_code = channel_code + self.account_identifier = account_identifier + self.reference_id = reference_id + self.currency = currency + self.amount = amount + self.cashflow = cashflow + self.business_id = business_id + self.fee = fee + self.created = created + self.updated = updated + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, id, product_id, type, status, channel_category, channel_code, account_identifier, reference_id, currency, amount, cashflow, business_id, fee, created, updated, *args, **kwargs): # noqa: E501 + """TransactionResponse - a model defined in OpenAPI + + Args: + id (TransactionId): + product_id (str): The product_id of the transaction. Product id will have a different prefix for each product. You can use this id to match the transaction from this API to each product API. + type (TransactionResponseType): + status (TransactionStatuses): + channel_category (ChannelsCategories): + channel_code (str, none_type): The channel of the transaction that is used. See [channel codes](https://docs.xendit.co/xendisburse/channel-codes) for the list of available per channel categories. + account_identifier (str, none_type): Account identifier of transaction. The format will be different from each channel. + reference_id (str): customer supplied reference/external_id + currency (Currency): + amount (float): The transaction amount. The number of decimal places will be different for each currency according to ISO 4217. + cashflow (str): Representing whether the transaction is money in or money out For transfer, the transfer out side it will shows up as money out and on transfer in side in will shows up as money-in. Available values are `MONEY_IN` for money in and `MONEY_OUT` for money out. + business_id (str): The id of business where this transaction belong to + fee (FeeResponse): + created (datetime): Transaction created timestamp (UTC+0) + updated (datetime): Transaction updated timestamp (UTC+0) + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + settlement_status (str, none_type): The settlement status of the transaction. `PENDING` - Transaction amount has not been settled to merchant's balance. `SETTLED` - Transaction has been settled to merchant's balance. [optional] # noqa: E501 + estimated_settlement_time (datetime, none_type): Estimated settlement time will only apply to money-in transactions. For money-out transaction, the value will be `NULL`. Estimated settlement time in which transaction amount will be settled to merchant's balance.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.product_id = product_id + self.type = type + self.status = status + self.channel_category = channel_category + self.channel_code = channel_code + self.account_identifier = account_identifier + self.reference_id = reference_id + self.currency = currency + self.amount = amount + self.cashflow = cashflow + self.business_id = business_id + self.fee = fee + self.created = created + self.updated = updated + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/balance_and_transaction/model/transaction_response_type.py b/xendit/balance_and_transaction/model/transaction_response_type.py new file mode 100644 index 00000000..b711aa55 --- /dev/null +++ b/xendit/balance_and_transaction/model/transaction_response_type.py @@ -0,0 +1,315 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.balance_and_transaction.model.transaction_types import TransactionTypes + globals()['TransactionTypes'] = TransactionTypes + + +class TransactionResponseType(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """TransactionResponseType - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """TransactionResponseType - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + TransactionTypes, + str, + ], + 'allOf': [ + ], + 'oneOf': [ + ], + } diff --git a/xendit/balance_and_transaction/model/transaction_statuses.py b/xendit/balance_and_transaction/model/transaction_statuses.py new file mode 100644 index 00000000..567673e1 --- /dev/null +++ b/xendit/balance_and_transaction/model/transaction_statuses.py @@ -0,0 +1,292 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class TransactionStatuses(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'SUCCESS': "SUCCESS", + 'PENDING': "PENDING", + 'FAILED': "FAILED", + 'REVERSED': "REVERSED", + 'VOIDED': "VOIDED", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """TransactionStatuses - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["SUCCESS", "PENDING", "FAILED", "REVERSED", "VOIDED", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["SUCCESS", "PENDING", "FAILED", "REVERSED", "VOIDED", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """TransactionStatuses - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["SUCCESS", "PENDING", "FAILED", "REVERSED", "VOIDED", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["SUCCESS", "PENDING", "FAILED", "REVERSED", "VOIDED", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/balance_and_transaction/model/transaction_types.py b/xendit/balance_and_transaction/model/transaction_types.py new file mode 100644 index 00000000..64fbc7a6 --- /dev/null +++ b/xendit/balance_and_transaction/model/transaction_types.py @@ -0,0 +1,300 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class TransactionTypes(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'BATCH_DISBURSEMENT': "BATCH_DISBURSEMENT", + 'DISBURSEMENT': "DISBURSEMENT", + 'PAYMENT': "PAYMENT", + 'REMITTANCE': "REMITTANCE", + 'REMITTANCE_PAYOUT': "REMITTANCE_PAYOUT", + 'REMITTANCE_COLLECTION': "REMITTANCE_COLLECTION", + 'TRANSFER': "TRANSFER", + 'PLATFORM_FEE': "PLATFORM_FEE", + 'REFUND': "REFUND", + 'CASHBACK': "CASHBACK", + 'TOPUP': "TOPUP", + 'WITHDRAWAL': "WITHDRAWAL", + 'OTHER': "OTHER", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """TransactionTypes - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["BATCH_DISBURSEMENT", "DISBURSEMENT", "PAYMENT", "REMITTANCE", "REMITTANCE_PAYOUT", "REMITTANCE_COLLECTION", "TRANSFER", "PLATFORM_FEE", "REFUND", "CASHBACK", "TOPUP", "WITHDRAWAL", "OTHER", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["BATCH_DISBURSEMENT", "DISBURSEMENT", "PAYMENT", "REMITTANCE", "REMITTANCE_PAYOUT", "REMITTANCE_COLLECTION", "TRANSFER", "PLATFORM_FEE", "REFUND", "CASHBACK", "TOPUP", "WITHDRAWAL", "OTHER", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """TransactionTypes - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["BATCH_DISBURSEMENT", "DISBURSEMENT", "PAYMENT", "REMITTANCE", "REMITTANCE_PAYOUT", "REMITTANCE_COLLECTION", "TRANSFER", "PLATFORM_FEE", "REFUND", "CASHBACK", "TOPUP", "WITHDRAWAL", "OTHER", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["BATCH_DISBURSEMENT", "DISBURSEMENT", "PAYMENT", "REMITTANCE", "REMITTANCE_PAYOUT", "REMITTANCE_COLLECTION", "TRANSFER", "PLATFORM_FEE", "REFUND", "CASHBACK", "TOPUP", "WITHDRAWAL", "OTHER", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/balance_and_transaction/model/transactions_response.py b/xendit/balance_and_transaction/model/transactions_response.py new file mode 100644 index 00000000..8b70ca38 --- /dev/null +++ b/xendit/balance_and_transaction/model/transactions_response.py @@ -0,0 +1,286 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.balance_and_transaction.model.link_item import LinkItem + from xendit.balance_and_transaction.model.transaction_response import TransactionResponse + globals()['LinkItem'] = LinkItem + globals()['TransactionResponse'] = TransactionResponse + + +class TransactionsResponse(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'has_more': (bool,), # noqa: E501 + 'data': ([TransactionResponse],), # noqa: E501 + 'links': ([LinkItem],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'has_more': 'has_more', # noqa: E501 + 'data': 'data', # noqa: E501 + 'links': 'links', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, has_more, data, *args, **kwargs): # noqa: E501 + """TransactionsResponse - a model defined in OpenAPI + + Args: + has_more (bool): Indicates whether there are more items to be queried with `after_id` of the last item from the current result. Use the `links` to follow to the next result. + data ([TransactionResponse]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + links ([LinkItem]): The links to the next page based on LinkItem if there is next result.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.has_more = has_more + self.data = data + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, has_more, data, *args, **kwargs): # noqa: E501 + """TransactionsResponse - a model defined in OpenAPI + + Args: + has_more (bool): Indicates whether there are more items to be queried with `after_id` of the last item from the current result. Use the `links` to follow to the next result. + data ([TransactionResponse]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + links ([LinkItem]): The links to the next page based on LinkItem if there is next result.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.has_more = has_more + self.data = data + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/balance_and_transaction/model/validation_error.py b/xendit/balance_and_transaction/model/validation_error.py new file mode 100644 index 00000000..f15bc374 --- /dev/null +++ b/xendit/balance_and_transaction/model/validation_error.py @@ -0,0 +1,284 @@ +""" + The version of the XENDIT API: 3.4.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class ValidationError(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'status_code': (float,), # noqa: E501 + 'error': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + 'validation': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'status_code': 'status_code', # noqa: E501 + 'error': 'error', # noqa: E501 + 'message': 'message', # noqa: E501 + 'validation': 'validation', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, status_code, error, message, *args, **kwargs): # noqa: E501 + """ValidationError - a model defined in OpenAPI + + Args: + status_code (float): + error (str): + message (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + validation ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.status_code = status_code + self.error = error + self.message = message + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, status_code, error, message, *args, **kwargs): # noqa: E501 + """ValidationError - a model defined in OpenAPI + + Args: + status_code (float): + error (str): + message (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + validation ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.status_code = status_code + self.error = error + self.message = message + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/balance_and_transaction/transaction_api.py b/xendit/balance_and_transaction/transaction_api.py new file mode 100644 index 00000000..a5190663 --- /dev/null +++ b/xendit/balance_and_transaction/transaction_api.py @@ -0,0 +1,405 @@ +""" + Transaction Service V4 API + + # Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint # noqa: E501 + + The version of the OpenAPI document: 3.4.2 +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.api_client import ApiClient, Endpoint as _Endpoint +from xendit.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) + +from xendit.balance_and_transaction.model import * # noqa: F401,E501 + +class TransactionApi(object): + """NOTE: This class is auto generated by the OpenAPI Generator. + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.get_all_transactions_endpoint = _Endpoint( + settings={ + 'response_type': (TransactionsResponse,), + 'auth': [], + 'endpoint_path': '/transactions', + 'operation_id': 'get_all_transactions', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'for_user_id', + 'types', + 'statuses', + 'channel_categories', + 'reference_id', + 'product_id', + 'account_identifier', + 'amount', + 'currency', + 'created', + 'updated', + 'limit', + 'after_id', + 'before_id', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'limit', + 'after_id', + 'before_id', + ] + }, + root_map={ + 'validations': { + ('limit',): { + + 'inclusive_maximum': 50, + }, + ('after_id',): { + + 'regex': { + 'pattern': r'^txn_[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$', # noqa: E501 + }, + }, + ('before_id',): { + + 'regex': { + 'pattern': r'^txn_[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$', # noqa: E501 + }, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'for_user_id': + (str,), + 'types': + ([TransactionTypes],), + 'statuses': + ([TransactionStatuses],), + 'channel_categories': + ([ChannelsCategories],), + 'reference_id': + (str,), + 'product_id': + (str,), + 'account_identifier': + (str,), + 'amount': + (float,), + 'currency': + (Currency,), + 'created': + (DateRangeFilter,), + 'updated': + (DateRangeFilter,), + 'limit': + (float,), + 'after_id': + (TransactionId,), + 'before_id': + (TransactionId,), + }, + 'attribute_map': { + 'for_user_id': 'for-user-id', + 'types': 'types', + 'statuses': 'statuses', + 'channel_categories': 'channel_categories', + 'reference_id': 'reference_id', + 'product_id': 'product_id', + 'account_identifier': 'account_identifier', + 'amount': 'amount', + 'currency': 'currency', + 'created': 'created', + 'updated': 'updated', + 'limit': 'limit', + 'after_id': 'after_id', + 'before_id': 'before_id', + }, + 'location_map': { + 'for_user_id': 'header', + 'types': 'query', + 'statuses': 'query', + 'channel_categories': 'query', + 'reference_id': 'query', + 'product_id': 'query', + 'account_identifier': 'query', + 'amount': 'query', + 'currency': 'query', + 'created': 'query', + 'updated': 'query', + 'limit': 'query', + 'after_id': 'query', + 'before_id': 'query', + }, + 'collection_format_map': { + 'types': 'multi', + 'statuses': 'multi', + 'channel_categories': 'multi', + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.get_transaction_by_id_endpoint = _Endpoint( + settings={ + 'response_type': (TransactionResponse,), + 'auth': [], + 'endpoint_path': '/transactions/{id}', + 'operation_id': 'get_transaction_by_id', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'id', + 'for_user_id', + ], + 'required': [ + 'id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'id', + ] + }, + root_map={ + 'validations': { + ('id',): { + + 'regex': { + 'pattern': r'^txn_[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$', # noqa: E501 + }, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'id': + (TransactionId,), + 'for_user_id': + (str,), + }, + 'attribute_map': { + 'id': 'id', + 'for_user_id': 'for-user-id', + }, + 'location_map': { + 'id': 'path', + 'for_user_id': 'header', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + + def get_all_transactions( + self, + **kwargs + ): + """Get a list of transactions # noqa: E501 + + Get a list of all transactions based on filter and search parameters. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_all_transactions(async_req=True) + >>> result = thread.get() + + + Keyword Args: + for_user_id (str): The sub-account user-id that you want to make this transaction for. This header is only used if you have access to xenPlatform. See xenPlatform for more information. [optional] + types ([TransactionTypes]): Transaction types that will be included in the result. Default is to include all transaction types. [optional] + statuses ([TransactionStatuses]): Status of the transaction. Default is to include all status.. [optional] + channel_categories ([ChannelsCategories]): Payment channels in which the transaction is carried out. Default is to include all channels.. [optional] + reference_id (str): To filter the result for transactions with matching reference given (case sensitive). [optional] + product_id (str): To filter the result for transactions with matching product_id (a.k.a payment_id) given (case sensitive). [optional] + account_identifier (str): Account identifier of transaction. The format will be different from each channel. For example, on `BANK` channel it will be account number and on `CARD` it will be masked card number.. [optional] + amount (float): Specific transaction amount to search for. [optional] + currency (Currency): [optional] + created (DateRangeFilter): Filter time of transaction by created date. If not specified will list all dates.. [optional] + updated (DateRangeFilter): Filter time of transaction by updated date. If not specified will list all dates.. [optional] + limit (float): number of items in the result per page. Another name for \"results_per_page\". [optional] if omitted the server will use the default value of 10 + after_id (TransactionId): [optional] + before_id (TransactionId): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + TransactionsResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + return self.get_all_transactions_endpoint.call_with_http_info(**kwargs) + + def get_transaction_by_id( + self, + id, + **kwargs + ): + """Get a transaction based on its id # noqa: E501 + + Get single specific transaction by transaction id. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_transaction_by_id(id, async_req=True) + >>> result = thread.get() + + Args: + id (TransactionId): + + Keyword Args: + for_user_id (str): The sub-account user-id that you want to make this transaction for. This header is only used if you have access to xenPlatform. See xenPlatform for more information. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + TransactionResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['id'] = \ + id + return self.get_transaction_by_id_endpoint.call_with_http_info(**kwargs) + diff --git a/xendit/configuration.py b/xendit/configuration.py new file mode 100644 index 00000000..663a5728 --- /dev/null +++ b/xendit/configuration.py @@ -0,0 +1,431 @@ +""" + XENDIT Client Configuration +""" +import copy +import logging +import multiprocessing +import sys +import urllib3 + +from http import client as http_client +from xendit.exceptions import ApiValueError + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +def set_api_key(api_key): + config = Configuration() + config.api_key = api_key + config.set_default(config) + +class Configuration(object): + """NOTE: This class is auto generated + Do not edit the class manually. + + :param host: Base url + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication + :param password: Password for HTTP basic authentication + :param discard_unknown_keys: Boolean value indicating whether to discard + unknown properties. A server may send a response that includes additional + properties that are not known by the client in the following scenarios: + 1. The OpenAPI document is incomplete, i.e. it does not match the server + implementation. + 2. The client was generated using an older version of the OpenAPI document + and the server has been upgraded since then. + If a schema in the OpenAPI document defines the additionalProperties attribute, + then all undeclared properties received by the server are injected into the + additional properties map. In that case, there are undeclared properties, and + nothing to discard. + :param disabled_client_side_validations (string): Comma-separated list of + JSON schema validation keywords to disable JSON schema structural validation + rules. The following keywords may be specified: multipleOf, maximum, + exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, + maxItems, minItems. + By default, the validation is performed for data generated locally by the client + and data received from the server, independent of any validation performed by + the server side. If the input data does not satisfy the JSON schema validation + rules specified in the OpenAPI document, an exception is raised. + If disabled_client_side_validations is set, structural validation is + disabled. This can be useful to troubleshoot data validation problem, such as + when the OpenAPI document validation rules do not match the actual API data + received by the server. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format + """ + + _default = None + + def __init__(self, host=None, + api_key=None, api_key_prefix=None, + access_token=None, + discard_unknown_keys=False, + disabled_client_side_validations="", + server_index=None, server_variables=None, + server_operation_index=None, server_operation_variables=None, + ssl_ca_cert=None, + ): + """Constructor + """ + self._base_path = "https://api.xendit.co" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.access_token = access_token + self.api_key = api_key + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.discard_unknown_keys = discard_unknown_keys + self.disabled_client_side_validations = disabled_client_side_validations + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("xendit") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ + + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + + self.proxy = None + """Proxy URL + """ + self.no_proxy = None + """bypass proxy for host in the no_proxy list. + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + # Options to pass down to the underlying urllib3 socket + self.socket_options = None + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + if name == 'disabled_client_side_validations': + s = set(filter(None, value.split(','))) + for v in s: + if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: + raise ApiValueError( + "Invalid keyword: '{0}''".format(v)) + self._disabled_client_side_validations = s + + @classmethod + def set_default(cls, default): + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = copy.deepcopy(default) + + @classmethod + def get_default_copy(cls): + """Return new instance of configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration passed by the set_default method. + + :return: The configuration object. + """ + if cls._default is not None: + return copy.deepcopy(cls._default) + return Configuration() + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on http_client debug + http_client.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off http_client debug + http_client.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier, alias=None): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth = {} + return auth + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 2.87.2\n"\ + "SDK Package Version: 3.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self): + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "https://api.xendit.co", + 'description': "Xendit API Server", + } + ] + + def get_host_from_settings(self, index, variables=None, servers=None): + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self): + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value): + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/xendit/exceptions.py b/xendit/exceptions.py new file mode 100644 index 00000000..58208c5b --- /dev/null +++ b/xendit/exceptions.py @@ -0,0 +1,153 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None): + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None): + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None): + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "Status Code: {0}\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message + + +class NotFoundException(ApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + super(NotFoundException, self).__init__(status, reason, http_resp) + + +class UnauthorizedException(ApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + super(UnauthorizedException, self).__init__(status, reason, http_resp) + + +class ForbiddenException(ApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + super(ForbiddenException, self).__init__(status, reason, http_resp) + + +class ServiceException(ApiException): + + def __init__(self, status=None, reason=None, http_resp=None): + super(ServiceException, self).__init__(status, reason, http_resp) + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/xendit/invoice/__init__.py b/xendit/invoice/__init__.py new file mode 100644 index 00000000..d81fc570 --- /dev/null +++ b/xendit/invoice/__init__.py @@ -0,0 +1 @@ +from xendit.invoice.invoice_api import InvoiceApi diff --git a/xendit/invoice/invoice_api.py b/xendit/invoice/invoice_api.py new file mode 100644 index 00000000..996ff8b7 --- /dev/null +++ b/xendit/invoice/invoice_api.py @@ -0,0 +1,634 @@ +""" + xendit-invoice-service + + xendit-invoice-service descriptions # noqa: E501 + + The version of the OpenAPI document: 1.5.0 +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.api_client import ApiClient, Endpoint as _Endpoint +from xendit.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) + +from xendit.invoice.model import * # noqa: F401,E501 + +class InvoiceApi(object): + """NOTE: This class is auto generated by the OpenAPI Generator. + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.create_invoice_endpoint = _Endpoint( + settings={ + 'response_type': (Invoice,), + 'auth': [], + 'endpoint_path': '/v2/invoices/', + 'operation_id': 'create_invoice', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'create_invoice_request', + ], + 'required': [ + 'create_invoice_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'create_invoice_request': + (CreateInvoiceRequest,), + }, + 'attribute_map': { + }, + 'location_map': { + 'create_invoice_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.expire_invoice_endpoint = _Endpoint( + settings={ + 'response_type': (Invoice,), + 'auth': [], + 'endpoint_path': '/invoices/{invoice_id}/expire!', + 'operation_id': 'expire_invoice', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'invoice_id', + ], + 'required': [ + 'invoice_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'invoice_id': + (str,), + }, + 'attribute_map': { + 'invoice_id': 'invoice_id', + }, + 'location_map': { + 'invoice_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.get_invoice_by_id_endpoint = _Endpoint( + settings={ + 'response_type': (Invoice,), + 'auth': [], + 'endpoint_path': '/v2/invoices/{invoice_id}', + 'operation_id': 'get_invoice_by_id', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'invoice_id', + ], + 'required': [ + 'invoice_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'invoice_id': + (str,), + }, + 'attribute_map': { + 'invoice_id': 'invoice_id', + }, + 'location_map': { + 'invoice_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.get_invoices_endpoint = _Endpoint( + settings={ + 'response_type': ([Invoice],), + 'auth': [], + 'endpoint_path': '/v2/invoices', + 'operation_id': 'get_invoices', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'external_id', + 'statuses', + 'limit', + 'created_after', + 'created_before', + 'paid_after', + 'paid_before', + 'expired_after', + 'expired_before', + 'last_invoice', + 'client_types', + 'payment_channels', + 'on_demand_link', + 'recurring_payment_id', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'external_id': + (str,), + 'statuses': + ([InvoiceStatus],), + 'limit': + (float,), + 'created_after': + (datetime,), + 'created_before': + (datetime,), + 'paid_after': + (datetime,), + 'paid_before': + (datetime,), + 'expired_after': + (datetime,), + 'expired_before': + (datetime,), + 'last_invoice': + (str,), + 'client_types': + ([InvoiceClientType],), + 'payment_channels': + ([str],), + 'on_demand_link': + (str,), + 'recurring_payment_id': + (str,), + }, + 'attribute_map': { + 'external_id': 'external_id', + 'statuses': 'statuses', + 'limit': 'limit', + 'created_after': 'created_after', + 'created_before': 'created_before', + 'paid_after': 'paid_after', + 'paid_before': 'paid_before', + 'expired_after': 'expired_after', + 'expired_before': 'expired_before', + 'last_invoice': 'last_invoice', + 'client_types': 'client_types', + 'payment_channels': 'payment_channels', + 'on_demand_link': 'on_demand_link', + 'recurring_payment_id': 'recurring_payment_id', + }, + 'location_map': { + 'external_id': 'query', + 'statuses': 'query', + 'limit': 'query', + 'created_after': 'query', + 'created_before': 'query', + 'paid_after': 'query', + 'paid_before': 'query', + 'expired_after': 'query', + 'expired_before': 'query', + 'last_invoice': 'query', + 'client_types': 'query', + 'payment_channels': 'query', + 'on_demand_link': 'query', + 'recurring_payment_id': 'query', + }, + 'collection_format_map': { + 'statuses': 'multi', + 'client_types': 'multi', + 'payment_channels': 'multi', + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + + def create_invoice( + self, + create_invoice_request, + **kwargs + ): + """Create an invoice # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_invoice(create_invoice_request, async_req=True) + >>> result = thread.get() + + Args: + create_invoice_request (CreateInvoiceRequest): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + Invoice + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['create_invoice_request'] = \ + create_invoice_request + return self.create_invoice_endpoint.call_with_http_info(**kwargs) + + def expire_invoice( + self, + invoice_id, + **kwargs + ): + """Manually expire an invoice # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.expire_invoice(invoice_id, async_req=True) + >>> result = thread.get() + + Args: + invoice_id (str): Invoice ID to be expired + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + Invoice + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['invoice_id'] = \ + invoice_id + return self.expire_invoice_endpoint.call_with_http_info(**kwargs) + + def get_invoice_by_id( + self, + invoice_id, + **kwargs + ): + """Get invoice by invoice id # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_invoice_by_id(invoice_id, async_req=True) + >>> result = thread.get() + + Args: + invoice_id (str): Invoice ID + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + Invoice + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['invoice_id'] = \ + invoice_id + return self.get_invoice_by_id_endpoint.call_with_http_info(**kwargs) + + def get_invoices( + self, + **kwargs + ): + """Get all Invoices # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_invoices(async_req=True) + >>> result = thread.get() + + + Keyword Args: + external_id (str): [optional] + statuses ([InvoiceStatus]): [optional] + limit (float): [optional] + created_after (datetime): [optional] + created_before (datetime): [optional] + paid_after (datetime): [optional] + paid_before (datetime): [optional] + expired_after (datetime): [optional] + expired_before (datetime): [optional] + last_invoice (str): [optional] + client_types ([InvoiceClientType]): [optional] + payment_channels ([str]): [optional] + on_demand_link (str): [optional] + recurring_payment_id (str): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + [Invoice] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + return self.get_invoices_endpoint.call_with_http_info(**kwargs) + diff --git a/xendit/invoice/model/__init__.py b/xendit/invoice/model/__init__.py new file mode 100644 index 00000000..20e7005a --- /dev/null +++ b/xendit/invoice/model/__init__.py @@ -0,0 +1,42 @@ +# flake8: noqa + +# import all models into this package +# if you have many models here with many references from one model to another this may +# raise a RecursionError +# to avoid this, import only the models that you directly need like: +# from xendit.invoice.model.pet import Pet +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + +from xendit.invoice.model.address_object import AddressObject +from xendit.invoice.model.alternative_display_item import AlternativeDisplayItem +from xendit.invoice.model.bad_request_error import BadRequestError +from xendit.invoice.model.bank import Bank +from xendit.invoice.model.bank_code import BankCode +from xendit.invoice.model.create_invoice_request import CreateInvoiceRequest +from xendit.invoice.model.customer_object import CustomerObject +from xendit.invoice.model.direct_debit import DirectDebit +from xendit.invoice.model.direct_debit_type import DirectDebitType +from xendit.invoice.model.ewallet import Ewallet +from xendit.invoice.model.ewallet_type import EwalletType +from xendit.invoice.model.forbidden_error import ForbiddenError +from xendit.invoice.model.invoice import Invoice +from xendit.invoice.model.invoice_client_type import InvoiceClientType +from xendit.invoice.model.invoice_currency import InvoiceCurrency +from xendit.invoice.model.invoice_error404_response_definition import InvoiceError404ResponseDefinition +from xendit.invoice.model.invoice_fee import InvoiceFee +from xendit.invoice.model.invoice_item import InvoiceItem +from xendit.invoice.model.invoice_not_found_error import InvoiceNotFoundError +from xendit.invoice.model.invoice_payment_method import InvoicePaymentMethod +from xendit.invoice.model.invoice_status import InvoiceStatus +from xendit.invoice.model.notification_channel import NotificationChannel +from xendit.invoice.model.notification_preference import NotificationPreference +from xendit.invoice.model.paylater import Paylater +from xendit.invoice.model.paylater_type import PaylaterType +from xendit.invoice.model.qr_code import QrCode +from xendit.invoice.model.qr_code_type import QrCodeType +from xendit.invoice.model.retail_outlet import RetailOutlet +from xendit.invoice.model.retail_outlet_name import RetailOutletName +from xendit.invoice.model.server_error import ServerError +from xendit.invoice.model.unauthorized_error import UnauthorizedError diff --git a/xendit/invoice/model/address_object.py b/xendit/invoice/model/address_object.py new file mode 100644 index 00000000..15be07bc --- /dev/null +++ b/xendit/invoice/model/address_object.py @@ -0,0 +1,286 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class AddressObject(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'country': (str, none_type,), # noqa: E501 + 'street_line1': (str, none_type,), # noqa: E501 + 'street_line2': (str, none_type,), # noqa: E501 + 'city': (str, none_type,), # noqa: E501 + 'province': (str, none_type,), # noqa: E501 + 'state': (str, none_type,), # noqa: E501 + 'postal_code': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'country': 'country', # noqa: E501 + 'street_line1': 'street_line1', # noqa: E501 + 'street_line2': 'street_line2', # noqa: E501 + 'city': 'city', # noqa: E501 + 'province': 'province', # noqa: E501 + 'state': 'state', # noqa: E501 + 'postal_code': 'postal_code', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AddressObject - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + country (str, none_type): The country where the address is located.. [optional] # noqa: E501 + street_line1 (str, none_type): The first line of the street address.. [optional] # noqa: E501 + street_line2 (str, none_type): The second line of the street address.. [optional] # noqa: E501 + city (str, none_type): The city or locality within the address.. [optional] # noqa: E501 + province (str, none_type): The province or region within the country.. [optional] # noqa: E501 + state (str, none_type): The state or administrative division within the country.. [optional] # noqa: E501 + postal_code (str, none_type): The postal code or ZIP code for the address.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """AddressObject - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + country (str, none_type): The country where the address is located.. [optional] # noqa: E501 + street_line1 (str, none_type): The first line of the street address.. [optional] # noqa: E501 + street_line2 (str, none_type): The second line of the street address.. [optional] # noqa: E501 + city (str, none_type): The city or locality within the address.. [optional] # noqa: E501 + province (str, none_type): The province or region within the country.. [optional] # noqa: E501 + state (str, none_type): The state or administrative division within the country.. [optional] # noqa: E501 + postal_code (str, none_type): The postal code or ZIP code for the address.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/invoice/model/alternative_display_item.py b/xendit/invoice/model/alternative_display_item.py new file mode 100644 index 00000000..0110e052 --- /dev/null +++ b/xendit/invoice/model/alternative_display_item.py @@ -0,0 +1,266 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class AlternativeDisplayItem(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'type': (str,), # noqa: E501 + 'value': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'type': 'type', # noqa: E501 + 'value': 'value', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AlternativeDisplayItem - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + type (str): Represent type of alternative display.. [optional] # noqa: E501 + value (str): Represent value of alternative display value.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """AlternativeDisplayItem - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + type (str): Represent type of alternative display.. [optional] # noqa: E501 + value (str): Represent value of alternative display value.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/invoice/model/bad_request_error.py b/xendit/invoice/model/bad_request_error.py new file mode 100644 index 00000000..3888699b --- /dev/null +++ b/xendit/invoice/model/bad_request_error.py @@ -0,0 +1,283 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class BadRequestError(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('error_code',): { + 'MAXIMUM_TRANSFER_AMOUNT_ERROR': "MAXIMUM_TRANSFER_AMOUNT_ERROR", + 'NO_COLLECTION_METHODS_ERROR': "NO_COLLECTION_METHODS_ERROR", + 'EMAIL_FORMAT_ERROR': "EMAIL_FORMAT_ERROR", + 'UNAVAILABLE_PAYMENT_METHOD_ERROR': "UNAVAILABLE_PAYMENT_METHOD_ERROR", + 'UNSUPPORTED_CURRENCY': "UNSUPPORTED_CURRENCY", + 'MISMATCH_CURRENCY_ERROR': "MISMATCH_CURRENCY_ERROR", + 'INVALID_REMINDER_TIME': "INVALID_REMINDER_TIME", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'error_code': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'error_code': 'error_code', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, error_code, message, *args, **kwargs): # noqa: E501 + """BadRequestError - a model defined in OpenAPI + + Args: + error_code (str): The error code indicating the type of error that occurred. + message (str): A human-readable error message that provides additional information about the error. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.error_code = error_code + self.message = message + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, error_code, message, *args, **kwargs): # noqa: E501 + """BadRequestError - a model defined in OpenAPI + + Args: + error_code (str): The error code indicating the type of error that occurred. + message (str): A human-readable error message that provides additional information about the error. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.error_code = error_code + self.message = message + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/invoice/model/bank.py b/xendit/invoice/model/bank.py new file mode 100644 index 00000000..741e8e94 --- /dev/null +++ b/xendit/invoice/model/bank.py @@ -0,0 +1,304 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.invoice.model.alternative_display_item import AlternativeDisplayItem + from xendit.invoice.model.bank_code import BankCode + globals()['AlternativeDisplayItem'] = AlternativeDisplayItem + globals()['BankCode'] = BankCode + + +class Bank(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'bank_code': (BankCode,), # noqa: E501 + 'collection_type': (str,), # noqa: E501 + 'account_holder_name': (str,), # noqa: E501 + 'bank_branch': (str,), # noqa: E501 + 'bank_account_number': (str,), # noqa: E501 + 'transfer_amount': (float,), # noqa: E501 + 'alternative_displays': ([AlternativeDisplayItem],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'bank_code': 'bank_code', # noqa: E501 + 'collection_type': 'collection_type', # noqa: E501 + 'account_holder_name': 'account_holder_name', # noqa: E501 + 'bank_branch': 'bank_branch', # noqa: E501 + 'bank_account_number': 'bank_account_number', # noqa: E501 + 'transfer_amount': 'transfer_amount', # noqa: E501 + 'alternative_displays': 'alternative_displays', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, bank_code, collection_type, account_holder_name, *args, **kwargs): # noqa: E501 + """Bank - a model defined in OpenAPI + + Args: + bank_code (BankCode): + collection_type (str): The collection type for the bank details. + account_holder_name (str): The name of the account holder. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + bank_branch (str): The branch of the bank.. [optional] # noqa: E501 + bank_account_number (str): The bank account number.. [optional] # noqa: E501 + transfer_amount (float): The transfer amount.. [optional] # noqa: E501 + alternative_displays ([AlternativeDisplayItem]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.bank_code = bank_code + self.collection_type = collection_type + self.account_holder_name = account_holder_name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, bank_code, collection_type, account_holder_name, *args, **kwargs): # noqa: E501 + """Bank - a model defined in OpenAPI + + Args: + bank_code (BankCode): + collection_type (str): The collection type for the bank details. + account_holder_name (str): The name of the account holder. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + bank_branch (str): The branch of the bank.. [optional] # noqa: E501 + bank_account_number (str): The bank account number.. [optional] # noqa: E501 + transfer_amount (float): The transfer amount.. [optional] # noqa: E501 + alternative_displays ([AlternativeDisplayItem]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.bank_code = bank_code + self.collection_type = collection_type + self.account_holder_name = account_holder_name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/invoice/model/bank_code.py b/xendit/invoice/model/bank_code.py new file mode 100644 index 00000000..73e07762 --- /dev/null +++ b/xendit/invoice/model/bank_code.py @@ -0,0 +1,294 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class BankCode(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'BCA': "BCA", + 'BNI': "BNI", + 'BRI': "BRI", + 'MANDIRI': "MANDIRI", + 'PERMATA': "PERMATA", + 'BSI': "BSI", + 'BJB': "BJB", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """BankCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Representing the available bank channels used for invoice-related transactions.., must be one of ["BCA", "BNI", "BRI", "MANDIRI", "PERMATA", "BSI", "BJB", ] # noqa: E501 + + Keyword Args: + value (str): Representing the available bank channels used for invoice-related transactions.., must be one of ["BCA", "BNI", "BRI", "MANDIRI", "PERMATA", "BSI", "BJB", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """BankCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Representing the available bank channels used for invoice-related transactions.., must be one of ["BCA", "BNI", "BRI", "MANDIRI", "PERMATA", "BSI", "BJB", ] # noqa: E501 + + Keyword Args: + value (str): Representing the available bank channels used for invoice-related transactions.., must be one of ["BCA", "BNI", "BRI", "MANDIRI", "PERMATA", "BSI", "BJB", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/invoice/model/create_invoice_request.py b/xendit/invoice/model/create_invoice_request.py new file mode 100644 index 00000000..e14a1fa1 --- /dev/null +++ b/xendit/invoice/model/create_invoice_request.py @@ -0,0 +1,358 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.invoice.model.customer_object import CustomerObject + from xendit.invoice.model.invoice_fee import InvoiceFee + from xendit.invoice.model.invoice_item import InvoiceItem + from xendit.invoice.model.notification_preference import NotificationPreference + globals()['CustomerObject'] = CustomerObject + globals()['InvoiceFee'] = InvoiceFee + globals()['InvoiceItem'] = InvoiceItem + globals()['NotificationPreference'] = NotificationPreference + + +class CreateInvoiceRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'external_id': (str,), # noqa: E501 + 'amount': (float,), # noqa: E501 + 'payer_email': (str,), # noqa: E501 + 'description': (str,), # noqa: E501 + 'invoice_duration': (str,), # noqa: E501 + 'callback_virtual_account_id': (str,), # noqa: E501 + 'should_send_email': (bool,), # noqa: E501 + 'customer': (CustomerObject,), # noqa: E501 + 'customer_notification_preference': (NotificationPreference,), # noqa: E501 + 'success_redirect_url': (str,), # noqa: E501 + 'failure_redirect_url': (str,), # noqa: E501 + 'payment_methods': ([str],), # noqa: E501 + 'mid_label': (str,), # noqa: E501 + 'should_authenticate_credit_card': (bool,), # noqa: E501 + 'currency': (str,), # noqa: E501 + 'reminder_time': (float,), # noqa: E501 + 'local': (str,), # noqa: E501 + 'reminder_time_unit': (str,), # noqa: E501 + 'items': ([InvoiceItem],), # noqa: E501 + 'fees': ([InvoiceFee],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'external_id': 'external_id', # noqa: E501 + 'amount': 'amount', # noqa: E501 + 'payer_email': 'payer_email', # noqa: E501 + 'description': 'description', # noqa: E501 + 'invoice_duration': 'invoice_duration', # noqa: E501 + 'callback_virtual_account_id': 'callback_virtual_account_id', # noqa: E501 + 'should_send_email': 'should_send_email', # noqa: E501 + 'customer': 'customer', # noqa: E501 + 'customer_notification_preference': 'customer_notification_preference', # noqa: E501 + 'success_redirect_url': 'success_redirect_url', # noqa: E501 + 'failure_redirect_url': 'failure_redirect_url', # noqa: E501 + 'payment_methods': 'payment_methods', # noqa: E501 + 'mid_label': 'mid_label', # noqa: E501 + 'should_authenticate_credit_card': 'should_authenticate_credit_card', # noqa: E501 + 'currency': 'currency', # noqa: E501 + 'reminder_time': 'reminder_time', # noqa: E501 + 'local': 'local', # noqa: E501 + 'reminder_time_unit': 'reminder_time_unit', # noqa: E501 + 'items': 'items', # noqa: E501 + 'fees': 'fees', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, external_id, amount, *args, **kwargs): # noqa: E501 + """CreateInvoiceRequest - a model defined in OpenAPI + + Args: + external_id (str): The external ID of the invoice. + amount (float): The invoice amount. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + payer_email (str): The email address of the payer.. [optional] # noqa: E501 + description (str): A description of the payment.. [optional] # noqa: E501 + invoice_duration (str): The duration of the invoice.. [optional] # noqa: E501 + callback_virtual_account_id (str): The ID of the callback virtual account.. [optional] # noqa: E501 + should_send_email (bool): Indicates whether email notifications should be sent.. [optional] # noqa: E501 + customer (CustomerObject): [optional] # noqa: E501 + customer_notification_preference (NotificationPreference): [optional] # noqa: E501 + success_redirect_url (str): The URL to redirect to on successful payment.. [optional] # noqa: E501 + failure_redirect_url (str): The URL to redirect to on payment failure.. [optional] # noqa: E501 + payment_methods ([str]): An array of available payment methods.. [optional] # noqa: E501 + mid_label (str): The middle label.. [optional] # noqa: E501 + should_authenticate_credit_card (bool): Indicates whether credit card authentication is required.. [optional] # noqa: E501 + currency (str): The currency of the invoice.. [optional] # noqa: E501 + reminder_time (float): The reminder time.. [optional] # noqa: E501 + local (str): The local.. [optional] # noqa: E501 + reminder_time_unit (str): The unit of the reminder time.. [optional] # noqa: E501 + items ([InvoiceItem]): An array of items included in the invoice.. [optional] # noqa: E501 + fees ([InvoiceFee]): An array of fees associated with the invoice.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.external_id = external_id + self.amount = amount + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, external_id, amount, *args, **kwargs): # noqa: E501 + """CreateInvoiceRequest - a model defined in OpenAPI + + Args: + external_id (str): The external ID of the invoice. + amount (float): The invoice amount. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + payer_email (str): The email address of the payer.. [optional] # noqa: E501 + description (str): A description of the payment.. [optional] # noqa: E501 + invoice_duration (str): The duration of the invoice.. [optional] # noqa: E501 + callback_virtual_account_id (str): The ID of the callback virtual account.. [optional] # noqa: E501 + should_send_email (bool): Indicates whether email notifications should be sent.. [optional] # noqa: E501 + customer (CustomerObject): [optional] # noqa: E501 + customer_notification_preference (NotificationPreference): [optional] # noqa: E501 + success_redirect_url (str): The URL to redirect to on successful payment.. [optional] # noqa: E501 + failure_redirect_url (str): The URL to redirect to on payment failure.. [optional] # noqa: E501 + payment_methods ([str]): An array of available payment methods.. [optional] # noqa: E501 + mid_label (str): The middle label.. [optional] # noqa: E501 + should_authenticate_credit_card (bool): Indicates whether credit card authentication is required.. [optional] # noqa: E501 + currency (str): The currency of the invoice.. [optional] # noqa: E501 + reminder_time (float): The reminder time.. [optional] # noqa: E501 + local (str): The local.. [optional] # noqa: E501 + reminder_time_unit (str): The unit of the reminder time.. [optional] # noqa: E501 + items ([InvoiceItem]): An array of items included in the invoice.. [optional] # noqa: E501 + fees ([InvoiceFee]): An array of fees associated with the invoice.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.external_id = external_id + self.amount = amount + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/invoice/model/customer_object.py b/xendit/invoice/model/customer_object.py new file mode 100644 index 00000000..09763dfc --- /dev/null +++ b/xendit/invoice/model/customer_object.py @@ -0,0 +1,296 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.invoice.model.address_object import AddressObject + globals()['AddressObject'] = AddressObject + + +class CustomerObject(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'id': (str, none_type,), # noqa: E501 + 'phone_number': (str, none_type,), # noqa: E501 + 'given_names': (str, none_type,), # noqa: E501 + 'surname': (str, none_type,), # noqa: E501 + 'email': (str, none_type,), # noqa: E501 + 'mobile_number': (str, none_type,), # noqa: E501 + 'customer_id': (str, none_type,), # noqa: E501 + 'addresses': ([AddressObject], none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'phone_number': 'phone_number', # noqa: E501 + 'given_names': 'given_names', # noqa: E501 + 'surname': 'surname', # noqa: E501 + 'email': 'email', # noqa: E501 + 'mobile_number': 'mobile_number', # noqa: E501 + 'customer_id': 'customer_id', # noqa: E501 + 'addresses': 'addresses', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """CustomerObject - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (str, none_type): The unique identifier for the customer.. [optional] # noqa: E501 + phone_number (str, none_type): The customer's phone number.. [optional] # noqa: E501 + given_names (str, none_type): The customer's given names or first names.. [optional] # noqa: E501 + surname (str, none_type): The customer's surname or last name.. [optional] # noqa: E501 + email (str, none_type): The customer's email address.. [optional] # noqa: E501 + mobile_number (str, none_type): The customer's mobile phone number.. [optional] # noqa: E501 + customer_id (str, none_type): An additional identifier for the customer.. [optional] # noqa: E501 + addresses ([AddressObject], none_type): An array of addresses associated with the customer.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """CustomerObject - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (str, none_type): The unique identifier for the customer.. [optional] # noqa: E501 + phone_number (str, none_type): The customer's phone number.. [optional] # noqa: E501 + given_names (str, none_type): The customer's given names or first names.. [optional] # noqa: E501 + surname (str, none_type): The customer's surname or last name.. [optional] # noqa: E501 + email (str, none_type): The customer's email address.. [optional] # noqa: E501 + mobile_number (str, none_type): The customer's mobile phone number.. [optional] # noqa: E501 + customer_id (str, none_type): An additional identifier for the customer.. [optional] # noqa: E501 + addresses ([AddressObject], none_type): An array of addresses associated with the customer.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/invoice/model/direct_debit.py b/xendit/invoice/model/direct_debit.py new file mode 100644 index 00000000..9bf54e73 --- /dev/null +++ b/xendit/invoice/model/direct_debit.py @@ -0,0 +1,274 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.invoice.model.direct_debit_type import DirectDebitType + globals()['DirectDebitType'] = DirectDebitType + + +class DirectDebit(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'direct_debit_type': (DirectDebitType,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'direct_debit_type': 'direct_debit_type', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, direct_debit_type, *args, **kwargs): # noqa: E501 + """DirectDebit - a model defined in OpenAPI + + Args: + direct_debit_type (DirectDebitType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.direct_debit_type = direct_debit_type + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, direct_debit_type, *args, **kwargs): # noqa: E501 + """DirectDebit - a model defined in OpenAPI + + Args: + direct_debit_type (DirectDebitType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.direct_debit_type = direct_debit_type + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/invoice/model/direct_debit_type.py b/xendit/invoice/model/direct_debit_type.py new file mode 100644 index 00000000..d4b6cfab --- /dev/null +++ b/xendit/invoice/model/direct_debit_type.py @@ -0,0 +1,301 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class DirectDebitType(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'BA_BRI': "BA_BRI", + 'DC_BRI': "DC_BRI", + 'DD_BRI': "DD_BRI", + 'DD_MANDIRI': "DD_MANDIRI", + 'BA_BPI': "BA_BPI", + 'DC_BPI': "DC_BPI", + 'DD_BPI': "DD_BPI", + 'BA_UBP': "BA_UBP", + 'DC_UBP': "DC_UBP", + 'DD_UBP': "DD_UBP", + 'BCA_KLIKPAY': "BCA_KLIKPAY", + 'BA_BCA_KLIKPAY': "BA_BCA_KLIKPAY", + 'DC_BCA_KLIKPAY': "DC_BCA_KLIKPAY", + 'DD_BCA_KLIKPAY': "DD_BCA_KLIKPAY", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """DirectDebitType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Representing the available Direct Debit channels used for invoice-related transactions.., must be one of ["BA_BRI", "DC_BRI", "DD_BRI", "DD_MANDIRI", "BA_BPI", "DC_BPI", "DD_BPI", "BA_UBP", "DC_UBP", "DD_UBP", "BCA_KLIKPAY", "BA_BCA_KLIKPAY", "DC_BCA_KLIKPAY", "DD_BCA_KLIKPAY", ] # noqa: E501 + + Keyword Args: + value (str): Representing the available Direct Debit channels used for invoice-related transactions.., must be one of ["BA_BRI", "DC_BRI", "DD_BRI", "DD_MANDIRI", "BA_BPI", "DC_BPI", "DD_BPI", "BA_UBP", "DC_UBP", "DD_UBP", "BCA_KLIKPAY", "BA_BCA_KLIKPAY", "DC_BCA_KLIKPAY", "DD_BCA_KLIKPAY", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """DirectDebitType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Representing the available Direct Debit channels used for invoice-related transactions.., must be one of ["BA_BRI", "DC_BRI", "DD_BRI", "DD_MANDIRI", "BA_BPI", "DC_BPI", "DD_BPI", "BA_UBP", "DC_UBP", "DD_UBP", "BCA_KLIKPAY", "BA_BCA_KLIKPAY", "DC_BCA_KLIKPAY", "DD_BCA_KLIKPAY", ] # noqa: E501 + + Keyword Args: + value (str): Representing the available Direct Debit channels used for invoice-related transactions.., must be one of ["BA_BRI", "DC_BRI", "DD_BRI", "DD_MANDIRI", "BA_BPI", "DC_BPI", "DD_BPI", "BA_UBP", "DC_UBP", "DD_UBP", "BCA_KLIKPAY", "BA_BCA_KLIKPAY", "DC_BCA_KLIKPAY", "DD_BCA_KLIKPAY", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/invoice/model/ewallet.py b/xendit/invoice/model/ewallet.py new file mode 100644 index 00000000..e439e12a --- /dev/null +++ b/xendit/invoice/model/ewallet.py @@ -0,0 +1,274 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.invoice.model.ewallet_type import EwalletType + globals()['EwalletType'] = EwalletType + + +class Ewallet(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'ewallet_type': (EwalletType,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'ewallet_type': 'ewallet_type', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, ewallet_type, *args, **kwargs): # noqa: E501 + """Ewallet - a model defined in OpenAPI + + Args: + ewallet_type (EwalletType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.ewallet_type = ewallet_type + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, ewallet_type, *args, **kwargs): # noqa: E501 + """Ewallet - a model defined in OpenAPI + + Args: + ewallet_type (EwalletType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.ewallet_type = ewallet_type + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/invoice/model/ewallet_type.py b/xendit/invoice/model/ewallet_type.py new file mode 100644 index 00000000..eb11bc7d --- /dev/null +++ b/xendit/invoice/model/ewallet_type.py @@ -0,0 +1,294 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class EwalletType(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'OVO': "OVO", + 'DANA': "DANA", + 'LINKAJA': "LINKAJA", + 'PAYMAYA': "PAYMAYA", + 'SHOPEEPAY': "SHOPEEPAY", + 'GCASH': "GCASH", + 'GRABPAY': "GRABPAY", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """EwalletType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Representing the available eWallet channels used for invoice-related transactions.., must be one of ["OVO", "DANA", "LINKAJA", "PAYMAYA", "SHOPEEPAY", "GCASH", "GRABPAY", ] # noqa: E501 + + Keyword Args: + value (str): Representing the available eWallet channels used for invoice-related transactions.., must be one of ["OVO", "DANA", "LINKAJA", "PAYMAYA", "SHOPEEPAY", "GCASH", "GRABPAY", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """EwalletType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Representing the available eWallet channels used for invoice-related transactions.., must be one of ["OVO", "DANA", "LINKAJA", "PAYMAYA", "SHOPEEPAY", "GCASH", "GRABPAY", ] # noqa: E501 + + Keyword Args: + value (str): Representing the available eWallet channels used for invoice-related transactions.., must be one of ["OVO", "DANA", "LINKAJA", "PAYMAYA", "SHOPEEPAY", "GCASH", "GRABPAY", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/invoice/model/forbidden_error.py b/xendit/invoice/model/forbidden_error.py new file mode 100644 index 00000000..926a8555 --- /dev/null +++ b/xendit/invoice/model/forbidden_error.py @@ -0,0 +1,279 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class ForbiddenError(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('error_code',): { + 'ACCESS_SUSPENDED': "ACCESS_SUSPENDED", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'error_code': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'error_code': 'error_code', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, message, *args, **kwargs): # noqa: E501 + """ForbiddenError - a model defined in OpenAPI + + Args: + message (str): A human-readable error message providing additional context about the 403 Forbidden response. + + Keyword Args: + error_code (str): The specific error code indicating that access to the invoice operation is suspended.. defaults to "ACCESS_SUSPENDED", must be one of ["ACCESS_SUSPENDED", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + error_code = kwargs.get('error_code', "ACCESS_SUSPENDED") + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.error_code = error_code + self.message = message + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, message, *args, **kwargs): # noqa: E501 + """ForbiddenError - a model defined in OpenAPI + + Args: + message (str): A human-readable error message providing additional context about the 403 Forbidden response. + + Keyword Args: + error_code (str): The specific error code indicating that access to the invoice operation is suspended.. defaults to "ACCESS_SUSPENDED", must be one of ["ACCESS_SUSPENDED", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + error_code = kwargs.get('error_code', "ACCESS_SUSPENDED") + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.error_code = error_code + self.message = message + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/invoice/model/invoice.py b/xendit/invoice/model/invoice.py new file mode 100644 index 00000000..4d5720f3 --- /dev/null +++ b/xendit/invoice/model/invoice.py @@ -0,0 +1,458 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.invoice.model.bank import Bank + from xendit.invoice.model.customer_object import CustomerObject + from xendit.invoice.model.direct_debit import DirectDebit + from xendit.invoice.model.ewallet import Ewallet + from xendit.invoice.model.invoice_currency import InvoiceCurrency + from xendit.invoice.model.invoice_fee import InvoiceFee + from xendit.invoice.model.invoice_item import InvoiceItem + from xendit.invoice.model.invoice_payment_method import InvoicePaymentMethod + from xendit.invoice.model.invoice_status import InvoiceStatus + from xendit.invoice.model.notification_preference import NotificationPreference + from xendit.invoice.model.paylater import Paylater + from xendit.invoice.model.qr_code import QrCode + from xendit.invoice.model.retail_outlet import RetailOutlet + globals()['Bank'] = Bank + globals()['CustomerObject'] = CustomerObject + globals()['DirectDebit'] = DirectDebit + globals()['Ewallet'] = Ewallet + globals()['InvoiceCurrency'] = InvoiceCurrency + globals()['InvoiceFee'] = InvoiceFee + globals()['InvoiceItem'] = InvoiceItem + globals()['InvoicePaymentMethod'] = InvoicePaymentMethod + globals()['InvoiceStatus'] = InvoiceStatus + globals()['NotificationPreference'] = NotificationPreference + globals()['Paylater'] = Paylater + globals()['QrCode'] = QrCode + globals()['RetailOutlet'] = RetailOutlet + + +class Invoice(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'external_id': (str,), # noqa: E501 + 'user_id': (str,), # noqa: E501 + 'status': (InvoiceStatus,), # noqa: E501 + 'merchant_name': (str,), # noqa: E501 + 'merchant_profile_picture_url': (str,), # noqa: E501 + 'amount': (float,), # noqa: E501 + 'expiry_date': (datetime,), # noqa: E501 + 'invoice_url': (str,), # noqa: E501 + 'available_banks': ([Bank],), # noqa: E501 + 'available_retail_outlets': ([RetailOutlet],), # noqa: E501 + 'available_ewallets': ([Ewallet],), # noqa: E501 + 'available_qr_codes': ([QrCode],), # noqa: E501 + 'available_direct_debits': ([DirectDebit],), # noqa: E501 + 'available_paylaters': ([Paylater],), # noqa: E501 + 'should_send_email': (bool,), # noqa: E501 + 'created': (datetime,), # noqa: E501 + 'updated': (datetime,), # noqa: E501 + 'id': (str,), # noqa: E501 + 'payer_email': (str,), # noqa: E501 + 'description': (str,), # noqa: E501 + 'payment_method': (InvoicePaymentMethod,), # noqa: E501 + 'locale': (str,), # noqa: E501 + 'should_exclude_credit_card': (bool,), # noqa: E501 + 'success_redirect_url': (str,), # noqa: E501 + 'failure_redirect_url': (str,), # noqa: E501 + 'should_authenticate_credit_card': (bool,), # noqa: E501 + 'currency': (InvoiceCurrency,), # noqa: E501 + 'items': ([InvoiceItem],), # noqa: E501 + 'fixed_va': (bool,), # noqa: E501 + 'reminder_date': (datetime,), # noqa: E501 + 'customer': (CustomerObject,), # noqa: E501 + 'customer_notification_preference': (NotificationPreference,), # noqa: E501 + 'fees': ([InvoiceFee],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'external_id': 'external_id', # noqa: E501 + 'user_id': 'user_id', # noqa: E501 + 'status': 'status', # noqa: E501 + 'merchant_name': 'merchant_name', # noqa: E501 + 'merchant_profile_picture_url': 'merchant_profile_picture_url', # noqa: E501 + 'amount': 'amount', # noqa: E501 + 'expiry_date': 'expiry_date', # noqa: E501 + 'invoice_url': 'invoice_url', # noqa: E501 + 'available_banks': 'available_banks', # noqa: E501 + 'available_retail_outlets': 'available_retail_outlets', # noqa: E501 + 'available_ewallets': 'available_ewallets', # noqa: E501 + 'available_qr_codes': 'available_qr_codes', # noqa: E501 + 'available_direct_debits': 'available_direct_debits', # noqa: E501 + 'available_paylaters': 'available_paylaters', # noqa: E501 + 'should_send_email': 'should_send_email', # noqa: E501 + 'created': 'created', # noqa: E501 + 'updated': 'updated', # noqa: E501 + 'id': 'id', # noqa: E501 + 'payer_email': 'payer_email', # noqa: E501 + 'description': 'description', # noqa: E501 + 'payment_method': 'payment_method', # noqa: E501 + 'locale': 'locale', # noqa: E501 + 'should_exclude_credit_card': 'should_exclude_credit_card', # noqa: E501 + 'success_redirect_url': 'success_redirect_url', # noqa: E501 + 'failure_redirect_url': 'failure_redirect_url', # noqa: E501 + 'should_authenticate_credit_card': 'should_authenticate_credit_card', # noqa: E501 + 'currency': 'currency', # noqa: E501 + 'items': 'items', # noqa: E501 + 'fixed_va': 'fixed_va', # noqa: E501 + 'reminder_date': 'reminder_date', # noqa: E501 + 'customer': 'customer', # noqa: E501 + 'customer_notification_preference': 'customer_notification_preference', # noqa: E501 + 'fees': 'fees', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, external_id, user_id, status, merchant_name, merchant_profile_picture_url, amount, expiry_date, invoice_url, available_banks, available_retail_outlets, available_ewallets, available_qr_codes, available_direct_debits, available_paylaters, should_send_email, created, updated, *args, **kwargs): # noqa: E501 + """Invoice - a model defined in OpenAPI + + Args: + external_id (str): The external identifier for the invoice. + user_id (str): The user ID associated with the invoice. + status (InvoiceStatus): + merchant_name (str): The name of the merchant. + merchant_profile_picture_url (str): The URL of the merchant's profile picture. + amount (float): The total amount of the invoice. + expiry_date (datetime): Representing a date and time in ISO 8601 format. + invoice_url (str): The URL to view the invoice. + available_banks ([Bank]): An array of available banks for payment. + available_retail_outlets ([RetailOutlet]): An array of available retail outlets for payment. + available_ewallets ([Ewallet]): An array of available e-wallets for payment. + available_qr_codes ([QrCode]): An array of available QR codes for payment. + available_direct_debits ([DirectDebit]): An array of available direct debit options for payment. + available_paylaters ([Paylater]): An array of available pay-later options for payment. + should_send_email (bool): Indicates whether email notifications should be sent. + created (datetime): Representing a date and time in ISO 8601 format. + updated (datetime): Representing a date and time in ISO 8601 format. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (str): The unique identifier for the invoice.. [optional] # noqa: E501 + payer_email (str): The email address of the payer.. [optional] # noqa: E501 + description (str): A description of the invoice.. [optional] # noqa: E501 + payment_method (InvoicePaymentMethod): [optional] # noqa: E501 + locale (str): The locale or language used for the invoice.. [optional] # noqa: E501 + should_exclude_credit_card (bool): Indicates whether credit card payments should be excluded.. [optional] # noqa: E501 + success_redirect_url (str): The URL to redirect to on successful payment.. [optional] # noqa: E501 + failure_redirect_url (str): The URL to redirect to on payment failure.. [optional] # noqa: E501 + should_authenticate_credit_card (bool): Indicates whether credit card authentication is required.. [optional] # noqa: E501 + currency (InvoiceCurrency): [optional] # noqa: E501 + items ([InvoiceItem]): An array of items included in the invoice.. [optional] # noqa: E501 + fixed_va (bool): Indicates whether the virtual account is fixed.. [optional] # noqa: E501 + reminder_date (datetime): Representing a date and time in ISO 8601 format.. [optional] # noqa: E501 + customer (CustomerObject): [optional] # noqa: E501 + customer_notification_preference (NotificationPreference): [optional] # noqa: E501 + fees ([InvoiceFee]): An array of fees associated with the invoice.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.external_id = external_id + self.user_id = user_id + self.status = status + self.merchant_name = merchant_name + self.merchant_profile_picture_url = merchant_profile_picture_url + self.amount = amount + self.expiry_date = expiry_date + self.invoice_url = invoice_url + self.available_banks = available_banks + self.available_retail_outlets = available_retail_outlets + self.available_ewallets = available_ewallets + self.available_qr_codes = available_qr_codes + self.available_direct_debits = available_direct_debits + self.available_paylaters = available_paylaters + self.should_send_email = should_send_email + self.created = created + self.updated = updated + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, external_id, user_id, status, merchant_name, merchant_profile_picture_url, amount, expiry_date, invoice_url, available_banks, available_retail_outlets, available_ewallets, available_qr_codes, available_direct_debits, available_paylaters, should_send_email, created, updated, *args, **kwargs): # noqa: E501 + """Invoice - a model defined in OpenAPI + + Args: + external_id (str): The external identifier for the invoice. + user_id (str): The user ID associated with the invoice. + status (InvoiceStatus): + merchant_name (str): The name of the merchant. + merchant_profile_picture_url (str): The URL of the merchant's profile picture. + amount (float): The total amount of the invoice. + expiry_date (datetime): Representing a date and time in ISO 8601 format. + invoice_url (str): The URL to view the invoice. + available_banks ([Bank]): An array of available banks for payment. + available_retail_outlets ([RetailOutlet]): An array of available retail outlets for payment. + available_ewallets ([Ewallet]): An array of available e-wallets for payment. + available_qr_codes ([QrCode]): An array of available QR codes for payment. + available_direct_debits ([DirectDebit]): An array of available direct debit options for payment. + available_paylaters ([Paylater]): An array of available pay-later options for payment. + should_send_email (bool): Indicates whether email notifications should be sent. + created (datetime): Representing a date and time in ISO 8601 format. + updated (datetime): Representing a date and time in ISO 8601 format. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (str): The unique identifier for the invoice.. [optional] # noqa: E501 + payer_email (str): The email address of the payer.. [optional] # noqa: E501 + description (str): A description of the invoice.. [optional] # noqa: E501 + payment_method (InvoicePaymentMethod): [optional] # noqa: E501 + locale (str): The locale or language used for the invoice.. [optional] # noqa: E501 + should_exclude_credit_card (bool): Indicates whether credit card payments should be excluded.. [optional] # noqa: E501 + success_redirect_url (str): The URL to redirect to on successful payment.. [optional] # noqa: E501 + failure_redirect_url (str): The URL to redirect to on payment failure.. [optional] # noqa: E501 + should_authenticate_credit_card (bool): Indicates whether credit card authentication is required.. [optional] # noqa: E501 + currency (InvoiceCurrency): [optional] # noqa: E501 + items ([InvoiceItem]): An array of items included in the invoice.. [optional] # noqa: E501 + fixed_va (bool): Indicates whether the virtual account is fixed.. [optional] # noqa: E501 + reminder_date (datetime): Representing a date and time in ISO 8601 format.. [optional] # noqa: E501 + customer (CustomerObject): [optional] # noqa: E501 + customer_notification_preference (NotificationPreference): [optional] # noqa: E501 + fees ([InvoiceFee]): An array of fees associated with the invoice.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.external_id = external_id + self.user_id = user_id + self.status = status + self.merchant_name = merchant_name + self.merchant_profile_picture_url = merchant_profile_picture_url + self.amount = amount + self.expiry_date = expiry_date + self.invoice_url = invoice_url + self.available_banks = available_banks + self.available_retail_outlets = available_retail_outlets + self.available_ewallets = available_ewallets + self.available_qr_codes = available_qr_codes + self.available_direct_debits = available_direct_debits + self.available_paylaters = available_paylaters + self.should_send_email = should_send_email + self.created = created + self.updated = updated + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/invoice/model/invoice_client_type.py b/xendit/invoice/model/invoice_client_type.py new file mode 100644 index 00000000..c9a5b91a --- /dev/null +++ b/xendit/invoice/model/invoice_client_type.py @@ -0,0 +1,293 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class InvoiceClientType(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'DASHBOARD': "DASHBOARD", + 'API_GATEWAY': "API_GATEWAY", + 'INTEGRATION': "INTEGRATION", + 'ON_DEMAND': "ON_DEMAND", + 'RECURRING': "RECURRING", + 'MOBILE': "MOBILE", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """InvoiceClientType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Representing the client type or source of an invoice.., must be one of ["DASHBOARD", "API_GATEWAY", "INTEGRATION", "ON_DEMAND", "RECURRING", "MOBILE", ] # noqa: E501 + + Keyword Args: + value (str): Representing the client type or source of an invoice.., must be one of ["DASHBOARD", "API_GATEWAY", "INTEGRATION", "ON_DEMAND", "RECURRING", "MOBILE", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """InvoiceClientType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Representing the client type or source of an invoice.., must be one of ["DASHBOARD", "API_GATEWAY", "INTEGRATION", "ON_DEMAND", "RECURRING", "MOBILE", ] # noqa: E501 + + Keyword Args: + value (str): Representing the client type or source of an invoice.., must be one of ["DASHBOARD", "API_GATEWAY", "INTEGRATION", "ON_DEMAND", "RECURRING", "MOBILE", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/invoice/model/invoice_currency.py b/xendit/invoice/model/invoice_currency.py new file mode 100644 index 00000000..8adfb803 --- /dev/null +++ b/xendit/invoice/model/invoice_currency.py @@ -0,0 +1,290 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class InvoiceCurrency(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'IDR': "IDR", + 'USD': "USD", + 'PHP': "PHP", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """InvoiceCurrency - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Representing the currency used for an invoice.., must be one of ["IDR", "USD", "PHP", ] # noqa: E501 + + Keyword Args: + value (str): Representing the currency used for an invoice.., must be one of ["IDR", "USD", "PHP", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """InvoiceCurrency - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Representing the currency used for an invoice.., must be one of ["IDR", "USD", "PHP", ] # noqa: E501 + + Keyword Args: + value (str): Representing the currency used for an invoice.., must be one of ["IDR", "USD", "PHP", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/invoice/model/invoice_error404_response_definition.py b/xendit/invoice/model/invoice_error404_response_definition.py new file mode 100644 index 00000000..927d1a71 --- /dev/null +++ b/xendit/invoice/model/invoice_error404_response_definition.py @@ -0,0 +1,279 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class InvoiceError404ResponseDefinition(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('error_code',): { + 'INVOICE_NOT_FOUND_ERROR': "INVOICE_NOT_FOUND_ERROR", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'error_code': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'error_code': 'error_code', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, message, *args, **kwargs): # noqa: E501 + """InvoiceError404ResponseDefinition - a model defined in OpenAPI + + Args: + message (str): A human-readable error message providing additional context about the resource not being found. + + Keyword Args: + error_code (str): The specific error code indicating that the requested invoice was not found.. defaults to "INVOICE_NOT_FOUND_ERROR", must be one of ["INVOICE_NOT_FOUND_ERROR", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + error_code = kwargs.get('error_code', "INVOICE_NOT_FOUND_ERROR") + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.error_code = error_code + self.message = message + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, message, *args, **kwargs): # noqa: E501 + """InvoiceError404ResponseDefinition - a model defined in OpenAPI + + Args: + message (str): A human-readable error message providing additional context about the resource not being found. + + Keyword Args: + error_code (str): The specific error code indicating that the requested invoice was not found.. defaults to "INVOICE_NOT_FOUND_ERROR", must be one of ["INVOICE_NOT_FOUND_ERROR", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + error_code = kwargs.get('error_code', "INVOICE_NOT_FOUND_ERROR") + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.error_code = error_code + self.message = message + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/invoice/model/invoice_fee.py b/xendit/invoice/model/invoice_fee.py new file mode 100644 index 00000000..7def8877 --- /dev/null +++ b/xendit/invoice/model/invoice_fee.py @@ -0,0 +1,274 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class InvoiceFee(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'type': (str,), # noqa: E501 + 'value': (float,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'type': 'type', # noqa: E501 + 'value': 'value', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, value, *args, **kwargs): # noqa: E501 + """InvoiceFee - a model defined in OpenAPI + + Args: + type (str): The type of fee. + value (float): The value or amount of the fee. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + self.value = value + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, type, value, *args, **kwargs): # noqa: E501 + """InvoiceFee - a model defined in OpenAPI + + Args: + type (str): The type of fee. + value (float): The value or amount of the fee. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + self.value = value + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/invoice/model/invoice_item.py b/xendit/invoice/model/invoice_item.py new file mode 100644 index 00000000..1bffdded --- /dev/null +++ b/xendit/invoice/model/invoice_item.py @@ -0,0 +1,295 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class InvoiceItem(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('quantity',): { + 'exclusive_minimum''inclusive_minimum': 0, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + 'price': (float,), # noqa: E501 + 'quantity': (float,), # noqa: E501 + 'reference_id': (str,), # noqa: E501 + 'url': (str,), # noqa: E501 + 'category': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'price': 'price', # noqa: E501 + 'quantity': 'quantity', # noqa: E501 + 'reference_id': 'reference_id', # noqa: E501 + 'url': 'url', # noqa: E501 + 'category': 'category', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, price, quantity, *args, **kwargs): # noqa: E501 + """InvoiceItem - a model defined in OpenAPI + + Args: + name (str): The name of the item. + price (float): The price of the item. + quantity (float): The quantity of the item. Must be greater than or equal to 0. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + reference_id (str): The reference ID of the item.. [optional] # noqa: E501 + url (str): The URL associated with the item.. [optional] # noqa: E501 + category (str): The category of the item.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + self.price = price + self.quantity = quantity + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, name, price, quantity, *args, **kwargs): # noqa: E501 + """InvoiceItem - a model defined in OpenAPI + + Args: + name (str): The name of the item. + price (float): The price of the item. + quantity (float): The quantity of the item. Must be greater than or equal to 0. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + reference_id (str): The reference ID of the item.. [optional] # noqa: E501 + url (str): The URL associated with the item.. [optional] # noqa: E501 + category (str): The category of the item.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + self.price = price + self.quantity = quantity + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/invoice/model/invoice_not_found_error.py b/xendit/invoice/model/invoice_not_found_error.py new file mode 100644 index 00000000..2753a89d --- /dev/null +++ b/xendit/invoice/model/invoice_not_found_error.py @@ -0,0 +1,279 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class InvoiceNotFoundError(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('error_code',): { + 'CALLBACK_VIRTUAL_ACCOUNT_NOT_FOUND_ERROR': "CALLBACK_VIRTUAL_ACCOUNT_NOT_FOUND_ERROR", + 'UNIQUE_ACCOUNT_NUMBER_UNAVAILABLE_ERROR': "UNIQUE_ACCOUNT_NUMBER_UNAVAILABLE_ERROR", + 'PAYMENT_CODE_NOT_AVAILABLE_ERROR': "PAYMENT_CODE_NOT_AVAILABLE_ERROR", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'error_code': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'error_code': 'error_code', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, error_code, message, *args, **kwargs): # noqa: E501 + """InvoiceNotFoundError - a model defined in OpenAPI + + Args: + error_code (str): The error code indicating the type of error that occurred. + message (str): A human-readable error message that provides additional information about the error. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.error_code = error_code + self.message = message + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, error_code, message, *args, **kwargs): # noqa: E501 + """InvoiceNotFoundError - a model defined in OpenAPI + + Args: + error_code (str): The error code indicating the type of error that occurred. + message (str): A human-readable error message that provides additional information about the error. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.error_code = error_code + self.message = message + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/invoice/model/invoice_payment_method.py b/xendit/invoice/model/invoice_payment_method.py new file mode 100644 index 00000000..3f70e61f --- /dev/null +++ b/xendit/invoice/model/invoice_payment_method.py @@ -0,0 +1,297 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class InvoicePaymentMethod(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'POOL': "POOL", + 'CALLBACK_VIRTUAL_ACCOUNT': "CALLBACK_VIRTUAL_ACCOUNT", + 'CREDIT_CARD': "CREDIT_CARD", + 'RETAIL_OUTLET': "RETAIL_OUTLET", + 'QR_CODE': "QR_CODE", + 'QRIS': "QRIS", + 'EWALLET': "EWALLET", + 'DIRECT_DEBIT': "DIRECT_DEBIT", + 'BANK_TRANSFER': "BANK_TRANSFER", + 'PAYLATER': "PAYLATER", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """InvoicePaymentMethod - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Representing the payment method used for an invoice.., must be one of ["POOL", "CALLBACK_VIRTUAL_ACCOUNT", "CREDIT_CARD", "RETAIL_OUTLET", "QR_CODE", "QRIS", "EWALLET", "DIRECT_DEBIT", "BANK_TRANSFER", "PAYLATER", ] # noqa: E501 + + Keyword Args: + value (str): Representing the payment method used for an invoice.., must be one of ["POOL", "CALLBACK_VIRTUAL_ACCOUNT", "CREDIT_CARD", "RETAIL_OUTLET", "QR_CODE", "QRIS", "EWALLET", "DIRECT_DEBIT", "BANK_TRANSFER", "PAYLATER", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """InvoicePaymentMethod - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Representing the payment method used for an invoice.., must be one of ["POOL", "CALLBACK_VIRTUAL_ACCOUNT", "CREDIT_CARD", "RETAIL_OUTLET", "QR_CODE", "QRIS", "EWALLET", "DIRECT_DEBIT", "BANK_TRANSFER", "PAYLATER", ] # noqa: E501 + + Keyword Args: + value (str): Representing the payment method used for an invoice.., must be one of ["POOL", "CALLBACK_VIRTUAL_ACCOUNT", "CREDIT_CARD", "RETAIL_OUTLET", "QR_CODE", "QRIS", "EWALLET", "DIRECT_DEBIT", "BANK_TRANSFER", "PAYLATER", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/invoice/model/invoice_status.py b/xendit/invoice/model/invoice_status.py new file mode 100644 index 00000000..814e44c0 --- /dev/null +++ b/xendit/invoice/model/invoice_status.py @@ -0,0 +1,291 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class InvoiceStatus(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'PENDING': "PENDING", + 'PAID': "PAID", + 'SETTLED': "SETTLED", + 'EXPIRED': "EXPIRED", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """InvoiceStatus - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Representing the status of an invoice.., must be one of ["PENDING", "PAID", "SETTLED", "EXPIRED", ] # noqa: E501 + + Keyword Args: + value (str): Representing the status of an invoice.., must be one of ["PENDING", "PAID", "SETTLED", "EXPIRED", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """InvoiceStatus - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Representing the status of an invoice.., must be one of ["PENDING", "PAID", "SETTLED", "EXPIRED", ] # noqa: E501 + + Keyword Args: + value (str): Representing the status of an invoice.., must be one of ["PENDING", "PAID", "SETTLED", "EXPIRED", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/invoice/model/notification_channel.py b/xendit/invoice/model/notification_channel.py new file mode 100644 index 00000000..6eee4e68 --- /dev/null +++ b/xendit/invoice/model/notification_channel.py @@ -0,0 +1,291 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class NotificationChannel(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'EMAIL': "email", + 'SMS': "sms", + 'WHATSAPP': "whatsapp", + 'VIBER': "viber", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """NotificationChannel - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Representing a notification channel for sending messages.., must be one of ["email", "sms", "whatsapp", "viber", ] # noqa: E501 + + Keyword Args: + value (str): Representing a notification channel for sending messages.., must be one of ["email", "sms", "whatsapp", "viber", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """NotificationChannel - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Representing a notification channel for sending messages.., must be one of ["email", "sms", "whatsapp", "viber", ] # noqa: E501 + + Keyword Args: + value (str): Representing a notification channel for sending messages.., must be one of ["email", "sms", "whatsapp", "viber", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/invoice/model/notification_preference.py b/xendit/invoice/model/notification_preference.py new file mode 100644 index 00000000..458ac7a6 --- /dev/null +++ b/xendit/invoice/model/notification_preference.py @@ -0,0 +1,280 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.invoice.model.notification_channel import NotificationChannel + globals()['NotificationChannel'] = NotificationChannel + + +class NotificationPreference(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'invoice_created': ([NotificationChannel],), # noqa: E501 + 'invoice_reminder': ([NotificationChannel],), # noqa: E501 + 'invoice_expired': ([NotificationChannel],), # noqa: E501 + 'invoice_paid': ([NotificationChannel],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'invoice_created': 'invoice_created', # noqa: E501 + 'invoice_reminder': 'invoice_reminder', # noqa: E501 + 'invoice_expired': 'invoice_expired', # noqa: E501 + 'invoice_paid': 'invoice_paid', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """NotificationPreference - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + invoice_created ([NotificationChannel]): Notification channels for when an invoice is created.. [optional] # noqa: E501 + invoice_reminder ([NotificationChannel]): Notification channels for invoice reminders.. [optional] # noqa: E501 + invoice_expired ([NotificationChannel]): Notification channels for expired invoices.. [optional] # noqa: E501 + invoice_paid ([NotificationChannel]): Notification channels for when an invoice is paid.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """NotificationPreference - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + invoice_created ([NotificationChannel]): Notification channels for when an invoice is created.. [optional] # noqa: E501 + invoice_reminder ([NotificationChannel]): Notification channels for invoice reminders.. [optional] # noqa: E501 + invoice_expired ([NotificationChannel]): Notification channels for expired invoices.. [optional] # noqa: E501 + invoice_paid ([NotificationChannel]): Notification channels for when an invoice is paid.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/invoice/model/paylater.py b/xendit/invoice/model/paylater.py new file mode 100644 index 00000000..1898c835 --- /dev/null +++ b/xendit/invoice/model/paylater.py @@ -0,0 +1,278 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.invoice.model.paylater_type import PaylaterType + globals()['PaylaterType'] = PaylaterType + + +class Paylater(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'paylater_type': (PaylaterType,), # noqa: E501 + 'should_exclude': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'paylater_type': 'paylater_type', # noqa: E501 + 'should_exclude': 'should_exclude', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, paylater_type, *args, **kwargs): # noqa: E501 + """Paylater - a model defined in OpenAPI + + Args: + paylater_type (PaylaterType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + should_exclude (bool): Indicates whether this paylater option should be excluded.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.paylater_type = paylater_type + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, paylater_type, *args, **kwargs): # noqa: E501 + """Paylater - a model defined in OpenAPI + + Args: + paylater_type (PaylaterType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + should_exclude (bool): Indicates whether this paylater option should be excluded.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.paylater_type = paylater_type + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/invoice/model/paylater_type.py b/xendit/invoice/model/paylater_type.py new file mode 100644 index 00000000..cc342fe3 --- /dev/null +++ b/xendit/invoice/model/paylater_type.py @@ -0,0 +1,293 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaylaterType(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'KREDIVO': "KREDIVO", + 'AKULAKU': "AKULAKU", + 'UANGME': "UANGME", + 'BILLEASE': "BILLEASE", + 'CASHALO': "CASHALO", + 'ATOME': "ATOME", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """PaylaterType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Representing the available paylater channels used for invoice-related transactions.., must be one of ["KREDIVO", "AKULAKU", "UANGME", "BILLEASE", "CASHALO", "ATOME", ] # noqa: E501 + + Keyword Args: + value (str): Representing the available paylater channels used for invoice-related transactions.., must be one of ["KREDIVO", "AKULAKU", "UANGME", "BILLEASE", "CASHALO", "ATOME", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """PaylaterType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Representing the available paylater channels used for invoice-related transactions.., must be one of ["KREDIVO", "AKULAKU", "UANGME", "BILLEASE", "CASHALO", "ATOME", ] # noqa: E501 + + Keyword Args: + value (str): Representing the available paylater channels used for invoice-related transactions.., must be one of ["KREDIVO", "AKULAKU", "UANGME", "BILLEASE", "CASHALO", "ATOME", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/invoice/model/qr_code.py b/xendit/invoice/model/qr_code.py new file mode 100644 index 00000000..73cfd57f --- /dev/null +++ b/xendit/invoice/model/qr_code.py @@ -0,0 +1,274 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.invoice.model.qr_code_type import QrCodeType + globals()['QrCodeType'] = QrCodeType + + +class QrCode(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'qr_code_type': (QrCodeType,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'qr_code_type': 'qr_code_type', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, qr_code_type, *args, **kwargs): # noqa: E501 + """QrCode - a model defined in OpenAPI + + Args: + qr_code_type (QrCodeType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.qr_code_type = qr_code_type + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, qr_code_type, *args, **kwargs): # noqa: E501 + """QrCode - a model defined in OpenAPI + + Args: + qr_code_type (QrCodeType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.qr_code_type = qr_code_type + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/invoice/model/qr_code_type.py b/xendit/invoice/model/qr_code_type.py new file mode 100644 index 00000000..59ccc3a3 --- /dev/null +++ b/xendit/invoice/model/qr_code_type.py @@ -0,0 +1,289 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class QrCodeType(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'QRIS': "QRIS", + 'PROMPTPAY': "PROMPTPAY", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """QrCodeType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Representing the available QR Code channels used for invoice-related transactions.., must be one of ["QRIS", "PROMPTPAY", ] # noqa: E501 + + Keyword Args: + value (str): Representing the available QR Code channels used for invoice-related transactions.., must be one of ["QRIS", "PROMPTPAY", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """QrCodeType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Representing the available QR Code channels used for invoice-related transactions.., must be one of ["QRIS", "PROMPTPAY", ] # noqa: E501 + + Keyword Args: + value (str): Representing the available QR Code channels used for invoice-related transactions.., must be one of ["QRIS", "PROMPTPAY", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/invoice/model/retail_outlet.py b/xendit/invoice/model/retail_outlet.py new file mode 100644 index 00000000..afda7468 --- /dev/null +++ b/xendit/invoice/model/retail_outlet.py @@ -0,0 +1,286 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.invoice.model.retail_outlet_name import RetailOutletName + globals()['RetailOutletName'] = RetailOutletName + + +class RetailOutlet(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'retail_outlet_name': (RetailOutletName,), # noqa: E501 + 'payment_code': (str,), # noqa: E501 + 'transfer_amount': (float,), # noqa: E501 + 'merchant_name': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'retail_outlet_name': 'retail_outlet_name', # noqa: E501 + 'payment_code': 'payment_code', # noqa: E501 + 'transfer_amount': 'transfer_amount', # noqa: E501 + 'merchant_name': 'merchant_name', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, retail_outlet_name, *args, **kwargs): # noqa: E501 + """RetailOutlet - a model defined in OpenAPI + + Args: + retail_outlet_name (RetailOutletName): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + payment_code (str): The payment code.. [optional] # noqa: E501 + transfer_amount (float): The transfer amount.. [optional] # noqa: E501 + merchant_name (str): The name of the merchant.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.retail_outlet_name = retail_outlet_name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, retail_outlet_name, *args, **kwargs): # noqa: E501 + """RetailOutlet - a model defined in OpenAPI + + Args: + retail_outlet_name (RetailOutletName): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + payment_code (str): The payment code.. [optional] # noqa: E501 + transfer_amount (float): The transfer amount.. [optional] # noqa: E501 + merchant_name (str): The name of the merchant.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.retail_outlet_name = retail_outlet_name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/invoice/model/retail_outlet_name.py b/xendit/invoice/model/retail_outlet_name.py new file mode 100644 index 00000000..fa391a20 --- /dev/null +++ b/xendit/invoice/model/retail_outlet_name.py @@ -0,0 +1,296 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class RetailOutletName(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'ALFAMART': "ALFAMART", + 'INDOMARET': "INDOMARET", + '7ELEVEN': "7ELEVEN", + 'CEBUANA': "CEBUANA", + 'DP_ECPAY_LOAN': "DP_ECPAY_LOAN", + 'DP_MLHUILLIER': "DP_MLHUILLIER", + 'DP_PALAWAN': "DP_PALAWAN", + 'DP_ECPAY_SCHOOL': "DP_ECPAY_SCHOOL", + 'LBC': "LBC", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """RetailOutletName - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Representing the available retail outlet channels used for invoice-related transactions.., must be one of ["ALFAMART", "INDOMARET", "7ELEVEN", "CEBUANA", "DP_ECPAY_LOAN", "DP_MLHUILLIER", "DP_PALAWAN", "DP_ECPAY_SCHOOL", "LBC", ] # noqa: E501 + + Keyword Args: + value (str): Representing the available retail outlet channels used for invoice-related transactions.., must be one of ["ALFAMART", "INDOMARET", "7ELEVEN", "CEBUANA", "DP_ECPAY_LOAN", "DP_MLHUILLIER", "DP_PALAWAN", "DP_ECPAY_SCHOOL", "LBC", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """RetailOutletName - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Representing the available retail outlet channels used for invoice-related transactions.., must be one of ["ALFAMART", "INDOMARET", "7ELEVEN", "CEBUANA", "DP_ECPAY_LOAN", "DP_MLHUILLIER", "DP_PALAWAN", "DP_ECPAY_SCHOOL", "LBC", ] # noqa: E501 + + Keyword Args: + value (str): Representing the available retail outlet channels used for invoice-related transactions.., must be one of ["ALFAMART", "INDOMARET", "7ELEVEN", "CEBUANA", "DP_ECPAY_LOAN", "DP_MLHUILLIER", "DP_PALAWAN", "DP_ECPAY_SCHOOL", "LBC", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/invoice/model/server_error.py b/xendit/invoice/model/server_error.py new file mode 100644 index 00000000..a690c976 --- /dev/null +++ b/xendit/invoice/model/server_error.py @@ -0,0 +1,279 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class ServerError(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('error_code',): { + 'SERVER_ERROR': "SERVER_ERROR", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'error_code': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'error_code': 'error_code', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, message, *args, **kwargs): # noqa: E501 + """ServerError - a model defined in OpenAPI + + Args: + message (str): + + Keyword Args: + error_code (str): defaults to "SERVER_ERROR", must be one of ["SERVER_ERROR", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + error_code = kwargs.get('error_code', "SERVER_ERROR") + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.error_code = error_code + self.message = message + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, message, *args, **kwargs): # noqa: E501 + """ServerError - a model defined in OpenAPI + + Args: + message (str): + + Keyword Args: + error_code (str): defaults to "SERVER_ERROR", must be one of ["SERVER_ERROR", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + error_code = kwargs.get('error_code', "SERVER_ERROR") + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.error_code = error_code + self.message = message + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/invoice/model/unauthorized_error.py b/xendit/invoice/model/unauthorized_error.py new file mode 100644 index 00000000..fe2cbbe0 --- /dev/null +++ b/xendit/invoice/model/unauthorized_error.py @@ -0,0 +1,279 @@ +""" + The version of the XENDIT API: 1.5.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class UnauthorizedError(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('error_code',): { + 'INVALID_API_KEY': "INVALID_API_KEY", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'error_code': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'error_code': 'error_code', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, message, *args, **kwargs): # noqa: E501 + """UnauthorizedError - a model defined in OpenAPI + + Args: + message (str): A human-readable error message providing additional context about the unauthorized access. + + Keyword Args: + error_code (str): The specific error code associated with the unauthorized access.. defaults to "INVALID_API_KEY", must be one of ["INVALID_API_KEY", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + error_code = kwargs.get('error_code', "INVALID_API_KEY") + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.error_code = error_code + self.message = message + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, message, *args, **kwargs): # noqa: E501 + """UnauthorizedError - a model defined in OpenAPI + + Args: + message (str): A human-readable error message providing additional context about the unauthorized access. + + Keyword Args: + error_code (str): The specific error code associated with the unauthorized access.. defaults to "INVALID_API_KEY", must be one of ["INVALID_API_KEY", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + error_code = kwargs.get('error_code', "INVALID_API_KEY") + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.error_code = error_code + self.message = message + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/model_utils.py b/xendit/model_utils.py new file mode 100644 index 00000000..6f252e47 --- /dev/null +++ b/xendit/model_utils.py @@ -0,0 +1,2053 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +from datetime import date, datetime # noqa: F401 +from copy import deepcopy +import inspect +import io +import os +import pprint +import re +import tempfile +import uuid + +from dateutil.parser import parse + +from xendit.exceptions import ( + ApiKeyError, + ApiAttributeError, + ApiTypeError, + ApiValueError, +) + +none_type = type(None) +file_type = io.IOBase + + +def convert_js_args_to_python_args(fn): + from functools import wraps + @wraps(fn) + def wrapped_init(_self, *args, **kwargs): + """ + An attribute named `self` received from the api will conflicts with the reserved `self` + parameter of a class method. During generation, `self` attributes are mapped + to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. + """ + spec_property_naming = kwargs.get('_spec_property_naming', False) + if spec_property_naming: + kwargs = change_keys_js_to_python( + kwargs, _self if isinstance( + _self, type) else _self.__class__) + return fn(_self, *args, **kwargs) + return wrapped_init + + +class cached_property(object): + # this caches the result of the function call for fn with no inputs + # use this as a decorator on function methods that you want converted + # into cached properties + result_key = '_results' + + def __init__(self, fn): + self._fn = fn + + def __get__(self, instance, cls=None): + if self.result_key in vars(self): + return vars(self)[self.result_key] + else: + result = self._fn() + setattr(self, self.result_key, result) + return result + + +PRIMITIVE_TYPES = (list, float, int, bool, datetime, date, str, file_type) + + +def allows_single_value_input(cls): + """ + This function returns True if the input composed schema model or any + descendant model allows a value only input + This is true for cases where oneOf contains items like: + oneOf: + - float + - NumberWithValidation + - StringEnum + - ArrayModel + - null + TODO: lru_cache this + """ + if ( + issubclass(cls, ModelSimple) or + cls in PRIMITIVE_TYPES + ): + return True + elif issubclass(cls, ModelComposed): + if not cls._composed_schemas['oneOf']: + return False + return any(allows_single_value_input(c) for c in cls._composed_schemas['oneOf']) + return False + + +def composed_model_input_classes(cls): + """ + This function returns a list of the possible models that can be accepted as + inputs. + TODO: lru_cache this + """ + if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: + return [cls] + elif issubclass(cls, ModelNormal): + if cls.discriminator is None: + return [cls] + else: + return get_discriminated_classes(cls) + elif issubclass(cls, ModelComposed): + if not cls._composed_schemas['oneOf']: + return [] + if cls.discriminator is None: + input_classes = [] + for c in cls._composed_schemas['oneOf']: + input_classes.extend(composed_model_input_classes(c)) + return input_classes + else: + return get_discriminated_classes(cls) + return [] + + +class OpenApiModel(object): + """The base class for all OpenAPIModels""" + + def set_attribute(self, name, value): + # this is only used to set properties on self + + path_to_item = [] + if self._path_to_item: + path_to_item.extend(self._path_to_item) + path_to_item.append(name) + + if name in self.openapi_types: + required_types_mixed = self.openapi_types[name] + elif self.additional_properties_type is None: + raise ApiAttributeError( + "{0} has no attribute '{1}'".format( + type(self).__name__, name), + path_to_item + ) + elif self.additional_properties_type is not None: + required_types_mixed = self.additional_properties_type + + if get_simple_class(name) != str: + error_msg = type_error_message( + var_name=name, + var_value=name, + valid_classes=(str,), + key_type=True + ) + raise ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=(str,), + key_type=True + ) + + if self._check_type: + value = validate_and_convert_types( + value, required_types_mixed, path_to_item, self._spec_property_naming, + self._check_type, configuration=self._configuration) + if (name,) in self.allowed_values: + check_allowed_values( + self.allowed_values, + (name,), + value + ) + if (name,) in self.validations: + check_validations( + self.validations, + (name,), + value, + self._configuration + ) + self.__dict__['_data_store'][name] = value + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other + + def __setattr__(self, attr, value): + """set the value of an attribute using dot notation: `instance.attr = val`""" + self[attr] = value + + def __getattr__(self, attr): + """get the value of an attribute using dot notation: `instance.attr`""" + return self.__getitem__(attr) + + def __copy__(self): + cls = self.__class__ + if self.get("_spec_property_naming", False): + return cls._new_from_openapi_data(**self.__dict__) + else: + return cls.__new__(cls, **self.__dict__) + + def __deepcopy__(self, memo): + cls = self.__class__ + + if self.get("_spec_property_naming", False): + new_inst = cls._new_from_openapi_data() + else: + new_inst = cls.__new__(cls, **self.__dict__) + + for k, v in self.__dict__.items(): + setattr(new_inst, k, deepcopy(v, memo)) + return new_inst + + + def __new__(cls, *args, **kwargs): + # this function uses the discriminator to + # pick a new schema/class to instantiate because a discriminator + # propertyName value was passed in + + if len(args) == 1: + arg = args[0] + if arg is None and is_type_nullable(cls): + # The input data is the 'null' value and the type is nullable. + return None + + if issubclass(cls, ModelComposed) and allows_single_value_input(cls): + model_kwargs = {} + oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) + return oneof_instance + + visited_composed_classes = kwargs.get('_visited_composed_classes', ()) + if ( + cls.discriminator is None or + cls in visited_composed_classes + ): + # Use case 1: this openapi schema (cls) does not have a discriminator + # Use case 2: we have already visited this class before and are sure that we + # want to instantiate it this time. We have visited this class deserializing + # a payload with a discriminator. During that process we traveled through + # this class but did not make an instance of it. Now we are making an + # instance of a composed class which contains cls in it, so this time make an instance of cls. + # + # Here's an example of use case 2: If Animal has a discriminator + # petType and we pass in "Dog", and the class Dog + # allOf includes Animal, we move through Animal + # once using the discriminator, and pick Dog. + # Then in the composed schema dog Dog, we will make an instance of the + # Animal class (because Dal has allOf: Animal) but this time we won't travel + # through Animal's discriminator because we passed in + # _visited_composed_classes = (Animal,) + + return super(OpenApiModel, cls).__new__(cls) + + # Get the name and value of the discriminator property. + # The discriminator name is obtained from the discriminator meta-data + # and the discriminator value is obtained from the input data. + discr_propertyname_py = list(cls.discriminator.keys())[0] + discr_propertyname_js = cls.attribute_map[discr_propertyname_py] + if discr_propertyname_js in kwargs: + discr_value = kwargs[discr_propertyname_js] + elif discr_propertyname_py in kwargs: + discr_value = kwargs[discr_propertyname_py] + else: + # The input data does not contain the discriminator property. + path_to_item = kwargs.get('_path_to_item', ()) + raise ApiValueError( + "Cannot deserialize input data due to missing discriminator. " + "The discriminator property '%s' is missing at path: %s" % + (discr_propertyname_js, path_to_item) + ) + + # Implementation note: the last argument to get_discriminator_class + # is a list of visited classes. get_discriminator_class may recursively + # call itself and update the list of visited classes, and the initial + # value must be an empty list. Hence not using 'visited_composed_classes' + new_cls = get_discriminator_class( + cls, discr_propertyname_py, discr_value, []) + if new_cls is None: + path_to_item = kwargs.get('_path_to_item', ()) + disc_prop_value = kwargs.get( + discr_propertyname_js, kwargs.get(discr_propertyname_py)) + raise ApiValueError( + "Cannot deserialize input data due to invalid discriminator " + "value. The OpenAPI document has no mapping for discriminator " + "property '%s'='%s' at path: %s" % + (discr_propertyname_js, disc_prop_value, path_to_item) + ) + + if new_cls in visited_composed_classes: + # if we are making an instance of a composed schema Descendent + # which allOf includes Ancestor, then Ancestor contains + # a discriminator that includes Descendent. + # So if we make an instance of Descendent, we have to make an + # instance of Ancestor to hold the allOf properties. + # This code detects that use case and makes the instance of Ancestor + # For example: + # When making an instance of Dog, _visited_composed_classes = (Dog,) + # then we make an instance of Animal to include in dog._composed_instances + # so when we are here, cls is Animal + # cls.discriminator != None + # cls not in _visited_composed_classes + # new_cls = Dog + # but we know we know that we already have Dog + # because it is in visited_composed_classes + # so make Animal here + return super(OpenApiModel, cls).__new__(cls) + + # Build a list containing all oneOf and anyOf descendants. + oneof_anyof_classes = None + if cls._composed_schemas is not None: + oneof_anyof_classes = ( + cls._composed_schemas.get('oneOf', ()) + + cls._composed_schemas.get('anyOf', ())) + oneof_anyof_child = new_cls in oneof_anyof_classes + kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) + + if cls._composed_schemas.get('allOf') and oneof_anyof_child: + # Validate that we can make self because when we make the + # new_cls it will not include the allOf validations in self + self_inst = super(OpenApiModel, cls).__new__(cls) + self_inst.__init__(*args, **kwargs) + + if kwargs.get("_spec_property_naming", False): + # when true, implies new is from deserialization + new_inst = new_cls._new_from_openapi_data(*args, **kwargs) + else: + new_inst = new_cls.__new__(new_cls, *args, **kwargs) + new_inst.__init__(*args, **kwargs) + + return new_inst + + @classmethod + @convert_js_args_to_python_args + def _new_from_openapi_data(cls, *args, **kwargs): + # this function uses the discriminator to + # pick a new schema/class to instantiate because a discriminator + # propertyName value was passed in + + if len(args) == 1: + arg = args[0] + if arg is None and is_type_nullable(cls): + # The input data is the 'null' value and the type is nullable. + return None + + if issubclass(cls, ModelComposed) and allows_single_value_input(cls): + model_kwargs = {} + oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) + return oneof_instance + + visited_composed_classes = kwargs.get('_visited_composed_classes', ()) + if ( + cls.discriminator is None or + cls in visited_composed_classes + ): + # Use case 1: this openapi schema (cls) does not have a discriminator + # Use case 2: we have already visited this class before and are sure that we + # want to instantiate it this time. We have visited this class deserializing + # a payload with a discriminator. During that process we traveled through + # this class but did not make an instance of it. Now we are making an + # instance of a composed class which contains cls in it, so this time make an instance of cls. + # + # Here's an example of use case 2: If Animal has a discriminator + # petType and we pass in "Dog", and the class Dog + # allOf includes Animal, we move through Animal + # once using the discriminator, and pick Dog. + # Then in the composed schema dog Dog, we will make an instance of the + # Animal class (because Dal has allOf: Animal) but this time we won't travel + # through Animal's discriminator because we passed in + # _visited_composed_classes = (Animal,) + + return cls._from_openapi_data(*args, **kwargs) + + # Get the name and value of the discriminator property. + # The discriminator name is obtained from the discriminator meta-data + # and the discriminator value is obtained from the input data. + discr_propertyname_py = list(cls.discriminator.keys())[0] + discr_propertyname_js = cls.attribute_map[discr_propertyname_py] + if discr_propertyname_js in kwargs: + discr_value = kwargs[discr_propertyname_js] + elif discr_propertyname_py in kwargs: + discr_value = kwargs[discr_propertyname_py] + else: + # The input data does not contain the discriminator property. + path_to_item = kwargs.get('_path_to_item', ()) + raise ApiValueError( + "Cannot deserialize input data due to missing discriminator. " + "The discriminator property '%s' is missing at path: %s" % + (discr_propertyname_js, path_to_item) + ) + + # Implementation note: the last argument to get_discriminator_class + # is a list of visited classes. get_discriminator_class may recursively + # call itself and update the list of visited classes, and the initial + # value must be an empty list. Hence not using 'visited_composed_classes' + new_cls = get_discriminator_class( + cls, discr_propertyname_py, discr_value, []) + if new_cls is None: + path_to_item = kwargs.get('_path_to_item', ()) + disc_prop_value = kwargs.get( + discr_propertyname_js, kwargs.get(discr_propertyname_py)) + raise ApiValueError( + "Cannot deserialize input data due to invalid discriminator " + "value. The OpenAPI document has no mapping for discriminator " + "property '%s'='%s' at path: %s" % + (discr_propertyname_js, disc_prop_value, path_to_item) + ) + + if new_cls in visited_composed_classes: + # if we are making an instance of a composed schema Descendent + # which allOf includes Ancestor, then Ancestor contains + # a discriminator that includes Descendent. + # So if we make an instance of Descendent, we have to make an + # instance of Ancestor to hold the allOf properties. + # This code detects that use case and makes the instance of Ancestor + # For example: + # When making an instance of Dog, _visited_composed_classes = (Dog,) + # then we make an instance of Animal to include in dog._composed_instances + # so when we are here, cls is Animal + # cls.discriminator != None + # cls not in _visited_composed_classes + # new_cls = Dog + # but we know we know that we already have Dog + # because it is in visited_composed_classes + # so make Animal here + return cls._from_openapi_data(*args, **kwargs) + + # Build a list containing all oneOf and anyOf descendants. + oneof_anyof_classes = None + if cls._composed_schemas is not None: + oneof_anyof_classes = ( + cls._composed_schemas.get('oneOf', ()) + + cls._composed_schemas.get('anyOf', ())) + oneof_anyof_child = new_cls in oneof_anyof_classes + kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) + + if cls._composed_schemas.get('allOf') and oneof_anyof_child: + # Validate that we can make self because when we make the + # new_cls it will not include the allOf validations in self + self_inst = cls._from_openapi_data(*args, **kwargs) + + new_inst = new_cls._new_from_openapi_data(*args, **kwargs) + return new_inst + + +class ModelSimple(OpenApiModel): + """the parent class of models whose type != object in their + swagger/openapi""" + + def __setitem__(self, name, value): + """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" + if name in self.required_properties: + self.__dict__[name] = value + return + + self.set_attribute(name, value) + + def get(self, name, default=None): + """returns the value of an attribute or some default value if the attribute was not set""" + if name in self.required_properties: + return self.__dict__[name] + + return self.__dict__['_data_store'].get(name, default) + + def __getitem__(self, name): + """get the value of an attribute using square-bracket notation: `instance[attr]`""" + if name in self: + return self.get(name) + + raise ApiAttributeError( + "{0} has no attribute '{1}'".format( + type(self).__name__, name), + [e for e in [self._path_to_item, name] if e] + ) + + def __contains__(self, name): + """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" + if name in self.required_properties: + return name in self.__dict__ + + return name in self.__dict__['_data_store'] + + def to_str(self): + """Returns the string representation of the model""" + return str(self.value) + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, self.__class__): + return False + + this_val = self._data_store['value'] + that_val = other._data_store['value'] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + return vals_equal + + +class ModelNormal(OpenApiModel): + """the parent class of models whose type == object in their + swagger/openapi""" + + def __setitem__(self, name, value): + """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" + if name in self.required_properties: + self.__dict__[name] = value + return + + self.set_attribute(name, value) + + def get(self, name, default=None): + """returns the value of an attribute or some default value if the attribute was not set""" + if name in self.required_properties: + return self.__dict__[name] + + return self.__dict__['_data_store'].get(name, default) + + def __getitem__(self, name): + """get the value of an attribute using square-bracket notation: `instance[attr]`""" + if name in self: + return self.get(name) + + raise ApiAttributeError( + "{0} has no attribute '{1}'".format( + type(self).__name__, name), + [e for e in [self._path_to_item, name] if e] + ) + + def __contains__(self, name): + """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" + if name in self.required_properties: + return name in self.__dict__ + + return name in self.__dict__['_data_store'] + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, self.__class__): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in self._data_store.items(): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if not vals_equal: + return False + return True + + +class ModelComposed(OpenApiModel): + """the parent class of models whose type == object in their + swagger/openapi and have oneOf/allOf/anyOf + + When one sets a property we use var_name_to_model_instances to store the value in + the correct class instances + run any type checking + validation code. + When one gets a property we use var_name_to_model_instances to get the value + from the correct class instances. + This allows multiple composed schemas to contain the same property with additive + constraints on the value. + + _composed_schemas (dict) stores the anyOf/allOf/oneOf classes + key (str): allOf/oneOf/anyOf + value (list): the classes in the XOf definition. + Note: none_type can be included when the openapi document version >= 3.1.0 + _composed_instances (list): stores a list of instances of the composed schemas + defined in _composed_schemas. When properties are accessed in the self instance, + they are returned from the self._data_store or the data stores in the instances + in self._composed_schemas + _var_name_to_model_instances (dict): maps between a variable name on self and + the composed instances (self included) which contain that data + key (str): property name + value (list): list of class instances, self or instances in _composed_instances + which contain the value that the key is referring to. + """ + + def __setitem__(self, name, value): + """set the value of an attribute using square-bracket notation: `instance[attr] = val`""" + if name in self.required_properties: + self.__dict__[name] = value + return + + """ + Use cases: + 1. additional_properties_type is None (additionalProperties == False in spec) + Check for property presence in self.openapi_types + if not present then throw an error + if present set in self, set attribute + always set on composed schemas + 2. additional_properties_type exists + set attribute on self + always set on composed schemas + """ + if self.additional_properties_type is None: + """ + For an attribute to exist on a composed schema it must: + - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND + - fulfill schema_requirements in each oneOf/anyOf/allOf schemas + + schema_requirements: + For an attribute to exist on a schema it must: + - be present in properties at the schema OR + - have additionalProperties unset (defaults additionalProperties = any type) OR + - have additionalProperties set + """ + if name not in self.openapi_types: + raise ApiAttributeError( + "{0} has no attribute '{1}'".format( + type(self).__name__, name), + [e for e in [self._path_to_item, name] if e] + ) + # attribute must be set on self and composed instances + self.set_attribute(name, value) + for model_instance in self._composed_instances: + setattr(model_instance, name, value) + if name not in self._var_name_to_model_instances: + # we assigned an additional property + self.__dict__['_var_name_to_model_instances'][name] = self._composed_instances + [self] + return None + + __unset_attribute_value__ = object() + + def get(self, name, default=None): + """returns the value of an attribute or some default value if the attribute was not set""" + if name in self.required_properties: + return self.__dict__[name] + + # get the attribute from the correct instance + model_instances = self._var_name_to_model_instances.get(name) + values = [] + # A composed model stores self and child (oneof/anyOf/allOf) models under + # self._var_name_to_model_instances. + # Any property must exist in self and all model instances + # The value stored in all model instances must be the same + if model_instances: + for model_instance in model_instances: + if name in model_instance._data_store: + v = model_instance._data_store[name] + if v not in values: + values.append(v) + len_values = len(values) + if len_values == 0: + return default + elif len_values == 1: + return values[0] + elif len_values > 1: + raise ApiValueError( + "Values stored for property {0} in {1} differ when looking " + "at self and self's composed instances. All values must be " + "the same".format(name, type(self).__name__), + [e for e in [self._path_to_item, name] if e] + ) + + def __getitem__(self, name): + """get the value of an attribute using square-bracket notation: `instance[attr]`""" + value = self.get(name, self.__unset_attribute_value__) + if value is self.__unset_attribute_value__: + raise ApiAttributeError( + "{0} has no attribute '{1}'".format( + type(self).__name__, name), + [e for e in [self._path_to_item, name] if e] + ) + return value + + def __contains__(self, name): + """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" + + if name in self.required_properties: + return name in self.__dict__ + + model_instances = self._var_name_to_model_instances.get( + name, self._additional_properties_model_instances) + + if model_instances: + for model_instance in model_instances: + if name in model_instance._data_store: + return True + + return False + + def to_dict(self): + """Returns the model properties as a dict""" + return model_to_dict(self, serialize=False) + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, self.__class__): + return False + + if not set(self._data_store.keys()) == set(other._data_store.keys()): + return False + for _var_name, this_val in self._data_store.items(): + that_val = other._data_store[_var_name] + types = set() + types.add(this_val.__class__) + types.add(that_val.__class__) + vals_equal = this_val == that_val + if not vals_equal: + return False + return True + + +COERCION_INDEX_BY_TYPE = { + ModelComposed: 0, + ModelNormal: 1, + ModelSimple: 2, + none_type: 3, # The type of 'None'. + list: 4, + dict: 5, + float: 6, + int: 7, + bool: 8, + datetime: 9, + date: 10, + str: 11, + file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. +} + +# these are used to limit what type conversions we try to do +# when we have a valid type already and we want to try converting +# to another type +UPCONVERSION_TYPE_PAIRS = ( + (str, datetime), + (str, date), + # A float may be serialized as an integer, e.g. '3' is a valid serialized float. + (int, float), + (list, ModelComposed), + (dict, ModelComposed), + (str, ModelComposed), + (int, ModelComposed), + (float, ModelComposed), + (list, ModelComposed), + (list, ModelNormal), + (dict, ModelNormal), + (str, ModelSimple), + (int, ModelSimple), + (float, ModelSimple), + (list, ModelSimple), +) + +COERCIBLE_TYPE_PAIRS = { + False: ( # client instantiation of a model with client data + # (dict, ModelComposed), + # (list, ModelComposed), + # (dict, ModelNormal), + # (list, ModelNormal), + # (str, ModelSimple), + # (int, ModelSimple), + # (float, ModelSimple), + # (list, ModelSimple), + # (str, int), + # (str, float), + # (str, datetime), + # (str, date), + # (int, str), + # (float, str), + ), + True: ( # server -> client data + (dict, ModelComposed), + (list, ModelComposed), + (dict, ModelNormal), + (list, ModelNormal), + (str, ModelSimple), + (int, ModelSimple), + (float, ModelSimple), + (list, ModelSimple), + # (str, int), + # (str, float), + (str, datetime), + (str, date), + # (int, str), + # (float, str), + (str, file_type) + ), +} + + +def get_simple_class(input_value): + """Returns an input_value's simple class that we will use for type checking + Python2: + float and int will return int, where int is the python3 int backport + str and unicode will return str, where str is the python3 str backport + Note: float and int ARE both instances of int backport + Note: str_py2 and unicode_py2 are NOT both instances of str backport + + Args: + input_value (class/class_instance): the item for which we will return + the simple class + """ + if isinstance(input_value, type): + # input_value is a class + return input_value + elif isinstance(input_value, tuple): + return tuple + elif isinstance(input_value, list): + return list + elif isinstance(input_value, dict): + return dict + elif isinstance(input_value, none_type): + return none_type + elif isinstance(input_value, file_type): + return file_type + elif isinstance(input_value, bool): + # this must be higher than the int check because + # isinstance(True, int) == True + return bool + elif isinstance(input_value, int): + return int + elif isinstance(input_value, datetime): + # this must be higher than the date check because + # isinstance(datetime_instance, date) == True + return datetime + elif isinstance(input_value, date): + return date + elif isinstance(input_value, str): + return str + return type(input_value) + + +def check_allowed_values(allowed_values, input_variable_path, input_values): + """Raises an exception if the input_values are not allowed + + Args: + allowed_values (dict): the allowed_values dict + input_variable_path (tuple): the path to the input variable + input_values (list/str/int/float/date/datetime): the values that we + are checking to see if they are in allowed_values + """ + these_allowed_values = list(allowed_values[input_variable_path].values()) + if (isinstance(input_values, list) + and not set(input_values).issubset( + set(these_allowed_values))): + invalid_values = ", ".join( + map(str, set(input_values) - set(these_allowed_values))), + raise ApiValueError( + "Invalid values for `%s` [%s], must be a subset of [%s]" % + ( + input_variable_path[0], + invalid_values, + ", ".join(map(str, these_allowed_values)) + ) + ) + elif (isinstance(input_values, dict) + and not set( + input_values.keys()).issubset(set(these_allowed_values))): + invalid_values = ", ".join( + map(str, set(input_values.keys()) - set(these_allowed_values))) + raise ApiValueError( + "Invalid keys in `%s` [%s], must be a subset of [%s]" % + ( + input_variable_path[0], + invalid_values, + ", ".join(map(str, these_allowed_values)) + ) + ) + elif (not isinstance(input_values, (list, dict)) + and input_values not in these_allowed_values): + raise ApiValueError( + "Invalid value for `%s` (%s), must be one of %s" % + ( + input_variable_path[0], + input_values, + these_allowed_values + ) + ) + + +def is_json_validation_enabled(schema_keyword, configuration=None): + """Returns true if JSON schema validation is enabled for the specified + validation keyword. This can be used to skip JSON schema structural validation + as requested in the configuration. + + Args: + schema_keyword (string): the name of a JSON schema validation keyword. + configuration (Configuration): the configuration class. + """ + + return (configuration is None or + not hasattr(configuration, '_disabled_client_side_validations') or + schema_keyword not in configuration._disabled_client_side_validations) + + +def check_validations( + validations, input_variable_path, input_values, + configuration=None): + """Raises an exception if the input_values are invalid + + Args: + validations (dict): the validation dictionary. + input_variable_path (tuple): the path to the input variable. + input_values (list/str/int/float/date/datetime): the values that we + are checking. + configuration (Configuration): the configuration class. + """ + + if input_values is None: + return + + current_validations = validations[input_variable_path] + if (is_json_validation_enabled('multipleOf', configuration) and + 'multiple_of' in current_validations and + isinstance(input_values, (int, float)) and + not (float(input_values) / current_validations['multiple_of']).is_integer()): + # Note 'multipleOf' will be as good as the floating point arithmetic. + raise ApiValueError( + "Invalid value for `%s`, value must be a multiple of " + "`%s`" % ( + input_variable_path[0], + current_validations['multiple_of'] + ) + ) + + if (is_json_validation_enabled('maxLength', configuration) and + 'max_length' in current_validations and + len(input_values) > current_validations['max_length']): + raise ApiValueError( + "Invalid value for `%s`, length must be less than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['max_length'] + ) + ) + + if (is_json_validation_enabled('minLength', configuration) and + 'min_length' in current_validations and + len(input_values) < current_validations['min_length']): + raise ApiValueError( + "Invalid value for `%s`, length must be greater than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['min_length'] + ) + ) + + if (is_json_validation_enabled('maxItems', configuration) and + 'max_items' in current_validations and + len(input_values) > current_validations['max_items']): + raise ApiValueError( + "Invalid value for `%s`, number of items must be less than or " + "equal to `%s`" % ( + input_variable_path[0], + current_validations['max_items'] + ) + ) + + if (is_json_validation_enabled('minItems', configuration) and + 'min_items' in current_validations and + len(input_values) < current_validations['min_items']): + raise ValueError( + "Invalid value for `%s`, number of items must be greater than or " + "equal to `%s`" % ( + input_variable_path[0], + current_validations['min_items'] + ) + ) + + items = ('exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', + 'inclusive_minimum') + if (any(item in current_validations for item in items)): + if isinstance(input_values, list): + max_val = max(input_values) + min_val = min(input_values) + elif isinstance(input_values, dict): + max_val = max(input_values.values()) + min_val = min(input_values.values()) + else: + max_val = input_values + min_val = input_values + + if (is_json_validation_enabled('exclusiveMaximum', configuration) and + 'exclusive_maximum' in current_validations and + max_val >= current_validations['exclusive_maximum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value less than `%s`" % ( + input_variable_path[0], + current_validations['exclusive_maximum'] + ) + ) + + if (is_json_validation_enabled('maximum', configuration) and + 'inclusive_maximum' in current_validations and + max_val > current_validations['inclusive_maximum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value less than or equal to " + "`%s`" % ( + input_variable_path[0], + current_validations['inclusive_maximum'] + ) + ) + + if (is_json_validation_enabled('exclusiveMinimum', configuration) and + 'exclusive_minimum' in current_validations and + min_val <= current_validations['exclusive_minimum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value greater than `%s`" % + ( + input_variable_path[0], + current_validations['exclusive_maximum'] + ) + ) + + if (is_json_validation_enabled('minimum', configuration) and + 'inclusive_minimum' in current_validations and + min_val < current_validations['inclusive_minimum']): + raise ApiValueError( + "Invalid value for `%s`, must be a value greater than or equal " + "to `%s`" % ( + input_variable_path[0], + current_validations['inclusive_minimum'] + ) + ) + flags = current_validations.get('regex', {}).get('flags', 0) + if (is_json_validation_enabled('pattern', configuration) and + 'regex' in current_validations and + not re.search(current_validations['regex']['pattern'], + input_values, flags=flags)): + err_msg = r"Invalid value for `%s`, must match regular expression `%s`" % ( + input_variable_path[0], + current_validations['regex']['pattern'] + ) + if flags != 0: + # Don't print the regex flags if the flags are not + # specified in the OAS document. + err_msg = r"%s with flags=`%s`" % (err_msg, flags) + raise ApiValueError(err_msg) + + +def order_response_types(required_types): + """Returns the required types sorted in coercion order + + Args: + required_types (list/tuple): collection of classes or instance of + list or dict with class information inside it. + + Returns: + (list): coercion order sorted collection of classes or instance + of list or dict with class information inside it. + """ + + def index_getter(class_or_instance): + if isinstance(class_or_instance, list): + return COERCION_INDEX_BY_TYPE[list] + elif isinstance(class_or_instance, dict): + return COERCION_INDEX_BY_TYPE[dict] + elif (inspect.isclass(class_or_instance) + and issubclass(class_or_instance, ModelComposed)): + return COERCION_INDEX_BY_TYPE[ModelComposed] + elif (inspect.isclass(class_or_instance) + and issubclass(class_or_instance, ModelNormal)): + return COERCION_INDEX_BY_TYPE[ModelNormal] + elif (inspect.isclass(class_or_instance) + and issubclass(class_or_instance, ModelSimple)): + return COERCION_INDEX_BY_TYPE[ModelSimple] + elif class_or_instance in COERCION_INDEX_BY_TYPE: + return COERCION_INDEX_BY_TYPE[class_or_instance] + raise ApiValueError("Unsupported type: %s" % class_or_instance) + + sorted_types = sorted( + required_types, + key=lambda class_or_instance: index_getter(class_or_instance) + ) + return sorted_types + + +def remove_uncoercible(required_types_classes, current_item, spec_property_naming, + must_convert=True): + """Only keeps the type conversions that are possible + + Args: + required_types_classes (tuple): tuple of classes that are required + these should be ordered by COERCION_INDEX_BY_TYPE + spec_property_naming (bool): True if the variable names in the input + data are serialized names as specified in the OpenAPI document. + False if the variables names in the input data are python + variable names in PEP-8 snake case. + current_item (any): the current item (input data) to be converted + + Keyword Args: + must_convert (bool): if True the item to convert is of the wrong + type and we want a big list of coercibles + if False, we want a limited list of coercibles + + Returns: + (list): the remaining coercible required types, classes only + """ + current_type_simple = get_simple_class(current_item) + + results_classes = [] + for required_type_class in required_types_classes: + # convert our models to OpenApiModel + required_type_class_simplified = required_type_class + if isinstance(required_type_class_simplified, type): + if issubclass(required_type_class_simplified, ModelComposed): + required_type_class_simplified = ModelComposed + elif issubclass(required_type_class_simplified, ModelNormal): + required_type_class_simplified = ModelNormal + elif issubclass(required_type_class_simplified, ModelSimple): + required_type_class_simplified = ModelSimple + + if required_type_class_simplified == current_type_simple: + # don't consider converting to one's own class + continue + + class_pair = (current_type_simple, required_type_class_simplified) + if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[spec_property_naming]: + results_classes.append(required_type_class) + elif class_pair in UPCONVERSION_TYPE_PAIRS: + results_classes.append(required_type_class) + return results_classes + + +def get_discriminated_classes(cls): + """ + Returns all the classes that a discriminator converts to + TODO: lru_cache this + """ + possible_classes = [] + key = list(cls.discriminator.keys())[0] + if is_type_nullable(cls): + possible_classes.append(cls) + for discr_cls in cls.discriminator[key].values(): + if hasattr(discr_cls, 'discriminator') and discr_cls.discriminator is not None: + possible_classes.extend(get_discriminated_classes(discr_cls)) + else: + possible_classes.append(discr_cls) + return possible_classes + + +def get_possible_classes(cls, from_server_context): + # TODO: lru_cache this + possible_classes = [cls] + if from_server_context: + return possible_classes + if hasattr(cls, 'discriminator') and cls.discriminator is not None: + possible_classes = [] + possible_classes.extend(get_discriminated_classes(cls)) + elif issubclass(cls, ModelComposed): + possible_classes.extend(composed_model_input_classes(cls)) + return possible_classes + + +def get_required_type_classes(required_types_mixed, spec_property_naming): + """Converts the tuple required_types into a tuple and a dict described + below + + Args: + required_types_mixed (tuple/list): will contain either classes or + instance of list or dict + spec_property_naming (bool): if True these values came from the + server, and we use the data types in our endpoints. + If False, we are client side and we need to include + oneOf and discriminator classes inside the data types in our endpoints + + Returns: + (valid_classes, dict_valid_class_to_child_types_mixed): + valid_classes (tuple): the valid classes that the current item + should be + dict_valid_class_to_child_types_mixed (dict): + valid_class (class): this is the key + child_types_mixed (list/dict/tuple): describes the valid child + types + """ + valid_classes = [] + child_req_types_by_current_type = {} + for required_type in required_types_mixed: + if isinstance(required_type, list): + valid_classes.append(list) + child_req_types_by_current_type[list] = required_type + elif isinstance(required_type, tuple): + valid_classes.append(tuple) + child_req_types_by_current_type[tuple] = required_type + elif isinstance(required_type, dict): + valid_classes.append(dict) + child_req_types_by_current_type[dict] = required_type[str] + else: + valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) + return tuple(valid_classes), child_req_types_by_current_type + + +def change_keys_js_to_python(input_dict, model_class): + """ + Converts from javascript_key keys in the input_dict to python_keys in + the output dict using the mapping in model_class. + If the input_dict contains a key which does not declared in the model_class, + the key is added to the output dict as is. The assumption is the model_class + may have undeclared properties (additionalProperties attribute in the OAS + document). + """ + + if getattr(model_class, 'attribute_map', None) is None: + return input_dict + output_dict = {} + reversed_attr_map = {value: key for key, value in + model_class.attribute_map.items()} + for javascript_key, value in input_dict.items(): + python_key = reversed_attr_map.get(javascript_key) + if python_key is None: + # if the key is unknown, it is in error or it is an + # additionalProperties variable + python_key = javascript_key + output_dict[python_key] = value + return output_dict + + +def get_type_error(var_value, path_to_item, valid_classes, key_type=False): + error_msg = type_error_message( + var_name=path_to_item[-1], + var_value=var_value, + valid_classes=valid_classes, + key_type=key_type + ) + return ApiTypeError( + error_msg, + path_to_item=path_to_item, + valid_classes=valid_classes, + key_type=key_type + ) + + +def deserialize_primitive(data, klass, path_to_item): + """Deserializes string to primitive type. + + :param data: str/int/float + :param klass: str/class the class to convert to + + :return: int, float, str, bool, date, datetime + """ + additional_message = "" + try: + if klass in {datetime, date}: + additional_message = ( + "If you need your parameter to have a fallback " + "string value, please set its type as `type: {}` in your " + "spec. That allows the value to be any type. " + ) + if klass == datetime: + if len(data) < 8: + raise ValueError("This is not a datetime") + # The string should be in iso8601 datetime format. + parsed_datetime = parse(data) + date_only = ( + parsed_datetime.hour == 0 and + parsed_datetime.minute == 0 and + parsed_datetime.second == 0 and + parsed_datetime.tzinfo is None and + 8 <= len(data) <= 10 + ) + if date_only: + raise ValueError("This is a date, not a datetime") + return parsed_datetime + elif klass == date: + if len(data) < 8: + raise ValueError("This is not a date") + return parse(data).date() + else: + converted_value = klass(data) + if isinstance(data, str) and klass == float: + if str(converted_value) != data: + # '7' -> 7.0 -> '7.0' != '7' + raise ValueError('This is not a float') + return converted_value + except (OverflowError, ValueError) as ex: + # parse can raise OverflowError + raise ApiValueError( + "{0}Failed to parse {1} as {2}".format( + additional_message, repr(data), klass.__name__ + ), + path_to_item=path_to_item + ) from ex + + +def get_discriminator_class(model_class, + discr_name, + discr_value, cls_visited): + """Returns the child class specified by the discriminator. + + Args: + model_class (OpenApiModel): the model class. + discr_name (string): the name of the discriminator property. + discr_value (any): the discriminator value. + cls_visited (list): list of model classes that have been visited. + Used to determine the discriminator class without + visiting circular references indefinitely. + + Returns: + used_model_class (class/None): the chosen child class that will be used + to deserialize the data, for example dog.Dog. + If a class is not found, None is returned. + """ + + if model_class in cls_visited: + # The class has already been visited and no suitable class was found. + return None + cls_visited.append(model_class) + used_model_class = None + if discr_name in model_class.discriminator: + class_name_to_discr_class = model_class.discriminator[discr_name] + used_model_class = class_name_to_discr_class.get(discr_value) + if used_model_class is None: + # We didn't find a discriminated class in class_name_to_discr_class. + # So look in the ancestor or descendant discriminators + # The discriminator mapping may exist in a descendant (anyOf, oneOf) + # or ancestor (allOf). + # Ancestor example: in the GrandparentAnimal -> ParentPet -> ChildCat + # hierarchy, the discriminator mappings may be defined at any level + # in the hierarchy. + # Descendant example: mammal -> whale/zebra/Pig -> BasquePig/DanishPig + # if we try to make BasquePig from mammal, we need to travel through + # the oneOf descendant discriminators to find BasquePig + descendant_classes = model_class._composed_schemas.get('oneOf', ()) + \ + model_class._composed_schemas.get('anyOf', ()) + ancestor_classes = model_class._composed_schemas.get('allOf', ()) + possible_classes = descendant_classes + ancestor_classes + for cls in possible_classes: + # Check if the schema has inherited discriminators. + if hasattr(cls, 'discriminator') and cls.discriminator is not None: + used_model_class = get_discriminator_class( + cls, discr_name, discr_value, cls_visited) + if used_model_class is not None: + return used_model_class + return used_model_class + + +def deserialize_model(model_data, model_class, path_to_item, check_type, + configuration, spec_property_naming): + """Deserializes model_data to model instance. + + Args: + model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model + model_class (OpenApiModel): the model class + path_to_item (list): path to the model in the received data + check_type (bool): whether to check the data tupe for the values in + the model + configuration (Configuration): the instance to use to convert files + spec_property_naming (bool): True if the variable names in the input + data are serialized names as specified in the OpenAPI document. + False if the variables names in the input data are python + variable names in PEP-8 snake case. + + Returns: + model instance + + Raise: + ApiTypeError + ApiValueError + ApiKeyError + """ + + kw_args = dict(_check_type=check_type, + _path_to_item=path_to_item, + _configuration=configuration, + _spec_property_naming=spec_property_naming) + + if issubclass(model_class, ModelSimple): + return model_class._new_from_openapi_data(model_data, **kw_args) + elif isinstance(model_data, list): + return model_class._new_from_openapi_data(*model_data, **kw_args) + if isinstance(model_data, dict): + kw_args.update(model_data) + return model_class._new_from_openapi_data(**kw_args) + elif isinstance(model_data, PRIMITIVE_TYPES): + return model_class._new_from_openapi_data(model_data, **kw_args) + + +def deserialize_file(response_data, configuration, content_disposition=None): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + Args: + param response_data (str): the file data to write + configuration (Configuration): the instance to use to convert files + + Keyword Args: + content_disposition (str): the value of the Content-Disposition + header + + Returns: + (file_type): the deserialized file which is open + The user is responsible for closing and reading the file + """ + fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition, + flags=re.I) + if filename is not None: + filename = filename.group(1) + else: + filename = "default_" + str(uuid.uuid4()) + + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + if isinstance(response_data, str): + # change str to bytes so we can write it + response_data = response_data.encode('utf-8') + f.write(response_data) + + f = open(path, "rb") + return f + + +def attempt_convert_item(input_value, valid_classes, path_to_item, + configuration, spec_property_naming, key_type=False, + must_convert=False, check_type=True): + """ + Args: + input_value (any): the data to convert + valid_classes (any): the classes that are valid + path_to_item (list): the path to the item to convert + configuration (Configuration): the instance to use to convert files + spec_property_naming (bool): True if the variable names in the input + data are serialized names as specified in the OpenAPI document. + False if the variables names in the input data are python + variable names in PEP-8 snake case. + key_type (bool): if True we need to convert a key type (not supported) + must_convert (bool): if True we must convert + check_type (bool): if True we check the type or the returned data in + ModelComposed/ModelNormal/ModelSimple instances + + Returns: + instance (any) the fixed item + + Raises: + ApiTypeError + ApiValueError + ApiKeyError + """ + valid_classes_ordered = order_response_types(valid_classes) + valid_classes_coercible = remove_uncoercible( + valid_classes_ordered, input_value, spec_property_naming) + if not valid_classes_coercible or key_type: + # we do not handle keytype errors, json will take care + # of this for us + if configuration is None or not configuration.discard_unknown_keys: + raise get_type_error(input_value, path_to_item, valid_classes, + key_type=key_type) + for valid_class in valid_classes_coercible: + try: + if issubclass(valid_class, OpenApiModel): + return deserialize_model(input_value, valid_class, + path_to_item, check_type, + configuration, spec_property_naming) + elif valid_class == file_type: + return deserialize_file(input_value, configuration) + return deserialize_primitive(input_value, valid_class, + path_to_item) + except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: + if must_convert: + raise conversion_exc + # if we have conversion errors when must_convert == False + # we ignore the exception and move on to the next class + continue + # we were unable to convert, must_convert == False + return input_value + + +def is_type_nullable(input_type): + """ + Returns true if None is an allowed value for the specified input_type. + + A type is nullable if at least one of the following conditions is true: + 1. The OAS 'nullable' attribute has been specified, + 1. The type is the 'null' type, + 1. The type is a anyOf/oneOf composed schema, and a child schema is + the 'null' type. + Args: + input_type (type): the class of the input_value that we are + checking + Returns: + bool + """ + if input_type is none_type: + return True + if issubclass(input_type, OpenApiModel) and input_type._nullable: + return True + if issubclass(input_type, ModelComposed): + # If oneOf/anyOf, check if the 'null' type is one of the allowed types. + for t in input_type._composed_schemas.get('oneOf', ()): + if is_type_nullable(t): + return True + for t in input_type._composed_schemas.get('anyOf', ()): + if is_type_nullable(t): + return True + return False + + +def is_valid_type(input_class_simple, valid_classes): + """ + Args: + input_class_simple (class): the class of the input_value that we are + checking + valid_classes (tuple): the valid classes that the current item + should be + Returns: + bool + """ + if issubclass(input_class_simple, OpenApiModel) and \ + valid_classes == (bool, date, datetime, dict, float, int, list, str, none_type,): + return True + valid_type = input_class_simple in valid_classes + if not valid_type and ( + issubclass(input_class_simple, OpenApiModel) or + input_class_simple is none_type): + for valid_class in valid_classes: + if input_class_simple is none_type and is_type_nullable(valid_class): + # Schema is oneOf/anyOf and the 'null' type is one of the allowed types. + return True + if not (issubclass(valid_class, OpenApiModel) and valid_class.discriminator): + continue + discr_propertyname_py = list(valid_class.discriminator.keys())[0] + discriminator_classes = ( + valid_class.discriminator[discr_propertyname_py].values() + ) + valid_type = is_valid_type(input_class_simple, discriminator_classes) + if valid_type: + return True + return valid_type + + +def validate_and_convert_types(input_value, required_types_mixed, path_to_item, + spec_property_naming, _check_type, configuration=None): + """Raises a TypeError is there is a problem, otherwise returns value + + Args: + input_value (any): the data to validate/convert + required_types_mixed (list/dict/tuple): A list of + valid classes, or a list tuples of valid classes, or a dict where + the value is a tuple of value classes + path_to_item: (list) the path to the data being validated + this stores a list of keys or indices to get to the data being + validated + spec_property_naming (bool): True if the variable names in the input + data are serialized names as specified in the OpenAPI document. + False if the variables names in the input data are python + variable names in PEP-8 snake case. + _check_type: (boolean) if true, type will be checked and conversion + will be attempted. + configuration: (Configuration): the configuration class to use + when converting file_type items. + If passed, conversion will be attempted when possible + If not passed, no conversions will be attempted and + exceptions will be raised + + Returns: + the correctly typed value + + Raises: + ApiTypeError + """ + results = get_required_type_classes(required_types_mixed, spec_property_naming) + valid_classes, child_req_types_by_current_type = results + + input_class_simple = get_simple_class(input_value) + valid_type = is_valid_type(input_class_simple, valid_classes) + if not valid_type: + if (configuration + or (input_class_simple == dict + and dict not in valid_classes)): + # if input_value is not valid_type try to convert it + converted_instance = attempt_convert_item( + input_value, + valid_classes, + path_to_item, + configuration, + spec_property_naming, + key_type=False, + must_convert=True, + check_type=_check_type + ) + return converted_instance + else: + raise get_type_error(input_value, path_to_item, valid_classes, + key_type=False) + + # input_value's type is in valid_classes + if len(valid_classes) > 1 and configuration: + # there are valid classes which are not the current class + valid_classes_coercible = remove_uncoercible( + valid_classes, input_value, spec_property_naming, must_convert=False) + if valid_classes_coercible: + converted_instance = attempt_convert_item( + input_value, + valid_classes_coercible, + path_to_item, + configuration, + spec_property_naming, + key_type=False, + must_convert=False, + check_type=_check_type + ) + return converted_instance + + if child_req_types_by_current_type == {}: + # all types are of the required types and there are no more inner + # variables left to look at + return input_value + inner_required_types = child_req_types_by_current_type.get( + type(input_value) + ) + if inner_required_types is None: + # for this type, there are not more inner variables left to look at + return input_value + if isinstance(input_value, list): + if input_value == []: + # allow an empty list + return input_value + for index, inner_value in enumerate(input_value): + inner_path = list(path_to_item) + inner_path.append(index) + input_value[index] = validate_and_convert_types( + inner_value, + inner_required_types, + inner_path, + spec_property_naming, + _check_type, + configuration=configuration + ) + elif isinstance(input_value, dict): + if input_value == {}: + # allow an empty dict + return input_value + for inner_key, inner_val in input_value.items(): + inner_path = list(path_to_item) + inner_path.append(inner_key) + if get_simple_class(inner_key) != str: + raise get_type_error(inner_key, inner_path, valid_classes, + key_type=True) + input_value[inner_key] = validate_and_convert_types( + inner_val, + inner_required_types, + inner_path, + spec_property_naming, + _check_type, + configuration=configuration + ) + return input_value + + +def model_to_dict(model_instance, serialize=True): + """Returns the model properties as a dict + + Args: + model_instance (one of your model instances): the model instance that + will be converted to a dict. + + Keyword Args: + serialize (bool): if True, the keys in the dict will be values from + attribute_map + """ + result = {} + + def extract_item(item): return ( + item[0], model_to_dict( + item[1], serialize=serialize)) if hasattr( + item[1], '_data_store') else item + + model_instances = [model_instance] + if model_instance._composed_schemas: + model_instances.extend(model_instance._composed_instances) + seen_json_attribute_names = set() + used_fallback_python_attribute_names = set() + py_to_json_map = {} + for model_instance in model_instances: + for attr, value in model_instance._data_store.items(): + if serialize: + # we use get here because additional property key names do not + # exist in attribute_map + try: + attr = model_instance.attribute_map[attr] + py_to_json_map.update(model_instance.attribute_map) + seen_json_attribute_names.add(attr) + except KeyError: + used_fallback_python_attribute_names.add(attr) + if isinstance(value, list): + if not value: + # empty list or None + result[attr] = value + else: + res = [] + for v in value: + if isinstance(v, PRIMITIVE_TYPES) or v is None: + res.append(v) + elif isinstance(v, ModelSimple): + res.append(v.value) + elif isinstance(v, dict): + res.append(dict(map( + extract_item, + v.items() + ))) + else: + res.append(model_to_dict(v, serialize=serialize)) + result[attr] = res + elif isinstance(value, dict): + result[attr] = dict(map( + extract_item, + value.items() + )) + elif isinstance(value, ModelSimple): + result[attr] = value.value + elif hasattr(value, '_data_store'): + result[attr] = model_to_dict(value, serialize=serialize) + else: + result[attr] = value + if serialize: + for python_key in used_fallback_python_attribute_names: + json_key = py_to_json_map.get(python_key) + if json_key is None: + continue + if python_key == json_key: + continue + json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names + if json_key_assigned_no_need_for_python_key: + del result[python_key] + + return result + + +def type_error_message(var_value=None, var_name=None, valid_classes=None, + key_type=None): + """ + Keyword Args: + var_value (any): the variable which has the type_error + var_name (str): the name of the variable which has the typ error + valid_classes (tuple): the accepted classes for current_item's + value + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + """ + key_or_value = 'value' + if key_type: + key_or_value = 'key' + valid_classes_phrase = get_valid_classes_phrase(valid_classes) + msg = ( + "Invalid type for variable '{0}'. Required {1} type {2} and " + "passed type was {3}".format( + var_name, + key_or_value, + valid_classes_phrase, + type(var_value).__name__, + ) + ) + return msg + + +def get_valid_classes_phrase(input_classes): + """Returns a string phrase describing what types are allowed + """ + all_classes = list(input_classes) + all_classes = sorted(all_classes, key=lambda cls: cls.__name__) + all_class_names = [cls.__name__ for cls in all_classes] + if len(all_class_names) == 1: + return 'is {0}'.format(all_class_names[0]) + return "is one of [{0}]".format(", ".join(all_class_names)) + + +def get_allof_instances(self, model_args, constant_args): + """ + Args: + self: the class we are handling + model_args (dict): var_name to var_value + used to make instances + constant_args (dict): + metadata arguments: + _check_type + _path_to_item + _spec_property_naming + _configuration + _visited_composed_classes + + Returns + composed_instances (list) + """ + composed_instances = [] + for allof_class in self._composed_schemas['allOf']: + + try: + if constant_args.get('_spec_property_naming'): + allof_instance = allof_class._from_openapi_data(**model_args, **constant_args) + else: + allof_instance = allof_class(**model_args, **constant_args) + composed_instances.append(allof_instance) + except Exception as ex: + raise ApiValueError( + "Invalid inputs given to generate an instance of '%s'. The " + "input data was invalid for the allOf schema '%s' in the composed " + "schema '%s'. Error=%s" % ( + allof_class.__name__, + allof_class.__name__, + self.__class__.__name__, + str(ex) + ) + ) from ex + return composed_instances + + +def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): + """ + Find the oneOf schema that matches the input data (e.g. payload). + If exactly one schema matches the input data, an instance of that schema + is returned. + If zero or more than one schema match the input data, an exception is raised. + In OAS 3.x, the payload MUST, by validation, match exactly one of the + schemas described by oneOf. + + Args: + cls: the class we are handling + model_kwargs (dict): var_name to var_value + The input data, e.g. the payload that must match a oneOf schema + in the OpenAPI document. + constant_kwargs (dict): var_name to var_value + args that every model requires, including configuration, server + and path to item. + + Kwargs: + model_arg: (int, float, bool, str, date, datetime, ModelSimple, None): + the value to assign to a primitive class or ModelSimple class + Notes: + - this is only passed in when oneOf includes types which are not object + - None is used to suppress handling of model_arg, nullable models are handled in __new__ + + Returns + oneof_instance (instance) + """ + if len(cls._composed_schemas['oneOf']) == 0: + return None + + oneof_instances = [] + # Iterate over each oneOf schema and determine if the input data + # matches the oneOf schemas. + for oneof_class in cls._composed_schemas['oneOf']: + # The composed oneOf schema allows the 'null' type and the input data + # is the null value. This is a OAS >= 3.1 feature. + if oneof_class is none_type: + # skip none_types because we are deserializing dict data. + # none_type deserialization is handled in the __new__ method + continue + + single_value_input = allows_single_value_input(oneof_class) + + try: + if not single_value_input: + if constant_kwargs.get('_spec_property_naming'): + oneof_instance = oneof_class._from_openapi_data( + **model_kwargs, **constant_kwargs) + else: + oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) + else: + if issubclass(oneof_class, ModelSimple): + if constant_kwargs.get('_spec_property_naming'): + oneof_instance = oneof_class._from_openapi_data( + model_arg, **constant_kwargs) + else: + oneof_instance = oneof_class(model_arg, **constant_kwargs) + elif oneof_class in PRIMITIVE_TYPES: + oneof_instance = validate_and_convert_types( + model_arg, + (oneof_class,), + constant_kwargs['_path_to_item'], + constant_kwargs['_spec_property_naming'], + constant_kwargs['_check_type'], + configuration=constant_kwargs['_configuration'] + ) + oneof_instances.append(oneof_instance) + except Exception: + pass + if len(oneof_instances) == 0: + raise ApiValueError( + "Invalid inputs given to generate an instance of %s. None " + "of the oneOf schemas matched the input data." % + cls.__name__ + ) + elif len(oneof_instances) > 1: + raise ApiValueError( + "Invalid inputs given to generate an instance of %s. Multiple " + "oneOf schemas matched the inputs, but a max of one is allowed." % + cls.__name__ + ) + return oneof_instances[0] + + +def get_anyof_instances(self, model_args, constant_args): + """ + Args: + self: the class we are handling + model_args (dict): var_name to var_value + The input data, e.g. the payload that must match at least one + anyOf child schema in the OpenAPI document. + constant_args (dict): var_name to var_value + args that every model requires, including configuration, server + and path to item. + + Returns + anyof_instances (list) + """ + anyof_instances = [] + if len(self._composed_schemas['anyOf']) == 0: + return anyof_instances + + for anyof_class in self._composed_schemas['anyOf']: + # The composed oneOf schema allows the 'null' type and the input data + # is the null value. This is a OAS >= 3.1 feature. + if anyof_class is none_type: + # skip none_types because we are deserializing dict data. + # none_type deserialization is handled in the __new__ method + continue + + try: + if constant_args.get('_spec_property_naming'): + anyof_instance = anyof_class._from_openapi_data(**model_args, **constant_args) + else: + anyof_instance = anyof_class(**model_args, **constant_args) + anyof_instances.append(anyof_instance) + except Exception: + pass + if len(anyof_instances) == 0: + raise ApiValueError( + "Invalid inputs given to generate an instance of %s. None of the " + "anyOf schemas matched the inputs." % + self.__class__.__name__ + ) + return anyof_instances + + +def get_discarded_args(self, composed_instances, model_args): + """ + Gathers the args that were discarded by configuration.discard_unknown_keys + """ + model_arg_keys = model_args.keys() + discarded_args = set() + # arguments passed to self were already converted to python names + # before __init__ was called + for instance in composed_instances: + if instance.__class__ in self._composed_schemas['allOf']: + try: + keys = instance.to_dict().keys() + discarded_keys = model_args - keys + discarded_args.update(discarded_keys) + except Exception: + # allOf integer schema will throw exception + pass + else: + try: + all_keys = set(model_to_dict(instance, serialize=False).keys()) + js_keys = model_to_dict(instance, serialize=True).keys() + all_keys.update(js_keys) + discarded_keys = model_arg_keys - all_keys + discarded_args.update(discarded_keys) + except Exception: + # allOf integer schema will throw exception + pass + return discarded_args + + +def validate_get_composed_info(constant_args, model_args, self): + """ + For composed schemas, generate schema instances for + all schemas in the oneOf/anyOf/allOf definition. If additional + properties are allowed, also assign those properties on + all matched schemas that contain additionalProperties. + Openapi schemas are python classes. + + Exceptions are raised if: + - 0 or > 1 oneOf schema matches the model_args input data + - no anyOf schema matches the model_args input data + - any of the allOf schemas do not match the model_args input data + + Args: + constant_args (dict): these are the args that every model requires + model_args (dict): these are the required and optional spec args that + were passed in to make this model + self (class): the class that we are instantiating + This class contains self._composed_schemas + + Returns: + composed_info (list): length three + composed_instances (list): the composed instances which are not + self + var_name_to_model_instances (dict): a dict going from var_name + to the model_instance which holds that var_name + the model_instance may be self or an instance of one of the + classes in self.composed_instances() + additional_properties_model_instances (list): a list of the + model instances which have the property + additional_properties_type. This list can include self + """ + # create composed_instances + composed_instances = [] + allof_instances = get_allof_instances(self, model_args, constant_args) + composed_instances.extend(allof_instances) + oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args) + if oneof_instance is not None: + composed_instances.append(oneof_instance) + anyof_instances = get_anyof_instances(self, model_args, constant_args) + composed_instances.extend(anyof_instances) + """ + set additional_properties_model_instances + additional properties must be evaluated at the schema level + so self's additional properties are most important + If self is a composed schema with: + - no properties defined in self + - additionalProperties: False + Then for object payloads every property is an additional property + and they are not allowed, so only empty dict is allowed + + Properties must be set on all matching schemas + so when a property is assigned toa composed instance, it must be set on all + composed instances regardless of additionalProperties presence + keeping it to prevent breaking changes in v5.0.1 + TODO remove cls._additional_properties_model_instances in 6.0.0 + """ + additional_properties_model_instances = [] + if self.additional_properties_type is not None: + additional_properties_model_instances = [self] + + """ + no need to set properties on self in here, they will be set in __init__ + By here all composed schema oneOf/anyOf/allOf instances have their properties set using + model_args + """ + discarded_args = get_discarded_args(self, composed_instances, model_args) + + # map variable names to composed_instances + var_name_to_model_instances = {} + for prop_name in model_args: + if prop_name not in discarded_args: + var_name_to_model_instances[prop_name] = [self] + list( + filter( + lambda x: prop_name in x.openapi_types, composed_instances)) + + return [ + composed_instances, + var_name_to_model_instances, + additional_properties_model_instances, + discarded_args + ] diff --git a/xendit/models/__init__.py b/xendit/models/__init__.py index 4103b312..19491681 100644 --- a/xendit/models/__init__.py +++ b/xendit/models/__init__.py @@ -1,18 +1 @@ -from .balance import * -from .batchdisbursement import * -from .cardlesscredit import * -from .creditcard import * -from .directdebit import * -from .disbursement import * -from .ewallet import * -from .invoice import * -from .payment import * -from .paymentmethod import * -from .paymentrequest import * -from .payout import * -from .qrcode import * -from .recurringpayment import * -from .refund import * -from .retailoutlet import * -from .virtualaccount import * -from .xenplatform import * +# models imported to module specific directories diff --git a/xendit/models/_base_model.py b/xendit/models/_base_model.py deleted file mode 100644 index e44e2747..00000000 --- a/xendit/models/_base_model.py +++ /dev/null @@ -1,36 +0,0 @@ -import json -from typing import List -from dataclasses import dataclass - - -@dataclass(init=False) -class BaseModel: - """Abstract class for feature class. Useful for pretty print and automatically set attribute""" - - def __init__(self, **kwargs): - for key, value in kwargs.items(): - setattr(self, key, value) - - def __repr__(self): - return json.dumps(vars(self), indent=4) - - - -@dataclass(init=False) -class BaseListModel: - has_more: bool - data: List[any] - - """Abstract class for feature class. Useful for pretty print and automatically set attribute""" - - def __init__(self, **kwargs): - for key, value in kwargs.items(): - setattr(self, key, value) - - def __repr__(self): - return json.dumps({ - "has_more": self.has_more, - "data": [ - vars(d) for d in self.data - ] - }, indent=4) diff --git a/xendit/models/_base_query.py b/xendit/models/_base_query.py deleted file mode 100644 index 4a05111c..00000000 --- a/xendit/models/_base_query.py +++ /dev/null @@ -1,9 +0,0 @@ -class BaseQuery(dict): - """Abstract class for query with object type""" - - def __init__(self, **kwargs): - dict_params = {} - for key, value in kwargs.items(): - if value is not None: - dict_params[key] = value - dict.__init__(self, dict_params) diff --git a/xendit/models/balance/__init__.py b/xendit/models/balance/__init__.py deleted file mode 100644 index 706dfa01..00000000 --- a/xendit/models/balance/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .balance import Balance -from .balance_account_type import BalanceAccountType diff --git a/xendit/models/balance/balance.py b/xendit/models/balance/balance.py deleted file mode 100644 index ef6bd536..00000000 --- a/xendit/models/balance/balance.py +++ /dev/null @@ -1,65 +0,0 @@ -from xendit.models._base_model import BaseModel -from .balance_account_type import BalanceAccountType - -from xendit.xendit_error import XenditError -from xendit._api_requestor import _APIRequestor -from xendit._extract_params import _extract_params - - -class Balance(BaseModel): - """Balance class (API Reference: Balance) - - Related Classes: - - Balance.AccountType - - Static Methods: - - Balance.get (API Reference: /Get Balance) - - Attributes: - - balance (int) - """ - - balance: int - - @staticmethod - def get( - *, - account_type=BalanceAccountType.CASH, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Send GET request to retrieve balance (API Reference: Balance/Get Balance) - - Args: - - account_type (BalanceAccountType) - - **for_user_id (str) (XenPlatform only) - - **x_api_version (str): API Version that will be used. If not provided will default to the latest - - Returns - Balance - - Raises - XenditError - """ - headers, _ = _extract_params( - locals(), - func_object=Balance.get, - headers_params=["for_user_id", "x_api_version"], - ) - kwargs["headers"] = headers - account_type = Balance._parse_value(account_type) - url = f"/balance?account_type={account_type}" - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return Balance(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def _parse_value(account_type): - try: - return account_type.name - except AttributeError: - return account_type diff --git a/xendit/models/balance/balance_account_type.py b/xendit/models/balance/balance_account_type.py deleted file mode 100644 index d00ae948..00000000 --- a/xendit/models/balance/balance_account_type.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class BalanceAccountType(Enum): - """Account Type for Get Balance""" - - CASH = "CASH" - HOLDING = "HOLDING" - TAX = "TAX" diff --git a/xendit/models/batchdisbursement/__init__.py b/xendit/models/batchdisbursement/__init__.py deleted file mode 100644 index 119217f0..00000000 --- a/xendit/models/batchdisbursement/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .batch_disbursement import BatchDisbursement diff --git a/xendit/models/batchdisbursement/batch_disbursement.py b/xendit/models/batchdisbursement/batch_disbursement.py deleted file mode 100644 index 52210c6e..00000000 --- a/xendit/models/batchdisbursement/batch_disbursement.py +++ /dev/null @@ -1,110 +0,0 @@ -from .batch_disbursement_item import BatchDisbursementItem - -from xendit.models._base_model import BaseModel -from xendit.xendit_error import XenditError -from xendit._api_requestor import _APIRequestor -from xendit._extract_params import _extract_params - - -class BatchDisbursement(BaseModel): - """BatchDisbursement class (API Reference: Batch Disbursement) - - Related Classes: - - BatchDisbursementItem - - Static Methods: - - BatchDisbursement.create (API Reference: /Create Batch Disbursement) - - Static Methods for Object Creation: - - BatchDisbursement.helper_create_batch_item (For BatchDisbursementItem in create_batch) - - Attributes: - - created (str) - - reference (str) - - total_uploaded_count (int) - - total_uploaded_amount (int) - - status (str) - - id (str) - """ - - created: str - reference: str - total_uploaded_count: int - total_uploaded_amount: int - status: str - id: str - - def helper_create_batch_item( - *, - amount, - bank_code, - bank_account_name, - bank_account_number, - description, - external_id, - email_to=None, - email_cc=None, - email_bcc=None, - **kwargs, - ): - """Construct Batch Disbursement Item Object - - Args: - - amount (int) - - bank_code (str) - - bank_account_name (str) - - bank_account_number (str) - - description (str) - - external_id (str) - - **email_to (str[]) - - **email_cc (str[]) - - **email_bcc (str[]) - - Return: - - BatchDisbursementItem - """ - params = locals() - del params["kwargs"] - - return BatchDisbursementItem.Query(**params) - - @staticmethod - def create( - *, - reference, - disbursements, - x_idempotency_key=None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Create a batch disbursements (API Reference: Batch Disbursement/Create Batch Disbursement) - - Args: - - reference (str) - - disbursements (BatchDisbursementItem.Query) - - **for_user_id (str) (XenPlatform only) - - **x_idempotency_key (str) - - **x_api_version (str) - - Returns - BatchDisbursement - - Raises - XenditError - - """ - url = "/batch_disbursements" - headers, body = _extract_params( - locals(), - func_object=BatchDisbursement.create, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return BatchDisbursement(**resp.body) - else: - raise XenditError(resp) diff --git a/xendit/models/batchdisbursement/batch_disbursement_item.py b/xendit/models/batchdisbursement/batch_disbursement_item.py deleted file mode 100644 index 78d542ad..00000000 --- a/xendit/models/batchdisbursement/batch_disbursement_item.py +++ /dev/null @@ -1,39 +0,0 @@ -from typing import List -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class BatchDisbursementItem(BaseModel): - """Item to be sent for Batch Disbursement (API Reference: BatchDisbursement)""" - - class Query(BaseQuery): - """Item to be sent for Batch Disbursement (API Reference: Batch Disbursement) - - Use this to initialize create_batch - - Attributes: - - amount (int) - - bank_code (str) - - bank_account_name (str) - - bank_account_number (str) - - description (str) - - external_id (str) - - Optional Attributes: - - email_to (str[]) - - email_cc (str[]) - - email_bcc (str[]) - - """ - - amount: int - bank_code: str - bank_account_name: str - bank_account_number: str - description: str - external_id: str - - # Optional - email_to: List[str] - email_cc: List[str] - email_bcc: List[str] diff --git a/xendit/models/cardlesscredit/__init__.py b/xendit/models/cardlesscredit/__init__.py deleted file mode 100644 index 59f0688f..00000000 --- a/xendit/models/cardlesscredit/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .cardless_credit import CardlessCredit -from .cardless_credit_item import CardlessCreditItem -from .cardless_credit_type import CardlessCreditType diff --git a/xendit/models/cardlesscredit/cardless_credit.py b/xendit/models/cardlesscredit/cardless_credit.py deleted file mode 100644 index 324a0ada..00000000 --- a/xendit/models/cardlesscredit/cardless_credit.py +++ /dev/null @@ -1,207 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.xendit_error import XenditError -from xendit._api_requestor import _APIRequestor -from xendit._extract_params import _extract_params - -from .payment import ( - CardlessCreditCustomerDetails, - CardlessCreditPayment, - CardlessCreditPaymentTypeCalculation, - CardlessCreditShippingAddress, -) -from .cardless_credit_item import CardlessCreditItem - - -class CardlessCredit(BaseModel): - """CardlessCredit class (API Reference: CardlessCredit) - - Static Methods: - - CardlessCredit.create_payment (API Reference: /Create Payment or Generate Checkout URL) - - CardlessCredit.calculate_payment_type (API Reference: /Get Payment Status) - - Static Methods for Object Creation: - - CardlessCredit.helper_create_item (For CardlessCreditItem in create_payment) - - CardlessCredit.helper_create_customer_details (For CardlessCreditCustomerDetails in create_payment) - - CardlessCredit.helper_create_shipping_address (For CardlessCreditShippingAdress in create_payment) - """ - - @staticmethod - def helper_create_item(*, id, name, price, type, url, quantity, **kwargs): - """Construct Cardless Credit Item Object - - Args: - - id (str) - - name (str) - - price (int) - - type (str) - - url (str) - - quantity (str) - - Return: - - CardlessCreditItem - """ - params = locals() - del params["kwargs"] - - return CardlessCreditItem.Query(**params) - - def helper_create_customer_details( - *, first_name, last_name, email, phone, **kwargs - ): - """Construct Cardless Credit Customer Details Object - - Args: - - first_name (str) - - last_name (str) - - email (str) - - phone (str) - - Return: - - CardlessCreditCustomerDetails - """ - params = locals() - del params["kwargs"] - - return CardlessCreditCustomerDetails.Query(**params) - - def helper_create_shipping_address( - *, - first_name, - last_name, - address, - city, - postal_code, - phone, - country_code, - **kwargs, - ): - """Construct Cardless Credit Customer Details Object - - Args: - - first_name (str) - - last_name (str) - - address (str) - - city (str) - - postal_code (str) - - phone (str) - - country_code (str) - - Return: - - CardlessCreditShippingAdress - """ - params = locals() - del params["kwargs"] - - return CardlessCreditShippingAddress.Query(**params) - - @staticmethod - def create_payment( - *, - cardless_credit_type, - external_id, - amount, - payment_type, - items, - customer_details, - shipping_address, - redirect_url, - callback_url, - x_idempotency_key=None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Create a cardless credit payment (API Reference: Cardless Credit/Create Payment or Generate Checkout URL) - - Args: - - cardless_credit_type (CardlessCreditType) - - external_id (str) - - amount (int) - - payment_type (str) - - items (CardlessCreditItem[]) - - customer_details (CardlessCreditCustomerDetails) - - shipping_address (CardlessCreditShippingAddress) - - redirect_url (str) - - callback_url (str) - - **for_user_id (str) (XenPlatform only) - - **x_idempotency_key (str) - - **x_api_version (str) - - Returns - CardlessCredit - - Raises - XenditError - - """ - cardless_credit_type = CardlessCredit._parse_cardless_credit_type( - cardless_credit_type - ) - url = "/cardless-credit" - headers, body = _extract_params( - locals(), - func_object=CardlessCredit.create_payment, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return CardlessCreditPayment(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def calculate_payment_type( - *, - cardless_credit_type, - amount, - items, - x_idempotency_key=None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Calculate Payment Types feature helps merchants to get an accurate value of the installment offered to end customers by the cardless credit provider - (API Reference: Cardless Credit/Calculate Payment Types) - - Args: - - cardless_credit_type (str) - - amount (int) - - items (CardlessCreditItem[]) - - **for_user_id (str) (XenPlatform only) - - **x_idempotency_key (str) - - **x_api_version (str) - - Returns - CardlessCreditPaymentType - - Raises - XenditError - - """ - cardless_credit_type = CardlessCredit._parse_cardless_credit_type( - cardless_credit_type - ) - url = "/cardless-credit/payment-types" - headers, body = _extract_params( - locals(), - func_object=CardlessCredit.calculate_payment_type, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return CardlessCreditPaymentTypeCalculation(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def _parse_cardless_credit_type(cardless_credit_type): - try: - return cardless_credit_type.name - except AttributeError: - return cardless_credit_type diff --git a/xendit/models/cardlesscredit/cardless_credit_item.py b/xendit/models/cardlesscredit/cardless_credit_item.py deleted file mode 100644 index 46f1c6ea..00000000 --- a/xendit/models/cardlesscredit/cardless_credit_item.py +++ /dev/null @@ -1,28 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class CardlessCreditItem(BaseModel): - """Item to be send for Cardless Credit (API Reference: Cardless Credit)""" - - class Query(BaseQuery): - """Item to be sent for Cardless Credit (API Reference: Cardless Credit) - - Use this to initialize create_payment - - Attributes: - - id (str) - - name (str) - - price (int) - - type (str) - - url (str) - - quantity (int) - - """ - - id: str - name: str - price: int - type: str - url: str - quantity: int diff --git a/xendit/models/cardlesscredit/cardless_credit_type.py b/xendit/models/cardlesscredit/cardless_credit_type.py deleted file mode 100644 index fb9b3bd2..00000000 --- a/xendit/models/cardlesscredit/cardless_credit_type.py +++ /dev/null @@ -1,7 +0,0 @@ -from enum import Enum - - -class CardlessCreditType(Enum): - """Cardless Credit Type""" - - KREDIVO = "KREDIVO" diff --git a/xendit/models/cardlesscredit/payment/__init__.py b/xendit/models/cardlesscredit/payment/__init__.py deleted file mode 100644 index 0dd44a21..00000000 --- a/xendit/models/cardlesscredit/payment/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -from .cardless_credit_payment import CardlessCreditPayment -from .cardless_credit_payment_type import CardlessCreditPaymentType -from .cardless_credit_payment_type_calculation import ( - CardlessCreditPaymentTypeCalculation, -) - -from .cardless_credit_customer_details import CardlessCreditCustomerDetails -from .cardless_credit_shipping_address import CardlessCreditShippingAddress diff --git a/xendit/models/cardlesscredit/payment/cardless_credit_customer_details.py b/xendit/models/cardlesscredit/payment/cardless_credit_customer_details.py deleted file mode 100644 index 58190d2f..00000000 --- a/xendit/models/cardlesscredit/payment/cardless_credit_customer_details.py +++ /dev/null @@ -1,28 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class CardlessCreditCustomerDetails(BaseModel): - """Customer details of Cardless Credit (API Reference: Cardless Credit)""" - - class Query(BaseQuery): - """Customer details of Cardless Credit (API Reference: Cardless Credit) - - Use this to initialize create_payment - - Attributes: - - id (str) - - name (str) - - price (int) - - type (str) - - url (str) - - quantity (int) - - """ - - id: str - name: str - price: int - type: str - url: str - quantity: int diff --git a/xendit/models/cardlesscredit/payment/cardless_credit_payment.py b/xendit/models/cardlesscredit/payment/cardless_credit_payment.py deleted file mode 100644 index 085ef428..00000000 --- a/xendit/models/cardlesscredit/payment/cardless_credit_payment.py +++ /dev/null @@ -1,20 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class CardlessCreditPayment(BaseModel): - """Payment class of Cardless Credit (API Reference: Cardless Credit) - - Attributes: - - created (str) - - reference (str) - - total_uploaded_count (int) - - total_uploaded_amount (int) - - status (str) - - id (str) - """ - - redirect_url: str - transaction_id: str - order_id: str - external_id: str - cardless_credit_type: str diff --git a/xendit/models/cardlesscredit/payment/cardless_credit_payment_type.py b/xendit/models/cardlesscredit/payment/cardless_credit_payment_type.py deleted file mode 100644 index 26a53b7c..00000000 --- a/xendit/models/cardlesscredit/payment/cardless_credit_payment_type.py +++ /dev/null @@ -1,32 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class CardlessCreditPaymentType(BaseModel): - """Payment type class of Cardless Credit (API Reference: Cardless Credit) - - Attributes: - - raw_monthly_installment (float) - - name (str) - - amount (int) - - installment_amount (int) - - raw_amount (float) - - rate (float) - - down_payment (int) - - monthly_installment (int) - - discounted_monthly_installment (int) - - tenure (int) - - id (str) - """ - - raw_monthly_installment: float - name: str - name: str - amount: int - installment_amount: int - raw_amount: float - rate: float - down_payment: IndentationError - monthly_installment: int - discounted_monthly_installment: int - tenure: int - id: str diff --git a/xendit/models/cardlesscredit/payment/cardless_credit_payment_type_calculation.py b/xendit/models/cardlesscredit/payment/cardless_credit_payment_type_calculation.py deleted file mode 100644 index 102421d8..00000000 --- a/xendit/models/cardlesscredit/payment/cardless_credit_payment_type_calculation.py +++ /dev/null @@ -1,16 +0,0 @@ -from typing import List -from xendit.models._base_model import BaseModel - -from .cardless_credit_payment_type import CardlessCreditPaymentType - - -class CardlessCreditPaymentTypeCalculation(BaseModel): - """Payment type calculation of Cardless Credit (API Reference: Cardless Credit) - - Attributes: - - message (str) - - payments (CardlessCreditPaymentType[]) - """ - - message: str - payments: List[CardlessCreditPaymentType] diff --git a/xendit/models/cardlesscredit/payment/cardless_credit_shipping_address.py b/xendit/models/cardlesscredit/payment/cardless_credit_shipping_address.py deleted file mode 100644 index 87575bb1..00000000 --- a/xendit/models/cardlesscredit/payment/cardless_credit_shipping_address.py +++ /dev/null @@ -1,30 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class CardlessCreditShippingAddress(BaseModel): - """Shipping address of Cardless Credit (API Reference: Cardless Credit)""" - - class Query(BaseQuery): - """Item to be sent for Cardless Credit (API Reference: Cardless Credit) - - Use this to initialize create_payment - - Attributes: - - first_name (str) - - last_name (str) - - address (str) - - city (str) - - postal_code (str) - - phone (str) - - country_code (str) - - """ - - first_name: str - last_name: str - address: str - city: str - postal_code: str - phone: str - country_code: str diff --git a/xendit/models/creditcard/__init__.py b/xendit/models/creditcard/__init__.py deleted file mode 100644 index 6f3ac46a..00000000 --- a/xendit/models/creditcard/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from .charge import * - -from .credit_card import CreditCard -from .credit_card_promotion import CreditCardPromotion -from .credit_card_refund import CreditCardRefund diff --git a/xendit/models/creditcard/charge/__init__.py b/xendit/models/creditcard/charge/__init__.py deleted file mode 100644 index 021158aa..00000000 --- a/xendit/models/creditcard/charge/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from .credit_card_charge import CreditCardCharge -from .credit_card_charge_address import CreditCardChargeAddress -from .credit_card_charge_billing_details import CreditCardChargeBillingDetails -from .credit_card_charge_installment import CreditCardChargeInstallment -from .credit_card_charge_promotion import CreditCardChargePromotion diff --git a/xendit/models/creditcard/charge/credit_card_charge.py b/xendit/models/creditcard/charge/credit_card_charge.py deleted file mode 100644 index 7f909bca..00000000 --- a/xendit/models/creditcard/charge/credit_card_charge.py +++ /dev/null @@ -1,59 +0,0 @@ -from xendit.models._base_model import BaseModel -from .credit_card_charge_installment import CreditCardChargeInstallment -from .credit_card_charge_promotion import CreditCardChargePromotion - - -class CreditCardCharge(BaseModel): - """Charge class (API Reference: Credit Card) - - Attributes: - - created (str) - - charge_type (str) - - business_id (str) - - authorized_amount (float) - - external_id (str) - - card_type (str) - - merchant_id (str) - - masked_card_number (str) - - charge_type (str) - - card_brand (str) - - bank_reconciliation_id (str) - - id (str) - - Optional Attributes: - - eci (str) - - capture_amount (float) - - failure_reason (str) - - approval_code (str) - - merchant_reference_code (str) - - descriptor (str) - - currency (str) - - mid_label (str) - - promotion (CreditCardChargePromotion) - - installment (CreditCardChargeInstallment) - """ - - created: str - charge_type: str - business_id: str - authorized_amount: float - external_id: str - card_type: str - merchant_id: str - masked_card_number: float - charge_type: str - card_brand: str - bank_reconciliation_id: str - id: str - - # Optional - eci: str - capture_amount: float - failure_reason: str - approval_code: str - merchant_reference_code: str - descriptor: str - currency: str - mid_label: str - promotion: CreditCardChargePromotion - installment: CreditCardChargeInstallment diff --git a/xendit/models/creditcard/charge/credit_card_charge_address.py b/xendit/models/creditcard/charge/credit_card_charge_address.py deleted file mode 100644 index 180e2473..00000000 --- a/xendit/models/creditcard/charge/credit_card_charge_address.py +++ /dev/null @@ -1,35 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class CreditCardChargeAddress(BaseModel): - """Address class of Charge Billing Details (API Reference: Credit Card)""" - - class Query(BaseQuery): - """Address class of Charge Billing Details Query (API Reference: Credit Card) - - Use this for initialize create_authorization and create_charge - - Attributes: - - country (str) - - Optional Attributes: - - street_line1 (str) - - street_line2 (str) - - city (str) - - province (str) - - state (str) - - postal_code (str) - - description (str) - """ - - country: str - - # Optional - street_line1: str - street_line2: str - city: str - province: str - state: str - postal_code: str - description: str diff --git a/xendit/models/creditcard/charge/credit_card_charge_billing_details.py b/xendit/models/creditcard/charge/credit_card_charge_billing_details.py deleted file mode 100644 index 2500ffc0..00000000 --- a/xendit/models/creditcard/charge/credit_card_charge_billing_details.py +++ /dev/null @@ -1,36 +0,0 @@ -from .credit_card_charge_address import CreditCardChargeAddress - -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class CreditCardChargeBillingDetails(BaseModel): - """BillingDetails class of Charge (API Reference: Credit Card)""" - - class Query(BaseQuery): - """BillingDetails class of Charge Query (API Reference: Credit Card) - - Use this for initialize create_authorization and create_charge - - Attributes: - - given_names (str) - - address (CreditCardCharge.Address) - - Optional Attributes: - - middle_name (str) - - surname (str) - - email (str) - - mobile_number (str) - - phone_number (str) - - """ - - given_names: str - address: CreditCardChargeAddress - - # Optional - middle_name: str - surname: str - email: str - mobile_number: str - phone_number: str diff --git a/xendit/models/creditcard/charge/credit_card_charge_installment.py b/xendit/models/creditcard/charge/credit_card_charge_installment.py deleted file mode 100644 index 49cb8f34..00000000 --- a/xendit/models/creditcard/charge/credit_card_charge_installment.py +++ /dev/null @@ -1,29 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class CreditCardChargeInstallment(BaseModel): - """Installment class of Charge (API Reference: Credit Card) - - Optional Attributes: - - count (int) - - interval (str) - """ - - # Optional - count: int - interval: str - - class Query(BaseQuery): - """Installment class of Charge Query (API Reference: Credit Card) - - Used for create_authorization and create_charge - - Optional Attributes: - - count (int) - - interval (str) - """ - - # Optional - count: int - interval: str diff --git a/xendit/models/creditcard/charge/credit_card_charge_promotion.py b/xendit/models/creditcard/charge/credit_card_charge_promotion.py deleted file mode 100644 index 4cf9d33a..00000000 --- a/xendit/models/creditcard/charge/credit_card_charge_promotion.py +++ /dev/null @@ -1,29 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class CreditCardChargePromotion(BaseModel): - """Promotion class of Credit Card Charge (API Reference: Credit Card) - - Optional Attributes: - - reference_id (str) - - original_amount (float) - """ - - # Optional - reference_id: str - original_amount: int - - class Query(BaseQuery): - """Promotion class of Credit Card Charge Query (API Reference: Credit Card) - - Used for create_authorization and create_charge - - Optional Attributes: - - reference_id (str) - - original_amount (float) - """ - - # Optional - reference_id: str - original_amount: int diff --git a/xendit/models/creditcard/credit_card.py b/xendit/models/creditcard/credit_card.py deleted file mode 100644 index 6c150966..00000000 --- a/xendit/models/creditcard/credit_card.py +++ /dev/null @@ -1,485 +0,0 @@ -from .charge import ( - CreditCardCharge, - CreditCardChargeAddress, - CreditCardChargeBillingDetails, - CreditCardChargeInstallment, - CreditCardChargePromotion, -) - -from .credit_card_promotion import CreditCardPromotion -from .credit_card_refund import CreditCardRefund -from .credit_card_reverse_authorization import CreditCardReverseAuthorization - -from xendit.models._base_model import BaseModel - -from xendit._api_requestor import _APIRequestor -from xendit._extract_params import _extract_params - -from xendit.xendit_error import XenditError - - -class CreditCard(BaseModel): - """CreditCard class (API Reference: CreditCard) - - Related Classes: - - CreditCardCharge - - CreditCardChargeAddress - - CreditCardChargeBillingDetails - - CreditCardChargeInstallment - - CreditCardChargePromotion - - Static Methods: - - CreditCard.create_authorization (API Reference: /Create Authorization) - - CreditCard.reverse_authorization (API Reference: /Reverse Authorization) - - CreditCard.create_charge (API Reference: /Create Charge) - - CreditCard.capture_charge (API Reference: /Capture Charge) - - CreditCard.get_charge (API Reference: /Get Charge) - - CreditCard.create_refund (API Reference: /Create Refund) - - CreditCard.create_promotion (API Reference: /Create Promotion) - - Static Methods for Object Creation: - - CreditCard.helper_create_installment (For Installment in create_authorization and create_charge) - - CreditCard.helper_create_charge_promotion (For Promotion in create_authorization and create_charge) - - CreditCard.helper_create_billing_details (For BillingDetails in create_authorization and create_charge) - - CreditCard.helper_create_address (For Address in create_billing_details) - """ - - @staticmethod - def helper_create_installment(*, count=None, interval=None, **kwargs): - """Construct Installments Object for Charge - - Args: - - **count (int) - - **interval (str) - - Return: - - CreditCardChargeInstallment.Query - """ - params = locals() - del params["kwargs"] - - return CreditCardChargeInstallment.Query(**params) - - @staticmethod - def helper_create_charge_promotion( - *, reference_id=None, original_amount=None, **kwargs - ): - """Construct Promotion Object for Charge - - Args: - - **reference_id (str) - - **original_amount (float) - - Return: - - CreditCardChargePromotion.Query - """ - params = locals() - del params["kwargs"] - - return CreditCardChargePromotion.Query(**params) - - @staticmethod - def helper_create_billing_details( - *, - given_names, - address, - middle_name=None, - surname=None, - email=None, - mobile_number=None, - phone_number=None, - **kwargs, - ): - """Construct Billing Details Object for Charge - - Args: - - given_names (str) - - address (CreditCardCharge.Address) - - **middle_name (str) - - **surname (str) - - **email (str) - - **mobile_number (str) - - **phone_number (str) - - Return: - - CreditCardChargeBillingDetails.Query - """ - params = locals() - del params["kwargs"] - - return CreditCardChargeBillingDetails.Query(**params) - - @staticmethod - def helper_create_address( - *, - country, - street_line1=None, - street_line2=None, - city=None, - province=None, - state=None, - postal_code=None, - description=None, - **kwargs, - ): - """Construct Address Object for Billing Details - - Args: - - country (str) - - **street_line1 (str) - - **street_line2 (str) - - **city (str) - - **province (str) - - **state (str) - - **postal_code (str) - - **description (str) - - Return: - - CreditCardChargeAddress.Query - """ - params = locals() - del params["kwargs"] - - return CreditCardChargeAddress.Query(**params) - - @staticmethod - def create_authorization( - *, - token_id, - external_id, - amount, - capture=False, - authentication_id=None, - card_cvn=None, - descriptor=None, - currency=None, - mid_label=None, - billing_details=None, - promotion=None, - installment=None, - x_idempotency_key=None, - for_user_id=None, - x_api_version=None, - metadata=None, - **kwargs, - ): - """Send POST Request to create Credit Card Authorization (API Reference: Credit Card/Create Authorization) - - Args: - - token_id (str) - - external_id (str) - - amount (float) - - authentication_id (str) - - card_cvn (str) - - **capture (bool) - - **descriptor (str) - - **currency (str) - - **mid_label (str) - - **billing_details (CreditCardCharge.BillingDetails.Query) - - **promotion (CreditCardCharge.Promotion.Query) - - **installment (CreditCardCharge.Installment.Query) - - **x_idempotency_key (str) - - **for_user_id (str) - - **x_api_version (str) - - **metadata (dict) - - - Returns: - CreditCardCharge - - Raises: - XenditError - - """ - params = locals() - params = {**params, **kwargs} - del params["kwargs"] - - return CreditCard.create_charge(**params) - - @staticmethod - def reverse_authorization( - *, - credit_card_charge_id, - external_id, - x_idempotency_key=None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Send POST Request to reverse Credit Card Authorization (API Reference: Credit Card/Reverse Authorization) - - Args: - - credit_card_charge_id (str) - - external_id (str) - - **x_idempotency_key (str) - - **for_user_id (str) - - **x_api_version - - Returns: - CreditCardReverseAuthorization - - Raises: - XenditError - - """ - url = f"/credit_card_charges/{credit_card_charge_id}/auth_reversal" - headers, body = _extract_params( - locals(), - func_object=CreditCard.reverse_authorization, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=["credit_card_charge_id"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return CreditCardReverseAuthorization(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def create_charge( - *, - token_id, - external_id, - amount, - capture=True, - authentication_id=None, - card_cvn=None, - descriptor=None, - currency=None, - mid_label=None, - billing_details=None, - promotion=None, - installment=None, - x_idempotency_key=None, - for_user_id=None, - x_api_version=None, - metadata=None, - with_fee_rule=None, - **kwargs, - ): - """Send POST Request to create Credit Card Charge (API Reference: Credit Card/Create Charge) - - Args: - - token_id (str) - - external_id (str) - - amount (float) - - authentication_id (str) - - card_cvn (str) - - **capture (bool) - - **descriptor (str) - - **currency (str) - - **mid_label (str) - - **billing_details (CreditCardCharge.BillingDetails.Query) - - **promotion (CreditCardCharge.Promotion.Query) - - **installment (CreditCardCharge.Installment.Query) - - **x_idempotency_key (str) - - **for_user_id (str) (XenPlatforms only) - - **with_fee_rule (str) (XenPlatforms only) - - **x_api_version (str) - - **metadata (dict) - - Returns: - CreditCardCharge - - Raises: - XenditError - - """ - url = "/credit_card_charges" - headers, body = _extract_params( - locals(), - func_object=CreditCard.create_charge, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version", "with_fee_rule"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return CreditCardCharge(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def capture_charge( - *, - credit_card_charge_id, - amount, - x_idempotency_key=None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Send POST Request to capture Credit Card Charge (API Reference: Credit Card/Capture Charge) - - Args: - - credit_card_charge_id (str) - - amount (str) - - **x_idempotency_key (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - CreditCardCharge - - Raises: - XenditError - - """ - url = f"/credit_card_charges/{credit_card_charge_id}/capture" - headers, body = _extract_params( - locals(), - func_object=CreditCard.capture_charge, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=["credit_card_charge_id"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return CreditCardCharge(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def get_charge( - *, credit_card_charge_id, for_user_id=None, x_api_version=None, **kwargs, - ): - """Get Detail of Credit Card Charge (API Reference: Credit Card/Get Charge) - - Args: - - credit_card_charge_id (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - CreditCardCharge - - Raises: - XenditError - - """ - url = f"/credit_card_charges/{credit_card_charge_id}" - headers, _ = _extract_params( - locals(), - func_object=CreditCard.get_charge, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=["credit_card_charge_id"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return CreditCardCharge(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def create_refund( - *, - credit_card_charge_id, - amount, - external_id, - x_idempotency_key=None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Send POST Request to create refund for Credit Card (API Reference: Credit Card/Create Refund) - - Args: - - credit_card_charge_id (str) - - amount (str) - - external_id (str) - - **x_idempotency_key (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - CreditCardRefund - - Raises: - XenditError - - """ - url = f"/credit_card_charges/{credit_card_charge_id}/refunds" - headers, body = _extract_params( - locals(), - func_object=CreditCard.create_refund, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=["credit_card_charge_id"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return CreditCardRefund(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def create_promotion( - *, - reference_id, - description, - start_time, - end_time, - promo_code=None, - bin_list=None, - channel_code=None, - discount_percent=None, - discount_amount=None, - currency=None, - max_discount_amount=None, - min_original_amount=None, - x_idempotency_key=None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Send POST Request to create new Promotion (API Reference: Credit Card/Create Promotion) - - Args: - - reference_id (str) - - description (str) - - start_time (str) - - end_time (str) - - **promo_code (str) - - **bin_list (str[]) - - **channel_code (str) - - **discount_percent (float) - - **discount_amount (float) - - **max_discount_amount (float) - - **min_original_amount (float) - - **currency (str) - - **x_idempotency_key (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - CreditCardPromotion - - Raises: - XenditError - - """ - url = "/promotions" - headers, body = _extract_params( - locals(), - func_object=CreditCard.create_promotion, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return CreditCardPromotion(**resp.body) - else: - raise XenditError(resp) diff --git a/xendit/models/creditcard/credit_card_promotion.py b/xendit/models/creditcard/credit_card_promotion.py deleted file mode 100644 index 5f6d1899..00000000 --- a/xendit/models/creditcard/credit_card_promotion.py +++ /dev/null @@ -1,40 +0,0 @@ -from typing import List -from xendit.models._base_model import BaseModel - - -class CreditCardPromotion(BaseModel): - """Promotion class (API Reference: Credit Card) - - Attributes: - - id (str) - - business_id (str) - - status (str) - - reference_id (str) - - description (str) - - promo_code (str) - - bin_list (str[]) - - channel_code (str) - - discount_percent (float) - - discount_amount (float) - - currency (str) - - start_time (str) - - end_time (str) - - min_original_amount (float) - - max_discount_amount (float) - """ - - id: str - business_id: str - status: str - reference_id: str - description: str - promo_code: str - bin_list: List[str] - channel_code: str - discount_percent: float - discount_amount: float - currency: str - start_time: str - end_time: str - min_original_amount: float - max_discount_amount: float diff --git a/xendit/models/creditcard/credit_card_refund.py b/xendit/models/creditcard/credit_card_refund.py deleted file mode 100644 index c6e6d3a7..00000000 --- a/xendit/models/creditcard/credit_card_refund.py +++ /dev/null @@ -1,33 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class CreditCardRefund(BaseModel): - """Refund class (API Reference: Credit Card) - - Attributes: - - updated (str) - - created (str) - - credit_card_charge_id (str) - - user_id (str) - - amount (int) - - external_id (str) - - status (str) - - fee_refund_amount (int) - - id (str) - - Optional Attributes: - - failure_reason (str) - """ - - updated: str - created: str - credit_card_charge_id: str - user_id: str - amount: int - external_id: str - status: str - fee_refund_amount: int - id: str - - # Optional - failure_reason: str diff --git a/xendit/models/creditcard/credit_card_reverse_authorization.py b/xendit/models/creditcard/credit_card_reverse_authorization.py deleted file mode 100644 index 36c13d8d..00000000 --- a/xendit/models/creditcard/credit_card_reverse_authorization.py +++ /dev/null @@ -1,31 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class CreditCardReverseAuthorization(BaseModel): - """Reverse Authorization class (API Reference: Credit Card) - - Attributes: - - status (str) - - currency (str) - - credit_card_charge_id (str) - - business_id (str) - - external_id (str) - - amount (int) - - created (str) - - id (str) - - Optional Attributes: - - failure_reason (str) - """ - - status: str - currency: str - credit_card_charge_id: str - business_id: str - external_id: str - amount: int - created: str - id: str - - # Optional - failure_reason: str diff --git a/xendit/models/directdebit/__init__.py b/xendit/models/directdebit/__init__.py deleted file mode 100644 index 7898af31..00000000 --- a/xendit/models/directdebit/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .customer import * -from .direct_debit import DirectDebit -from .paymentmethod import DirectDebitPaymentMethodType diff --git a/xendit/models/directdebit/customer/__init__.py b/xendit/models/directdebit/customer/__init__.py deleted file mode 100644 index 2f26f3d5..00000000 --- a/xendit/models/directdebit/customer/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .direct_debit_customer import DirectDebitCustomer -from .direct_debit_customer_address import DirectDebitCustomerAddress diff --git a/xendit/models/directdebit/customer/direct_debit_customer.py b/xendit/models/directdebit/customer/direct_debit_customer.py deleted file mode 100644 index 58ae68dd..00000000 --- a/xendit/models/directdebit/customer/direct_debit_customer.py +++ /dev/null @@ -1,39 +0,0 @@ -from typing import List -from .direct_debit_customer_address import DirectDebitCustomerAddress - -from xendit.models._base_model import BaseModel - - -class DirectDebitCustomer(BaseModel): - """Customer class in Direct Debit (API Reference: Direct Debit) - - Attributes: - - id (str) - - reference_id (str) - - mobile_number (str) - - email (str) - - given_names (str) - - middle_name (str) - - surname (str) - - description (str) - - phone_number (str) - - nationality (str) - - addresses (DirectDebitCustomerAddress[]) - - date_of_birth (str) - - metadata (dict) - - """ - - id: str - reference_id: str - mobile_number: str - email: str - given_names: str - middle_name: str - surname: str - description: str - phone_number: str - nationality: str - addresses: List[DirectDebitCustomerAddress] - date_of_birth: str - metadata: dict diff --git a/xendit/models/directdebit/customer/direct_debit_customer_address.py b/xendit/models/directdebit/customer/direct_debit_customer_address.py deleted file mode 100644 index 1b064b66..00000000 --- a/xendit/models/directdebit/customer/direct_debit_customer_address.py +++ /dev/null @@ -1,57 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class DirectDebitCustomerAddress(BaseModel): - """Address class of Customer in Direct Debit (API Reference: Direct Debit) - - Use this to initialize create_customer - - Attributes: - - country (str) - - Optional Attributes: - - street_line1 (str) - - street_line2 (str) - - city (str) - - province (str) - - state (str) - - postal_code (str) - """ - - country: str - - # Optional - street_line1: str - street_line2: str - city: str - province: str - state: str - postal_code: str - - class Query(BaseQuery): - """Address class of Customer in Direct Debit (API Reference: Direct Debit) - - Use this to initialize create_customer - - Attributes: - - country (str) - - Optional Attributes: - - street_line1 (str) - - street_line2 (str) - - city (str) - - province (str) - - state (str) - - postal_code (str) - """ - - country: str - - # Optional - street_line1: str - street_line2: str - city: str - province: str - state: str - postal_code: str diff --git a/xendit/models/directdebit/direct_debit.py b/xendit/models/directdebit/direct_debit.py deleted file mode 100644 index 4ad0b72f..00000000 --- a/xendit/models/directdebit/direct_debit.py +++ /dev/null @@ -1,667 +0,0 @@ -from .customer import DirectDebitCustomer, DirectDebitCustomerAddress -from .payment import ( - DirectDebitBasket, - DirectDebitPayment, -) -from .paymentmethod import ( - DirectDebitPaymentMethodProperties, - DirectDebitPaymentMethod, -) -from .token import ( - DirectDebitCardLink, - DirectDebitOnlineBankingLink, - DirectDebitToken, - DirectDebitAccessibleAccount, -) -from xendit.models._base_model import BaseModel - -from xendit._api_requestor import _APIRequestor -from xendit._extract_params import _extract_params - -from xendit.xendit_error import XenditError - - -class DirectDebit(BaseModel): - """DirectDebit class (API Reference: Direct Debit) - - Related Classes: - - DirectDebitCustomer - - DirectDebitCustomerAddress - - DirectDebitCardLink - - DirectDebitOnlineBankingLinking - - DirectDebitToken - - DirectDebitAccessibleAccount - - DirectDebitPaymentMethod - - DirectDebitPaymentMethodProperties - - DirectDebitBasket - - DirectDebitPayment - - Static Methods: - - DirectDebit.create_customer (API Reference: /Create Customer) - - DirectDebit.get_customer_by_ref_id (API Reference: /Get Customer by Reference ID) - - DirectDebit.initialize_tokenization (API Reference: /Initialize Linked Account Tokenization) - - DirectDebit.validate_token_otp (API Reference: /Validate OTP for Linked Account Token) - - DirectDebit.get_accessible_account_by_token (API Reference: /Retrieve Accessible Accounts by Linked Account Token) - - DirectDebit.create_payment_method (API Reference: /Create Payment Method) - - DirectDebit.get_payment_method_by_customer_id (API Reference: /Get Payment Methods by Customer ID) - - DirectDebit.create_payment (API Reference: /Create Direct Debit Payment) - - DirectDebit.validate_payment_otp (API Reference: /Validate OTP for Direct Debit Payment) - - DirectDebit.get_payment_status (API Reference: /Get Direct Debit Payment Status by ID) - - DirectDebit.get_payment_status_by_ref_id (API Reference: /Get Direct Debit Payment Status by Reference ID) - - Static Methods for Object Creation: - - DirectDebit.helper_create_customer_address (For Address in create_customer) - - DirectDebit.helper_create_online_banking_link (For OnlineBankingLink in initialize_tokenization) - - DirectDebit.helper_create_card_link (For CardLink in initialize_tokenization) - - DirectDebit.helper_create_payment_method_properties (For Properties in create_payment_method) - - DirectDebit.helper_create_basket (For Basket in create_payment) - """ - - @staticmethod - def helper_create_customer_address( - *, - country, - street_line1=None, - street_line2=None, - city=None, - province=None, - state=None, - postal_code=None, - **kwargs, - ): - """Construct Address Object for DirectDebit Customer - - Args: - - country (str) - - **street_line1 (str) - - **street_line2 (str) - - **city (str) - - **province (str) - - **state (str) - - **postal_code (str) - - Return: - - DirectDebitCustomerAddress - """ - params = locals() - del params["kwargs"] - - return DirectDebitCustomerAddress.Query(**params) - - @staticmethod - def helper_create_online_banking_link( - *, success_redirect_url, failure_redirect_url=None, callback_url=None, **kwargs, - ): - """Construct OnlineBankingLink Object for DirectDebit Token - - Args: - - success_redirect_url (str) - - failure_redirect_url (str) - - callback_url (str) - - Return: - - DirectDebitOnlineBankingLink - """ - params = locals() - del params["kwargs"] - - return DirectDebitOnlineBankingLink.Query(**params) - - @staticmethod - def helper_create_card_link( - *, account_mobile_number, card_last_four, card_expiry, account_email, **kwargs, - ): - """Construct CardLink Object for DirectDebit Token - - Args: - - account_mobile_number (str) - - card_last_four (str) - - card_expiry (str) - - account_email (str) - - Return: - - DirectDebitCardLink.Query - """ - params = locals() - del params["kwargs"] - - return DirectDebitCardLink.Query(**params) - - def helper_create_payment_method_properties(*, id, **kwargs): - """Construct Properties Object for DirectDebit Payment Methods - - Args: - - id (str) - - Return: - - DirectDebitPaymentMethodProperties.Query - """ - params = locals() - del params["kwargs"] - - return DirectDebitPaymentMethodProperties.Query(**params) - - @staticmethod - def helper_create_basket( - *, - reference_id, - name, - market, - type, - description=None, - category=None, - sub_category=None, - price=None, - url=None, - metadata=None, - quantity=None, - **kwargs, - ): - """Construct Basket object for DirectDebit payment - - Args: - - reference_id (str) - - name (str) - - market (str) - - type (str) - - **description (str) - - **category (str) - - **sub_category (str) - - **price (str) - - **url (str) - - **metadata (str) - - **quantity (str) - - Return: - - DirectDebitBasket.Query - """ - params = locals() - del params["kwargs"] - - return DirectDebitBasket.Query(**params) - - @staticmethod - def create_customer( - *, - reference_id, - given_names, - mobile_number=None, - email=None, - middle_name=None, - surname=None, - description=None, - phone_number=None, - nationality=None, - addresses=None, - date_of_birth=None, - metadata=None, - x_idempotency_key=None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Send POST Request to create Customer (API Reference: Direct Debit/Create Customer) - - Args: - - reference_id (str) - - given_names (str) - - **mobile_number (str) (Either mobile_number or email must be present) - - **email (Either mobile_number or email must be present) - - **middle_name (str) - - **surname (str) - - **description (str) - - **phone_number (str) - - **nationality (str) - - **addresses (DirectDebitCustomerAddress[]) - - **date_of_birth (str) - - **metadata (dict) - - **for_user_id (str) - - **x_idempotency_key (str) - - **x_api_version (str) - - Returns: - DirectDebitCustomer - - Raises: - XenditError - - """ - url = "/customers" - headers, body = _extract_params( - locals(), - func_object=DirectDebit.create_customer, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return DirectDebitCustomer(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def get_customer_by_ref_id( - *, reference_id, for_user_id=None, x_api_version=None, **kwargs, - ): - """Get Customer by Reference ID (API Reference: Direct Debit/Get Customer by Reference ID) - - Args: - - reference_id (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - DirectDebitCustomer - - Raises: - XenditError - - """ - url = f"/customers?reference_id={reference_id}" - headers, _ = _extract_params( - locals(), - func_object=DirectDebit.get_customer_by_ref_id, - headers_params=["for_user_id", "x_api_version"], - ignore_params=["reference_id"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - customers = [] - for customer in resp.body: - customers.append(DirectDebitCustomer(**customer)) - return customers - else: - raise XenditError(resp) - - @staticmethod - def initialize_tokenization( - *, - customer_id, - channel_code, - properties=None, - metadata=None, - x_idempotency_key=None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Initialize Authorization Process and Account Token Creation - (API Reference: Direct Debit/Initialize Linked Account Tokenization) - - Args: - - customer_id (str) - - channel_code (str) - - **properties (DirectDebitCardLinking.Query or DirectDebitOnlineBanking.Query) - - **metadata (dict) - - **x_idempotency_key (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - DirectDebitToken - - Raises: - XenditError - - """ - url = "/linked_account_tokens/auth" - headers, body = _extract_params( - locals(), - func_object=DirectDebit.initialize_tokenization, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return DirectDebitToken(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def validate_token_otp( - *, - linked_account_token_id, - otp_code, - x_idempotency_key=None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Validates the Linked Account Token OTP - (API Reference: Direct Debit/Validate OTP for Linked Account Token) - - Args: - - linked_account_token_id (str) - - otp_code (str) - - **x_idempotency_key (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - DirectDebitToken - - Raises: - XenditError - - """ - url = f"/linked_account_tokens/{linked_account_token_id}/validate_otp" - headers, body = _extract_params( - locals(), - func_object=DirectDebit.validate_token_otp, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=["linked_account_token_id"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return DirectDebitToken(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def get_accessible_accounts_by_token( - *, linked_account_token_id, for_user_id=None, x_api_version=None, **kwargs, - ): - """Get list of bank accounts accessible by the linked account token - (API Reference: Direct Debit/Retrieve Accessible Accounts by Linked Account Token) - - Args: - - linked_account_token_id (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - DirectDebitAccessibleAccount[] - - Raises: - XenditError - - """ - url = f"/linked_account_tokens/{linked_account_token_id}/accounts" - headers, _ = _extract_params( - locals(), - func_object=DirectDebit.get_accessible_accounts_by_token, - headers_params=["for_user_id", "x_api_version"], - ignore_params=["linked_account_token_id"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - accessible_accounts = [] - for accessible_account in resp.body: - accessible_accounts.append( - DirectDebitAccessibleAccount(**accessible_account) - ) - return accessible_accounts - else: - raise XenditError(resp) - - @staticmethod - def create_payment_method( - *, - customer_id, - type, - properties, - metadata=None, - x_idempotency_key=None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Create payment method for making payment - (API Reference: Direct Debit/Create Payment Method) - - Args: - - customer_id (str) - - type (DirectDebitPaymentMethodType) - - properties (DirectDebitPaymentMethodProperties.Query) - - **metadata (dict) - - **x_idempotency_key (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - DirectDebitPaymentMethod - - Raises: - XenditError - - """ - type = DirectDebit._parse_payment_method_type(type) - url = "/payment_methods" - headers, body = _extract_params( - locals(), - func_object=DirectDebit.create_payment_method, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return DirectDebitPaymentMethod(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def get_payment_methods_by_customer_id( - *, customer_id, for_user_id=None, x_api_version=None, **kwargs, - ): - """Get payment methods by Customer ID - (API Reference: Direct Debit/Get Payment Methods by Customer ID) - - Args: - - customer_id (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - DirectDebitPaymentMethod[] - - Raises: - XenditError - - """ - url = f"/payment_methods?customer_id={customer_id}" - headers, body = _extract_params( - locals(), - func_object=DirectDebit.get_payment_methods_by_customer_id, - headers_params=["for_user_id", "x_api_version"], - ignore_params=["customer_id"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - payment_methods = [] - for payment_method in resp.body: - payment_methods.append(DirectDebitPaymentMethod(**payment_method)) - return payment_methods - else: - raise XenditError(resp) - - @staticmethod - def create_payment( - *, - reference_id, - payment_method_id, - currency, - amount, - callback_url, - idempotency_key, - enable_otp=None, - description=None, - basket=None, - metadata=None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Create a debit to pull funds from the end customer's account - (API Reference: Direct Debit/Create Direct Debit Payment) - - Args: - - reference_id (str) - - payment_method_id (str) - - currency (str) - - amount (int) - - callback_url (str) - - idempotency_key (str) - - **enable_otp (bool) - - **description (str) - - **basket (DirectDebitBasket[]) - - **metadata (dict) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - DirectDebitPayment - - Raises: - XenditError - - """ - url = "/direct_debits" - headers, body = _extract_params( - locals(), - func_object=DirectDebit.create_payment, - headers_params=["for_user_id", "idempotency_key", "x_api_version"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return DirectDebitPayment(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def validate_payment_otp( - *, - direct_debit_id, - otp_code, - x_idempotency_key=None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Validate OTP provided by end customer - (API Reference: Direct Debit/Validate OTP for Direct Debit Payment) - - Args: - - direct_debit_id (str) - - otp_code (str) - - **x_idempotency_key (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - DirectDebitPayment - - Raises: - XenditError - - """ - url = f"/direct_debits/{direct_debit_id}/validate_otp/" - headers, body = _extract_params( - locals(), - func_object=DirectDebit.validate_payment_otp, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=["direct_debit_id"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return DirectDebitPayment(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def get_payment_status( - *, direct_debit_id, for_user_id=None, x_api_version=None, **kwargs, - ): - """Get the details of a direct debit payment - (API Reference: Direct Debit/Get Direct Debit Payment Status by ID) - - Args: - - direct_debit_id (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - DirectDebitPayment - - Raises: - XenditError - - """ - url = f"/direct_debits/{direct_debit_id}/" - headers, _ = _extract_params( - locals(), - func_object=DirectDebit.get_payment_status, - headers_params=["for_user_id", "x_api_version"], - ignore_params=["direct_debit_id"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return DirectDebitPayment(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def get_payment_status_by_ref_id( - *, reference_id, for_user_id=None, x_api_version=None, **kwargs, - ): - """Get the details of a direct debit payment - (API Reference: Direct Debit/Get Direct Debit Payment Status by Reference ID) - - Args: - - reference_id (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - DirectDebitPayment[] - - Raises: - XenditError - - """ - url = f"/direct_debits?reference_id={reference_id}" - headers, _ = _extract_params( - locals(), - func_object=DirectDebit.get_payment_status, - headers_params=["for_user_id", "x_api_version"], - ignore_params=["reference_id"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - payments = [] - for payment in resp.body: - payments.append(DirectDebitPayment(**payment)) - return payments - else: - raise XenditError(resp) - - @staticmethod - def _parse_payment_method_type(payment_method_type): - try: - return payment_method_type.name - except AttributeError: - return payment_method_type diff --git a/xendit/models/directdebit/payment/__init__.py b/xendit/models/directdebit/payment/__init__.py deleted file mode 100644 index aab781d0..00000000 --- a/xendit/models/directdebit/payment/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .direct_debit_basket import DirectDebitBasket -from .direct_debit_payment import DirectDebitPayment diff --git a/xendit/models/directdebit/payment/direct_debit_basket.py b/xendit/models/directdebit/payment/direct_debit_basket.py deleted file mode 100644 index b22cc8dd..00000000 --- a/xendit/models/directdebit/payment/direct_debit_basket.py +++ /dev/null @@ -1,65 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class DirectDebitBasket(BaseModel): - """Basket class in Direct Debit payment (API Reference: Direct Debit) - - Attributes: - - reference_id (str) - - name (str) - - market (str) - - type (str) - - description (str) - - category (str) - - sub_category (str) - - price (str) - - url (str) - - metadata (str) - - quantity (str) - """ - - reference_id: str - name: str - market: str - type: str - description: str - category: str - sub_category: str - price: str - url: str - metadata: str - quantity: str - - class Query(BaseQuery): - """Basket class in Direct Debit payment query (API Reference: Direct Debit) - - Use this for create_payment - - Attributes: - - reference_id (str) - - name (str) - - market (str) - - type (str) - - Optional Attributes: - - description (str) - - category (str) - - sub_category (str) - - price (str) - - url (str) - - metadata (str) - - quantity (str) - """ - - reference_id: str - name: str - market: str - type: str - description: str - category: str - sub_category: str - price: str - url: str - metadata: str - quantity: str diff --git a/xendit/models/directdebit/payment/direct_debit_payment.py b/xendit/models/directdebit/payment/direct_debit_payment.py deleted file mode 100644 index 6165dbc4..00000000 --- a/xendit/models/directdebit/payment/direct_debit_payment.py +++ /dev/null @@ -1,45 +0,0 @@ -from typing import List - -from xendit.models._base_model import BaseModel - -from .direct_debit_basket import DirectDebitBasket - - -class DirectDebitPayment(BaseModel): - """Payment class in Direct Debit (API Reference: Direct Debit) - - Attributes: - - id (str) - - reference_id (str) - - channel_code (str) - - payment_method_id (str) - - currency (str) - - amount (float) - - description (str) - - status (bool) - - failure_code (str) - - is_otp_required (bool) - - otp_mobile_number (str) - - otp_expiration_timestamp (str) - - created (str) - - updated (str) - - basket (DirectDebitBasket[]) - - metadata (dict) - """ - - id: str - reference_id: str - channel_code: str - payment_method_id: str - currency: str - amount: float - description: str - status: bool - failure_code: str - is_otp_required: bool - otp_mobile_number: str - otp_expiration_timestamp: str - created: str - updated: str - basket: List[DirectDebitBasket] - metadata: dict diff --git a/xendit/models/directdebit/paymentmethod/__init__.py b/xendit/models/directdebit/paymentmethod/__init__.py deleted file mode 100644 index 7e7ce2e1..00000000 --- a/xendit/models/directdebit/paymentmethod/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .direct_debit_payment_method import DirectDebitPaymentMethod -from .direct_debit_payment_method_properties import DirectDebitPaymentMethodProperties -from .direct_debit_payment_method_type import DirectDebitPaymentMethodType diff --git a/xendit/models/directdebit/paymentmethod/direct_debit_payment_method.py b/xendit/models/directdebit/paymentmethod/direct_debit_payment_method.py deleted file mode 100644 index e72cbcbf..00000000 --- a/xendit/models/directdebit/paymentmethod/direct_debit_payment_method.py +++ /dev/null @@ -1,33 +0,0 @@ -from typing import Union - -from xendit.models._base_model import BaseModel - -from xendit.models.directdebit.token.direct_debit_card_link import DirectDebitCardLink -from xendit.models.directdebit.token.direct_debit_online_banking_link import ( - DirectDebitOnlineBankingLink, -) - - -class DirectDebitPaymentMethod(BaseModel): - """Payment Method class in Direct Debit (API Reference: Direct Debit) - - Attributes: - - id (str) - - type (str) - - properties (DirectDebitCardLink or DirectDebitOnlineBankingLink) - - customer_id (str) - - status (str) - - created (str) - - updated (str) - - metadata (dict) - - """ - - id: str - type: str - properties: Union[DirectDebitCardLink, DirectDebitOnlineBankingLink] - customer_id: str - status: str - created: str - updated: str - metadata: dict diff --git a/xendit/models/directdebit/paymentmethod/direct_debit_payment_method_properties.py b/xendit/models/directdebit/paymentmethod/direct_debit_payment_method_properties.py deleted file mode 100644 index 15b5ac3a..00000000 --- a/xendit/models/directdebit/paymentmethod/direct_debit_payment_method_properties.py +++ /dev/null @@ -1,21 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class DirectDebitPaymentMethodProperties(BaseModel): - """Payment Method Properties class in Direct Debit (API Reference: Direct Debit) - - Attributes: - - id (str) - - """ - - class Query(BaseQuery): - """Payment Method Properties class in Direct Debit Query (API Reference: Direct Debit) - - Attributes: - - id (str) - - """ - - id: str diff --git a/xendit/models/directdebit/paymentmethod/direct_debit_payment_method_type.py b/xendit/models/directdebit/paymentmethod/direct_debit_payment_method_type.py deleted file mode 100644 index 15abd7d7..00000000 --- a/xendit/models/directdebit/paymentmethod/direct_debit_payment_method_type.py +++ /dev/null @@ -1,8 +0,0 @@ -from enum import Enum - - -class DirectDebitPaymentMethodType(Enum): - """Payment method type for Create Payment Methods""" - - DEBIT_CARD = "DEBIT_CARD" - BANK_ACCOUNT = "BANK_ACCOUNT" diff --git a/xendit/models/directdebit/token/__init__.py b/xendit/models/directdebit/token/__init__.py deleted file mode 100644 index 81a84fbc..00000000 --- a/xendit/models/directdebit/token/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from .direct_debit_accessible_account import DirectDebitAccessibleAccount -from .direct_debit_card_link import DirectDebitCardLink -from .direct_debit_online_banking_link import DirectDebitOnlineBankingLink -from .direct_debit_token import DirectDebitToken diff --git a/xendit/models/directdebit/token/direct_debit_accessible_account.py b/xendit/models/directdebit/token/direct_debit_accessible_account.py deleted file mode 100644 index dea9bc14..00000000 --- a/xendit/models/directdebit/token/direct_debit_accessible_account.py +++ /dev/null @@ -1,23 +0,0 @@ -from typing import Union - -from .direct_debit_card_link import DirectDebitCardLink -from .direct_debit_online_banking_link import DirectDebitOnlineBankingLink - -from xendit.models._base_model import BaseModel - - -class DirectDebitAccessibleAccount(BaseModel): - """Accessible Account in Direct Debit (API Reference: Direct Debit) - - Attributes: - - id (str) - - channel_code (str) - - type (str) - - properties (DirectDebitCardLink or DirectDebitOnlineBankingLink) - - """ - - id: str - channel_code: str - type: str - properties: Union[DirectDebitCardLink, DirectDebitOnlineBankingLink] diff --git a/xendit/models/directdebit/token/direct_debit_card_link.py b/xendit/models/directdebit/token/direct_debit_card_link.py deleted file mode 100644 index 9048b9a9..00000000 --- a/xendit/models/directdebit/token/direct_debit_card_link.py +++ /dev/null @@ -1,36 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class DirectDebitCardLink(BaseModel): - """Card Linking class in Direct Debit Tokenization (API Reference: Direct Debit) - - Attributes: - - card_last_four (str) - - card_expiry (str) - - currency (str) - - description (str) - - """ - - card_last_four: str - card_expiry: str - currency: str - description: str - - class Query(BaseQuery): - """Card Linking class in Direct Debit Tokenization Query (API Reference: Direct Debit) - - Initialize this for initialize_tokenization - - Attributes: - - account_mobile_number (str) - - card_last_four (str) - - card_expiry (str) - - account_email (str) - """ - - account_mobile_number: str - card_last_four: str - card_expiry: str - account_email: str diff --git a/xendit/models/directdebit/token/direct_debit_online_banking_link.py b/xendit/models/directdebit/token/direct_debit_online_banking_link.py deleted file mode 100644 index e08feda0..00000000 --- a/xendit/models/directdebit/token/direct_debit_online_banking_link.py +++ /dev/null @@ -1,39 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class DirectDebitOnlineBankingLink(BaseModel): - """Online Banking Linking class in Direct Debit Tokenization (API Reference: Direct Debit) - - Use this for initialize_tokenization - - Attributes: - - account_details (str) - - account_hash (str) - - account_type (str) - - currency (str) - - description (str) - - """ - - account_details: str - account_hash: str - account_type: str - currency: str - description: str - - class Query(BaseQuery): - """Online Banking Linking class in Direct Debit Tokenization (API Reference: Direct Debit) - - Use this for initialize_tokenization - - Attributes: - - success_redirect_url (str) - - failure_redirect_url (str) - - callback_url (str) - - """ - - success_redirect_url: str - failure_redirect_url: str - callback_url: str diff --git a/xendit/models/directdebit/token/direct_debit_token.py b/xendit/models/directdebit/token/direct_debit_token.py deleted file mode 100644 index 67488dae..00000000 --- a/xendit/models/directdebit/token/direct_debit_token.py +++ /dev/null @@ -1,26 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class DirectDebitToken(BaseModel): - """Token class in Direct Debit (API Reference: Direct Debit) - - Attributes: - - id (str) - - customer_id (str) - - channel_code (str) - - status (str) - - metadata (dict) - - Optional Attributes: - - authorizer_url (str) - - """ - - id: str - customer_id: str - channel_code: str - status: str - metadata: dict - - # Optional - authorizer_url: str diff --git a/xendit/models/disbursement/__init__.py b/xendit/models/disbursement/__init__.py deleted file mode 100644 index 0571fe25..00000000 --- a/xendit/models/disbursement/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .disbursement import Disbursement -from .disbursement_bank import DisbursementBank diff --git a/xendit/models/disbursement/disbursement.py b/xendit/models/disbursement/disbursement.py deleted file mode 100644 index 76820df5..00000000 --- a/xendit/models/disbursement/disbursement.py +++ /dev/null @@ -1,206 +0,0 @@ -from typing import List - -from .disbursement_bank import DisbursementBank - -from xendit.models._base_model import BaseModel - -from xendit._api_requestor import _APIRequestor -from xendit._extract_params import _extract_params - -from xendit.xendit_error import XenditError - - -class Disbursement(BaseModel): - """Disbursement class (API Reference: Disbursement) - - Related Classes: - - DisbursementBank - - Static Methods: - - Disbursement.create (API Reference: /Create Disbursement) - - Disbursement.get (API Reference: /Get Disbursement by ID) - - Disbursement.get_by_ext_id (API Reference: /Get Disbursement by External ID) - - Disbursement.get_available_banks (API Reference: /Get Available Banks) - - Attributes: - - user_id (str) - - external_id (str) - - amount (int) - - bank_code (str) - - account_holder_name (str) - - disbursement_description (str) - - status (str) - - id (str) - - Optional Attributes: - - email_to (str[]) - - email_cc (str[]) - - email_bcc (str[]) - - """ - - user_id: str - external_id: str - amount: int - bank_code: str - account_holder_name: str - disbursement_description: str - status: str - id: str - - # Optional - email_to: List[str] - email_cc: List[str] - email_bcc: List[str] - - @staticmethod - def create( - *, - external_id, - bank_code, - account_holder_name, - account_number, - description, - amount, - email_to=[], - email_cc=[], - email_bcc=[], - x_idempotency_key=None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Send POST Request to create Disbursement (API Reference: Disbursement/Create Disbursement) - - Args: - - external_id (str) - - bank_code (str) - - account_holder_name (str) - - account_number (str) - - description (str) - - amount (int) - - **email_to (str[]) - - **email_cc (str[]) - - **email_bcc (str[]) - - **for_user_id (str) - - **x_idempotency_key (str) - - **x_api_version (str): API Version that will be used. If not provided will default to the latest - - Returns: - Disbursement - - Raises: - XenditError - - """ - url = "/disbursements" - headers, body = _extract_params( - locals(), - func_object=Disbursement.create, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return Disbursement(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def get(*, id, for_user_id=None, x_api_version=None, **kwargs): - """Get Disbursement detail by ID (API Reference: Disbursement/Get Disbursement by ID) - - Args: - - id (str) - - **for_user_id (str) - - **x_api_version (str): API Version that will be used. If not provided will default to the latest - - Returns: - Disbursement - - Raises: - XenditError - - """ - url = f"/disbursements/{id}" - headers, _ = _extract_params( - locals(), - func_object=Disbursement.get, - headers_params=["for_user_id", "x_api_version"], - ignore_params=["id"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return Disbursement(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def get_by_ext_id(*, external_id, for_user_id=None, x_api_version=None, **kwargs): - """Get Disbursement detail by external ID (API Reference: Disbursement/Get Disbursement by External ID) - - Args: - - external_id (str) - - **for_user_id (str) - - **x_api_version (str): API Version that will be used. If not provided will default to the latest - - Returns: - Disbursement - - Raises: - XenditError - - """ - url = f"/disbursements?external_id={external_id}" - headers, _ = _extract_params( - locals(), - func_object=Disbursement.get_by_ext_id, - headers_params=["for_user_id", "x_api_version"], - ignore_params=["external_id"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - disbursements = [] - for disbursement in resp.body: - disbursements.append(Disbursement(**disbursement)) - return disbursements - else: - raise XenditError(resp) - - @staticmethod - def get_available_banks(*, for_user_id=None, x_api_version=None, **kwargs): - """Get Available Banks (API Reference: Disbursement/Get Available Banks) - - Args: - - **for_user_id (str) - - **x_api_version (str): API Version that will be used. If not provided will default to the latest - - Returns: - List of DisbursementBank - - Raises: - XenditError - - """ - url = "/available_disbursements_banks" - headers, _ = _extract_params( - locals(), - func_object=Disbursement.get_available_banks, - headers_params=["for_user_id", "x_api_version"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - disbursement_banks = [] - for bank in resp.body: - disbursement_banks.append(DisbursementBank(**bank)) - return disbursement_banks - else: - raise XenditError(resp) diff --git a/xendit/models/disbursement/disbursement_bank.py b/xendit/models/disbursement/disbursement_bank.py deleted file mode 100644 index 18e4c741..00000000 --- a/xendit/models/disbursement/disbursement_bank.py +++ /dev/null @@ -1,17 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class DisbursementBank(BaseModel): - """Bank class for Disbursement (API Reference: Disbursement) - - Attributes: - - name (str) - - code (str) - - can_disburse (bool) - - can_name_validate (bool) - """ - - name: str - code: str - can_disburse: bool - can_name_validate: bool diff --git a/xendit/models/ewallet/__init__.py b/xendit/models/ewallet/__init__.py deleted file mode 100644 index 95dd417e..00000000 --- a/xendit/models/ewallet/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -from .ewallet import EWallet -from .ewallet_type import EWalletType - -from .dana import * -from .linkaja import * -from .ovo import * diff --git a/xendit/models/ewallet/dana/__init__.py b/xendit/models/ewallet/dana/__init__.py deleted file mode 100644 index 4fa723a9..00000000 --- a/xendit/models/ewallet/dana/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .dana_payment import DANAPayment -from .dana_payment_status import DANAPaymentStatus diff --git a/xendit/models/ewallet/dana/dana_payment.py b/xendit/models/ewallet/dana/dana_payment.py deleted file mode 100644 index 53b34eaa..00000000 --- a/xendit/models/ewallet/dana/dana_payment.py +++ /dev/null @@ -1,17 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class DANAPayment(BaseModel): - """Payment detail for DANA (API Reference: eWallets) - - Attributes: - - external_id (str) - - amount (int) - - checkout_url (str) - - ewallet_type (str) - """ - - external_id: str - amount: int - checkout_url: str - ewallet_type: str diff --git a/xendit/models/ewallet/dana/dana_payment_status.py b/xendit/models/ewallet/dana/dana_payment_status.py deleted file mode 100644 index 5bec4a4d..00000000 --- a/xendit/models/ewallet/dana/dana_payment_status.py +++ /dev/null @@ -1,21 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class DANAPaymentStatus(BaseModel): - """Payment Status for DANA (API Reference: eWallets) - - Attributes: - - external_id (str) - - business_id (str) - - amount (int) - - expiration_date (str) - - checkout_url (str) - - status (str) - """ - - external_id: str - business_id: str - amount: int - expiration_date: str - checkout_url: str - status: str diff --git a/xendit/models/ewallet/ewallet.py b/xendit/models/ewallet/ewallet.py deleted file mode 100644 index 9a9a2309..00000000 --- a/xendit/models/ewallet/ewallet.py +++ /dev/null @@ -1,371 +0,0 @@ -from xendit._api_requestor import _APIRequestor -from xendit._extract_params import _extract_params - -from xendit.xendit_error import XenditError - -from .ewallet_type import EWalletType -from .ovo import OVOPayment, OVOPaymentStatus -from .dana import DANAPayment, DANAPaymentStatus -from .linkaja import LinkAjaPayment, LinkAjaPaymentStatus, LinkAjaItem -from .ewallet_charge import EWalletCharge -from .ewallet_basket import EWalletBasket - - -class EWallet: - """EWallet class (API Reference: eWallets) - - Related Classes: - - OVOPayment - - OVOPaymentStatus - - DANAPayment - - DANAPaymentStatus - - LinkAjaPayment - - LinkAjaPaymentStatus - - EWalletCharge - - Static Methods: - - EWallet.create_ovo_payment (API Reference: /Create Payment) - - EWallet.create_dana_payment (API Reference: /Create Payment) - - EWallet.create_linkaja_payment (API Reference: /Create Payment) - - EWallet.get_payment_status (API Reference: /Get Payment Status) - - EWallet.create_ewallet_charge (API Reference: /Create E-Wallet Charge) - - EWallet.get_ewallet_charge_status (API Reference: /Get E-Wallet Charge Status) - - Static Methods for Object Creation: - - CreditCard.helper_create_linkaja_item (For create_linkaja_payment) - - EWallet.helper_create_basket_item (For ewallet charge) - """ - - @staticmethod - def helper_create_linkaja_item(*, id, name, price, quantity, **kwargs): - """Construct Installments Object for Charge - - Args: - - id (str) - - name (str) - - price (int) - - quantity (int) - - Return: - - LinkajaItem - """ - params = locals() - del params["kwargs"] - - return LinkAjaItem.Query(**params) - - @staticmethod - def helper_create_basket_item( - *, - reference_id: str, - name: str, - category: str, - currency: str, - price: int, - quantity: int, - type: str, - url: str = None, - description: str = None, - sub_category: str = None, - metadata: dict = None, - **kwargs, - ): - """Construct Installments Object for Charge - - Args: - - reference_id (str) - - name (str) - - category (str) - - currency (str) - - price (int) - - quantity (int) - - type (str) - - url (str) - - description (str) - - sub_category (str) - - metadata (dict) - - Return: - - EWalletBasket - """ - params = locals() - del params["kwargs"] - - return EWalletBasket.Query(**params) - - @staticmethod - def create_ovo_payment( - *, - external_id, - amount, - phone, - for_user_id=None, - x_idempotency_key=None, - x_api_version=None, - **kwargs, - ): - """Send POST Request to create OVO Payment (API Reference: eWallets/Create Payment) - - Args: - - external_id (str) - - amount (int) - - phone (str) - - **for_user_id (str) (XenPlatforms only) - - **x_idempotency_key (str) - - **x_api_version (str) - - Returns: - OVOPayment - - Raises: - XenditError - - """ - url = "/ewallets" - headers, body = _extract_params( - locals(), - func_object=EWallet.create_ovo_payment, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ) - body["ewallet_type"] = "OVO" - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return OVOPayment(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def create_dana_payment( - *, - external_id, - amount, - callback_url, - redirect_url, - expiration_date=None, - for_user_id=None, - x_idempotency_key=None, - x_api_version=None, - **kwargs, - ): - """Send POST Request to create DANA Payment (API Reference: eWallets/Create Payment) - - Args: - - external_id (str) - - amount (int) - - callback_url (str) - - redirect_url (str) - - **expiration_date (str) - - **for_user_id (str) (XenPlatforms only) - - **x_idempotency_key (str) - - **x_api_version (str) - - Returns: - DANAPayment - - Raises: - XenditError - - """ - url = "/ewallets" - headers, body = _extract_params( - locals(), - func_object=EWallet.create_dana_payment, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ) - body["ewallet_type"] = "DANA" - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return DANAPayment(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def create_linkaja_payment( - *, - external_id, - phone, - amount, - items, - callback_url, - redirect_url, - for_user_id=None, - x_idempotency_key=None, - x_api_version=None, - **kwargs, - ): - """Send POST Request to create LinkAja Payment (API Reference: eWallets/Create Payment) - - Args: - - external_id (str) - - phone (str) - - amount (int) - - items (LinkAjaItem.Query[]) - - callback_url (str) - - redirect_url (str) - - **for_user_id (str) (XenPlatforms only) - - **x_idempotency_key (str) - - **x_api_version (str) - - Returns: - LinkAjaPayment - - Raises: - XenditError - - """ - url = "/ewallets" - headers, body = _extract_params( - locals(), - func_object=EWallet.create_linkaja_payment, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ) - body["ewallet_type"] = "LINKAJA" - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return LinkAjaPayment(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def get_payment_status( - *, external_id, ewallet_type, for_user_id=None, x_api_version=None, **kwargs - ): - """Get payment status of given external id (API Reference: eWallets/Get Payment Status) - - Args: - - external_id (str) - - ewallet_type (EWalletType) - - **for_user_id (str) (XenPlatforms only) - - **x_api_version (str) - - Returns: - - OVOPaymentStatus (For EWalletType.OVO) - - DANAPaymentStatus (For EWalletType.DANA) - - LinkAjaPaymentStatus (For EWalletType.LINKAJA) - - Raises: - XenditError - - """ - parsed_ewallet_type = EWallet._parse_ewallet_type(ewallet_type) - url = f"/ewallets?external_id={external_id}&ewallet_type={parsed_ewallet_type}" - headers, _ = _extract_params( - locals(), - func_object=EWallet.create_linkaja_payment, - headers_params=["for_user_id", "x_api_version"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - if ewallet_type == EWalletType.OVO: - return OVOPaymentStatus(**resp.body) - elif ewallet_type == EWalletType.DANA: - return DANAPaymentStatus(**resp.body) - elif ewallet_type == EWalletType.LINKAJA: - return LinkAjaPaymentStatus(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def _parse_ewallet_type(ewallet_type): - try: - return ewallet_type.name - except AttributeError: - return ewallet_type - - @staticmethod - def create_ewallet_charge( - *, - reference_id: str, - currency: str, - amount: int, - checkout_method: str, - channel_code: str = None, - channel_properties: dict = None, - customer_id: str = None, - basket: list = None, - metadata: dict = None, - for_user_id: str = None, - with_fee_rule: str = None, - **kwargs, - ): - """Send POST Request to create EWallet Charge (API Reference: eWallets/Create E-Wallet Charge) - - Args: - - reference_id (str) - - currency (str) - - amount (int) - - checkout_method (str) - - channel_code (str) - - channel_properties (dict) - - customer_id (str) - - basket (list) - - metadata (dict) - - **for_user_id (str) (XenPlatforms only) - - **with_fee_rule (str) (XenPlatforms only) - - Returns: - EWalletCharge - - Raises: - XenditError - - """ - url = "/ewallets/charges" - headers, body = _extract_params( - locals(), - func_object=EWallet.create_ewallet_charge, - headers_params=["for_user_id", "with_fee_rule"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return EWalletCharge(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def get_ewallet_charge_status( - *, - charge_id: str, - for_user_id: str = None, - **kwargs, - ): - """Get ewallet charge status of given charge id (API Reference: eWallets/Get E-Wallet Charge Status) - - Args: - - charge_id (str) - - **for_user_id (str) (XenPlatforms only) - - Returns: - - EWalletCharge - - Raises: - XenditError - - """ - url = f"/ewallets/charges/{charge_id}" - headers, body = _extract_params( - locals(), - func_object=EWallet.get_ewallet_charge_status, - headers_params=["for_user_id"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return EWalletCharge(**resp.body) - else: - raise XenditError(resp) diff --git a/xendit/models/ewallet/ewallet_basket.py b/xendit/models/ewallet/ewallet_basket.py deleted file mode 100644 index 43295778..00000000 --- a/xendit/models/ewallet/ewallet_basket.py +++ /dev/null @@ -1,37 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class EWalletBasket(BaseModel): - """Basket Class for EWallet (API Reference: eWallets)""" - - class Query(BaseQuery): - """Basket Object for EWallet Query (API Reference: eWallets) - - Use this for create_ewallet_charge - - Attributes: - - reference_id: str - - name: str - - category: str - - currency: str - - price: int - - quantity: int - - type: str - - url: str - - description: str - - sub_category: str - - metadata: dict - """ - - reference_id: str - name: str - category: str - currency: str - price: int - quantity: int - type: str - url: str - description: str - sub_category: str - metadata: dict diff --git a/xendit/models/ewallet/ewallet_charge.py b/xendit/models/ewallet/ewallet_charge.py deleted file mode 100644 index 51d9b23a..00000000 --- a/xendit/models/ewallet/ewallet_charge.py +++ /dev/null @@ -1,53 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class EWalletCharge(BaseModel): - """Detail for EWallet Charge (API Reference: eWallets) - - Attributes: - - id (str) (prefix: ewc_ followed by UUIDv4) - - business_id (str) - - reference_id (str) - - status (str) - - currency (str) (ISO 4217) - - charge_amount (int) - - capture_amount (int) - - checkout_method (str) - - channel_code (str) - - channel_properties (dict) - - actions (str) - - is_redirect_required (bool) - - callback_url (str) - - created (str) (ISO 8601) - - updated (str) (ISO 8601) - - voided_at (str) (ISO 8601) - - capture_now (str) - - customer_id (str) - - payment_method_id (str) - - failure_code (str) - - basket (list) - - metadata (dict) - """ - - id: str - business_id: str - reference_id: str - status: str - currency: str - charge_amount: int - capture_amount: int - checkout_method: str - channel_code: str - channel_properties: dict - actions: str - is_redirect_required: bool - callback_url: str - created: str - updated: str - voided_at: str - capture_now: str - customer_id: str - payment_method_id: str - failure_code: str - basket: list - metadata: dict diff --git a/xendit/models/ewallet/ewallet_type.py b/xendit/models/ewallet/ewallet_type.py deleted file mode 100644 index b2861818..00000000 --- a/xendit/models/ewallet/ewallet_type.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import Enum - - -class EWalletType(Enum): - """eWallet Type""" - - OVO = "OVO" - DANA = "DANA" - LINKAJA = "LINKAJA" diff --git a/xendit/models/ewallet/linkaja/__init__.py b/xendit/models/ewallet/linkaja/__init__.py deleted file mode 100644 index ec6b388b..00000000 --- a/xendit/models/ewallet/linkaja/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .linkaja_item import LinkAjaItem -from .linkaja_payment import LinkAjaPayment -from .linkaja_payment_status import LinkAjaPaymentStatus diff --git a/xendit/models/ewallet/linkaja/linkaja_item.py b/xendit/models/ewallet/linkaja/linkaja_item.py deleted file mode 100644 index 618194d4..00000000 --- a/xendit/models/ewallet/linkaja/linkaja_item.py +++ /dev/null @@ -1,23 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class LinkAjaItem(BaseModel): - """Item Class for LinkAja (API Reference: eWallets)""" - - class Query(BaseQuery): - """Item Object for LinkAja Query (API Reference: eWallets) - - Use this for create_linkaja_payment - - Attributes: - - id (str) - - name (str) - - price (int) - - quantity (int) - """ - - id: str - name: str - price: int - quantity: int diff --git a/xendit/models/ewallet/linkaja/linkaja_payment.py b/xendit/models/ewallet/linkaja/linkaja_payment.py deleted file mode 100644 index 30745f32..00000000 --- a/xendit/models/ewallet/linkaja/linkaja_payment.py +++ /dev/null @@ -1,19 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class LinkAjaPayment(BaseModel): - """Payment detail for LinkAja (API Reference: eWallets) - - Attributes: - - checkout_url (str) - - transaction_date (str) (ISO 8601) - - amount (int) - - external_id (str) - - ewallet_type (str) - """ - - checkout_url: str - transaction_date: str - amount: int - external_id: str - ewallet_type: str diff --git a/xendit/models/ewallet/linkaja/linkaja_payment_status.py b/xendit/models/ewallet/linkaja/linkaja_payment_status.py deleted file mode 100644 index e76925db..00000000 --- a/xendit/models/ewallet/linkaja/linkaja_payment_status.py +++ /dev/null @@ -1,27 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class LinkAjaPaymentStatus(BaseModel): - """Payment Status for LinkAja (API Reference: eWallets) - - Attributes: - - business_id (str) - - external_id (str) - - amount (int) - - status (str) - - payment_timestamp (str) (Exists if status == "COMPLETED" or "FAILED") - - expired_at (str) (Exists if status == "PENDING" or "EXPIRED") - - checkout_url (str) (Exists if status == "PENDING" or "EXPIRED") - """ - - business_id: str - external_id: str - amount: int - status: str - - # Attributes for (status == "COMPLETED" or "FAILED") - payment_timestamp: str - - # Attributes for (status == "PENDING" or "EXPIRED") - expired_at: str - checkout_url: str diff --git a/xendit/models/ewallet/ovo/__init__.py b/xendit/models/ewallet/ovo/__init__.py deleted file mode 100644 index 96d890cb..00000000 --- a/xendit/models/ewallet/ovo/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .ovo_payment import OVOPayment -from .ovo_payment_status import OVOPaymentStatus diff --git a/xendit/models/ewallet/ovo/ovo_payment.py b/xendit/models/ewallet/ovo/ovo_payment.py deleted file mode 100644 index c3e54933..00000000 --- a/xendit/models/ewallet/ovo/ovo_payment.py +++ /dev/null @@ -1,31 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class OVOPayment(BaseModel): - """Payment detail for OVO (API Reference: eWallets) - - Attributes: - - amount (int) - - business_id (str) - - created (str) (ISO 8601) - - ewallet_type (str) - - external_id (str) - - phone (str) - - status (str) - - Legacy Attributes: - - transaction_date (Last version: 2019-02-04) - - ewallet_transaction_id (Last version: 2019-02-04) - """ - - amount: int - business_id: str - created: str - ewallet_type: str - external_id: str - phone: str - status: str - - # Attributes for (x_api_version == 2019-02-04) - transaction_date: str - ewallet_transaction_id: str diff --git a/xendit/models/ewallet/ovo/ovo_payment_status.py b/xendit/models/ewallet/ovo/ovo_payment_status.py deleted file mode 100644 index 7071cb9b..00000000 --- a/xendit/models/ewallet/ovo/ovo_payment_status.py +++ /dev/null @@ -1,21 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class OVOPaymentStatus(BaseModel): - """Payment Status for OVO (API Reference: eWallets) - - Attributes: - - amount (str) - - business_id (str) - - ewallet_type (str) - - external_id (str) - - status (str) - - transaction_date (str) (ISO 8601 Date) - """ - - amount: str - business_id: str - ewallet_type: str - external_id: str - status: str - transaction_date: str diff --git a/xendit/models/invoice/__init__.py b/xendit/models/invoice/__init__.py deleted file mode 100644 index b5ceeef7..00000000 --- a/xendit/models/invoice/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .invoice import Invoice -from .invoice_bank import InvoiceBank -from .invoice_retail_outlet import InvoiceRetailOutlet diff --git a/xendit/models/invoice/invoice.py b/xendit/models/invoice/invoice.py deleted file mode 100644 index 1947ba9d..00000000 --- a/xendit/models/invoice/invoice.py +++ /dev/null @@ -1,277 +0,0 @@ -from typing import List - -from xendit.models._base_model import BaseModel - -from xendit._api_requestor import _APIRequestor -from xendit._extract_params import _extract_params - -from xendit.xendit_error import XenditError - -from .invoice_bank import InvoiceBank -from .invoice_retail_outlet import InvoiceRetailOutlet - - -class Invoice(BaseModel): - """Invoice class (API Reference: Invoice) - - Related Classes: - - InvoiceBank - - Static Methods: - - Invoice.create (API Reference: /Create Invoice) - - Invoice.get (API Reference: /Get Invoice) - - Invoice.expire (API Reference: /Expire Invoice) - - Invoice.list_all (API Reference: /List All Invoice) - - Attributes: - - id (str) - - external_id (str) - - user_id (str) - - status (str) - - merchant_name (str) - - merchant_profile_picture_url (str) - - customer (object) - - amount (int) - - payer_email (str) - - description (str) - - expiry_date (str) - - invoice_url (str) - - available_banks (InvoiceBank[]) - - available_ewallets (?) - - should_exclude_credit_card (bool) - - should_send_email (bool) - - created (str) - - updated (str) - - currency (str) - - """ - - id: str - external_id: str - user_id: str - status: str - merchant_name: str - merchant_profile_picture_url: str - customer: object - amount: int - payer_email: str - description: str - invoice_url: str - expiry_date: str - available_banks: List[InvoiceBank] - available_ewallets: List[None] - available_retail_outlets: List[InvoiceRetailOutlet] - should_exclude_credit_card: bool - should_send_email: bool - created: str - updated: str - currency: str - - @staticmethod - def create( - *, - external_id, - payer_email, - description, - amount, - customer=None, - should_send_email=None, - callback_virtual_account_id=None, - invoice_duration=None, - success_redirect_url=None, - failure_redirect_url=None, - payment_methods=None, - mid_label=None, - currency=None, - fixed_va=None, - reminder_time=None, - fees=None, - items=None, - for_user_id=None, - x_idempotency_key=None, - x_api_version=None, - **kwargs, - ): - """Send POST Request to create Invoice (API Reference: Invoice/Create Invoice) - - Args: - - external_id (str) - - payer_email (str) - - description (str) - - amount (int) - - **customer (object) - - **should_send_email (bool) - - **callback_virtual_account_id (str) - - **invoice_duration (int) - - **success_redirect_url (str) - - **failure_redirect_url (str) - - **payment_methods (str[]) - - **mid_label (str) - - **currency (str) - - **fixed_va (bool) - - **reminder_time (int) - - **fees (object[]) - - **items (object[]) - - **for_user_id (str) (XenPlatforms only) - - **x_idempotency_key (str) - - **x_api_version (str): API Version that will be used. If not provided will default to the latest - - Returns: - Invoice - - Raises: - XenditError - - """ - url = "/v2/invoices" - headers, body = _extract_params( - locals(), - func_object=Invoice.create, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return Invoice(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def get( - *, invoice_id, for_user_id=None, x_api_version=None, **kwargs, - ): - """Get Invoice (API Reference: Invoice/Get Invoice) - - Args: - - invoice_id (str) - - **for_user_id (str) - - **x_api_version (str): API Version that will be used. If not provided will default to the latest - - Returns: - Invoice - - Raises: - XenditError - - """ - url = f"/v2/invoices/{invoice_id}" - headers, _ = _extract_params( - locals(), - func_object=Invoice.get, - headers_params=["for_user_id", "x_api_version"], - ignore_params=["invoice_id"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return Invoice(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def expire( - *, - invoice_id, - for_user_id=None, - x_idempotency_key=None, - x_api_version=None, - **kwargs, - ): - """Cancel an already created invoice (API Reference: Invoice/Expire Invoice) - - Args: - - invoice_id (str) - - **for_user_id (str) - - **x_idempotency_key (str) - - **x_api_version (str): API Version that will be used. If not provided will default to the latest - - Returns: - Invoice - - Raises: - XenditError - - """ - url = f"/invoices/{invoice_id}/expire!" - headers, body = _extract_params( - locals(), - func_object=Invoice.expire, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=["invoice_id"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return Invoice(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def list_all( - *, - statuses=None, - limit=None, - created_after=None, - created_before=None, - paid_after=None, - paid_before=None, - expired_after=None, - expired_before=None, - last_invoice_id=None, - client_types=None, - payment_channels=None, - on_demand_link=None, - recurring_payment_id=None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """List all Invoice based on filter (API Reference: Invoice/List All Invoice) - - Args: - - statuses (str[]) - - limit (int) - - created_after (str) - - created_before (str) - - paid_after (str) - - paid_before (str) - - expired_after (str) - - expired_before (str) - - last_invoice_id (str) - - client_types (str[]) - - payment_channels (str[]) - - on_demand_link (str) - - recurring_payment_id (str) - - **for_user_id (str) - - **x_api_version (str): API Version that will be used. If not provided will default to the latest - - Returns: - Invoice - - Raises: - XenditError - - """ - url = "/v2/invoices" - headers, params = _extract_params( - locals(), - func_object=Invoice.list_all, - headers_params=["for_user_id", "x_api_version"], - ignore_params=[], - ) - kwargs["headers"] = headers - kwargs["params"] = params - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - invoices = [] - for invoice in resp.body: - invoices.append(Invoice(**invoice)) - return invoices - else: - raise XenditError(resp) diff --git a/xendit/models/invoice/invoice_bank.py b/xendit/models/invoice/invoice_bank.py deleted file mode 100644 index 811f2898..00000000 --- a/xendit/models/invoice/invoice_bank.py +++ /dev/null @@ -1,23 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class InvoiceBank(BaseModel): - """Bank data detail in Invoice (API Reference: Invoice) - - Attributes: - - bank_code (str) - - collection_type (str) - - bank_account_number (str) - - transfer_amount (int) - - bank_branch (str) - - account_holder_name (str) - - identity_amount (str) - """ - - bank_code: str - collection_type: str - bank_account_number: str - transfer_amount: int - bank_branch: str - account_holder_name: str - identity_amount: str diff --git a/xendit/models/invoice/invoice_ewallet.py b/xendit/models/invoice/invoice_ewallet.py deleted file mode 100644 index e83098c0..00000000 --- a/xendit/models/invoice/invoice_ewallet.py +++ /dev/null @@ -1,11 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class InvoiceRetailOutlet(BaseModel): - """EWallet data detail in Invoice (API Reference: Invoice) - - Attributes: - - ewallet_type (str) - """ - - ewallet_type: str diff --git a/xendit/models/invoice/invoice_retail_outlet.py b/xendit/models/invoice/invoice_retail_outlet.py deleted file mode 100644 index 353dc167..00000000 --- a/xendit/models/invoice/invoice_retail_outlet.py +++ /dev/null @@ -1,15 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class InvoiceRetailOutlet(BaseModel): - """Retail Outlet data detail in Invoice (API Reference: Invoice) - - Attributes: - - retail_outlet_name (str) - - payment_code (str) - - transfer_amount (int) - """ - - retail_outlet_name: str - payment_code: str - transfer_amount: int diff --git a/xendit/models/payment/__init__.py b/xendit/models/payment/__init__.py deleted file mode 100644 index aef9edb5..00000000 --- a/xendit/models/payment/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .payment import Payment diff --git a/xendit/models/payment/payment.py b/xendit/models/payment/payment.py deleted file mode 100644 index 95209972..00000000 --- a/xendit/models/payment/payment.py +++ /dev/null @@ -1,27 +0,0 @@ -from typing import List - -from xendit.models._base_model import BaseModel, BaseListModel -from xendit.models.paymentmethod.payment_method import PaymentMethod - - -class Payment(BaseModel): - id: str - payment_request_id: str - reference_id: str - customer_id: str - currency: str - amount: str - country: str - status: str - payment_method: PaymentMethod - channel_properties: dict - payment_detail: dict - failure_code: str - created: str - updated: str - metadata: dict - - -class PaymentList(BaseListModel): - has_more: bool - data: List[Payment] diff --git a/xendit/models/paymentmethod/__init__.py b/xendit/models/paymentmethod/__init__.py deleted file mode 100644 index 2502e0dd..00000000 --- a/xendit/models/paymentmethod/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -from .payment_method import BillingInformation, PaymentMethod -from .card.card import Card -from .direct_debit.direct_debit import DirectDebit -from .ewallet.ewallet import EWallet -from .over_the_counter.over_the_counter import OverTheCounter -from .qr_code.qr_code import QRCode -from .virtual_account.virtual_account import VirtualAccount diff --git a/xendit/models/paymentmethod/billing_information.py b/xendit/models/paymentmethod/billing_information.py deleted file mode 100644 index 496fe9b6..00000000 --- a/xendit/models/paymentmethod/billing_information.py +++ /dev/null @@ -1,24 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class BillingInformation(BaseModel): - """ - Object containing information about the end-customer’s billing address. - For cards, this is the billing information on record with the cardholder’s issuer. - Recommended for 3DS 2 / AVS verification. - - Attributes: - - country (str) - - street_line1 (str) - - street_line2 (str) - - city (str) - - province_state (str) - - postal_code (str) - """ - - country: str - street_line1: str - street_line2: str - city: str - province_state: str - postal_code: str diff --git a/xendit/models/paymentmethod/card/__init__.py b/xendit/models/paymentmethod/card/__init__.py deleted file mode 100644 index 7b49e771..00000000 --- a/xendit/models/paymentmethod/card/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from .card import Card -from .card_information import CardInformation -from .card_verification_results import CardVerificationResults -from .channel_properties import ChannelProperties diff --git a/xendit/models/paymentmethod/card/card.py b/xendit/models/paymentmethod/card/card.py deleted file mode 100644 index 07ffe168..00000000 --- a/xendit/models/paymentmethod/card/card.py +++ /dev/null @@ -1,41 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery -from xendit.models.paymentmethod.card.card_verification_results import ( - CardVerificationResults, -) -from xendit.models.paymentmethod.card.card_information import CardInformation -from xendit.models.paymentmethod.card.channel_properties import ChannelProperties - - -class Card(BaseModel): - """ - For type=CARD, this contains the necessary information to describe a card payment method. This will be None otherwise. - (API Reference: Payment Method) - - Attributes: - - currency (str) - - channel_properties (ChannelProperties) - - card_information (CardInformation) - - card_verification_results (CardVerificationResults) - - """ - - currency: str - channel_properties: ChannelProperties - card_information: CardInformation - card_verification_results: CardVerificationResults - - class Query(BaseQuery): - """ - For type='CARD', this contains the necessary information to describe a virtual account payment method. - (API Reference: Payment Method) - - Attributes: - - currency (str) - - channel_properties (ChannelProperties.Query) - - card_information (CardInformation.Query) - """ - - currency: str - channel_properties: ChannelProperties.Query - card_information: CardInformation.Query diff --git a/xendit/models/paymentmethod/card/card_information.py b/xendit/models/paymentmethod/card/card_information.py deleted file mode 100644 index 44edc480..00000000 --- a/xendit/models/paymentmethod/card/card_information.py +++ /dev/null @@ -1,49 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class CardInformation(BaseModel): - """ - Information pertaining to the card - - Attributes: - - token_id (str) - - masked_card_numer (str) - - cardholder_name (str) - - expiry_month (str) - - expiry_year (str) - - fingerprint (str) - - type (str) - - network (str) - - country (str) - - issuer (str) - - """ - - token_id: str - masked_card_number: str - cardholder_name: str - expiry_month: str - expiry_year: str - fingerprint: str - type: str - network: str - country: str - issuer: str - - class Query(BaseQuery): - """ - Information pertaining to the card - - Attributes: - - card_number (str) - - expiry_month (str) - - expiry_year (str) - - cvv (str) - - """ - - card_number: str - expiry_month: str - expiry_year: str - cvv: str diff --git a/xendit/models/paymentmethod/card/card_verification_results.py b/xendit/models/paymentmethod/card/card_verification_results.py deleted file mode 100644 index 90358a94..00000000 --- a/xendit/models/paymentmethod/card/card_verification_results.py +++ /dev/null @@ -1,17 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class CardVerificationResults(BaseModel): - """ - Contains the results of various checks done such as 3DS, CVV, and AVS. - (API Reference: Payment Method) - - Attributes: - - three_d_secure - - cvv_result - - address_verification_result - """ - - three_d_secure: dict - cvv_result: str - address_verification_result: str diff --git a/xendit/models/paymentmethod/card/channel_properties.py b/xendit/models/paymentmethod/card/channel_properties.py deleted file mode 100644 index ea3aaaaa..00000000 --- a/xendit/models/paymentmethod/card/channel_properties.py +++ /dev/null @@ -1,36 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class ChannelProperties(BaseModel): - """ - Information provided specific to the channel partner that was provided during the request - - Attributes: - - skip_three_d_secure (bool) - - success_return_url (str) - - failure_return_url (str) - - cardonfile_type (str) - """ - - skip_three_d_secure: bool - success_return_url: str - failure_return_url: str - cardonfile_type: str - - class Query(BaseQuery): - """ - Object that contains the information to authorize the card for payments - - Attributes: - - skip_three_d_secure (bool) - - success_return_url (str) - - failure_return_url (str) - - cardonfile_type (str) - - """ - - skip_three_d_secure: bool - success_return_url: str - failure_return_url: str - cardonfile_type: str diff --git a/xendit/models/paymentmethod/direct_debit/__init__.py b/xendit/models/paymentmethod/direct_debit/__init__.py deleted file mode 100644 index d7bd9224..00000000 --- a/xendit/models/paymentmethod/direct_debit/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from .bank_account import BankAccount -from .channel_properties import ChannelProperties -from .debit_card import DebitCard -from .direct_debit import DirectDebit diff --git a/xendit/models/paymentmethod/direct_debit/bank_account.py b/xendit/models/paymentmethod/direct_debit/bank_account.py deleted file mode 100644 index f434391b..00000000 --- a/xendit/models/paymentmethod/direct_debit/bank_account.py +++ /dev/null @@ -1,14 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class BankAccount(BaseModel): - """ - If type='BANK_ACCOUNT', this contains details regarding the underlying bank account of the payment method. This will be None otherwise. - - Attributes: - - masked_bank_account_number (str) - - bank_account_hash (str) - """ - - masked_bank_account_number: str - bank_account_hash: str diff --git a/xendit/models/paymentmethod/direct_debit/channel_properties.py b/xendit/models/paymentmethod/direct_debit/channel_properties.py deleted file mode 100644 index bd15307e..00000000 --- a/xendit/models/paymentmethod/direct_debit/channel_properties.py +++ /dev/null @@ -1,49 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class ChannelProperties(BaseModel): - """ - Information provided specific to the channel partner that was provided during the request - (API Reference: Payment Method) - - Attributes: - - success_return_url (str) - - failure_return_url (str) - - mobile_number (int) - - card_last_four (str) - - card_expiry (str) - - email (str) - - require_auth (bool) - """ - - success_return_url: str - failure_return_url: str - mobile_number: str - card_last_four: str - card_expiry: str - email: str - require_auth: bool - - class Query(BaseQuery): - """ - Object that contains the information to authorize the direct debit account for payments - (API Reference: Payment Method) - - Attributes: - - success_return_url (str) - - failure_return_url (str) - - mobile_number (int) - - card_last_four (str) - - card_expiry (str) - - email (str) - - require_auth (bool) - """ - - success_return_url: str - failure_return_url: str - mobile_number: str - card_last_four: str - card_expiry: str - email: str - require_auth: bool diff --git a/xendit/models/paymentmethod/direct_debit/debit_card.py b/xendit/models/paymentmethod/direct_debit/debit_card.py deleted file mode 100644 index 25d4226f..00000000 --- a/xendit/models/paymentmethod/direct_debit/debit_card.py +++ /dev/null @@ -1,18 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class DebitCard(BaseModel): - """ - If type='DEBIT_CARD', this contains details regarding the debit card to be used for payments. This will be None otherwise. - - Attributes: - - mobile_number (str) - - card_last_four (str) - - card_expiry (str) - - email (str) - """ - - mobile_number: str - card_last_four: str - card_expiry: str - email: str diff --git a/xendit/models/paymentmethod/direct_debit/direct_debit.py b/xendit/models/paymentmethod/direct_debit/direct_debit.py deleted file mode 100644 index 06334b74..00000000 --- a/xendit/models/paymentmethod/direct_debit/direct_debit.py +++ /dev/null @@ -1,43 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - -from xendit.models.paymentmethod.direct_debit.bank_account import BankAccount -from xendit.models.paymentmethod.direct_debit.channel_properties import ( - ChannelProperties, -) -from xendit.models.paymentmethod.direct_debit.debit_card import DebitCard - - -class DirectDebit(BaseModel): - """ - For type='DIRECT_DEBIT', this contains the necessary information to describe a direct debit payment method. - (API Reference: Payment Method) - - Attributes: - - type (str) - - channel_code (str) - - channel_properties (ChannelProperties) - - bank_account (BankAccount) - - debit_card (DebitCard) - """ - - type: str - channel_code: str - channel_properties: ChannelProperties - bank_account: BankAccount - debit_card: DebitCard - - class Query(BaseQuery): - """ - For type='DIRECT_DEBIT', this contains the necessary information to describe a direct debit payment method. - (API Reference: Payment Method) - - Attributes: - - type (str) - - channel_code (str) - - channel_properties (ChannelProperties.Query) - """ - - type: str - channel_code: str - channel_properties: ChannelProperties.Query diff --git a/xendit/models/paymentmethod/ewallet/__init__.py b/xendit/models/paymentmethod/ewallet/__init__.py deleted file mode 100644 index 1e0f1841..00000000 --- a/xendit/models/paymentmethod/ewallet/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .account import Account -from .channel_properties import ChannelProperties -from .ewallet import EWallet diff --git a/xendit/models/paymentmethod/ewallet/account.py b/xendit/models/paymentmethod/ewallet/account.py deleted file mode 100644 index 8a480724..00000000 --- a/xendit/models/paymentmethod/ewallet/account.py +++ /dev/null @@ -1,18 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class Account(BaseModel): - """ - Details regarding the underlying e-wallet account as payment method - - Attributes: - - name (str) - - account_details (int) - - balance (float) - - point_balance (float) - """ - - name: str - account_details: str - balance: float - point_balance: float diff --git a/xendit/models/paymentmethod/ewallet/channel_properties.py b/xendit/models/paymentmethod/ewallet/channel_properties.py deleted file mode 100644 index 62b8de0c..00000000 --- a/xendit/models/paymentmethod/ewallet/channel_properties.py +++ /dev/null @@ -1,46 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class ChannelProperties(BaseModel): - """ - Information provided specific to the channel partner that was provided during the request - (API Reference: Payment Method) - - Attributes: - - success_return_url (str) - - failure_return_url (int) - - cancel_return_url (str) - - mobile_number (str) - - redeem_points (str) - - cashtag (str) - """ - - success_return_url: str - failure_return_url: str - cancel_return_url: str - mobile_number: str - redeem_points: str - cashtag: str - - class Query(BaseQuery): - """ - Object that contains the information to authorize the e-wallet account for payments - (API Reference: Payment Method) - - Attributes: - - success_return_url (str) - - failure_return_url (int) - - cancel_return_url (str) - - mobile_number (str) - - redeem_points (str) - - cashtag (str) - - """ - - success_return_url: str - failure_return_url: str - cancel_return_url: str - mobile_number: str - redeem_points: str - cashtag: str diff --git a/xendit/models/paymentmethod/ewallet/ewallet.py b/xendit/models/paymentmethod/ewallet/ewallet.py deleted file mode 100644 index c306a02e..00000000 --- a/xendit/models/paymentmethod/ewallet/ewallet.py +++ /dev/null @@ -1,36 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - -from xendit.models.paymentmethod.ewallet.account import Account -from xendit.models.paymentmethod.ewallet.channel_properties import ( - ChannelProperties, -) - - -class EWallet(BaseModel): - """ - For type='EWALLET', this contains the necessary information to describe an ewallet payment method. - (API Reference: Payment Method) - - Attributes: - - channel_code (str) - - channel_properties (ChannelProperties.Query) - - account (Account) - """ - - channel_code: str - channel_properties: ChannelProperties - account: Account - - class Query(BaseQuery): - """ - For type='EWALLET', this contains the necessary information to describe an ewallet payment method. - (API Reference: Payment Method) - - Attributes: - - channel_code (str) - - channel_properties (ChannelProperties.Query) - """ - - channel_code: str - channel_properties: ChannelProperties.Query diff --git a/xendit/models/paymentmethod/over_the_counter/__init__.py b/xendit/models/paymentmethod/over_the_counter/__init__.py deleted file mode 100644 index c88bd9fb..00000000 --- a/xendit/models/paymentmethod/over_the_counter/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .channel_properties import ChannelProperties -from .over_the_counter import OverTheCounter diff --git a/xendit/models/paymentmethod/over_the_counter/channel_properties.py b/xendit/models/paymentmethod/over_the_counter/channel_properties.py deleted file mode 100644 index 455f5a08..00000000 --- a/xendit/models/paymentmethod/over_the_counter/channel_properties.py +++ /dev/null @@ -1,33 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class ChannelProperties(BaseModel): - """ - Information provided specific to the channel partner that was provided during the request - (API Reference: Payment Method) - - Attributes: - - payment_code (str) - - customer_name (str) - - expires_at (str) - """ - - payment_code: str - customer_name: str - expires_at: str - - class Query(BaseQuery): - """ - Object that contains the information to generate a valid payment code - (API Reference: Payment Method) - - Attributes: - - payment_code (str) - - customer_name (str) - - expires_at (str) - """ - - payment_code: str - customer_name: str - expires_at: str diff --git a/xendit/models/paymentmethod/over_the_counter/over_the_counter.py b/xendit/models/paymentmethod/over_the_counter/over_the_counter.py deleted file mode 100644 index ab9d44d3..00000000 --- a/xendit/models/paymentmethod/over_the_counter/over_the_counter.py +++ /dev/null @@ -1,40 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery -from xendit.models.paymentmethod.over_the_counter.channel_properties import ( - ChannelProperties, -) - - -class OverTheCounter(BaseModel): - """ - For type='OVER_THE_COUNTER', this contains the necessary information to describe an over-the-counter/retail outlet payment method. - (API Reference: Payment Method) - - Attributes: - - amount (float) - - currency (str) - - channel_code (str) - - channel_properties (ChannelProperties) - """ - - amount: float - currency: str - channel_code: str - channel_properties: ChannelProperties - - class Query(BaseQuery): - """ - For type='OVER_THE_COUNTER', this contains the necessary information to describe an over-the-counter/retail outlet payment method. - (API Reference: Payment Method) - - Attributes: - - amount (float) - - currency (str) - - channel_code (str) - - channel_properties (ChannelProperties.Query) - """ - - amount: float - currency: str - channel_code: str - channel_properties: ChannelProperties.Query diff --git a/xendit/models/paymentmethod/payment_method.py b/xendit/models/paymentmethod/payment_method.py deleted file mode 100644 index 0f1edf77..00000000 --- a/xendit/models/paymentmethod/payment_method.py +++ /dev/null @@ -1,431 +0,0 @@ -from typing import List -from xendit._api_requestor import _APIRequestor -from xendit._extract_params import _extract_params -from xendit.models._base_model import BaseModel, BaseListModel -from xendit.models._base_query import BaseQuery -from xendit.models.paymentmethod.billing_information import BillingInformation -from xendit.models.paymentmethod.card.card import Card - -from xendit.models.paymentmethod.direct_debit.direct_debit import DirectDebit -from xendit.models.paymentmethod.ewallet.ewallet import EWallet -from xendit.models.paymentmethod.over_the_counter.over_the_counter import ( - OverTheCounter, -) -from xendit.models.paymentmethod.qr_code.qr_code import QRCode -from xendit.models.paymentmethod.virtual_account.virtual_account import ( - VirtualAccount, -) -from xendit.xendit_error import XenditError - - -class PaymentMethod(BaseModel): - """PaymentMethod class (API Reference: Payment Method) - - Related Classes: - - Card - - DirectDebit - - EWallet - - OverTheCounter - - QRCode - - VirtualAccount - - paymentrequest.PaymentRequest - - payment.Payment - - Static Methods: - - PaymentMethod.create (API Reference: /Create Payment Method) - - PaymentMethod.get (API Reference: /Get Payment Method by ID) - - PaymentMethod.update (API Reference: /Update Payment Method) - - PaymentMethod.expire (API Reference: /Expire Payment Method) - - PaymentMethod.authorize (API Reference: /Authorize Payment Method) - - PaymentMethod.list (API Reference: /Fetch Payment Methods) - - PaymentMethod.list_payments (API Reference: /Fetch Payments by Payment Method ID) - """ - - id: str - type: str - business_id: str - country: str - reusability: str - customer_id: str - reference_id: str - description: str - status: str - card: Card - direct_debit: DirectDebit - ewallet: EWallet - over_the_counter: OverTheCounter - qr_code: QRCode - virtual_account: VirtualAccount - metadata: dict - billing_information: BillingInformation - failure_code: str - actions: List[dict] - created: str - updated: str - - @staticmethod - def create( - *, - type: str, - reusability: str, - reference_id: str = None, - description: str = None, - metadata: dict = None, - country: str = None, - customer_id: str = None, - card: Card.Query = None, - direct_debit: DirectDebit.Query = None, - ewallet: EWallet.Query = None, - over_the_counter: OverTheCounter.Query = None, - qr_code: QRCode.Query = None, - virtual_account: VirtualAccount.Query = None, - billing_information: BillingInformation = None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Send POST Request to create Payment Method - (API Reference: Payment Methods/Create Payment Method) - - Args: - - type (str) - - reusability (str) - - **reference_id (str) - - **description (str) - - **metadata (dict) - - **country (str) - - **customer_id (str) - - **card (Card.Query) - - **direct_debit (DirectDebit.Query) - - **ewallet (EWallet.Query) - - **over_the_counter (OverTheCounter.Query) - - **qr_code (QRCode.Query) - - **virtual_account (VirtualAccount.Query) - - **billing_information (BillingInformation) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - PaymentMethod - - Raises: - XenditError - """ - - url = "/v2/payment_methods" - headers, body = _extract_params( - locals(), - func_object=PaymentMethod.create, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return PaymentMethod(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def get( - *, - payment_method_id, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Get Payment Method by Payment Method ID (API Reference: Payment Methods/Get Payment Method by ID) - - Args: - - payment_method_id (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - PaymentMethod - - Raises: - XenditError - - """ - url = f"/v2/payment_methods/{payment_method_id}" - headers, _ = _extract_params( - locals(), - func_object=PaymentMethod.get, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=["payment_method_id"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return PaymentMethod(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def update( - *, - payment_method_id: str, - description: str = None, - status: str = None, - reusability: str = None, - reference_id: str = None, - over_the_counter: OverTheCounter.Query = None, - virtual_account: VirtualAccount.Query = None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Update specific information of a particular Payment Method by Payment Method ID (API Reference: Payment Methods/Update Payment Method) - - Args: - - payment_method_id (str) - - **description (str) - - **status (str) - - **reusability (str) - - **over_the_counter (OverTheCounter.Query) - - **virtual_account (VirtualAccount.Query) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - PaymentMethod - - Raises: - XenditError - - """ - url = f"/v2/payment_methods/{payment_method_id}" - headers, body = _extract_params( - locals(), - func_object=PaymentMethod.update, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=["payment_method_id"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.patch(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return PaymentMethod(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def expire( - *, - payment_method_id: str, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Expire forces expiry or revokes authorization to an active Payment Method. - For VIRTUAL_ACCOUNT, this will also set the expires_at to the current time. (API Reference: Payment Methods/Expire Payment Method) - - Args: - - payment_method_id (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - Payment Method - - Raises: - XenditError - - """ - url = f"/v2/payment_methods/{payment_method_id}/expire" - headers, _ = _extract_params( - locals(), - func_object=PaymentMethod.expire, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=["payment_method_id"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return PaymentMethod(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def list( - *, - after_id: str = None, - before_id: str = None, - channel_code: str = None, - customer_id: str = None, - payment_method_id: str = None, - reusability: str = None, - status: str = None, - type: str = None, - limit: int = None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """List retrieves an array of Payment Method objects that match the provided filter. - An empty array [] will be returned if no records match the provided parameters. - (API Reference: Payment Methods/Fetch Payment Methods) - - Args: - - **after_id (str) - - **before_id (str) - - **channel_code (str) - - **customer_id (str) - - **payment_method_id (str) - - **reusability (str) - - **status (str) - - **type (str) - - **limit (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - PaymentMethod[] - - Raises: - XenditError - - """ - url = "/v2/payment_methods" - headers, params = _extract_params( - locals(), - func_object=PaymentMethod.list, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=[], - ) - kwargs["headers"] = headers - kwargs["params"] = params - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - has_more = resp.body["has_more"] - data = [PaymentMethod(**pm) for pm in resp.body["data"]] - return PaymentMethodList(has_more=has_more, data=data) - else: - raise XenditError(resp) - - @staticmethod - def authorize( - *, - payment_method_id: str, - auth_code: str, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Authorize is used when an additional authorization (ex. OTP Validation) is required in order to successfully activate a Payment Method. - (API Reference: Payment Methods/Authorize Payment Method) - - Args: - - payment_method_id (str) - - auth_code (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - PaymentMethod - - Raises: - XenditError - """ - - url = f"/v2/payment_methods/{payment_method_id}/auth" - headers, body = _extract_params( - locals(), - func_object=PaymentMethod.authorize, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=["payment_method_id"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return PaymentMethod(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def list_payments( - *, - payment_method_id: str, - after_id: str = None, - before_id: str = None, - channel_code: str = None, - customer_id: str = None, - payment_request_id: str = None, - reference_id: str = None, - status: str = None, - limit: int = None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """This endpoints returns a list of matching Payment objects made on a Payment Method. - (API Reference: Payment Methods/Fetch Payments by Payment Method ID) - - Args: - - payment_method_id (str) - - **after_id (str) - - **before_id (str) - - **channel_code (str) - - **customer_id (str) - - **payment_request_id (str) - - **reference_id (str) - - **status (str) - - **limit (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - Payment[] - - Raises: - XenditError - - """ - - from xendit.models.payment.payment import Payment, PaymentList - - url = f"/v2/payment_methods/{payment_method_id}/payments" - headers, params = _extract_params( - locals(), - func_object=PaymentMethod.list_payments, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=["payment_method_id"], - ) - kwargs["headers"] = headers - kwargs["params"] = params - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - has_more = resp.body["has_more"] - data = [Payment(**p) for p in resp.body["data"]] - return PaymentList(has_more=has_more, data=data) - else: - raise XenditError(resp) - - class Query(BaseQuery): - type: str - reusability: str - reference_id: str - description: str - metadata: dict - country: str - customer_id: str - card: Card.Query - direct_debit: DirectDebit.Query - ewallet: EWallet.Query - over_the_counter: OverTheCounter.Query - qr_code: QRCode.Query - virtual_account: VirtualAccount.Query - billing_information: BillingInformation - - -class PaymentMethodList(BaseListModel): - pass diff --git a/xendit/models/paymentmethod/qr_code/__init__.py b/xendit/models/paymentmethod/qr_code/__init__.py deleted file mode 100644 index 4e543f45..00000000 --- a/xendit/models/paymentmethod/qr_code/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .channel_properties import ChannelProperties -from .qr_code import QRCode diff --git a/xendit/models/paymentmethod/qr_code/channel_properties.py b/xendit/models/paymentmethod/qr_code/channel_properties.py deleted file mode 100644 index bc7f92f3..00000000 --- a/xendit/models/paymentmethod/qr_code/channel_properties.py +++ /dev/null @@ -1,16 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class ChannelProperties(BaseModel): - """ - Information provided specific to the channel partner that was provided during the request - (API Reference: Payment Method) - - Attributes: - - qr_string (str) - - expires_at (str) - """ - - qr_string: str - expires_at: str diff --git a/xendit/models/paymentmethod/qr_code/qr_code.py b/xendit/models/paymentmethod/qr_code/qr_code.py deleted file mode 100644 index d93de2b8..00000000 --- a/xendit/models/paymentmethod/qr_code/qr_code.py +++ /dev/null @@ -1,38 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery -from xendit.models.paymentmethod.qr_code.channel_properties import ( - ChannelProperties, -) - - -class QRCode(BaseModel): - """ - For type=QR_CODE, this contains the necessary information to describe an QR code payment method. This will be None otherwise. - (API Reference: Payment Method) - - Attributes: - - amount (float) - - currency (str) - - channel_code (str) - - channel_properties (ChannelProperties) - """ - - amount: float - currency: str - channel_code: str - - class Query(BaseQuery): - """ - For type='QR_CODE', this contains the necessary information to describe a QR Code payment method. - Note: A QR Code Payment method will only be ACTIVE and eligible for accepting payments with a corresponding valid Payment - (API Reference: Payment Method) - - Attributes: - - amount (float) - - currency (str) - - channel_code (str) - """ - - amount: float - currency: str - channel_code: str diff --git a/xendit/models/paymentmethod/virtual_account/__init__.py b/xendit/models/paymentmethod/virtual_account/__init__.py deleted file mode 100644 index 9382a3f2..00000000 --- a/xendit/models/paymentmethod/virtual_account/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .channel_properties import ChannelProperties -from .virtual_account import VirtualAccount diff --git a/xendit/models/paymentmethod/virtual_account/channel_properties.py b/xendit/models/paymentmethod/virtual_account/channel_properties.py deleted file mode 100644 index e51ac772..00000000 --- a/xendit/models/paymentmethod/virtual_account/channel_properties.py +++ /dev/null @@ -1,38 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class ChannelProperties(BaseModel): - """ - Information provided specific to the channel partner that was provided during the request - (API Reference: Payment Method) - - Attributes: - - customer_name (str) - - virtual_account_number (str) - - expires_at (str) - - suggested_amount (float) - - """ - - customer_name: str - virtual_account_number: str - expires_at: str - suggested_amount: float - - class Query(BaseQuery): - """ - Object that contains the information to generate a virtual account number - (API Reference: Payment Method) - - Attributes - - customer_name (str) - - virtual_account_number (str) - - expires_at (str) - - suggested_amount (float) - """ - - customer_name: str - virtual_account_number: str - expires_at: str - suggested_amount: float diff --git a/xendit/models/paymentmethod/virtual_account/virtual_account.py b/xendit/models/paymentmethod/virtual_account/virtual_account.py deleted file mode 100644 index ca89ebf2..00000000 --- a/xendit/models/paymentmethod/virtual_account/virtual_account.py +++ /dev/null @@ -1,44 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery -from xendit.models.paymentmethod.virtual_account.channel_properties import ( - ChannelProperties, -) - - -class VirtualAccount(BaseModel): - """ - For type=VIRTUAL_ACCOUNT, this contains the necessary information to describe a virtual account payment method. This will be None otherwise. - (API Reference: Payment Method) - - Attributes: - - amount (float) - - min_amount (float) - - max_amount (float) - - currency (str) - - channel_code (str) - - channel_properties (ChannelProperties) - """ - - amount: float - min_amount: float - max_amount: float - currency: str - channel_code: str - channel_properties: ChannelProperties - - class Query(BaseQuery): - """ - For type='VIRTUAL_ACCOUNT', this contains the necessary information to describe a virtual account payment method. - (API Reference: Payment Method) - - Attributes: - - amount (float) - - currency (str) - - channel_code (str) - - channel_properties (ChannelProperties.Query) - """ - - amount: float - currency: str - channel_code: str - channel_properties: ChannelProperties.Query diff --git a/xendit/models/paymentrequest/__init__.py b/xendit/models/paymentrequest/__init__.py deleted file mode 100644 index a0bed2bb..00000000 --- a/xendit/models/paymentrequest/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .payment_request import PaymentRequest diff --git a/xendit/models/paymentrequest/payment_request.py b/xendit/models/paymentrequest/payment_request.py deleted file mode 100644 index ea0d1866..00000000 --- a/xendit/models/paymentrequest/payment_request.py +++ /dev/null @@ -1,288 +0,0 @@ -from typing import List - -from xendit._api_requestor import _APIRequestor -from xendit._extract_params import _extract_params -from xendit.models._base_model import BaseModel, BaseListModel -from xendit.models.paymentmethod.payment_method import PaymentMethod -from xendit.xendit_error import XenditError - - -class PaymentRequest(BaseModel): - """PaymentRequest class (API Reference: PaymentRequests) - - Related Classes: - - paymentmethod.PaymentMethod - - payment.Payment - - refund.Refund - - Static Methods: - - PaymentRequest.create (API Reference: /Create Payment Request) - - PaymentRequest.get (API Reference: /Get Payment Request by ID) - - PaymentRequest.confirm (API Reference: /Confirm Payment Request) - - PaymentRequest.resend_auth (API Reference: /Resend Auth for Payment Request) - - PaymentRequest.list (API Reference: /Fetch Payment Requests) - - """ - - id: str - created: str - type: str - updated: str - reference_id: str - business_id: str - customer_id: str - amount: float - country: str - currency: str - payment_method: PaymentMethod - channel_properties: dict - description: str - failure_code: str - capture_method: str - initiator: str - card_verification_results: dict - status: str - actions: List[dict] - metadata: dict - shipping_information: dict - - def create( - *, - currency: str, - amount: float = None, - reference_id: str = None, - customer_id: str = None, - country: str = None, - description: str = None, - payment_method: PaymentMethod.Query = None, - payment_method_id: str = None, - channel_properties: dict = None, - metadata: dict = None, - shipping_information: dict = None, - capture_method: str = None, - initiator: str = None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Send POST Request to create Payment Request - (API Reference: Payment Requests/Create Payment Request) - - Args: - - type (str) - - reusability (str) - - **reference_id (str) - - **description (str) - - **country (str) - - **customer_id (str) - - **payment_method (paymentmethod.PaymentRequest) - - **payment_method_id (str) - - **channel_properties (ChannelProperties) - - **metadata (dict) - - **shipping_information (dict) - - **capture_method (str) - - **initiator (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - PaymentRequest - - Raises: - XenditError - """ - - url = "/payment_requests" - headers, body = _extract_params( - locals(), - func_object=PaymentRequest.create, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return PaymentRequest(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def get( - *, - payment_request_id: str, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Get Payment Request by Payment Request ID (API Reference: Payment Requests/Get Payment Request by ID) - - Args: - - payment_request_id (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - PaymentRequest - - Raises: - XenditError - - """ - url = f"/payment_requests/{payment_request_id}" - headers, _ = _extract_params( - locals(), - func_object=PaymentRequest.get, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=["payment_request_id"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return PaymentRequest(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def confirm( - *, - payment_request_id: str, - auth_code: str, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """This endpoint only applies to BRI Direct Debit. This is only applicable for select payment DIRECT_DEBIT channels (BRI Direct Debit, BPI, RCBC, UBP, CHINABANK) - This is used when an additional authorization (ex. OTP Validation, PIN validation) is required in order to successfully activate a payment method. This is equivalent to the POST - AUTH action provided when a Payment Method has the status REQUIRES_ACTION. - (API Reference: Payment Requests/Confirm Payment Request) - - Args: - - payment_request_id (str) - - auth_code (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - PaymentRequest - - Raises: - XenditError - - """ - url = f"/payment_requests/{payment_request_id}/auth" - headers, body = _extract_params( - locals(), - func_object=PaymentRequest.confirm, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=["payment_request_id"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return PaymentRequest(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def resend_auth( - *, - payment_request_id: str, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """This endpoint only applies to BRI Direct Debit. This is only applicable for select payment DIRECT_DEBIT channels (BRI Direct Debit, BPI, UBP, CHINABANK) - This is used when an additional authorization (ex. OTP Validation) is required in order to successfully activate a payment method. This is equivalent to the POST - AUTH action provided when a Payment Method has the status REQUIRES_ACTION. - API Reference: Payment Requests/Resend Auth for Payment Request) - - Args: - - payment_request_id (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - PaymentRequest - - Raises: - XenditError - - """ - url = f"/payment_requests/{payment_request_id}/auth/resend" - headers, _ = _extract_params( - locals(), - func_object=PaymentRequest.resend_auth, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=["payment_request_id"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return PaymentRequest(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def list( - *, - after_id: str = None, - before_id: str = None, - channel_code: str = None, - customer_id: str = None, - payment_request_id: str = None, - reusability: str = None, - status: str = None, - type: str = None, - limit: int = None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """List retrieves an array of Payment Request objects that match the provided filter. - An empty array [] will be returned if no records match the provided parameters. - (API Reference: Payment Requests/Fetch Payment Requests) - - Args: - - **after_id (str) - - **before_id (str) - - **channel_code (str) - - **customer_id (str) - - **payment_request_id (str) - - **reusability (str) - - **status (str) - - **type (str) - - **limit (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - PaymentRequest[] - - Raises: - XenditError - - """ - url = "/payment_requests" - headers, params = _extract_params( - locals(), - func_object=PaymentRequest.list, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=[], - ) - kwargs["headers"] = headers - kwargs["params"] = params - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - has_more = resp.body["has_more"] - data = [PaymentRequest(**pm) for pm in resp.body["data"]] - return PaymentRequestList(has_more=has_more, data=data) - else: - raise XenditError(resp) - - -class PaymentRequestList(BaseListModel): - pass diff --git a/xendit/models/payout/__init__.py b/xendit/models/payout/__init__.py deleted file mode 100644 index 0daddb3e..00000000 --- a/xendit/models/payout/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .payout import Payout diff --git a/xendit/models/payout/payout.py b/xendit/models/payout/payout.py deleted file mode 100644 index 006dab5e..00000000 --- a/xendit/models/payout/payout.py +++ /dev/null @@ -1,168 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.xendit_error import XenditError -from xendit._api_requestor import _APIRequestor -from xendit._extract_params import _extract_params - - -class Payout(BaseModel): - """Payout class (API Reference: Payout) - - Static Methods: - - Payout.create (API Reference: /Create Payout) - - Payout.get (API Reference: /Get Payout) - - Payout.void (API Reference: /Void a Payout) - - Attributes: - - id (str) - - external_id (str) - - amount (int) - - merchant_name (str) - - status (str) - - Optional Attributes: - - expiration_timestamp (str) - - createad (str) - - payout_url (str) - - email (str) - - bank_code (str) - - account_holder_name (str) - - account_number (str) - - disbursement_id (str) - - failure_reason (str) - - claimed_timestamp (str) - - completed_timestamp (str) - - failed_timestamp (str) - - payment_id (str) - """ - - id: str - external_id: str - amount: int - merchant_name: str - status: str - - # Optional - expiration_timestamp: str - created: str - payout_url: str - email: str - bank_code: str - account_holder_name: str - account_number: str - disbursement_id: str - failure_reason: str - claimed_timestamp: str - completed_timestamp: str - failed_timestamp: str - payment_id: str - - @staticmethod - def create( - *, - external_id, - amount, - email, - x_idempotency_key=None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Create a payout (API Reference: Payout/Create Payout) - - Args: - - external_id (str) - - amount (int) - - email (str) - - **for_user_id (str) (XenPlatform only) - - **x_idempotency_key (str) - - **x_api_version (str) - - Returns - Payout - - Raises - XenditError - - """ - url = "/payouts" - headers, body = _extract_params( - locals(), - func_object=Payout.create, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return Payout(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def get( - *, id, for_user_id=None, x_api_version=None, **kwargs, - ): - """Get payout (API Reference: Payout/Get Payout) - - Args: - - id (str) - - **for_user_id (str) (XenPlatform only) - - **x_api_version (str) - - Returns - Payout - - Raises - XenditError - - """ - url = f"/payouts/{id}" - headers, _ = _extract_params( - locals(), - func_object=Payout.get, - headers_params=["for_user_id", "x_api_version"], - ignore_params=["id"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return Payout(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def void( - *, id, x_idempotency_key=None, for_user_id=None, x_api_version=None, **kwargs, - ): - """Void a payout (API Reference: Payout/Void a Payout) - - Args: - - id (str) - - **for_user_id (str) (XenPlatform only) - - **x_idempotency_key (str) - - **x_api_version (str) - - Returns - Payout - - Raises - XenditError - - """ - url = f"/payouts/{id}/void" - headers, body = _extract_params( - locals(), - func_object=Payout.void, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=["id"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return Payout(**resp.body) - else: - raise XenditError(resp) diff --git a/xendit/models/qrcode/__init__.py b/xendit/models/qrcode/__init__.py deleted file mode 100644 index 4391981b..00000000 --- a/xendit/models/qrcode/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .qrcode import QRCode -from .qrcode_type import QRCodeType diff --git a/xendit/models/qrcode/qrcode.py b/xendit/models/qrcode/qrcode.py deleted file mode 100644 index 22aabf44..00000000 --- a/xendit/models/qrcode/qrcode.py +++ /dev/null @@ -1,127 +0,0 @@ -from xendit.models._base_model import BaseModel - -from xendit._api_requestor import _APIRequestor -from xendit._extract_params import _extract_params - -from xendit.xendit_error import XenditError - - -class QRCode(BaseModel): - """QR Codes class (API Reference: QR Codes) - - Static Methods: - - QRCode.create (API Reference: /Create QR Code) - - QRCode.get_by_ext_id (API Reference: /Get QR Code by External ID) - - Attributes: - - id (str) - - external_id (str) - - amount (float) - - qr_string (str) - - callback_url (str) - - type (str) - - status (str) - - created (str) - - updated (str) - - """ - - id: str - external_id: str - amount: float - qr_string: str - callback_url: str - type: str - status: str - created: str - updated: str - - @staticmethod - def create( - *, - external_id, - type, - callback_url, - amount=None, - for_user_id=None, - x_idempotency_key=None, - x_api_version=None, - **kwargs, - ): - """Send POST Request to create QR Codes (API Reference: QR Code/Create QR Code) - - Args: - - external_id (str) - - type (str) - - callback_url (str) - - amount (int) - - **for_user_id (str) (XenPlatforms only) - - **x_idempotency_key (str) - - **x_api_version (str): API Version that will be used. If not provided will default to the latest - - Returns: - QRCode - - Raises: - XenditError - - """ - type = QRCode._parse_qrcode_type(type) - url = "/qr_codes" - headers, body = _extract_params( - locals(), - func_object=QRCode.create, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return QRCode(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def get_by_ext_id( - *, - external_id, - for_user_id=None, - x_idempotency_key=None, - x_api_version=None, - **kwargs, - ): - """Get QR Codes by external_id (API Reference: QR Code/Get QR Code by External ID) - - Args: - - external_id (str) - - **for_user_id (str) (XenPlatforms only) - - **x_api_version (str): API Version that will be used. If not provided will default to the latest - - Returns: - QRCode - - Raises: - XenditError - - """ - url = f"/qr_codes/{external_id}" - headers, _ = _extract_params( - locals(), - func_object=QRCode.get_by_ext_id, - headers_params=["for_user_id", "x_api_version"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return QRCode(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def _parse_qrcode_type(qrcode_type): - try: - return qrcode_type.name - except AttributeError: - return qrcode_type diff --git a/xendit/models/qrcode/qrcode_type.py b/xendit/models/qrcode/qrcode_type.py deleted file mode 100644 index 4c654601..00000000 --- a/xendit/models/qrcode/qrcode_type.py +++ /dev/null @@ -1,8 +0,0 @@ -from enum import Enum - - -class QRCodeType(Enum): - """QR Code Type""" - - DYNAMIC = "DYNAMIC" - STATIC = "STATIC" diff --git a/xendit/models/recurringpayment/__init__.py b/xendit/models/recurringpayment/__init__.py deleted file mode 100644 index 5d1acad4..00000000 --- a/xendit/models/recurringpayment/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .recurring_payment import RecurringPayment diff --git a/xendit/models/recurringpayment/recurring_payment.py b/xendit/models/recurringpayment/recurring_payment.py deleted file mode 100644 index be80d494..00000000 --- a/xendit/models/recurringpayment/recurring_payment.py +++ /dev/null @@ -1,341 +0,0 @@ -from xendit.models._base_model import BaseModel - -from xendit._api_requestor import _APIRequestor -from xendit._extract_params import _extract_params - -from xendit.xendit_error import XenditError - - -class RecurringPayment(BaseModel): - """RecurringPayment class (API Reference: RecurringPayment) - - Static Methods: - - RecurringPayment.create (API Reference: /Create Recurring Payment) - - RecurringPayment.get (API Reference: /Get Recurring Payment) - - RecurringPayment.edit (API Reference: /Edit Recurring Payment) - - RecurringPayment.stop (API Reference: /Stop Recurring Payment) - - RecurringPayment.pause (API Reference: /Pause Recurring Payment) - - RecurringPayment.resume (API Reference: /Resume Recurring Payment) - - Static Methods for Object Creation: - - RecurringPayment.helper_create_installment (For Installment in create_authorization and create_charge) - - Attributes: - - id (str) - - user_id (str) - - external_id (str) - - status (str) - - amount (float) - - payer_email (str) - - description (str) - - should_send_email (bool) - - interval (str) - - interval_count (int) - - recurrence_progress (int) - - last_created_invoice_url (str) - - credit_card_token (str) - - created (str) - - updated (str) - - recharge (bool) - - payment_method_id (str) - - Optional Attributes: - - success_redirect_url (str) - - failure_redirect_url (str) - - invoice_duration (int) - - charge_immediately (bool) - - currency (str) - """ - - id: str - user_id: str - external_id: str - status: str - amount: float - payer_email: str - description: str - should_send_email: bool - interval: str - interval_count: int - recurrence_progress: int - last_created_invoice_url: str - credit_card_token: str - created: str - updated: str - recharge: bool - payment_method_id: str - - # Optional - success_redirect_url: str - failure_redirect_url: str - invoice_duration: int - charge_immediately: bool - currency: str - - @staticmethod - def create( - *, - external_id, - payer_email, - description, - amount, - interval, - interval_count, - total_recurrence=None, - invoice_duration=None, - should_send_email=None, - missed_payment_action=None, - credit_card_token=None, - start_date=None, - success_redirect_url=None, - failure_redirect_url=None, - recharge=None, - charge_immediately=None, - payment_method_id=None, - currency=None, - x_idempotency_key=None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Send POST Request to create refund for Credit Card (API Reference: Credit Card/Create Refund) - - Args: - - external_id (str) - - payer_email (str) - - description (str) - - amount (float) - - interval (str) - - interval_count (int) - - **total_recurrence (int) - - **invoice_duration (int) - - **should_send_email (int) - - **missed_payment_action (str) - - **credit_card_token (str) - - **start_date (str) - - **success_redirect_url (str) - - **failure_redirect_url (str) - - **recharge (bool) - - **charge_immediately (bool) - - **payment_method_id (str) - - **currency (str) - - **x_idempotency_key (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - RecurringPayment - - Raises: - XenditError - - """ - url = "/recurring_payments" - headers, body = _extract_params( - locals(), - func_object=RecurringPayment.create, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return RecurringPayment(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def get( - *, id, for_user_id=None, x_api_version=None, **kwargs, - ): - """Get Recurring Payment by ID (API Reference: Recurring Payment/Get Recurring Payment) - - Args: - - id (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - RecurringPayment - - Raises: - XenditError - - """ - url = f"/recurring_payments/{id}" - headers, _ = _extract_params( - locals(), - func_object=RecurringPayment.get, - headers_params=["for_user_id", "x_api_version"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return RecurringPayment(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def edit( - *, - id, - amount=None, - credit_card_token=None, - interval=None, - interval_count=None, - should_send_email=None, - invoice_duration=None, - missed_payment_action=None, - payment_method_id=None, - customer_id=None, - x_idempotency_key=None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Edit Recurring Payment Data (API Reference: Recurring Payment/Edit Recurring Payment) - - Args: - - id (str) - - **amount (int) - - **credit_card_token (str) - - **interval (str) - - **interval_count (int) - - **should_send_email (bool) - - **invoice_duration (int) - - **missed_payment_action (str) - - **payment_method_id (str) - - **customer_id (str) - - **x_idempotency_key (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - RecurringPayment - - Raises: - XenditError - - """ - url = f"/recurring_payments/{id}" - headers, body = _extract_params( - locals(), - func_object=RecurringPayment.edit, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=["id"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.patch(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return RecurringPayment(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def stop( - *, id, x_idempotency_key=None, for_user_id=None, x_api_version=None, **kwargs, - ): - """Stop Recurring Payment (API Reference: Recurring Payment/Stop Recurring Payment) - - Args: - - id (str) - - **x_idempotency_key (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - RecurringPayment - - Raises: - XenditError - - """ - url = f"/recurring_payments/{id}/stop!" - headers, body = _extract_params( - locals(), - func_object=RecurringPayment.stop, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=["id"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return RecurringPayment(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def pause( - *, id, x_idempotency_key=None, for_user_id=None, x_api_version=None, **kwargs, - ): - """Pause Recurring Payment (API Reference: Recurring Payment/Pause Recurring Payment) - - Args: - - id (str) - - **x_idempotency_key (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - RecurringPayment - - Raises: - XenditError - - """ - url = f"/recurring_payments/{id}/pause!" - headers, body = _extract_params( - locals(), - func_object=RecurringPayment.stop, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=["id"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return RecurringPayment(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def resume( - *, id, x_idempotency_key=None, for_user_id=None, x_api_version=None, **kwargs, - ): - """Pause Recurring Payment (API Reference: Recurring Payment/Pause Recurring Payment) - - Args: - - id (str) - - **x_idempotency_key (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - RecurringPayment - - Raises: - XenditError - - """ - url = f"/recurring_payments/{id}/resume!" - headers, body = _extract_params( - locals(), - func_object=RecurringPayment.stop, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=["id"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return RecurringPayment(**resp.body) - else: - raise XenditError(resp) diff --git a/xendit/models/refund/__init__.py b/xendit/models/refund/__init__.py deleted file mode 100644 index b1a2af7f..00000000 --- a/xendit/models/refund/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .refund import Refund diff --git a/xendit/models/refund/refund.py b/xendit/models/refund/refund.py deleted file mode 100644 index fea425da..00000000 --- a/xendit/models/refund/refund.py +++ /dev/null @@ -1,180 +0,0 @@ -from typing import List - -from xendit._api_requestor import _APIRequestor -from xendit._extract_params import _extract_params -from xendit.models._base_model import BaseModel, BaseListModel -from xendit.xendit_error import XenditError - - -class Refund(BaseModel): - """Refund class (API Reference: Payment Method) - - Related Classes: - - paymentrequest.PaymentRequest - - payment.Payment - - Static Methods: - - Refund.create (API Reference: /Create Refund) - - Refund.get (API Reference: /Get Refund by ID) - - Refund.list (API Reference: /Fetch Refunds) - """ - - id: str - payment_request_id: str - invoice_id: str - payment_method_type: str - reference_id: str - country: str - status: str - channel_code: str - reason: str - failure_code: str - refund_fee_amount: float - created: str - updated: str - metadata: dict - - @staticmethod - def create( - *, - payment_request_id: str = None, - reference_id: str = None, - invoice_id: str = None, - currency: str = None, - amount: float = None, - reason: str = None, - metadata: dict = None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Send POST Request to create Refund - (API Reference: Refunds/Create Refund) - - Args: - - **reference_id (str) - - **payment_request_id (str) - - **invoice_id (str) - - **currency (str) - - **amount (float) - - **reason (str) - - **metadata (dict) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - Refund - - Raises: - XenditError - """ - - url = "/refunds" - headers, body = _extract_params( - locals(), - func_object=Refund.create, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return Refund(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def get( - *, - refund_id, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Get Refund by Refund ID (API Reference: Refunds/Get Refund by ID) - - Args: - - refund_id (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - Refund - - Raises: - XenditError - - """ - url = f"/refunds/{refund_id}" - headers, _ = _extract_params( - locals(), - func_object=Refund.get, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=["refund_id"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return Refund(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def list( - *, - payment_request_id: str = None, - invoice_id: str = None, - payment_method_type: str = None, - channel_code: str = None, - after_id: str = None, - before_id: str = None, - limit: int = None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """List retrieves an array of Payment Method objects that match the provided filter. - An empty array [] will be returned if no records match the provided parameters. - (API Reference: Payment Methods/Fetch Payment Methods) - - Args: - - **payment_request_id (str) - - **invoice_id (str) - - **payment_method_type (str) - - **channel_code (str) - - **after_id (str) - - **before_id (str) - - **limit (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns: - Refund[] - - Raises: - XenditError - - """ - url = "refunds" - headers, params = _extract_params( - locals(), - func_object=Refund.list, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ignore_params=[], - ) - kwargs["headers"] = headers - kwargs["params"] = params - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - has_more = resp.body["has_more"] - data = [Refund(**pm) for pm in resp.body["data"]] - return RefundList(has_more=has_more, data=data) - else: - raise XenditError(resp) - - -class RefundList(BaseListModel): - pass diff --git a/xendit/models/retailoutlet/__init__.py b/xendit/models/retailoutlet/__init__.py deleted file mode 100644 index fce09170..00000000 --- a/xendit/models/retailoutlet/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .retail_outlet import RetailOutlet diff --git a/xendit/models/retailoutlet/retail_outlet.py b/xendit/models/retailoutlet/retail_outlet.py deleted file mode 100644 index 41369524..00000000 --- a/xendit/models/retailoutlet/retail_outlet.py +++ /dev/null @@ -1,170 +0,0 @@ -from xendit.models._base_model import BaseModel - -from xendit._api_requestor import _APIRequestor -from xendit._extract_params import _extract_params - -from xendit.xendit_error import XenditError - - -class RetailOutlet(BaseModel): - """RetailOutlet class (API Reference: Retail Outlets) - - Static Methods: - - RetailOutlet.create_fixed_payment_code (API Reference: /Create Fixed Payment Code) - - RetailOutlet.update_fixed_payment_code (API Reference: /Update Fixed Payment Code) - - RetailOutlet.get_fixed_payment_code (API Reference: /Get Fixed Payment Code) - - Attributes: - - owner_id (str) - - external_id (str) - - retail_outlet_name (str) - - prefix (str) - - name (str) - - payment_code (str) - - expected_amount (int) - - is_single_use (bool) - - expiration_date (str) (ISO 8601 Date) - - id (str) - - """ - - owner_id: str - external_id: str - retail_outlet_name: str - prefix: str - name: str - payment_code: str - expected_amount: int - is_single_use: bool - expiration_Date: str - id: str - status: str - type: str - - @staticmethod - def create_fixed_payment_code( - *, - external_id, - retail_outlet_name, - name, - expected_amount, - payment_code=None, - expiration_date=None, - is_single_use=None, - for_user_id=None, - x_idempotency_key=None, - x_api_version=None, - **kwargs, - ): - """Send POST Request to create fixed payment code (API Reference: Retail Outlets/Create Fixed Payment Code) - - Args: - - external_id (str) - - retail_outlet_name (str) - - name (str) - - expected_amount (int) - - **payment_code (str) - - **expiration_date (str) (ISO 8601 Date) - - **is_single_use (bool) - - **for_user_id (str) - - **x_idempotency_key (str) - - **x_api_version (str): API Version that will be used. If not provided will default to the latest - - Returns: - RetailOutlet - - Raises: - XenditError - - """ - url = "/fixed_payment_code" - headers, body = _extract_params( - locals(), - func_object=RetailOutlet.create_fixed_payment_code, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return RetailOutlet(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def update_fixed_payment_code( - *, - fixed_payment_code_id, - name=None, - expected_amount=None, - expiration_date=None, - for_user_id=None, - x_idempotency_key=None, - x_api_version=None, - **kwargs, - ): - """Update fixed payment code (API Reference: Retail Outlets/Update Fixed Payment Code) - - Args: - - fixed_payment_code_id (str) - - **name (str) - - **expected_amount (int) - - **expiration_date (str) (ISO 8601 Date) - - **for_user_id (str) - - **x_idempotency_key (str) - - **x_api_version (str): API Version that will be used. If not provided will default to the latest - - Returns: - RetailOutlet - - Raises: - XenditError - - """ - url = f"/fixed_payment_code/{fixed_payment_code_id}" - headers, body = _extract_params( - locals(), - func_object=RetailOutlet.update_fixed_payment_code, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.patch(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return RetailOutlet(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def get_fixed_payment_code( - *, fixed_payment_code_id, for_user_id=None, x_api_version=None, **kwargs - ): - """Get the detail of given Fixed Payment Code (API Reference: Retail Outlets/Get Fixed Payment Code) - - Args: - - fixed_payment_code_id (str) - - **for_user_id (str) (XenPlatforms only) - - **x_api_version (str): API Version that will be used. If not provided will default to the latest - - Returns: - RetailOutlet - - Raises: - XenditError - - """ - url = f"/fixed_payment_code/{fixed_payment_code_id}" - headers, _ = _extract_params( - locals(), - func_object=RetailOutlet.update_fixed_payment_code, - headers_params=["for_user_id", "x_api_version"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return RetailOutlet(**resp.body) - else: - raise XenditError(resp) diff --git a/xendit/models/virtualaccount/__init__.py b/xendit/models/virtualaccount/__init__.py deleted file mode 100644 index bcffa8a1..00000000 --- a/xendit/models/virtualaccount/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .virtual_account import VirtualAccount -from .virtual_acount_bank import VirtualAccountBank -from .virtual_account_payment import VirtualAccountPayment diff --git a/xendit/models/virtualaccount/virtual_account.py b/xendit/models/virtualaccount/virtual_account.py deleted file mode 100644 index ec7d4b4b..00000000 --- a/xendit/models/virtualaccount/virtual_account.py +++ /dev/null @@ -1,258 +0,0 @@ -from .virtual_acount_bank import VirtualAccountBank -from .virtual_account_payment import VirtualAccountPayment - -from xendit.models._base_model import BaseModel - -from xendit._api_requestor import _APIRequestor -from xendit._extract_params import _extract_params - -from xendit.xendit_error import XenditError - - -class VirtualAccount(BaseModel): - """Virtual Account class (API Reference: Virtual Account) - - Related Classes: - - VirtualAccountBanks - - VirtualAccountPayment - - Static Methods: - - VirtualAccount.create (API Reference: /Create Virtual Account) - - VirtualAccount.get_banks (API Reference: /Get Virtual Account Banks) - - VirtualAccount.get (API Reference: /Get Virtual Account) - - VirtualAccount.update (API Reference: /Update Virtual Account) - - VirtualAccount.get_payment (API Reference: /Get Virtual Account Payment) - - Attributes: - - owner_id (str) - - external_id (str) - - bank_code (str) - - merchant_code (str) - - name (str) - - account_number (str) - - is_closed (bool) - - id (str) - - is_single_use (bool) - - status (str) - - expiration_date (str) (ISO 8601 Date) - - Optional Attributes: - - suggested_amount (str) - - expected_amount (str) - - description (str) - - """ - - owner_id: str - external_id: str - bank_code: str - merchant_code: str - name: str - account_number: str - is_closed: bool - id: str - is_single_use: bool - status: str - expiration_date: str - - # Optional - suggested_amount: str - expected_amount: str - description: str - - @staticmethod - def create( - *, - external_id, - bank_code, - name, - virtual_account_number=None, - suggested_amount=None, - is_closed=None, - expected_amount=None, - expiration_date=None, - is_single_use=None, - description=None, - for_user_id=None, - x_idempotency_key=None, - x_api_version=None, - **kwargs, - ): - """Send POST Request to create VirtualAccount (API Reference: Virtual Account/Create Virtual Account) - - Args: - - external_id (str) - - bank_code (str) - - name (str) - - **virtual_account_number (str) - - **suggested_amount (int) - - **is_closed (bool) - - **expected_amount (int) - - **expiration_date (str) (ISO 8601 Date) - - **is_single_use (bool) - - **description (str) - - **for_user_id (str) (XenPlatforms only) - - **x_idempotency_key (str) - - **x_api_version (str): API Version that will be used. If not provided will default to the latest - - Returns: - VirtualAccount - - Raises: - XenditError - - """ - url = "/callback_virtual_accounts" - headers, body = _extract_params( - locals(), - func_object=VirtualAccount.create, - headers_params=["for_user_id", "x_idempotency_key", "x_api_version"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return VirtualAccount(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def get_banks(*, for_user_id=None, x_api_version=None, **kwargs): - """Get available banks (API Reference: Virtual Account/Get Virtual Account Banks) - - Args: - - **for_user_id (str) (XenPlatforms only) - - **x_api_version (str): API Version that will be used. If not provided will default to the latest - - Returns: - List of VirtualAccountBank - - Raises: - XenditError - - """ - url = "/available_virtual_account_banks" - headers, _ = _extract_params( - locals(), - func_object=VirtualAccount.get_banks, - headers_params=["for_user_id", "x_api_version"], - ignore_params=["id"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - virtual_account_banks = [] - for bank in resp.body: - virtual_account_banks.append(VirtualAccountBank(**bank)) - return virtual_account_banks - else: - raise XenditError(resp) - - @staticmethod - def get(*, id, for_user_id=None, x_api_version=None, **kwargs): - """Get the detail of Virtual Account (API Reference: Virtual Account/Get Virtual Account - - Args: - - id (str) - - **for_user_id (str) (XenPlatforms only) - - **x_api_version (str): API Version that will be used. If not provided will default to the latest - - Returns: - VirtualAccount - - Raises: - XenditError - """ - url = f"/callback_virtual_accounts/{id}" - headers, _ = _extract_params( - locals(), - func_object=VirtualAccount.get, - headers_params=["for_user_id", "x_api_version"], - ignore_params=["id"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return VirtualAccount(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def update( - *, - id, - suggested_amount=None, - expected_amount=None, - expiration_date=None, - is_single_use=None, - description=None, - for_user_id=None, - x_idempotency_key=None, - x_api_version=None, - **kwargs, - ): - """Update Virtual Account detail (API Reference: Virtual Account/Update Virtual Account - - Args: - - id (str) - - **suggested_amount (int) - - **expected_amount (int) - - **expiration_date (str) (ISO 8601 Date) - - **is_single_use (bool) - - **description (str) - - **for_user_id (str) (XenPlatforms only) - - **x_idempotency_key (str) - - **x_api_version (str): API Version that will be used. If not provided will default to the latest - - Returns: - VirtualAccount - - Raises: - XenditError - """ - url = f"/callback_virtual_accounts/{id}" - headers, body = _extract_params( - locals(), - func_object=VirtualAccount.update, - headers_params=["x_idempotency_key", "for_user_id", "x_api_version"], - ignore_params=["id"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.patch(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return VirtualAccount(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def get_payment(*, payment_id, for_user_id=None, x_api_version=None, **kwargs): - """Get payment from virtual account (API Reference: Virtual Account/Get Virtual Account Payment - - Args: - - payment_id (str) - - Returns: - VirtualAccountPayment - - Raises: - XenditError - """ - url = f"/callback_virtual_account_payments/payment_id={payment_id}" - headers, _ = _extract_params( - locals(), - func_object=VirtualAccount.get_payment, - headers_params=["for_user_id", "x_api_version"], - ignore_params=["payment_id"], - ) - kwargs["headers"] = headers - - resp = _APIRequestor.get(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return VirtualAccountPayment(**resp.body) - else: - raise XenditError(resp) diff --git a/xendit/models/virtualaccount/virtual_account_payment.py b/xendit/models/virtualaccount/virtual_account_payment.py deleted file mode 100644 index 89aad94d..00000000 --- a/xendit/models/virtualaccount/virtual_account_payment.py +++ /dev/null @@ -1,33 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class VirtualAccountPayment(BaseModel): - """Payment class for Virtual Account (API Reference: Virtual Account) - - Attributes: - - id (str) - - payment_id (str) - - callback_virtual_account_id (str) - - external_id (str) - - merchant_code (str) - - account_number (str) - - bank_code (str) - - amount (int) - - transaction_timestamp (str) - - Optional Attributes: - - sender_name (str) - """ - - id: str - payment_id: str - callback_virtual_account_id: str - external_id: str - merchant_code: str - account_number: str - bank_code: str - amount: int - transaction_timestamp: str - - # Optional - sender_name: str diff --git a/xendit/models/virtualaccount/virtual_acount_bank.py b/xendit/models/virtualaccount/virtual_acount_bank.py deleted file mode 100644 index 3efaec72..00000000 --- a/xendit/models/virtualaccount/virtual_acount_bank.py +++ /dev/null @@ -1,13 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class VirtualAccountBank(BaseModel): - """Bank class for Virtual Account (API Reference: Virtual Account) - - Attributes: - - name (str) - - code (str) - """ - - name: str - code: str diff --git a/xendit/models/xenplatform/__init__.py b/xendit/models/xenplatform/__init__.py deleted file mode 100644 index cc8634ec..00000000 --- a/xendit/models/xenplatform/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .xenplatform import XenPlatform -from .xenplatform_account_type import XenPlatformAccountType -from .xenplatform_url_type import XenPlatformURLType diff --git a/xendit/models/xenplatform/response/__init__.py b/xendit/models/xenplatform/response/__init__.py deleted file mode 100644 index fa362b17..00000000 --- a/xendit/models/xenplatform/response/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .xenplatform_account import XenPlatformAccount -from .xenplatform_callback_url import XenPlatformCallbackURL -from .xenplatform_transfers import XenPlatformTransfers diff --git a/xendit/models/xenplatform/response/xenplatform_account.py b/xendit/models/xenplatform/response/xenplatform_account.py deleted file mode 100644 index 725442d5..00000000 --- a/xendit/models/xenplatform/response/xenplatform_account.py +++ /dev/null @@ -1,19 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class XenPlatformAccount(BaseModel): - """Account response object for xenPlatform (API Reference: xenPlatform) - - Attributes: - - created (str) - - status (str) - - account_email (str) - - user_id (str) - - type (str) - """ - - created: str - status: str - account_email: str - user_id: str - type: str diff --git a/xendit/models/xenplatform/response/xenplatform_callback_url.py b/xendit/models/xenplatform/response/xenplatform_callback_url.py deleted file mode 100644 index 0e0c4c4d..00000000 --- a/xendit/models/xenplatform/response/xenplatform_callback_url.py +++ /dev/null @@ -1,19 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class XenPlatformCallbackURL(BaseModel): - """Callback URL response object for xenPlatform (API Reference: xenPlatform) - - Attributes: - - status (str) - - user_id (str) - - url (str) - - environment (str) - - callback_token (str) - """ - - status: str - user_id: str - url: str - environment: str - callback_token: str diff --git a/xendit/models/xenplatform/response/xenplatform_transfers.py b/xendit/models/xenplatform/response/xenplatform_transfers.py deleted file mode 100644 index 9a31ec52..00000000 --- a/xendit/models/xenplatform/response/xenplatform_transfers.py +++ /dev/null @@ -1,23 +0,0 @@ -from xendit.models._base_model import BaseModel - - -class XenPlatformTransfers(BaseModel): - """Transfers response object for xenPlatform (API Reference: xenPlatform) - - Attributes: - - created (str) - - transfer_id (str) - - reference (str) - - source_user_id (str) - - destination_user_id (str) - - status (str) - - amount (str) - """ - - created: str - transfer_id: str - reference: str - source_user_id: str - destination_user_id: str - status: str - amount: str diff --git a/xendit/models/xenplatform/xenplatform.py b/xendit/models/xenplatform/xenplatform.py deleted file mode 100644 index 98c55eaf..00000000 --- a/xendit/models/xenplatform/xenplatform.py +++ /dev/null @@ -1,173 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.xendit_error import XenditError -from xendit._api_requestor import _APIRequestor -from xendit._extract_params import _extract_params - -from .response import XenPlatformAccount, XenPlatformCallbackURL, XenPlatformTransfers -from .xenplatform_business_profile import XenPlatformBusinessProfile - - -class XenPlatform(BaseModel): - """XenPlatform class (API Reference: xenPlatform) - - Static Methods: - - XenPlatform.create_account (API Reference: /Create Account) - - XenPlatform.set_callback_url (API Reference: /Set Callback URLs) - - XenPlatform.transfers (API Reference: /Transfers) - - Static Methods for Object Creation: - - XenPlatform.helper_create_business_profile (For BusinessProfile in create_account) - """ - - def helper_create_business_profile( - *, business_name, **kwargs, - ): - """Construct xenPlatform business profile - - Args: - - business_name (str) - - Return: - - XenPlatformBusinessProfile - """ - params = locals() - del params["kwargs"] - - return XenPlatformBusinessProfile.Query(**params) - - @staticmethod - def create_account( - *, - account_email, - type, - business_profile=None, - x_idempotency_key=None, - x_api_version=None, - **kwargs, - ): - """Create a subaccount (API Reference: xenPlatform/Create Account) - - Args: - - account_email (str) - - type (XenPlatformAccountType) - - **business_profile (XenPlatformBusinessType) (Required if type == OWNED) - - **x_idempotency_key (str) - - **x_api_version (str) - - Returns - XenPlatformAccount - - Raises - XenditError - - """ - type = XenPlatform._parse_type(type) - url = "/accounts" - headers, body = _extract_params( - locals(), - func_object=XenPlatform.create_account, - headers_params=["x_idempotency_key", "x_api_version"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return XenPlatformAccount(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def set_callback_url( - *, - type, - url, - x_idempotency_key=None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Set a callback URL (API Reference: xenPlatform/Set Callback URLs) - - Args: - - type (XenPlatformURLType) - - url (str) - - **x_idempotency_key (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns - XenPlatformCallbackURL - - Raises - XenditError - - """ - type = XenPlatform._parse_type(type) - headers, body = _extract_params( - locals(), - func_object=XenPlatform.set_callback_url, - headers_params=["x_idempotency_key", "for_user_id", "x_api_version"], - ignore_params=["type"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - url = f"/callback_urls/{type}" - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return XenPlatformCallbackURL(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def transfers( - *, - reference, - amount, - source_user_id, - destination_user_id, - x_idempotency_key=None, - for_user_id=None, - x_api_version=None, - **kwargs, - ): - """Transfers balance from sub-account to main account and vice versa (API Reference: xenPlatform/Transfers) - - Args: - - reference (str) - - amount (int) - - source_user_id (str) - - destination_user_id (str) - - **x_idempotency_key (str) - - **for_user_id (str) - - **x_api_version (str) - - Returns - XenPlatformTransfers - - Raises - XenditError - - """ - url = "/transfers" - headers, body = _extract_params( - locals(), - func_object=XenPlatform.transfers, - headers_params=["x_idempotency_key", "for_user_id", "x_api_version"], - ) - kwargs["headers"] = headers - kwargs["body"] = body - - resp = _APIRequestor.post(url, **kwargs) - if resp.status_code >= 200 and resp.status_code < 300: - return XenPlatformTransfers(**resp.body) - else: - raise XenditError(resp) - - @staticmethod - def _parse_type(enum_type): - try: - return enum_type.value - except AttributeError: - return enum_type diff --git a/xendit/models/xenplatform/xenplatform_account_type.py b/xendit/models/xenplatform/xenplatform_account_type.py deleted file mode 100644 index 8c5f8526..00000000 --- a/xendit/models/xenplatform/xenplatform_account_type.py +++ /dev/null @@ -1,8 +0,0 @@ -from enum import Enum - - -class XenPlatformAccountType(Enum): - """Account type for xenPlatform""" - - MANAGED = "MANAGED" - OWNED = "OWNED" diff --git a/xendit/models/xenplatform/xenplatform_business_profile.py b/xendit/models/xenplatform/xenplatform_business_profile.py deleted file mode 100644 index fa8b2382..00000000 --- a/xendit/models/xenplatform/xenplatform_business_profile.py +++ /dev/null @@ -1,18 +0,0 @@ -from xendit.models._base_model import BaseModel -from xendit.models._base_query import BaseQuery - - -class XenPlatformBusinessProfile(BaseModel): - """Business profile for xenPlatform (API Reference: xenPlatform)""" - - class Query(BaseQuery): - """Business profile for xenPlatform (API Reference: xenPlatform) - - Use this to initialize create_batch - - Attributes: - - business_name (str) - - """ - - business_name: str diff --git a/xendit/models/xenplatform/xenplatform_url_type.py b/xendit/models/xenplatform/xenplatform_url_type.py deleted file mode 100644 index 09b4bd0a..00000000 --- a/xendit/models/xenplatform/xenplatform_url_type.py +++ /dev/null @@ -1,13 +0,0 @@ -from enum import Enum - - -class XenPlatformURLType(Enum): - """Callback URL Type for xenPlatform""" - - INVOICE = "invoice" - FVA_STATUS = "fva_status" - FVA_PAID = "fva_paid" - RO_FPC_PAID = "ro_fpc_paid" - OVO_PAID = "ovo_paid" - DISBURSEMENT = "disbursement" - BATCH_DISBURSEMENT = "batch_disbursement" diff --git a/xendit/network/__init__.py b/xendit/network/__init__.py deleted file mode 100644 index f4761d9a..00000000 --- a/xendit/network/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .xendit_response import XenditResponse - -from .http_client_interface import HTTPClientInterface diff --git a/xendit/network/http_client_interface.py b/xendit/network/http_client_interface.py deleted file mode 100644 index 273e147d..00000000 --- a/xendit/network/http_client_interface.py +++ /dev/null @@ -1,20 +0,0 @@ -import abc -import requests - - -class HTTPClientInterface(metaclass=abc.ABCMeta): - """Interface for HTTP Client. Inject it to your xendit instance to use it.""" - - @staticmethod - def request(method, url, **kwargs) -> requests.Response: - """ - Args: - - method (str): HTTP Method that will be sent. For Xendit we will mainly use "GET", "POST", "PATCH" - - url (str): URL for the request - - **headers (dict): HTTP Headers to send with the request - - **json (dict): Body that will be send with the request - - Returns: - requests.Response - """ - raise NotImplementedError diff --git a/xendit/network/xendit_response.py b/xendit/network/xendit_response.py deleted file mode 100644 index 50ce333d..00000000 --- a/xendit/network/xendit_response.py +++ /dev/null @@ -1,7 +0,0 @@ -class XenditResponse: - """Response that will be returned by the API Server.""" - - def __init__(self, status_code, headers, body): - self.status_code = status_code - self.headers = headers - self.body = body diff --git a/xendit/payment_method/__init__.py b/xendit/payment_method/__init__.py new file mode 100644 index 00000000..2f4bdb4e --- /dev/null +++ b/xendit/payment_method/__init__.py @@ -0,0 +1 @@ +from xendit.payment_method.payment_method_api import PaymentMethodApi diff --git a/xendit/payment_method/model/__init__.py b/xendit/payment_method/model/__init__.py new file mode 100644 index 00000000..28c359fc --- /dev/null +++ b/xendit/payment_method/model/__init__.py @@ -0,0 +1,77 @@ +# flake8: noqa + +# import all models into this package +# if you have many models here with many references from one model to another this may +# raise a RecursionError +# to avoid this, import only the models that you directly need like: +# from xendit.payment_method.model.pet import Pet +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + +from xendit.payment_method.model.billing_information import BillingInformation +from xendit.payment_method.model.card import Card +from xendit.payment_method.model.card_channel_properties import CardChannelProperties +from xendit.payment_method.model.card_parameters import CardParameters +from xendit.payment_method.model.card_parameters_card_information import CardParametersCardInformation +from xendit.payment_method.model.card_verification_results import CardVerificationResults +from xendit.payment_method.model.card_verification_results_three_d_secure import CardVerificationResultsThreeDSecure +from xendit.payment_method.model.channel_amount_limits import ChannelAmountLimits +from xendit.payment_method.model.channel_amount_limits_all_of import ChannelAmountLimitsAllOf +from xendit.payment_method.model.channel_property import ChannelProperty +from xendit.payment_method.model.channel_property_all_of import ChannelPropertyAllOf +from xendit.payment_method.model.create_payment_method409_response import CreatePaymentMethod409Response +from xendit.payment_method.model.create_payment_method503_response import CreatePaymentMethod503Response +from xendit.payment_method.model.direct_debit import DirectDebit +from xendit.payment_method.model.direct_debit_all_of import DirectDebitAllOf +from xendit.payment_method.model.direct_debit_bank_account import DirectDebitBankAccount +from xendit.payment_method.model.direct_debit_channel_code import DirectDebitChannelCode +from xendit.payment_method.model.direct_debit_channel_properties import DirectDebitChannelProperties +from xendit.payment_method.model.direct_debit_debit_card import DirectDebitDebitCard +from xendit.payment_method.model.direct_debit_parameters import DirectDebitParameters +from xendit.payment_method.model.direct_debit_type import DirectDebitType +from xendit.payment_method.model.e_wallet import EWallet +from xendit.payment_method.model.e_wallet_account import EWalletAccount +from xendit.payment_method.model.e_wallet_channel_code import EWalletChannelCode +from xendit.payment_method.model.e_wallet_channel_properties import EWalletChannelProperties +from xendit.payment_method.model.e_wallet_parameters import EWalletParameters +from xendit.payment_method.model.get_all_payment_methods400_response import GetAllPaymentMethods400Response +from xendit.payment_method.model.get_all_payment_methods403_response import GetAllPaymentMethods403Response +from xendit.payment_method.model.get_all_payment_methods404_response import GetAllPaymentMethods404Response +from xendit.payment_method.model.get_all_payment_methods_default_response import GetAllPaymentMethodsDefaultResponse +from xendit.payment_method.model.over_the_counter import OverTheCounter +from xendit.payment_method.model.over_the_counter_channel_code import OverTheCounterChannelCode +from xendit.payment_method.model.over_the_counter_channel_properties import OverTheCounterChannelProperties +from xendit.payment_method.model.over_the_counter_channel_properties_update import OverTheCounterChannelPropertiesUpdate +from xendit.payment_method.model.over_the_counter_parameters import OverTheCounterParameters +from xendit.payment_method.model.over_the_counter_update_parameters import OverTheCounterUpdateParameters +from xendit.payment_method.model.payment_channel import PaymentChannel +from xendit.payment_method.model.payment_channel_all_of import PaymentChannelAllOf +from xendit.payment_method.model.payment_channel_list import PaymentChannelList +from xendit.payment_method.model.payment_channel_list_links_inner import PaymentChannelListLinksInner +from xendit.payment_method.model.payment_channel_list_links_inner_all_of import PaymentChannelListLinksInnerAllOf +from xendit.payment_method.model.payment_method import PaymentMethod +from xendit.payment_method.model.payment_method_action import PaymentMethodAction +from xendit.payment_method.model.payment_method_auth_parameters import PaymentMethodAuthParameters +from xendit.payment_method.model.payment_method_country import PaymentMethodCountry +from xendit.payment_method.model.payment_method_expire_parameters import PaymentMethodExpireParameters +from xendit.payment_method.model.payment_method_list import PaymentMethodList +from xendit.payment_method.model.payment_method_parameters import PaymentMethodParameters +from xendit.payment_method.model.payment_method_reusability import PaymentMethodReusability +from xendit.payment_method.model.payment_method_status import PaymentMethodStatus +from xendit.payment_method.model.payment_method_type import PaymentMethodType +from xendit.payment_method.model.payment_method_update_parameters import PaymentMethodUpdateParameters +from xendit.payment_method.model.qr_code import QRCode +from xendit.payment_method.model.qr_code_channel_code import QRCodeChannelCode +from xendit.payment_method.model.qr_code_channel_properties import QRCodeChannelProperties +from xendit.payment_method.model.qr_code_parameters import QRCodeParameters +from xendit.payment_method.model.simulate_payment_request import SimulatePaymentRequest +from xendit.payment_method.model.tokenized_card_information import TokenizedCardInformation +from xendit.payment_method.model.virtual_account import VirtualAccount +from xendit.payment_method.model.virtual_account_all_of import VirtualAccountAllOf +from xendit.payment_method.model.virtual_account_alternative_display import VirtualAccountAlternativeDisplay +from xendit.payment_method.model.virtual_account_channel_code import VirtualAccountChannelCode +from xendit.payment_method.model.virtual_account_channel_properties import VirtualAccountChannelProperties +from xendit.payment_method.model.virtual_account_channel_properties_patch import VirtualAccountChannelPropertiesPatch +from xendit.payment_method.model.virtual_account_parameters import VirtualAccountParameters +from xendit.payment_method.model.virtual_account_update_parameters import VirtualAccountUpdateParameters diff --git a/xendit/payment_method/model/billing_information.py b/xendit/payment_method/model/billing_information.py new file mode 100644 index 00000000..1869ba39 --- /dev/null +++ b/xendit/payment_method/model/billing_information.py @@ -0,0 +1,306 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class BillingInformation(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('country',): { + 'max_length': 2, + }, + ('street_line1',): { + 'max_length': 255, + }, + ('street_line2',): { + 'max_length': 255, + }, + ('city',): { + 'max_length': 255, + }, + ('province_state',): { + 'max_length': 255, + }, + ('postal_code',): { + 'max_length': 255, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'country': (str,), # noqa: E501 + 'street_line1': (str, none_type,), # noqa: E501 + 'street_line2': (str, none_type,), # noqa: E501 + 'city': (str, none_type,), # noqa: E501 + 'province_state': (str, none_type,), # noqa: E501 + 'postal_code': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'country': 'country', # noqa: E501 + 'street_line1': 'street_line1', # noqa: E501 + 'street_line2': 'street_line2', # noqa: E501 + 'city': 'city', # noqa: E501 + 'province_state': 'province_state', # noqa: E501 + 'postal_code': 'postal_code', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, country, *args, **kwargs): # noqa: E501 + """BillingInformation - a model defined in OpenAPI + + Args: + country (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + street_line1 (str, none_type): [optional] # noqa: E501 + street_line2 (str, none_type): [optional] # noqa: E501 + city (str, none_type): [optional] # noqa: E501 + province_state (str, none_type): [optional] # noqa: E501 + postal_code (str, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.country = country + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, country, *args, **kwargs): # noqa: E501 + """BillingInformation - a model defined in OpenAPI + + Args: + country (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + street_line1 (str, none_type): [optional] # noqa: E501 + street_line2 (str, none_type): [optional] # noqa: E501 + city (str, none_type): [optional] # noqa: E501 + province_state (str, none_type): [optional] # noqa: E501 + postal_code (str, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.country = country + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/card.py b/xendit/payment_method/model/card.py new file mode 100644 index 00000000..5b0b47b0 --- /dev/null +++ b/xendit/payment_method/model/card.py @@ -0,0 +1,292 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.card_channel_properties import CardChannelProperties + from xendit.payment_method.model.card_verification_results import CardVerificationResults + from xendit.payment_method.model.tokenized_card_information import TokenizedCardInformation + globals()['CardChannelProperties'] = CardChannelProperties + globals()['CardVerificationResults'] = CardVerificationResults + globals()['TokenizedCardInformation'] = TokenizedCardInformation + + +class Card(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'currency': (str, none_type,), # noqa: E501 + 'channel_properties': (CardChannelProperties,), # noqa: E501 + 'card_information': (TokenizedCardInformation,), # noqa: E501 + 'card_verification_results': (CardVerificationResults,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'currency': 'currency', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'card_information': 'card_information', # noqa: E501 + 'card_verification_results': 'card_verification_results', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, currency, channel_properties, *args, **kwargs): # noqa: E501 + """Card - a model defined in OpenAPI + + Args: + currency (str, none_type): + channel_properties (CardChannelProperties): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + card_information (TokenizedCardInformation): [optional] # noqa: E501 + card_verification_results (CardVerificationResults): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.currency = currency + self.channel_properties = channel_properties + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, currency, channel_properties, *args, **kwargs): # noqa: E501 + """Card - a model defined in OpenAPI + + Args: + currency (str, none_type): + channel_properties (CardChannelProperties): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + card_information (TokenizedCardInformation): [optional] # noqa: E501 + card_verification_results (CardVerificationResults): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.currency = currency + self.channel_properties = channel_properties + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/card_channel_properties.py b/xendit/payment_method/model/card_channel_properties.py new file mode 100644 index 00000000..e33654d5 --- /dev/null +++ b/xendit/payment_method/model/card_channel_properties.py @@ -0,0 +1,290 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class CardChannelProperties(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('cardonfile_type',): { + 'None': None, + 'MERCHANT_UNSCHEDULED': "MERCHANT_UNSCHEDULED", + 'CUSTOMER_UNSCHEDULED': "CUSTOMER_UNSCHEDULED", + 'RECURRING': "RECURRING", + }, + } + + validations = { + ('success_return_url',): { + 'regex': { + 'pattern': r'^\S{1,255}:\/\/\S{0,1000}$', # noqa: E501 + }, + }, + ('failure_return_url',): { + 'regex': { + 'pattern': r'^\S{1,255}:\/\/\S{0,1000}$', # noqa: E501 + }, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'skip_three_d_secure': (bool, none_type,), # noqa: E501 + 'success_return_url': (str, none_type,), # noqa: E501 + 'failure_return_url': (str, none_type,), # noqa: E501 + 'cardonfile_type': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'skip_three_d_secure': 'skip_three_d_secure', # noqa: E501 + 'success_return_url': 'success_return_url', # noqa: E501 + 'failure_return_url': 'failure_return_url', # noqa: E501 + 'cardonfile_type': 'cardonfile_type', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """CardChannelProperties - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + skip_three_d_secure (bool, none_type): This field value is only being used for reusability = MULTIPLE_USE. To indicate whether to perform 3DS during the linking phase. Defaults to false.. [optional] # noqa: E501 + success_return_url (str, none_type): URL where the end-customer is redirected if the authorization is successful. [optional] # noqa: E501 + failure_return_url (str, none_type): URL where the end-customer is redirected if the authorization failed. [optional] # noqa: E501 + cardonfile_type (str, none_type): Type of “credential-on-file” / “card-on-file” payment being made. Indicate that this payment uses a previously linked Payment Method for charging.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """CardChannelProperties - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + skip_three_d_secure (bool, none_type): This field value is only being used for reusability = MULTIPLE_USE. To indicate whether to perform 3DS during the linking phase. Defaults to false.. [optional] # noqa: E501 + success_return_url (str, none_type): URL where the end-customer is redirected if the authorization is successful. [optional] # noqa: E501 + failure_return_url (str, none_type): URL where the end-customer is redirected if the authorization failed. [optional] # noqa: E501 + cardonfile_type (str, none_type): Type of “credential-on-file” / “card-on-file” payment being made. Indicate that this payment uses a previously linked Payment Method for charging.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/card_parameters.py b/xendit/payment_method/model/card_parameters.py new file mode 100644 index 00000000..fc16aef5 --- /dev/null +++ b/xendit/payment_method/model/card_parameters.py @@ -0,0 +1,284 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.card_channel_properties import CardChannelProperties + from xendit.payment_method.model.card_parameters_card_information import CardParametersCardInformation + globals()['CardChannelProperties'] = CardChannelProperties + globals()['CardParametersCardInformation'] = CardParametersCardInformation + + +class CardParameters(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'currency': (str,), # noqa: E501 + 'channel_properties': (CardChannelProperties,), # noqa: E501 + 'card_information': (CardParametersCardInformation,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'currency': 'currency', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'card_information': 'card_information', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, currency, *args, **kwargs): # noqa: E501 + """CardParameters - a model defined in OpenAPI + + Args: + currency (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + channel_properties (CardChannelProperties): [optional] # noqa: E501 + card_information (CardParametersCardInformation): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.currency = currency + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, currency, *args, **kwargs): # noqa: E501 + """CardParameters - a model defined in OpenAPI + + Args: + currency (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + channel_properties (CardChannelProperties): [optional] # noqa: E501 + card_information (CardParametersCardInformation): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.currency = currency + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/card_parameters_card_information.py b/xendit/payment_method/model/card_parameters_card_information.py new file mode 100644 index 00000000..83181dd5 --- /dev/null +++ b/xendit/payment_method/model/card_parameters_card_information.py @@ -0,0 +1,288 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class CardParametersCardInformation(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'card_number': (str,), # noqa: E501 + 'expiry_month': (str,), # noqa: E501 + 'expiry_year': (str,), # noqa: E501 + 'cardholder_name': (str, none_type,), # noqa: E501 + 'cvv': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'card_number': 'card_number', # noqa: E501 + 'expiry_month': 'expiry_month', # noqa: E501 + 'expiry_year': 'expiry_year', # noqa: E501 + 'cardholder_name': 'cardholder_name', # noqa: E501 + 'cvv': 'cvv', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, card_number, expiry_month, expiry_year, *args, **kwargs): # noqa: E501 + """CardParametersCardInformation - a model defined in OpenAPI + + Args: + card_number (str): + expiry_month (str): Card expiry month in MM format + expiry_year (str): Card expiry month in YY format + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cardholder_name (str, none_type): Cardholder name. [optional] # noqa: E501 + cvv (str, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.card_number = card_number + self.expiry_month = expiry_month + self.expiry_year = expiry_year + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, card_number, expiry_month, expiry_year, *args, **kwargs): # noqa: E501 + """CardParametersCardInformation - a model defined in OpenAPI + + Args: + card_number (str): + expiry_month (str): Card expiry month in MM format + expiry_year (str): Card expiry month in YY format + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cardholder_name (str, none_type): Cardholder name. [optional] # noqa: E501 + cvv (str, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.card_number = card_number + self.expiry_month = expiry_month + self.expiry_year = expiry_year + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/card_verification_results.py b/xendit/payment_method/model/card_verification_results.py new file mode 100644 index 00000000..86da593a --- /dev/null +++ b/xendit/payment_method/model/card_verification_results.py @@ -0,0 +1,282 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.card_verification_results_three_d_secure import CardVerificationResultsThreeDSecure + globals()['CardVerificationResultsThreeDSecure'] = CardVerificationResultsThreeDSecure + + +class CardVerificationResults(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'three_d_secure': (CardVerificationResultsThreeDSecure,), # noqa: E501 + 'cvv_result': (str, none_type,), # noqa: E501 + 'address_verification_result': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'three_d_secure': 'three_d_secure', # noqa: E501 + 'cvv_result': 'cvv_result', # noqa: E501 + 'address_verification_result': 'address_verification_result', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, three_d_secure, *args, **kwargs): # noqa: E501 + """CardVerificationResults - a model defined in OpenAPI + + Args: + three_d_secure (CardVerificationResultsThreeDSecure): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cvv_result (str, none_type): [optional] # noqa: E501 + address_verification_result (str, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.three_d_secure = three_d_secure + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, three_d_secure, *args, **kwargs): # noqa: E501 + """CardVerificationResults - a model defined in OpenAPI + + Args: + three_d_secure (CardVerificationResultsThreeDSecure): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cvv_result (str, none_type): [optional] # noqa: E501 + address_verification_result (str, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.three_d_secure = three_d_secure + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/card_verification_results_three_d_secure.py b/xendit/payment_method/model/card_verification_results_three_d_secure.py new file mode 100644 index 00000000..562095b6 --- /dev/null +++ b/xendit/payment_method/model/card_verification_results_three_d_secure.py @@ -0,0 +1,283 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class CardVerificationResultsThreeDSecure(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('three_d_secure_flow',): { + 'None': None, + 'CHALLENGE': "CHALLENGE", + 'FRICTIONLESS': "FRICTIONLESS", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'three_d_secure_flow': (str, none_type,), # noqa: E501 + 'eci_code': (str, none_type,), # noqa: E501 + 'three_d_secure_result': (str, none_type,), # noqa: E501 + 'three_d_secure_result_reason': (str, none_type,), # noqa: E501 + 'three_d_secure_version': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'three_d_secure_flow': 'three_d_secure_flow', # noqa: E501 + 'eci_code': 'eci_code', # noqa: E501 + 'three_d_secure_result': 'three_d_secure_result', # noqa: E501 + 'three_d_secure_result_reason': 'three_d_secure_result_reason', # noqa: E501 + 'three_d_secure_version': 'three_d_secure_version', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """CardVerificationResultsThreeDSecure - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + three_d_secure_flow (str, none_type): [optional] # noqa: E501 + eci_code (str, none_type): [optional] # noqa: E501 + three_d_secure_result (str, none_type): [optional] # noqa: E501 + three_d_secure_result_reason (str, none_type): [optional] # noqa: E501 + three_d_secure_version (str, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """CardVerificationResultsThreeDSecure - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + three_d_secure_flow (str, none_type): [optional] # noqa: E501 + eci_code (str, none_type): [optional] # noqa: E501 + three_d_secure_result (str, none_type): [optional] # noqa: E501 + three_d_secure_result_reason (str, none_type): [optional] # noqa: E501 + three_d_secure_version (str, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/channel_amount_limits.py b/xendit/payment_method/model/channel_amount_limits.py new file mode 100644 index 00000000..f1f01883 --- /dev/null +++ b/xendit/payment_method/model/channel_amount_limits.py @@ -0,0 +1,326 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.channel_amount_limits_all_of import ChannelAmountLimitsAllOf + globals()['ChannelAmountLimitsAllOf'] = ChannelAmountLimitsAllOf + + +class ChannelAmountLimits(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'currency': (str,), # noqa: E501 + 'min_limit': (float,), # noqa: E501 + 'max_limit': (float,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'currency': 'currency', # noqa: E501 + 'min_limit': 'min_limit', # noqa: E501 + 'max_limit': 'max_limit', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ChannelAmountLimits - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + currency (str): Currency supported by the payment channel. [optional] # noqa: E501 + min_limit (float): The minimum allowed transaction amount for the payment channel. [optional] # noqa: E501 + max_limit (float): The minimum allowed transaction amount for the payment channel. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ChannelAmountLimits - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + currency (str): Currency supported by the payment channel. [optional] # noqa: E501 + min_limit (float): The minimum allowed transaction amount for the payment channel. [optional] # noqa: E501 + max_limit (float): The minimum allowed transaction amount for the payment channel. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + ChannelAmountLimitsAllOf, + ], + 'oneOf': [ + ], + } diff --git a/xendit/payment_method/model/channel_amount_limits_all_of.py b/xendit/payment_method/model/channel_amount_limits_all_of.py new file mode 100644 index 00000000..3f0c49e6 --- /dev/null +++ b/xendit/payment_method/model/channel_amount_limits_all_of.py @@ -0,0 +1,270 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class ChannelAmountLimitsAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'currency': (str,), # noqa: E501 + 'min_limit': (float,), # noqa: E501 + 'max_limit': (float,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'currency': 'currency', # noqa: E501 + 'min_limit': 'min_limit', # noqa: E501 + 'max_limit': 'max_limit', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ChannelAmountLimitsAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + currency (str): Currency supported by the payment channel. [optional] # noqa: E501 + min_limit (float): The minimum allowed transaction amount for the payment channel. [optional] # noqa: E501 + max_limit (float): The minimum allowed transaction amount for the payment channel. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ChannelAmountLimitsAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + currency (str): Currency supported by the payment channel. [optional] # noqa: E501 + min_limit (float): The minimum allowed transaction amount for the payment channel. [optional] # noqa: E501 + max_limit (float): The minimum allowed transaction amount for the payment channel. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/channel_property.py b/xendit/payment_method/model/channel_property.py new file mode 100644 index 00000000..8b271a98 --- /dev/null +++ b/xendit/payment_method/model/channel_property.py @@ -0,0 +1,326 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.channel_property_all_of import ChannelPropertyAllOf + globals()['ChannelPropertyAllOf'] = ChannelPropertyAllOf + + +class ChannelProperty(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'name': (str,), # noqa: E501 + 'type': (str,), # noqa: E501 + 'is_required': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'type': 'type', # noqa: E501 + 'is_required': 'is_required', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ChannelProperty - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The corresponding parameter name. [optional] # noqa: E501 + type (str): Data type of the parameter. [optional] # noqa: E501 + is_required (bool): Indicates whether or not the parameter is required. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ChannelProperty - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The corresponding parameter name. [optional] # noqa: E501 + type (str): Data type of the parameter. [optional] # noqa: E501 + is_required (bool): Indicates whether or not the parameter is required. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + ChannelPropertyAllOf, + ], + 'oneOf': [ + ], + } diff --git a/xendit/payment_method/model/channel_property_all_of.py b/xendit/payment_method/model/channel_property_all_of.py new file mode 100644 index 00000000..ac8ce1cf --- /dev/null +++ b/xendit/payment_method/model/channel_property_all_of.py @@ -0,0 +1,270 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class ChannelPropertyAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + 'type': (str,), # noqa: E501 + 'is_required': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'type': 'type', # noqa: E501 + 'is_required': 'is_required', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ChannelPropertyAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The corresponding parameter name. [optional] # noqa: E501 + type (str): Data type of the parameter. [optional] # noqa: E501 + is_required (bool): Indicates whether or not the parameter is required. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ChannelPropertyAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The corresponding parameter name. [optional] # noqa: E501 + type (str): Data type of the parameter. [optional] # noqa: E501 + is_required (bool): Indicates whether or not the parameter is required. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/create_payment_method409_response.py b/xendit/payment_method/model/create_payment_method409_response.py new file mode 100644 index 00000000..5befb0cd --- /dev/null +++ b/xendit/payment_method/model/create_payment_method409_response.py @@ -0,0 +1,272 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class CreatePaymentMethod409Response(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('error_code',): { + 'PAYMENT_METHOD_ALREADY_ACTIVE': "PAYMENT_METHOD_ALREADY_ACTIVE", + 'PAYMENT_METHOD_ALREADY_FAILED': "PAYMENT_METHOD_ALREADY_FAILED", + 'DUPLICATE_ERROR': "DUPLICATE_ERROR", + 'IDEMPOTENCY_ERROR': "IDEMPOTENCY_ERROR", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'error_code': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'error_code': 'error_code', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """CreatePaymentMethod409Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """CreatePaymentMethod409Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/create_payment_method503_response.py b/xendit/payment_method/model/create_payment_method503_response.py new file mode 100644 index 00000000..2ad3f17b --- /dev/null +++ b/xendit/payment_method/model/create_payment_method503_response.py @@ -0,0 +1,270 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class CreatePaymentMethod503Response(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('error_code',): { + 'CHANNEL_UNAVAILABLE': "CHANNEL_UNAVAILABLE", + 'OTP_DELIVERY_ERROR': "OTP_DELIVERY_ERROR", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'error_code': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'error_code': 'error_code', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """CreatePaymentMethod503Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """CreatePaymentMethod503Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/direct_debit.py b/xendit/payment_method/model/direct_debit.py new file mode 100644 index 00000000..71fcdb6c --- /dev/null +++ b/xendit/payment_method/model/direct_debit.py @@ -0,0 +1,347 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.direct_debit_all_of import DirectDebitAllOf + from xendit.payment_method.model.direct_debit_bank_account import DirectDebitBankAccount + from xendit.payment_method.model.direct_debit_channel_code import DirectDebitChannelCode + from xendit.payment_method.model.direct_debit_channel_properties import DirectDebitChannelProperties + from xendit.payment_method.model.direct_debit_debit_card import DirectDebitDebitCard + from xendit.payment_method.model.direct_debit_parameters import DirectDebitParameters + from xendit.payment_method.model.direct_debit_type import DirectDebitType + globals()['DirectDebitAllOf'] = DirectDebitAllOf + globals()['DirectDebitBankAccount'] = DirectDebitBankAccount + globals()['DirectDebitChannelCode'] = DirectDebitChannelCode + globals()['DirectDebitChannelProperties'] = DirectDebitChannelProperties + globals()['DirectDebitDebitCard'] = DirectDebitDebitCard + globals()['DirectDebitParameters'] = DirectDebitParameters + globals()['DirectDebitType'] = DirectDebitType + + +class DirectDebit(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'channel_code': (DirectDebitChannelCode,), # noqa: E501 + 'channel_properties': (DirectDebitChannelProperties,), # noqa: E501 + 'type': (DirectDebitType,), # noqa: E501 + 'bank_account': (DirectDebitBankAccount,), # noqa: E501 + 'debit_card': (DirectDebitDebitCard,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'type': 'type', # noqa: E501 + 'bank_account': 'bank_account', # noqa: E501 + 'debit_card': 'debit_card', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DirectDebit - a model defined in OpenAPI + + Keyword Args: + channel_code (DirectDebitChannelCode): + channel_properties (DirectDebitChannelProperties): + type (DirectDebitType): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + bank_account (DirectDebitBankAccount): [optional] # noqa: E501 + debit_card (DirectDebitDebitCard): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """DirectDebit - a model defined in OpenAPI + + Keyword Args: + channel_code (DirectDebitChannelCode): + channel_properties (DirectDebitChannelProperties): + type (DirectDebitType): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + bank_account (DirectDebitBankAccount): [optional] # noqa: E501 + debit_card (DirectDebitDebitCard): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + DirectDebitAllOf, + DirectDebitParameters, + ], + 'oneOf': [ + ], + } diff --git a/xendit/payment_method/model/direct_debit_all_of.py b/xendit/payment_method/model/direct_debit_all_of.py new file mode 100644 index 00000000..ba7fca89 --- /dev/null +++ b/xendit/payment_method/model/direct_debit_all_of.py @@ -0,0 +1,286 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.direct_debit_bank_account import DirectDebitBankAccount + from xendit.payment_method.model.direct_debit_debit_card import DirectDebitDebitCard + from xendit.payment_method.model.direct_debit_type import DirectDebitType + globals()['DirectDebitBankAccount'] = DirectDebitBankAccount + globals()['DirectDebitDebitCard'] = DirectDebitDebitCard + globals()['DirectDebitType'] = DirectDebitType + + +class DirectDebitAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'type': (DirectDebitType,), # noqa: E501 + 'bank_account': (DirectDebitBankAccount,), # noqa: E501 + 'debit_card': (DirectDebitDebitCard,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'type': 'type', # noqa: E501 + 'bank_account': 'bank_account', # noqa: E501 + 'debit_card': 'debit_card', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 + """DirectDebitAllOf - a model defined in OpenAPI + + Args: + type (DirectDebitType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + bank_account (DirectDebitBankAccount): [optional] # noqa: E501 + debit_card (DirectDebitDebitCard): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, type, *args, **kwargs): # noqa: E501 + """DirectDebitAllOf - a model defined in OpenAPI + + Args: + type (DirectDebitType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + bank_account (DirectDebitBankAccount): [optional] # noqa: E501 + debit_card (DirectDebitDebitCard): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/direct_debit_bank_account.py b/xendit/payment_method/model/direct_debit_bank_account.py new file mode 100644 index 00000000..40f0a735 --- /dev/null +++ b/xendit/payment_method/model/direct_debit_bank_account.py @@ -0,0 +1,274 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class DirectDebitBankAccount(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'masked_bank_account_number': (str, none_type,), # noqa: E501 + 'bank_account_hash': (str, none_type,), # noqa: E501 + 'mobile_number': (str, none_type,), # noqa: E501 + 'identity_document_number': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'masked_bank_account_number': 'masked_bank_account_number', # noqa: E501 + 'bank_account_hash': 'bank_account_hash', # noqa: E501 + 'mobile_number': 'mobile_number', # noqa: E501 + 'identity_document_number': 'identity_document_number', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DirectDebitBankAccount - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + masked_bank_account_number (str, none_type): [optional] # noqa: E501 + bank_account_hash (str, none_type): [optional] # noqa: E501 + mobile_number (str, none_type): Mobile number of the customer registered to the partner channel. [optional] # noqa: E501 + identity_document_number (str, none_type): Identity number of the customer registered to the partner channel. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """DirectDebitBankAccount - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + masked_bank_account_number (str, none_type): [optional] # noqa: E501 + bank_account_hash (str, none_type): [optional] # noqa: E501 + mobile_number (str, none_type): Mobile number of the customer registered to the partner channel. [optional] # noqa: E501 + identity_document_number (str, none_type): Identity number of the customer registered to the partner channel. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/direct_debit_channel_code.py b/xendit/payment_method/model/direct_debit_channel_code.py new file mode 100644 index 00000000..912b2ac9 --- /dev/null +++ b/xendit/payment_method/model/direct_debit_channel_code.py @@ -0,0 +1,350 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class DirectDebitChannelCode(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'BCA_KLIKPAY': "BCA_KLIKPAY", + 'BCA_ONEKLIK': "BCA_ONEKLIK", + 'BDO': "BDO", + 'BPI': "BPI", + 'BRI': "BRI", + 'BNI': "BNI", + 'CHINABANK': "CHINABANK", + 'CIMBNIAGA': "CIMBNIAGA", + 'MTB': "MTB", + 'RCBC': "RCBC", + 'UBP': "UBP", + 'MANDIRI': "MANDIRI", + 'BBL': "BBL", + 'SCB': "SCB", + 'KTB': "KTB", + 'BAY': "BAY", + 'KBANK_MB': "KBANK_MB", + 'BAY_MB': "BAY_MB", + 'KTB_MB': "KTB_MB", + 'BBL_MB': "BBL_MB", + 'SCB_MB': "SCB_MB", + 'BDO_EPAY': "BDO_EPAY", + 'AUTODEBIT_UBP': "AUTODEBIT_UBP", + 'AFFIN_FPX': "AFFIN_FPX", + 'AGRO_FPX': "AGRO_FPX", + 'ALLIANCE_FPX': "ALLIANCE_FPX", + 'AMBANK_FPX': "AMBANK_FPX", + 'ISLAM_FPX': "ISLAM_FPX", + 'MUAMALAT_FPX': "MUAMALAT_FPX", + 'BOC_FPX': "BOC_FPX", + 'RAKYAT_FPX': "RAKYAT_FPX", + 'BSN_FPX': "BSN_FPX", + 'CIMB_FPX': "CIMB_FPX", + 'HLB_FPX': "HLB_FPX", + 'HSBC_FPX': "HSBC_FPX", + 'KFH_FPX': "KFH_FPX", + 'MAYB2E_FPX': "MAYB2E_FPX", + 'MAYB2U_FPX': "MAYB2U_FPX", + 'OCBC_FPX': "OCBC_FPX", + 'PUBLIC_FPX': "PUBLIC_FPX", + 'RHB_FPX': "RHB_FPX", + 'SCH_FPX': "SCH_FPX", + 'UOB_FPX': "UOB_FPX", + 'AFFIN_FPX_BUSINESS': "AFFIN_FPX_BUSINESS", + 'AGRO_FPX_BUSINESS': "AGRO_FPX_BUSINESS", + 'ALLIANCE_FPX_BUSINESS': "ALLIANCE_FPX_BUSINESS", + 'AMBANK_FPX_BUSINESS': "AMBANK_FPX_BUSINESS", + 'ISLAM_FPX_BUSINESS': "ISLAM_FPX_BUSINESS", + 'MUAMALAT_FPX_BUSINESS': "MUAMALAT_FPX_BUSINESS", + 'BNP_FPX_BUSINESS': "BNP_FPX_BUSINESS", + 'CIMB_FPX_BUSINESS': "CIMB_FPX_BUSINESS", + 'CITIBANK_FPX_BUSINESS': "CITIBANK_FPX_BUSINESS", + 'DEUTSCHE_FPX_BUSINESS': "DEUTSCHE_FPX_BUSINESS", + 'HLB_FPX_BUSINESS': "HLB_FPX_BUSINESS", + 'HSBC_FPX_BUSINESS': "HSBC_FPX_BUSINESS", + 'RAKYAT_FPX_BUSINESS': "RAKYAT_FPX_BUSINESS", + 'KFH_FPX_BUSINESS': "KFH_FPX_BUSINESS", + 'MAYB2E_FPX_BUSINESS': "MAYB2E_FPX_BUSINESS", + 'OCBC_FPX_BUSINESS': "OCBC_FPX_BUSINESS", + 'PUBLIC_FPX_BUSINESS': "PUBLIC_FPX_BUSINESS", + 'RHB_FPX_BUSINESS': "RHB_FPX_BUSINESS", + 'SCH_FPX_BUSINESS': "SCH_FPX_BUSINESS", + 'UOB_FPX_BUSINESS': "UOB_FPX_BUSINESS", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """DirectDebitChannelCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Direct Debit Channel Code., must be one of ["BCA_KLIKPAY", "BCA_ONEKLIK", "BDO", "BPI", "BRI", "BNI", "CHINABANK", "CIMBNIAGA", "MTB", "RCBC", "UBP", "MANDIRI", "BBL", "SCB", "KTB", "BAY", "KBANK_MB", "BAY_MB", "KTB_MB", "BBL_MB", "SCB_MB", "BDO_EPAY", "AUTODEBIT_UBP", "AFFIN_FPX", "AGRO_FPX", "ALLIANCE_FPX", "AMBANK_FPX", "ISLAM_FPX", "MUAMALAT_FPX", "BOC_FPX", "RAKYAT_FPX", "BSN_FPX", "CIMB_FPX", "HLB_FPX", "HSBC_FPX", "KFH_FPX", "MAYB2E_FPX", "MAYB2U_FPX", "OCBC_FPX", "PUBLIC_FPX", "RHB_FPX", "SCH_FPX", "UOB_FPX", "AFFIN_FPX_BUSINESS", "AGRO_FPX_BUSINESS", "ALLIANCE_FPX_BUSINESS", "AMBANK_FPX_BUSINESS", "ISLAM_FPX_BUSINESS", "MUAMALAT_FPX_BUSINESS", "BNP_FPX_BUSINESS", "CIMB_FPX_BUSINESS", "CITIBANK_FPX_BUSINESS", "DEUTSCHE_FPX_BUSINESS", "HLB_FPX_BUSINESS", "HSBC_FPX_BUSINESS", "RAKYAT_FPX_BUSINESS", "KFH_FPX_BUSINESS", "MAYB2E_FPX_BUSINESS", "OCBC_FPX_BUSINESS", "PUBLIC_FPX_BUSINESS", "RHB_FPX_BUSINESS", "SCH_FPX_BUSINESS", "UOB_FPX_BUSINESS", ] # noqa: E501 + + Keyword Args: + value (str): Direct Debit Channel Code., must be one of ["BCA_KLIKPAY", "BCA_ONEKLIK", "BDO", "BPI", "BRI", "BNI", "CHINABANK", "CIMBNIAGA", "MTB", "RCBC", "UBP", "MANDIRI", "BBL", "SCB", "KTB", "BAY", "KBANK_MB", "BAY_MB", "KTB_MB", "BBL_MB", "SCB_MB", "BDO_EPAY", "AUTODEBIT_UBP", "AFFIN_FPX", "AGRO_FPX", "ALLIANCE_FPX", "AMBANK_FPX", "ISLAM_FPX", "MUAMALAT_FPX", "BOC_FPX", "RAKYAT_FPX", "BSN_FPX", "CIMB_FPX", "HLB_FPX", "HSBC_FPX", "KFH_FPX", "MAYB2E_FPX", "MAYB2U_FPX", "OCBC_FPX", "PUBLIC_FPX", "RHB_FPX", "SCH_FPX", "UOB_FPX", "AFFIN_FPX_BUSINESS", "AGRO_FPX_BUSINESS", "ALLIANCE_FPX_BUSINESS", "AMBANK_FPX_BUSINESS", "ISLAM_FPX_BUSINESS", "MUAMALAT_FPX_BUSINESS", "BNP_FPX_BUSINESS", "CIMB_FPX_BUSINESS", "CITIBANK_FPX_BUSINESS", "DEUTSCHE_FPX_BUSINESS", "HLB_FPX_BUSINESS", "HSBC_FPX_BUSINESS", "RAKYAT_FPX_BUSINESS", "KFH_FPX_BUSINESS", "MAYB2E_FPX_BUSINESS", "OCBC_FPX_BUSINESS", "PUBLIC_FPX_BUSINESS", "RHB_FPX_BUSINESS", "SCH_FPX_BUSINESS", "UOB_FPX_BUSINESS", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """DirectDebitChannelCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Direct Debit Channel Code., must be one of ["BCA_KLIKPAY", "BCA_ONEKLIK", "BDO", "BPI", "BRI", "BNI", "CHINABANK", "CIMBNIAGA", "MTB", "RCBC", "UBP", "MANDIRI", "BBL", "SCB", "KTB", "BAY", "KBANK_MB", "BAY_MB", "KTB_MB", "BBL_MB", "SCB_MB", "BDO_EPAY", "AUTODEBIT_UBP", "AFFIN_FPX", "AGRO_FPX", "ALLIANCE_FPX", "AMBANK_FPX", "ISLAM_FPX", "MUAMALAT_FPX", "BOC_FPX", "RAKYAT_FPX", "BSN_FPX", "CIMB_FPX", "HLB_FPX", "HSBC_FPX", "KFH_FPX", "MAYB2E_FPX", "MAYB2U_FPX", "OCBC_FPX", "PUBLIC_FPX", "RHB_FPX", "SCH_FPX", "UOB_FPX", "AFFIN_FPX_BUSINESS", "AGRO_FPX_BUSINESS", "ALLIANCE_FPX_BUSINESS", "AMBANK_FPX_BUSINESS", "ISLAM_FPX_BUSINESS", "MUAMALAT_FPX_BUSINESS", "BNP_FPX_BUSINESS", "CIMB_FPX_BUSINESS", "CITIBANK_FPX_BUSINESS", "DEUTSCHE_FPX_BUSINESS", "HLB_FPX_BUSINESS", "HSBC_FPX_BUSINESS", "RAKYAT_FPX_BUSINESS", "KFH_FPX_BUSINESS", "MAYB2E_FPX_BUSINESS", "OCBC_FPX_BUSINESS", "PUBLIC_FPX_BUSINESS", "RHB_FPX_BUSINESS", "SCH_FPX_BUSINESS", "UOB_FPX_BUSINESS", ] # noqa: E501 + + Keyword Args: + value (str): Direct Debit Channel Code., must be one of ["BCA_KLIKPAY", "BCA_ONEKLIK", "BDO", "BPI", "BRI", "BNI", "CHINABANK", "CIMBNIAGA", "MTB", "RCBC", "UBP", "MANDIRI", "BBL", "SCB", "KTB", "BAY", "KBANK_MB", "BAY_MB", "KTB_MB", "BBL_MB", "SCB_MB", "BDO_EPAY", "AUTODEBIT_UBP", "AFFIN_FPX", "AGRO_FPX", "ALLIANCE_FPX", "AMBANK_FPX", "ISLAM_FPX", "MUAMALAT_FPX", "BOC_FPX", "RAKYAT_FPX", "BSN_FPX", "CIMB_FPX", "HLB_FPX", "HSBC_FPX", "KFH_FPX", "MAYB2E_FPX", "MAYB2U_FPX", "OCBC_FPX", "PUBLIC_FPX", "RHB_FPX", "SCH_FPX", "UOB_FPX", "AFFIN_FPX_BUSINESS", "AGRO_FPX_BUSINESS", "ALLIANCE_FPX_BUSINESS", "AMBANK_FPX_BUSINESS", "ISLAM_FPX_BUSINESS", "MUAMALAT_FPX_BUSINESS", "BNP_FPX_BUSINESS", "CIMB_FPX_BUSINESS", "CITIBANK_FPX_BUSINESS", "DEUTSCHE_FPX_BUSINESS", "HLB_FPX_BUSINESS", "HSBC_FPX_BUSINESS", "RAKYAT_FPX_BUSINESS", "KFH_FPX_BUSINESS", "MAYB2E_FPX_BUSINESS", "OCBC_FPX_BUSINESS", "PUBLIC_FPX_BUSINESS", "RHB_FPX_BUSINESS", "SCH_FPX_BUSINESS", "UOB_FPX_BUSINESS", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_method/model/direct_debit_channel_properties.py b/xendit/payment_method/model/direct_debit_channel_properties.py new file mode 100644 index 00000000..7607f86a --- /dev/null +++ b/xendit/payment_method/model/direct_debit_channel_properties.py @@ -0,0 +1,290 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class DirectDebitChannelProperties(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'success_return_url': (str,), # noqa: E501 + 'failure_return_url': (str, none_type,), # noqa: E501 + 'mobile_number': (str, none_type,), # noqa: E501 + 'card_last_four': (str, none_type,), # noqa: E501 + 'card_expiry': (str, none_type,), # noqa: E501 + 'email': (str, none_type,), # noqa: E501 + 'identity_document_number': (str, none_type,), # noqa: E501 + 'require_auth': (bool, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'success_return_url': 'success_return_url', # noqa: E501 + 'failure_return_url': 'failure_return_url', # noqa: E501 + 'mobile_number': 'mobile_number', # noqa: E501 + 'card_last_four': 'card_last_four', # noqa: E501 + 'card_expiry': 'card_expiry', # noqa: E501 + 'email': 'email', # noqa: E501 + 'identity_document_number': 'identity_document_number', # noqa: E501 + 'require_auth': 'require_auth', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DirectDebitChannelProperties - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + success_return_url (str): [optional] # noqa: E501 + failure_return_url (str, none_type): [optional] # noqa: E501 + mobile_number (str, none_type): Mobile number of the customer registered to the partner channel. [optional] # noqa: E501 + card_last_four (str, none_type): Last four digits of the debit card. [optional] # noqa: E501 + card_expiry (str, none_type): Expiry month and year of the debit card (in MM/YY format). [optional] # noqa: E501 + email (str, none_type): Email address of the customer that is registered to the partner channel. [optional] # noqa: E501 + identity_document_number (str, none_type): Identity number of the customer registered to the partner channel. [optional] # noqa: E501 + require_auth (bool, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """DirectDebitChannelProperties - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + success_return_url (str): [optional] # noqa: E501 + failure_return_url (str, none_type): [optional] # noqa: E501 + mobile_number (str, none_type): Mobile number of the customer registered to the partner channel. [optional] # noqa: E501 + card_last_four (str, none_type): Last four digits of the debit card. [optional] # noqa: E501 + card_expiry (str, none_type): Expiry month and year of the debit card (in MM/YY format). [optional] # noqa: E501 + email (str, none_type): Email address of the customer that is registered to the partner channel. [optional] # noqa: E501 + identity_document_number (str, none_type): Identity number of the customer registered to the partner channel. [optional] # noqa: E501 + require_auth (bool, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/direct_debit_debit_card.py b/xendit/payment_method/model/direct_debit_debit_card.py new file mode 100644 index 00000000..4ef78884 --- /dev/null +++ b/xendit/payment_method/model/direct_debit_debit_card.py @@ -0,0 +1,274 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class DirectDebitDebitCard(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'mobile_number': (str, none_type,), # noqa: E501 + 'card_last_four': (str, none_type,), # noqa: E501 + 'card_expiry': (str, none_type,), # noqa: E501 + 'email': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'mobile_number': 'mobile_number', # noqa: E501 + 'card_last_four': 'card_last_four', # noqa: E501 + 'card_expiry': 'card_expiry', # noqa: E501 + 'email': 'email', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DirectDebitDebitCard - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + mobile_number (str, none_type): Mobile number of the customer registered to the partner channel. [optional] # noqa: E501 + card_last_four (str, none_type): Last four digits of the debit card. [optional] # noqa: E501 + card_expiry (str, none_type): Expiry month and year of the debit card (in MM/YY format). [optional] # noqa: E501 + email (str, none_type): Email address of the customer that is registered to the partner channel. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """DirectDebitDebitCard - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + mobile_number (str, none_type): Mobile number of the customer registered to the partner channel. [optional] # noqa: E501 + card_last_four (str, none_type): Last four digits of the debit card. [optional] # noqa: E501 + card_expiry (str, none_type): Expiry month and year of the debit card (in MM/YY format). [optional] # noqa: E501 + email (str, none_type): Email address of the customer that is registered to the partner channel. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/direct_debit_parameters.py b/xendit/payment_method/model/direct_debit_parameters.py new file mode 100644 index 00000000..c5f061e2 --- /dev/null +++ b/xendit/payment_method/model/direct_debit_parameters.py @@ -0,0 +1,282 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.direct_debit_channel_code import DirectDebitChannelCode + from xendit.payment_method.model.direct_debit_channel_properties import DirectDebitChannelProperties + globals()['DirectDebitChannelCode'] = DirectDebitChannelCode + globals()['DirectDebitChannelProperties'] = DirectDebitChannelProperties + + +class DirectDebitParameters(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'channel_code': (DirectDebitChannelCode,), # noqa: E501 + 'channel_properties': (DirectDebitChannelProperties,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, channel_code, channel_properties, *args, **kwargs): # noqa: E501 + """DirectDebitParameters - a model defined in OpenAPI + + Args: + channel_code (DirectDebitChannelCode): + channel_properties (DirectDebitChannelProperties): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.channel_code = channel_code + self.channel_properties = channel_properties + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, channel_code, channel_properties, *args, **kwargs): # noqa: E501 + """DirectDebitParameters - a model defined in OpenAPI + + Args: + channel_code (DirectDebitChannelCode): + channel_properties (DirectDebitChannelProperties): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.channel_code = channel_code + self.channel_properties = channel_properties + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/direct_debit_type.py b/xendit/payment_method/model/direct_debit_type.py new file mode 100644 index 00000000..99a8cdbc --- /dev/null +++ b/xendit/payment_method/model/direct_debit_type.py @@ -0,0 +1,290 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class DirectDebitType(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'DEBIT_CARD': "DEBIT_CARD", + 'BANK_ACCOUNT': "BANK_ACCOUNT", + 'BANK_REDIRECT': "BANK_REDIRECT", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """DirectDebitType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["DEBIT_CARD", "BANK_ACCOUNT", "BANK_REDIRECT", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["DEBIT_CARD", "BANK_ACCOUNT", "BANK_REDIRECT", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """DirectDebitType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["DEBIT_CARD", "BANK_ACCOUNT", "BANK_REDIRECT", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["DEBIT_CARD", "BANK_ACCOUNT", "BANK_REDIRECT", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_method/model/e_wallet.py b/xendit/payment_method/model/e_wallet.py new file mode 100644 index 00000000..eda2df44 --- /dev/null +++ b/xendit/payment_method/model/e_wallet.py @@ -0,0 +1,332 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.e_wallet_account import EWalletAccount + from xendit.payment_method.model.e_wallet_channel_code import EWalletChannelCode + from xendit.payment_method.model.e_wallet_channel_properties import EWalletChannelProperties + from xendit.payment_method.model.e_wallet_parameters import EWalletParameters + globals()['EWalletAccount'] = EWalletAccount + globals()['EWalletChannelCode'] = EWalletChannelCode + globals()['EWalletChannelProperties'] = EWalletChannelProperties + globals()['EWalletParameters'] = EWalletParameters + + +class EWallet(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'channel_code': (EWalletChannelCode,), # noqa: E501 + 'channel_properties': (EWalletChannelProperties,), # noqa: E501 + 'account': (EWalletAccount,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'account': 'account', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """EWallet - a model defined in OpenAPI + + Keyword Args: + channel_code (EWalletChannelCode): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + channel_properties (EWalletChannelProperties): [optional] # noqa: E501 + account (EWalletAccount): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """EWallet - a model defined in OpenAPI + + Keyword Args: + channel_code (EWalletChannelCode): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + channel_properties (EWalletChannelProperties): [optional] # noqa: E501 + account (EWalletAccount): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + EWalletParameters, + ], + 'oneOf': [ + ], + } diff --git a/xendit/payment_method/model/e_wallet_account.py b/xendit/payment_method/model/e_wallet_account.py new file mode 100644 index 00000000..ae55076a --- /dev/null +++ b/xendit/payment_method/model/e_wallet_account.py @@ -0,0 +1,274 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class EWalletAccount(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str, none_type,), # noqa: E501 + 'account_details': (str, none_type,), # noqa: E501 + 'balance': (float, none_type,), # noqa: E501 + 'point_balance': (float, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'account_details': 'account_details', # noqa: E501 + 'balance': 'balance', # noqa: E501 + 'point_balance': 'point_balance', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """EWalletAccount - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str, none_type): Name of the eWallet account holder. The value is null if unavailableName of the eWallet account holder. The value is null if unavailable. [optional] # noqa: E501 + account_details (str, none_type): Identifier from eWallet provider e.g. phone number. The value is null if unavailable. [optional] # noqa: E501 + balance (float, none_type): The main balance amount on eWallet account provided from eWallet provider. The value is null if unavailable. [optional] # noqa: E501 + point_balance (float, none_type): The point balance amount on eWallet account. Applicable only on some eWallet provider that has point system. The value is null if unavailabl. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """EWalletAccount - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str, none_type): Name of the eWallet account holder. The value is null if unavailableName of the eWallet account holder. The value is null if unavailable. [optional] # noqa: E501 + account_details (str, none_type): Identifier from eWallet provider e.g. phone number. The value is null if unavailable. [optional] # noqa: E501 + balance (float, none_type): The main balance amount on eWallet account provided from eWallet provider. The value is null if unavailable. [optional] # noqa: E501 + point_balance (float, none_type): The point balance amount on eWallet account. Applicable only on some eWallet provider that has point system. The value is null if unavailabl. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/e_wallet_channel_code.py b/xendit/payment_method/model/e_wallet_channel_code.py new file mode 100644 index 00000000..9664a2a6 --- /dev/null +++ b/xendit/payment_method/model/e_wallet_channel_code.py @@ -0,0 +1,307 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class EWalletChannelCode(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'GCASH': "GCASH", + 'GRABPAY': "GRABPAY", + 'PAYMAYA': "PAYMAYA", + 'OVO': "OVO", + 'DANA': "DANA", + 'LINKAJA': "LINKAJA", + 'SHOPEEPAY': "SHOPEEPAY", + 'SAKUKU': "SAKUKU", + 'NEXCASH': "NEXCASH", + 'ASTRAPAY': "ASTRAPAY", + 'JENIUSPAY': "JENIUSPAY", + 'APPOTA': "APPOTA", + 'MOMO': "MOMO", + 'VNPTWALLET': "VNPTWALLET", + 'VIETTELPAY': "VIETTELPAY", + 'ZALOPAY': "ZALOPAY", + 'WECHATPAY': "WECHATPAY", + 'LINEPAY': "LINEPAY", + 'TRUEMONEY': "TRUEMONEY", + 'ALIPAY': "ALIPAY", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """EWalletChannelCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): EWallet Channel Code., must be one of ["GCASH", "GRABPAY", "PAYMAYA", "OVO", "DANA", "LINKAJA", "SHOPEEPAY", "SAKUKU", "NEXCASH", "ASTRAPAY", "JENIUSPAY", "APPOTA", "MOMO", "VNPTWALLET", "VIETTELPAY", "ZALOPAY", "WECHATPAY", "LINEPAY", "TRUEMONEY", "ALIPAY", ] # noqa: E501 + + Keyword Args: + value (str): EWallet Channel Code., must be one of ["GCASH", "GRABPAY", "PAYMAYA", "OVO", "DANA", "LINKAJA", "SHOPEEPAY", "SAKUKU", "NEXCASH", "ASTRAPAY", "JENIUSPAY", "APPOTA", "MOMO", "VNPTWALLET", "VIETTELPAY", "ZALOPAY", "WECHATPAY", "LINEPAY", "TRUEMONEY", "ALIPAY", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """EWalletChannelCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): EWallet Channel Code., must be one of ["GCASH", "GRABPAY", "PAYMAYA", "OVO", "DANA", "LINKAJA", "SHOPEEPAY", "SAKUKU", "NEXCASH", "ASTRAPAY", "JENIUSPAY", "APPOTA", "MOMO", "VNPTWALLET", "VIETTELPAY", "ZALOPAY", "WECHATPAY", "LINEPAY", "TRUEMONEY", "ALIPAY", ] # noqa: E501 + + Keyword Args: + value (str): EWallet Channel Code., must be one of ["GCASH", "GRABPAY", "PAYMAYA", "OVO", "DANA", "LINKAJA", "SHOPEEPAY", "SAKUKU", "NEXCASH", "ASTRAPAY", "JENIUSPAY", "APPOTA", "MOMO", "VNPTWALLET", "VIETTELPAY", "ZALOPAY", "WECHATPAY", "LINEPAY", "TRUEMONEY", "ALIPAY", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_method/model/e_wallet_channel_properties.py b/xendit/payment_method/model/e_wallet_channel_properties.py new file mode 100644 index 00000000..248f0804 --- /dev/null +++ b/xendit/payment_method/model/e_wallet_channel_properties.py @@ -0,0 +1,302 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class EWalletChannelProperties(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('success_return_url',): { + 'regex': { + 'pattern': r'^\S{1,255}:\/\/\S{0,1000}$', # noqa: E501 + }, + }, + ('failure_return_url',): { + 'regex': { + 'pattern': r'^\S{1,255}:\/\/\S{0,1000}$', # noqa: E501 + }, + }, + ('cancel_return_url',): { + 'regex': { + 'pattern': r'^\S{1,255}:\/\/\S{0,1000}$', # noqa: E501 + }, + }, + ('cashtag',): { + 'regex': { + 'pattern': r'^[$][a-zA-Z0-9_]{3,15}$', # noqa: E501 + }, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'success_return_url': (str,), # noqa: E501 + 'failure_return_url': (str,), # noqa: E501 + 'cancel_return_url': (str,), # noqa: E501 + 'mobile_number': (str,), # noqa: E501 + 'redeem_points': (str,), # noqa: E501 + 'cashtag': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'success_return_url': 'success_return_url', # noqa: E501 + 'failure_return_url': 'failure_return_url', # noqa: E501 + 'cancel_return_url': 'cancel_return_url', # noqa: E501 + 'mobile_number': 'mobile_number', # noqa: E501 + 'redeem_points': 'redeem_points', # noqa: E501 + 'cashtag': 'cashtag', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """EWalletChannelProperties - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + success_return_url (str): URL where the end-customer is redirected if the authorization is successful. [optional] # noqa: E501 + failure_return_url (str): URL where the end-customer is redirected if the authorization failed. [optional] # noqa: E501 + cancel_return_url (str): URL where the end-customer is redirected if the authorization cancelled. [optional] # noqa: E501 + mobile_number (str): Mobile number of customer in E.164 format (e.g. +628123123123). For OVO one time payment use only.. [optional] # noqa: E501 + redeem_points (str): REDEEM_NONE will not use any point, REDEEM_ALL will use all available points before cash balance is used. For OVO and ShopeePay tokenized payment use only.. [optional] # noqa: E501 + cashtag (str): Available for JENIUSPAY only. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """EWalletChannelProperties - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + success_return_url (str): URL where the end-customer is redirected if the authorization is successful. [optional] # noqa: E501 + failure_return_url (str): URL where the end-customer is redirected if the authorization failed. [optional] # noqa: E501 + cancel_return_url (str): URL where the end-customer is redirected if the authorization cancelled. [optional] # noqa: E501 + mobile_number (str): Mobile number of customer in E.164 format (e.g. +628123123123). For OVO one time payment use only.. [optional] # noqa: E501 + redeem_points (str): REDEEM_NONE will not use any point, REDEEM_ALL will use all available points before cash balance is used. For OVO and ShopeePay tokenized payment use only.. [optional] # noqa: E501 + cashtag (str): Available for JENIUSPAY only. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/e_wallet_parameters.py b/xendit/payment_method/model/e_wallet_parameters.py new file mode 100644 index 00000000..a161338c --- /dev/null +++ b/xendit/payment_method/model/e_wallet_parameters.py @@ -0,0 +1,286 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.e_wallet_account import EWalletAccount + from xendit.payment_method.model.e_wallet_channel_code import EWalletChannelCode + from xendit.payment_method.model.e_wallet_channel_properties import EWalletChannelProperties + globals()['EWalletAccount'] = EWalletAccount + globals()['EWalletChannelCode'] = EWalletChannelCode + globals()['EWalletChannelProperties'] = EWalletChannelProperties + + +class EWalletParameters(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'channel_code': (EWalletChannelCode,), # noqa: E501 + 'channel_properties': (EWalletChannelProperties,), # noqa: E501 + 'account': (EWalletAccount,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'account': 'account', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, channel_code, *args, **kwargs): # noqa: E501 + """EWalletParameters - a model defined in OpenAPI + + Args: + channel_code (EWalletChannelCode): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + channel_properties (EWalletChannelProperties): [optional] # noqa: E501 + account (EWalletAccount): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.channel_code = channel_code + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, channel_code, *args, **kwargs): # noqa: E501 + """EWalletParameters - a model defined in OpenAPI + + Args: + channel_code (EWalletChannelCode): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + channel_properties (EWalletChannelProperties): [optional] # noqa: E501 + account (EWalletAccount): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.channel_code = channel_code + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/get_all_payment_methods400_response.py b/xendit/payment_method/model/get_all_payment_methods400_response.py new file mode 100644 index 00000000..aca923f2 --- /dev/null +++ b/xendit/payment_method/model/get_all_payment_methods400_response.py @@ -0,0 +1,282 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class GetAllPaymentMethods400Response(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('error_code',): { + 'API_VALIDATION_ERROR': "API_VALIDATION_ERROR", + 'NOT_SUPPORTED_BY_CHANNEL': "NOT_SUPPORTED_BY_CHANNEL", + 'EXPIRED_OTP_ERROR': "EXPIRED_OTP_ERROR", + 'INVALID_ACCOUNT_DETAILS': "INVALID_ACCOUNT_DETAILS", + 'INVALID_OTP_ERROR': "INVALID_OTP_ERROR", + 'INVALID_PAYMENT_METHOD': "INVALID_PAYMENT_METHOD", + 'MAX_OTP_ATTEMPTS_ERROR': "MAX_OTP_ATTEMPTS_ERROR", + 'CUSTOMER_NOT_FOUND_ERROR': "CUSTOMER_NOT_FOUND_ERROR", + 'ACCOUNT_ACCESS_BLOCKED': "ACCOUNT_ACCESS_BLOCKED", + 'MAX_ACCOUNT_LINKING': "MAX_ACCOUNT_LINKING", + 'INACTIVE_PAYMENT_METHOD': "INACTIVE_PAYMENT_METHOD", + 'PAYMENT_METHOD_NOT_SUPPORTED': "PAYMENT_METHOD_NOT_SUPPORTED", + 'INCORRECT_AMOUNT': "INCORRECT_AMOUNT", + 'DUPLICATED_FIXED_PAYMENT_INSTRUMENT': "DUPLICATED_FIXED_PAYMENT_INSTRUMENT", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'error_code': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'error_code': 'error_code', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """GetAllPaymentMethods400Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """GetAllPaymentMethods400Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/get_all_payment_methods403_response.py b/xendit/payment_method/model/get_all_payment_methods403_response.py new file mode 100644 index 00000000..28050319 --- /dev/null +++ b/xendit/payment_method/model/get_all_payment_methods403_response.py @@ -0,0 +1,270 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class GetAllPaymentMethods403Response(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('error_code',): { + 'UNAUTHORIZED': "UNAUTHORIZED", + 'CHANNEL_NOT_ACTIVATED': "CHANNEL_NOT_ACTIVATED", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'error_code': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'error_code': 'error_code', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """GetAllPaymentMethods403Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """GetAllPaymentMethods403Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/get_all_payment_methods404_response.py b/xendit/payment_method/model/get_all_payment_methods404_response.py new file mode 100644 index 00000000..724440a1 --- /dev/null +++ b/xendit/payment_method/model/get_all_payment_methods404_response.py @@ -0,0 +1,269 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class GetAllPaymentMethods404Response(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('error_code',): { + 'DATA_NOT_FOUND': "DATA_NOT_FOUND", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'error_code': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'error_code': 'error_code', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """GetAllPaymentMethods404Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] if omitted the server will use the default value of "DATA_NOT_FOUND" # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """GetAllPaymentMethods404Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] if omitted the server will use the default value of "DATA_NOT_FOUND" # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/get_all_payment_methods_default_response.py b/xendit/payment_method/model/get_all_payment_methods_default_response.py new file mode 100644 index 00000000..e5b51fe1 --- /dev/null +++ b/xendit/payment_method/model/get_all_payment_methods_default_response.py @@ -0,0 +1,266 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class GetAllPaymentMethodsDefaultResponse(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'error_code': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'error_code': 'error_code', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """GetAllPaymentMethodsDefaultResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """GetAllPaymentMethodsDefaultResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/over_the_counter.py b/xendit/payment_method/model/over_the_counter.py new file mode 100644 index 00000000..a80bedc0 --- /dev/null +++ b/xendit/payment_method/model/over_the_counter.py @@ -0,0 +1,334 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.over_the_counter_channel_code import OverTheCounterChannelCode + from xendit.payment_method.model.over_the_counter_channel_properties import OverTheCounterChannelProperties + from xendit.payment_method.model.over_the_counter_parameters import OverTheCounterParameters + globals()['OverTheCounterChannelCode'] = OverTheCounterChannelCode + globals()['OverTheCounterChannelProperties'] = OverTheCounterChannelProperties + globals()['OverTheCounterParameters'] = OverTheCounterParameters + + +class OverTheCounter(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'channel_code': (OverTheCounterChannelCode,), # noqa: E501 + 'channel_properties': (OverTheCounterChannelProperties,), # noqa: E501 + 'amount': (float, none_type,), # noqa: E501 + 'currency': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'amount': 'amount', # noqa: E501 + 'currency': 'currency', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """OverTheCounter - a model defined in OpenAPI + + Keyword Args: + channel_code (OverTheCounterChannelCode): + channel_properties (OverTheCounterChannelProperties): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + amount (float, none_type): [optional] # noqa: E501 + currency (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """OverTheCounter - a model defined in OpenAPI + + Keyword Args: + channel_code (OverTheCounterChannelCode): + channel_properties (OverTheCounterChannelProperties): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + amount (float, none_type): [optional] # noqa: E501 + currency (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + OverTheCounterParameters, + ], + 'oneOf': [ + ], + } diff --git a/xendit/payment_method/model/over_the_counter_channel_code.py b/xendit/payment_method/model/over_the_counter_channel_code.py new file mode 100644 index 00000000..23b58b59 --- /dev/null +++ b/xendit/payment_method/model/over_the_counter_channel_code.py @@ -0,0 +1,303 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class OverTheCounterChannelCode(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + '7ELEVEN': "7ELEVEN", + '7ELEVEN_CLIQQ': "7ELEVEN_CLIQQ", + 'CEBUANA': "CEBUANA", + 'ECPAY': "ECPAY", + 'PALAWAN': "PALAWAN", + 'MLHUILLIER': "MLHUILLIER", + 'ECPAY_DRAGONLOAN': "ECPAY_DRAGONLOAN", + 'LBC': "LBC", + 'ECPAY_SCHOOL': "ECPAY_SCHOOL", + 'RD_PAWNSHOP': "RD_PAWNSHOP", + 'CVM': "CVM", + 'USSC': "USSC", + 'SM_BILLS': "SM_BILLS", + 'ROBINSONS_BILLS': "ROBINSONS_BILLS", + 'ALFAMART': "ALFAMART", + 'INDOMARET': "INDOMARET", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """OverTheCounterChannelCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Over The Counter Channel Code., must be one of ["7ELEVEN", "7ELEVEN_CLIQQ", "CEBUANA", "ECPAY", "PALAWAN", "MLHUILLIER", "ECPAY_DRAGONLOAN", "LBC", "ECPAY_SCHOOL", "RD_PAWNSHOP", "CVM", "USSC", "SM_BILLS", "ROBINSONS_BILLS", "ALFAMART", "INDOMARET", ] # noqa: E501 + + Keyword Args: + value (str): Over The Counter Channel Code., must be one of ["7ELEVEN", "7ELEVEN_CLIQQ", "CEBUANA", "ECPAY", "PALAWAN", "MLHUILLIER", "ECPAY_DRAGONLOAN", "LBC", "ECPAY_SCHOOL", "RD_PAWNSHOP", "CVM", "USSC", "SM_BILLS", "ROBINSONS_BILLS", "ALFAMART", "INDOMARET", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """OverTheCounterChannelCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Over The Counter Channel Code., must be one of ["7ELEVEN", "7ELEVEN_CLIQQ", "CEBUANA", "ECPAY", "PALAWAN", "MLHUILLIER", "ECPAY_DRAGONLOAN", "LBC", "ECPAY_SCHOOL", "RD_PAWNSHOP", "CVM", "USSC", "SM_BILLS", "ROBINSONS_BILLS", "ALFAMART", "INDOMARET", ] # noqa: E501 + + Keyword Args: + value (str): Over The Counter Channel Code., must be one of ["7ELEVEN", "7ELEVEN_CLIQQ", "CEBUANA", "ECPAY", "PALAWAN", "MLHUILLIER", "ECPAY_DRAGONLOAN", "LBC", "ECPAY_SCHOOL", "RD_PAWNSHOP", "CVM", "USSC", "SM_BILLS", "ROBINSONS_BILLS", "ALFAMART", "INDOMARET", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_method/model/over_the_counter_channel_properties.py b/xendit/payment_method/model/over_the_counter_channel_properties.py new file mode 100644 index 00000000..bf406655 --- /dev/null +++ b/xendit/payment_method/model/over_the_counter_channel_properties.py @@ -0,0 +1,276 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class OverTheCounterChannelProperties(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'customer_name': (str,), # noqa: E501 + 'payment_code': (str,), # noqa: E501 + 'expires_at': (datetime,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'customer_name': 'customer_name', # noqa: E501 + 'payment_code': 'payment_code', # noqa: E501 + 'expires_at': 'expires_at', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, customer_name, *args, **kwargs): # noqa: E501 + """OverTheCounterChannelProperties - a model defined in OpenAPI + + Args: + customer_name (str): Name of customer. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + payment_code (str): The payment code that you want to assign, e.g 12345. If you do not send one, one will be picked at random.. [optional] # noqa: E501 + expires_at (datetime): The time when the payment code will be expired. The minimum is 2 hours and the maximum is 9 days for 7ELEVEN. Default expired date will be 2 days from payment code generated.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.customer_name = customer_name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, customer_name, *args, **kwargs): # noqa: E501 + """OverTheCounterChannelProperties - a model defined in OpenAPI + + Args: + customer_name (str): Name of customer. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + payment_code (str): The payment code that you want to assign, e.g 12345. If you do not send one, one will be picked at random.. [optional] # noqa: E501 + expires_at (datetime): The time when the payment code will be expired. The minimum is 2 hours and the maximum is 9 days for 7ELEVEN. Default expired date will be 2 days from payment code generated.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.customer_name = customer_name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/over_the_counter_channel_properties_update.py b/xendit/payment_method/model/over_the_counter_channel_properties_update.py new file mode 100644 index 00000000..ab9b9e1e --- /dev/null +++ b/xendit/payment_method/model/over_the_counter_channel_properties_update.py @@ -0,0 +1,266 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class OverTheCounterChannelPropertiesUpdate(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'customer_name': (str,), # noqa: E501 + 'expires_at': (datetime,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'customer_name': 'customer_name', # noqa: E501 + 'expires_at': 'expires_at', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """OverTheCounterChannelPropertiesUpdate - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + customer_name (str): Name of customer.. [optional] # noqa: E501 + expires_at (datetime): The time when the payment code will be expired. The minimum is 2 hours and the maximum is 9 days for 7ELEVEN. Default expired date will be 2 days from payment code generated.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """OverTheCounterChannelPropertiesUpdate - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + customer_name (str): Name of customer.. [optional] # noqa: E501 + expires_at (datetime): The time when the payment code will be expired. The minimum is 2 hours and the maximum is 9 days for 7ELEVEN. Default expired date will be 2 days from payment code generated.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/over_the_counter_parameters.py b/xendit/payment_method/model/over_the_counter_parameters.py new file mode 100644 index 00000000..68d10b62 --- /dev/null +++ b/xendit/payment_method/model/over_the_counter_parameters.py @@ -0,0 +1,290 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.over_the_counter_channel_code import OverTheCounterChannelCode + from xendit.payment_method.model.over_the_counter_channel_properties import OverTheCounterChannelProperties + globals()['OverTheCounterChannelCode'] = OverTheCounterChannelCode + globals()['OverTheCounterChannelProperties'] = OverTheCounterChannelProperties + + +class OverTheCounterParameters(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'channel_code': (OverTheCounterChannelCode,), # noqa: E501 + 'channel_properties': (OverTheCounterChannelProperties,), # noqa: E501 + 'amount': (float, none_type,), # noqa: E501 + 'currency': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'amount': 'amount', # noqa: E501 + 'currency': 'currency', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, channel_code, channel_properties, *args, **kwargs): # noqa: E501 + """OverTheCounterParameters - a model defined in OpenAPI + + Args: + channel_code (OverTheCounterChannelCode): + channel_properties (OverTheCounterChannelProperties): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + amount (float, none_type): [optional] # noqa: E501 + currency (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.channel_code = channel_code + self.channel_properties = channel_properties + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, channel_code, channel_properties, *args, **kwargs): # noqa: E501 + """OverTheCounterParameters - a model defined in OpenAPI + + Args: + channel_code (OverTheCounterChannelCode): + channel_properties (OverTheCounterChannelProperties): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + amount (float, none_type): [optional] # noqa: E501 + currency (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.channel_code = channel_code + self.channel_properties = channel_properties + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/over_the_counter_update_parameters.py b/xendit/payment_method/model/over_the_counter_update_parameters.py new file mode 100644 index 00000000..9ab6ac87 --- /dev/null +++ b/xendit/payment_method/model/over_the_counter_update_parameters.py @@ -0,0 +1,272 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.over_the_counter_channel_properties_update import OverTheCounterChannelPropertiesUpdate + globals()['OverTheCounterChannelPropertiesUpdate'] = OverTheCounterChannelPropertiesUpdate + + +class OverTheCounterUpdateParameters(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'amount': (float, none_type,), # noqa: E501 + 'channel_properties': (OverTheCounterChannelPropertiesUpdate,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'amount': 'amount', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """OverTheCounterUpdateParameters - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + amount (float, none_type): [optional] # noqa: E501 + channel_properties (OverTheCounterChannelPropertiesUpdate): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """OverTheCounterUpdateParameters - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + amount (float, none_type): [optional] # noqa: E501 + channel_properties (OverTheCounterChannelPropertiesUpdate): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/payment_channel.py b/xendit/payment_method/model/payment_channel.py new file mode 100644 index 00000000..6378dc57 --- /dev/null +++ b/xendit/payment_method/model/payment_channel.py @@ -0,0 +1,346 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.channel_amount_limits import ChannelAmountLimits + from xendit.payment_method.model.channel_property import ChannelProperty + from xendit.payment_method.model.payment_channel_all_of import PaymentChannelAllOf + globals()['ChannelAmountLimits'] = ChannelAmountLimits + globals()['ChannelProperty'] = ChannelProperty + globals()['PaymentChannelAllOf'] = PaymentChannelAllOf + + +class PaymentChannel(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'channel_code': (str,), # noqa: E501 + 'type': (str,), # noqa: E501 + 'country': (str,), # noqa: E501 + 'channel_name': (str,), # noqa: E501 + 'channel_properties': ([ChannelProperty],), # noqa: E501 + 'logo_url': (str,), # noqa: E501 + 'amount_limits': ([ChannelAmountLimits],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'channel_code': 'channel_code', # noqa: E501 + 'type': 'type', # noqa: E501 + 'country': 'country', # noqa: E501 + 'channel_name': 'channel_name', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'logo_url': 'logo_url', # noqa: E501 + 'amount_limits': 'amount_limits', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PaymentChannel - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + channel_code (str): The specific Xendit code used to identify the partner channel. [optional] # noqa: E501 + type (str): The payment method type. [optional] # noqa: E501 + country (str): The country where the channel operates in ISO 3166-2 country code. [optional] # noqa: E501 + channel_name (str): Official parter name of the payment channel. [optional] # noqa: E501 + channel_properties ([ChannelProperty]): [optional] # noqa: E501 + logo_url (str): If available, this contains a URL to the logo of the partner channel. [optional] # noqa: E501 + amount_limits ([ChannelAmountLimits]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """PaymentChannel - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + channel_code (str): The specific Xendit code used to identify the partner channel. [optional] # noqa: E501 + type (str): The payment method type. [optional] # noqa: E501 + country (str): The country where the channel operates in ISO 3166-2 country code. [optional] # noqa: E501 + channel_name (str): Official parter name of the payment channel. [optional] # noqa: E501 + channel_properties ([ChannelProperty]): [optional] # noqa: E501 + logo_url (str): If available, this contains a URL to the logo of the partner channel. [optional] # noqa: E501 + amount_limits ([ChannelAmountLimits]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + PaymentChannelAllOf, + ], + 'oneOf': [ + ], + } diff --git a/xendit/payment_method/model/payment_channel_all_of.py b/xendit/payment_method/model/payment_channel_all_of.py new file mode 100644 index 00000000..7563596a --- /dev/null +++ b/xendit/payment_method/model/payment_channel_all_of.py @@ -0,0 +1,294 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.channel_amount_limits import ChannelAmountLimits + from xendit.payment_method.model.channel_property import ChannelProperty + globals()['ChannelAmountLimits'] = ChannelAmountLimits + globals()['ChannelProperty'] = ChannelProperty + + +class PaymentChannelAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'channel_code': (str,), # noqa: E501 + 'type': (str,), # noqa: E501 + 'country': (str,), # noqa: E501 + 'channel_name': (str,), # noqa: E501 + 'channel_properties': ([ChannelProperty],), # noqa: E501 + 'logo_url': (str,), # noqa: E501 + 'amount_limits': ([ChannelAmountLimits],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'channel_code': 'channel_code', # noqa: E501 + 'type': 'type', # noqa: E501 + 'country': 'country', # noqa: E501 + 'channel_name': 'channel_name', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'logo_url': 'logo_url', # noqa: E501 + 'amount_limits': 'amount_limits', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PaymentChannelAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + channel_code (str): The specific Xendit code used to identify the partner channel. [optional] # noqa: E501 + type (str): The payment method type. [optional] # noqa: E501 + country (str): The country where the channel operates in ISO 3166-2 country code. [optional] # noqa: E501 + channel_name (str): Official parter name of the payment channel. [optional] # noqa: E501 + channel_properties ([ChannelProperty]): [optional] # noqa: E501 + logo_url (str): If available, this contains a URL to the logo of the partner channel. [optional] # noqa: E501 + amount_limits ([ChannelAmountLimits]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """PaymentChannelAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + channel_code (str): The specific Xendit code used to identify the partner channel. [optional] # noqa: E501 + type (str): The payment method type. [optional] # noqa: E501 + country (str): The country where the channel operates in ISO 3166-2 country code. [optional] # noqa: E501 + channel_name (str): Official parter name of the payment channel. [optional] # noqa: E501 + channel_properties ([ChannelProperty]): [optional] # noqa: E501 + logo_url (str): If available, this contains a URL to the logo of the partner channel. [optional] # noqa: E501 + amount_limits ([ChannelAmountLimits]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/payment_channel_list.py b/xendit/payment_method/model/payment_channel_list.py new file mode 100644 index 00000000..04b54389 --- /dev/null +++ b/xendit/payment_method/model/payment_channel_list.py @@ -0,0 +1,278 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.payment_channel import PaymentChannel + from xendit.payment_method.model.payment_channel_list_links_inner import PaymentChannelListLinksInner + globals()['PaymentChannel'] = PaymentChannel + globals()['PaymentChannelListLinksInner'] = PaymentChannelListLinksInner + + +class PaymentChannelList(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'data': ([PaymentChannel],), # noqa: E501 + 'links': ([PaymentChannelListLinksInner],), # noqa: E501 + 'has_more': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'data': 'data', # noqa: E501 + 'links': 'links', # noqa: E501 + 'has_more': 'has_more', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PaymentChannelList - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([PaymentChannel]): Array of resources that match the provided filters. [optional] # noqa: E501 + links ([PaymentChannelListLinksInner]): Array of objects that can be used to assist on navigating through the data. [optional] # noqa: E501 + has_more (bool): Indicates whether there are more items in the list. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """PaymentChannelList - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([PaymentChannel]): Array of resources that match the provided filters. [optional] # noqa: E501 + links ([PaymentChannelListLinksInner]): Array of objects that can be used to assist on navigating through the data. [optional] # noqa: E501 + has_more (bool): Indicates whether there are more items in the list. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/payment_channel_list_links_inner.py b/xendit/payment_method/model/payment_channel_list_links_inner.py new file mode 100644 index 00000000..a9571f73 --- /dev/null +++ b/xendit/payment_method/model/payment_channel_list_links_inner.py @@ -0,0 +1,332 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.payment_channel_list_links_inner_all_of import PaymentChannelListLinksInnerAllOf + globals()['PaymentChannelListLinksInnerAllOf'] = PaymentChannelListLinksInnerAllOf + + +class PaymentChannelListLinksInner(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('rel',): { + 'FIRST': "first", + 'LAST': "last", + 'NEXT': "next", + 'PREV': "prev", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'href': (str,), # noqa: E501 + 'rel': (str,), # noqa: E501 + 'method': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'href': 'href', # noqa: E501 + 'rel': 'rel', # noqa: E501 + 'method': 'method', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PaymentChannelListLinksInner - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + href (str): Target URI that should contain a target to Internationalized Resource Identifiers (IRI). [optional] # noqa: E501 + rel (str): The link relation type described how the current context (source) is related to target resource. [optional] # noqa: E501 + method (str): The HTTP method to be used to call `href`. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """PaymentChannelListLinksInner - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + href (str): Target URI that should contain a target to Internationalized Resource Identifiers (IRI). [optional] # noqa: E501 + rel (str): The link relation type described how the current context (source) is related to target resource. [optional] # noqa: E501 + method (str): The HTTP method to be used to call `href`. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + PaymentChannelListLinksInnerAllOf, + ], + 'oneOf': [ + ], + } diff --git a/xendit/payment_method/model/payment_channel_list_links_inner_all_of.py b/xendit/payment_method/model/payment_channel_list_links_inner_all_of.py new file mode 100644 index 00000000..026e8aa3 --- /dev/null +++ b/xendit/payment_method/model/payment_channel_list_links_inner_all_of.py @@ -0,0 +1,276 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentChannelListLinksInnerAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('rel',): { + 'FIRST': "first", + 'LAST': "last", + 'NEXT': "next", + 'PREV': "prev", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'href': (str,), # noqa: E501 + 'rel': (str,), # noqa: E501 + 'method': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'href': 'href', # noqa: E501 + 'rel': 'rel', # noqa: E501 + 'method': 'method', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PaymentChannelListLinksInnerAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + href (str): Target URI that should contain a target to Internationalized Resource Identifiers (IRI). [optional] # noqa: E501 + rel (str): The link relation type described how the current context (source) is related to target resource. [optional] # noqa: E501 + method (str): The HTTP method to be used to call `href`. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """PaymentChannelListLinksInnerAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + href (str): Target URI that should contain a target to Internationalized Resource Identifiers (IRI). [optional] # noqa: E501 + rel (str): The link relation type described how the current context (source) is related to target resource. [optional] # noqa: E501 + method (str): The HTTP method to be used to call `href`. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/payment_method.py b/xendit/payment_method/model/payment_method.py new file mode 100644 index 00000000..d1f78cb5 --- /dev/null +++ b/xendit/payment_method/model/payment_method.py @@ -0,0 +1,380 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.billing_information import BillingInformation + from xendit.payment_method.model.card import Card + from xendit.payment_method.model.direct_debit import DirectDebit + from xendit.payment_method.model.e_wallet import EWallet + from xendit.payment_method.model.over_the_counter import OverTheCounter + from xendit.payment_method.model.payment_method_action import PaymentMethodAction + from xendit.payment_method.model.payment_method_country import PaymentMethodCountry + from xendit.payment_method.model.payment_method_reusability import PaymentMethodReusability + from xendit.payment_method.model.payment_method_status import PaymentMethodStatus + from xendit.payment_method.model.payment_method_type import PaymentMethodType + from xendit.payment_method.model.qr_code import QRCode + from xendit.payment_method.model.virtual_account import VirtualAccount + globals()['BillingInformation'] = BillingInformation + globals()['Card'] = Card + globals()['DirectDebit'] = DirectDebit + globals()['EWallet'] = EWallet + globals()['OverTheCounter'] = OverTheCounter + globals()['PaymentMethodAction'] = PaymentMethodAction + globals()['PaymentMethodCountry'] = PaymentMethodCountry + globals()['PaymentMethodReusability'] = PaymentMethodReusability + globals()['PaymentMethodStatus'] = PaymentMethodStatus + globals()['PaymentMethodType'] = PaymentMethodType + globals()['QRCode'] = QRCode + globals()['VirtualAccount'] = VirtualAccount + + +class PaymentMethod(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'id': (str,), # noqa: E501 + 'business_id': (str,), # noqa: E501 + 'type': (PaymentMethodType,), # noqa: E501 + 'country': (PaymentMethodCountry,), # noqa: E501 + 'customer_id': (str, none_type,), # noqa: E501 + 'customer': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 + 'reference_id': (str,), # noqa: E501 + 'description': (str, none_type,), # noqa: E501 + 'status': (PaymentMethodStatus,), # noqa: E501 + 'reusability': (PaymentMethodReusability,), # noqa: E501 + 'actions': ([PaymentMethodAction],), # noqa: E501 + 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 + 'billing_information': (BillingInformation,), # noqa: E501 + 'failure_code': (str, none_type,), # noqa: E501 + 'created': (datetime,), # noqa: E501 + 'updated': (datetime,), # noqa: E501 + 'ewallet': (EWallet,), # noqa: E501 + 'direct_debit': (DirectDebit,), # noqa: E501 + 'over_the_counter': (OverTheCounter,), # noqa: E501 + 'card': (Card,), # noqa: E501 + 'qr_code': (QRCode,), # noqa: E501 + 'virtual_account': (VirtualAccount,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'business_id': 'business_id', # noqa: E501 + 'type': 'type', # noqa: E501 + 'country': 'country', # noqa: E501 + 'customer_id': 'customer_id', # noqa: E501 + 'customer': 'customer', # noqa: E501 + 'reference_id': 'reference_id', # noqa: E501 + 'description': 'description', # noqa: E501 + 'status': 'status', # noqa: E501 + 'reusability': 'reusability', # noqa: E501 + 'actions': 'actions', # noqa: E501 + 'metadata': 'metadata', # noqa: E501 + 'billing_information': 'billing_information', # noqa: E501 + 'failure_code': 'failure_code', # noqa: E501 + 'created': 'created', # noqa: E501 + 'updated': 'updated', # noqa: E501 + 'ewallet': 'ewallet', # noqa: E501 + 'direct_debit': 'direct_debit', # noqa: E501 + 'over_the_counter': 'over_the_counter', # noqa: E501 + 'card': 'card', # noqa: E501 + 'qr_code': 'qr_code', # noqa: E501 + 'virtual_account': 'virtual_account', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, *args, **kwargs): # noqa: E501 + """PaymentMethod - a model defined in OpenAPI + + Args: + id (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + business_id (str): [optional] # noqa: E501 + type (PaymentMethodType): [optional] # noqa: E501 + country (PaymentMethodCountry): [optional] # noqa: E501 + customer_id (str, none_type): [optional] # noqa: E501 + customer ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + reference_id (str): [optional] # noqa: E501 + description (str, none_type): [optional] # noqa: E501 + status (PaymentMethodStatus): [optional] # noqa: E501 + reusability (PaymentMethodReusability): [optional] # noqa: E501 + actions ([PaymentMethodAction]): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + billing_information (BillingInformation): [optional] # noqa: E501 + failure_code (str, none_type): [optional] # noqa: E501 + created (datetime): [optional] # noqa: E501 + updated (datetime): [optional] # noqa: E501 + ewallet (EWallet): [optional] # noqa: E501 + direct_debit (DirectDebit): [optional] # noqa: E501 + over_the_counter (OverTheCounter): [optional] # noqa: E501 + card (Card): [optional] # noqa: E501 + qr_code (QRCode): [optional] # noqa: E501 + virtual_account (VirtualAccount): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, id, *args, **kwargs): # noqa: E501 + """PaymentMethod - a model defined in OpenAPI + + Args: + id (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + business_id (str): [optional] # noqa: E501 + type (PaymentMethodType): [optional] # noqa: E501 + country (PaymentMethodCountry): [optional] # noqa: E501 + customer_id (str, none_type): [optional] # noqa: E501 + customer ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + reference_id (str): [optional] # noqa: E501 + description (str, none_type): [optional] # noqa: E501 + status (PaymentMethodStatus): [optional] # noqa: E501 + reusability (PaymentMethodReusability): [optional] # noqa: E501 + actions ([PaymentMethodAction]): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + billing_information (BillingInformation): [optional] # noqa: E501 + failure_code (str, none_type): [optional] # noqa: E501 + created (datetime): [optional] # noqa: E501 + updated (datetime): [optional] # noqa: E501 + ewallet (EWallet): [optional] # noqa: E501 + direct_debit (DirectDebit): [optional] # noqa: E501 + over_the_counter (OverTheCounter): [optional] # noqa: E501 + card (Card): [optional] # noqa: E501 + qr_code (QRCode): [optional] # noqa: E501 + virtual_account (VirtualAccount): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/payment_method_action.py b/xendit/payment_method/model/payment_method_action.py new file mode 100644 index 00000000..6d9b9366 --- /dev/null +++ b/xendit/payment_method/model/payment_method_action.py @@ -0,0 +1,274 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentMethodAction(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'action': (str,), # noqa: E501 + 'method': (str,), # noqa: E501 + 'url': (str,), # noqa: E501 + 'url_type': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'action': 'action', # noqa: E501 + 'method': 'method', # noqa: E501 + 'url': 'url', # noqa: E501 + 'url_type': 'url_type', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PaymentMethodAction - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + action (str): [optional] # noqa: E501 + method (str): [optional] # noqa: E501 + url (str): [optional] # noqa: E501 + url_type (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """PaymentMethodAction - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + action (str): [optional] # noqa: E501 + method (str): [optional] # noqa: E501 + url (str): [optional] # noqa: E501 + url_type (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/payment_method_auth_parameters.py b/xendit/payment_method/model/payment_method_auth_parameters.py new file mode 100644 index 00000000..717d55fd --- /dev/null +++ b/xendit/payment_method/model/payment_method_auth_parameters.py @@ -0,0 +1,272 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentMethodAuthParameters(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('auth_code',): { + 'max_length': 6, + 'min_length': 6, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'auth_code': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'auth_code': 'auth_code', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, auth_code, *args, **kwargs): # noqa: E501 + """PaymentMethodAuthParameters - a model defined in OpenAPI + + Args: + auth_code (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.auth_code = auth_code + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, auth_code, *args, **kwargs): # noqa: E501 + """PaymentMethodAuthParameters - a model defined in OpenAPI + + Args: + auth_code (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.auth_code = auth_code + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/payment_method_country.py b/xendit/payment_method/model/payment_method_country.py new file mode 100644 index 00000000..66de3193 --- /dev/null +++ b/xendit/payment_method/model/payment_method_country.py @@ -0,0 +1,292 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentMethodCountry(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'PH': "PH", + 'ID': "ID", + 'VN': "VN", + 'TH': "TH", + 'MY': "MY", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """PaymentMethodCountry - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["PH", "ID", "VN", "TH", "MY", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["PH", "ID", "VN", "TH", "MY", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """PaymentMethodCountry - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["PH", "ID", "VN", "TH", "MY", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["PH", "ID", "VN", "TH", "MY", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_method/model/payment_method_expire_parameters.py b/xendit/payment_method/model/payment_method_expire_parameters.py new file mode 100644 index 00000000..6746e17a --- /dev/null +++ b/xendit/payment_method/model/payment_method_expire_parameters.py @@ -0,0 +1,266 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentMethodExpireParameters(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'success_return_url': (str, none_type,), # noqa: E501 + 'failure_return_url': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'success_return_url': 'success_return_url', # noqa: E501 + 'failure_return_url': 'failure_return_url', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PaymentMethodExpireParameters - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + success_return_url (str, none_type): URL where the end customer is redirected if the unlinking authorization is successful.. [optional] # noqa: E501 + failure_return_url (str, none_type): URL where the end customer is redirected if the unlinking authorization is failed.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """PaymentMethodExpireParameters - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + success_return_url (str, none_type): URL where the end customer is redirected if the unlinking authorization is successful.. [optional] # noqa: E501 + failure_return_url (str, none_type): URL where the end customer is redirected if the unlinking authorization is failed.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/payment_method_list.py b/xendit/payment_method/model/payment_method_list.py new file mode 100644 index 00000000..9e66158f --- /dev/null +++ b/xendit/payment_method/model/payment_method_list.py @@ -0,0 +1,278 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.payment_method import PaymentMethod + globals()['PaymentMethod'] = PaymentMethod + + +class PaymentMethodList(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'data': ([PaymentMethod],), # noqa: E501 + 'has_more': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'data': 'data', # noqa: E501 + 'has_more': 'has_more', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """PaymentMethodList - a model defined in OpenAPI + + Args: + data ([PaymentMethod]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + has_more (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, data, *args, **kwargs): # noqa: E501 + """PaymentMethodList - a model defined in OpenAPI + + Args: + data ([PaymentMethod]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + has_more (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/payment_method_parameters.py b/xendit/payment_method/model/payment_method_parameters.py new file mode 100644 index 00000000..93547666 --- /dev/null +++ b/xendit/payment_method/model/payment_method_parameters.py @@ -0,0 +1,344 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.billing_information import BillingInformation + from xendit.payment_method.model.card_parameters import CardParameters + from xendit.payment_method.model.direct_debit_parameters import DirectDebitParameters + from xendit.payment_method.model.e_wallet_parameters import EWalletParameters + from xendit.payment_method.model.over_the_counter_parameters import OverTheCounterParameters + from xendit.payment_method.model.payment_method_reusability import PaymentMethodReusability + from xendit.payment_method.model.payment_method_type import PaymentMethodType + from xendit.payment_method.model.qr_code_parameters import QRCodeParameters + from xendit.payment_method.model.virtual_account_parameters import VirtualAccountParameters + globals()['BillingInformation'] = BillingInformation + globals()['CardParameters'] = CardParameters + globals()['DirectDebitParameters'] = DirectDebitParameters + globals()['EWalletParameters'] = EWalletParameters + globals()['OverTheCounterParameters'] = OverTheCounterParameters + globals()['PaymentMethodReusability'] = PaymentMethodReusability + globals()['PaymentMethodType'] = PaymentMethodType + globals()['QRCodeParameters'] = QRCodeParameters + globals()['VirtualAccountParameters'] = VirtualAccountParameters + + +class PaymentMethodParameters(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'type': (PaymentMethodType,), # noqa: E501 + 'reusability': (PaymentMethodReusability,), # noqa: E501 + 'country': (str, none_type,), # noqa: E501 + 'customer_id': (str, none_type,), # noqa: E501 + 'reference_id': (str,), # noqa: E501 + 'description': (str, none_type,), # noqa: E501 + 'card': (CardParameters,), # noqa: E501 + 'direct_debit': (DirectDebitParameters,), # noqa: E501 + 'ewallet': (EWalletParameters,), # noqa: E501 + 'over_the_counter': (OverTheCounterParameters,), # noqa: E501 + 'virtual_account': (VirtualAccountParameters,), # noqa: E501 + 'qr_code': (QRCodeParameters,), # noqa: E501 + 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 + 'billing_information': (BillingInformation,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'type': 'type', # noqa: E501 + 'reusability': 'reusability', # noqa: E501 + 'country': 'country', # noqa: E501 + 'customer_id': 'customer_id', # noqa: E501 + 'reference_id': 'reference_id', # noqa: E501 + 'description': 'description', # noqa: E501 + 'card': 'card', # noqa: E501 + 'direct_debit': 'direct_debit', # noqa: E501 + 'ewallet': 'ewallet', # noqa: E501 + 'over_the_counter': 'over_the_counter', # noqa: E501 + 'virtual_account': 'virtual_account', # noqa: E501 + 'qr_code': 'qr_code', # noqa: E501 + 'metadata': 'metadata', # noqa: E501 + 'billing_information': 'billing_information', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, reusability, *args, **kwargs): # noqa: E501 + """PaymentMethodParameters - a model defined in OpenAPI + + Args: + type (PaymentMethodType): + reusability (PaymentMethodReusability): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + country (str, none_type): [optional] # noqa: E501 + customer_id (str, none_type): [optional] # noqa: E501 + reference_id (str): [optional] # noqa: E501 + description (str, none_type): [optional] # noqa: E501 + card (CardParameters): [optional] # noqa: E501 + direct_debit (DirectDebitParameters): [optional] # noqa: E501 + ewallet (EWalletParameters): [optional] # noqa: E501 + over_the_counter (OverTheCounterParameters): [optional] # noqa: E501 + virtual_account (VirtualAccountParameters): [optional] # noqa: E501 + qr_code (QRCodeParameters): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + billing_information (BillingInformation): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + self.reusability = reusability + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, type, reusability, *args, **kwargs): # noqa: E501 + """PaymentMethodParameters - a model defined in OpenAPI + + Args: + type (PaymentMethodType): + reusability (PaymentMethodReusability): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + country (str, none_type): [optional] # noqa: E501 + customer_id (str, none_type): [optional] # noqa: E501 + reference_id (str): [optional] # noqa: E501 + description (str, none_type): [optional] # noqa: E501 + card (CardParameters): [optional] # noqa: E501 + direct_debit (DirectDebitParameters): [optional] # noqa: E501 + ewallet (EWalletParameters): [optional] # noqa: E501 + over_the_counter (OverTheCounterParameters): [optional] # noqa: E501 + virtual_account (VirtualAccountParameters): [optional] # noqa: E501 + qr_code (QRCodeParameters): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + billing_information (BillingInformation): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + self.reusability = reusability + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/payment_method_reusability.py b/xendit/payment_method/model/payment_method_reusability.py new file mode 100644 index 00000000..9d68b81c --- /dev/null +++ b/xendit/payment_method/model/payment_method_reusability.py @@ -0,0 +1,289 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentMethodReusability(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'MULTIPLE_USE': "MULTIPLE_USE", + 'ONE_TIME_USE': "ONE_TIME_USE", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """PaymentMethodReusability - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["MULTIPLE_USE", "ONE_TIME_USE", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["MULTIPLE_USE", "ONE_TIME_USE", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """PaymentMethodReusability - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["MULTIPLE_USE", "ONE_TIME_USE", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["MULTIPLE_USE", "ONE_TIME_USE", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_method/model/payment_method_status.py b/xendit/payment_method/model/payment_method_status.py new file mode 100644 index 00000000..e734af32 --- /dev/null +++ b/xendit/payment_method/model/payment_method_status.py @@ -0,0 +1,293 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentMethodStatus(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'ACTIVE': "ACTIVE", + 'EXPIRED': "EXPIRED", + 'INACTIVE': "INACTIVE", + 'PENDING': "PENDING", + 'REQUIRES_ACTION': "REQUIRES_ACTION", + 'FAILED': "FAILED", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """PaymentMethodStatus - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["ACTIVE", "EXPIRED", "INACTIVE", "PENDING", "REQUIRES_ACTION", "FAILED", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["ACTIVE", "EXPIRED", "INACTIVE", "PENDING", "REQUIRES_ACTION", "FAILED", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """PaymentMethodStatus - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["ACTIVE", "EXPIRED", "INACTIVE", "PENDING", "REQUIRES_ACTION", "FAILED", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["ACTIVE", "EXPIRED", "INACTIVE", "PENDING", "REQUIRES_ACTION", "FAILED", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_method/model/payment_method_type.py b/xendit/payment_method/model/payment_method_type.py new file mode 100644 index 00000000..9f3d5665 --- /dev/null +++ b/xendit/payment_method/model/payment_method_type.py @@ -0,0 +1,295 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentMethodType(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'CARD': "CARD", + 'CRYPTOCURRENCY': "CRYPTOCURRENCY", + 'DIRECT_BANK_TRANSFER': "DIRECT_BANK_TRANSFER", + 'DIRECT_DEBIT': "DIRECT_DEBIT", + 'EWALLET': "EWALLET", + 'OVER_THE_COUNTER': "OVER_THE_COUNTER", + 'QR_CODE': "QR_CODE", + 'VIRTUAL_ACCOUNT': "VIRTUAL_ACCOUNT", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """PaymentMethodType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["CARD", "CRYPTOCURRENCY", "DIRECT_BANK_TRANSFER", "DIRECT_DEBIT", "EWALLET", "OVER_THE_COUNTER", "QR_CODE", "VIRTUAL_ACCOUNT", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["CARD", "CRYPTOCURRENCY", "DIRECT_BANK_TRANSFER", "DIRECT_DEBIT", "EWALLET", "OVER_THE_COUNTER", "QR_CODE", "VIRTUAL_ACCOUNT", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """PaymentMethodType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["CARD", "CRYPTOCURRENCY", "DIRECT_BANK_TRANSFER", "DIRECT_DEBIT", "EWALLET", "OVER_THE_COUNTER", "QR_CODE", "VIRTUAL_ACCOUNT", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["CARD", "CRYPTOCURRENCY", "DIRECT_BANK_TRANSFER", "DIRECT_DEBIT", "EWALLET", "OVER_THE_COUNTER", "QR_CODE", "VIRTUAL_ACCOUNT", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_method/model/payment_method_update_parameters.py b/xendit/payment_method/model/payment_method_update_parameters.py new file mode 100644 index 00000000..0f0b0c61 --- /dev/null +++ b/xendit/payment_method/model/payment_method_update_parameters.py @@ -0,0 +1,294 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.over_the_counter_update_parameters import OverTheCounterUpdateParameters + from xendit.payment_method.model.payment_method_reusability import PaymentMethodReusability + from xendit.payment_method.model.payment_method_status import PaymentMethodStatus + from xendit.payment_method.model.virtual_account_update_parameters import VirtualAccountUpdateParameters + globals()['OverTheCounterUpdateParameters'] = OverTheCounterUpdateParameters + globals()['PaymentMethodReusability'] = PaymentMethodReusability + globals()['PaymentMethodStatus'] = PaymentMethodStatus + globals()['VirtualAccountUpdateParameters'] = VirtualAccountUpdateParameters + + +class PaymentMethodUpdateParameters(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'description': (str,), # noqa: E501 + 'reference_id': (str,), # noqa: E501 + 'reusability': (PaymentMethodReusability,), # noqa: E501 + 'status': (PaymentMethodStatus,), # noqa: E501 + 'over_the_counter': (OverTheCounterUpdateParameters,), # noqa: E501 + 'virtual_account': (VirtualAccountUpdateParameters,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'description': 'description', # noqa: E501 + 'reference_id': 'reference_id', # noqa: E501 + 'reusability': 'reusability', # noqa: E501 + 'status': 'status', # noqa: E501 + 'over_the_counter': 'over_the_counter', # noqa: E501 + 'virtual_account': 'virtual_account', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PaymentMethodUpdateParameters - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + description (str): [optional] # noqa: E501 + reference_id (str): [optional] # noqa: E501 + reusability (PaymentMethodReusability): [optional] # noqa: E501 + status (PaymentMethodStatus): [optional] # noqa: E501 + over_the_counter (OverTheCounterUpdateParameters): [optional] # noqa: E501 + virtual_account (VirtualAccountUpdateParameters): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """PaymentMethodUpdateParameters - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + description (str): [optional] # noqa: E501 + reference_id (str): [optional] # noqa: E501 + reusability (PaymentMethodReusability): [optional] # noqa: E501 + status (PaymentMethodStatus): [optional] # noqa: E501 + over_the_counter (OverTheCounterUpdateParameters): [optional] # noqa: E501 + virtual_account (VirtualAccountUpdateParameters): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/qr_code.py b/xendit/payment_method/model/qr_code.py new file mode 100644 index 00000000..2bde22d6 --- /dev/null +++ b/xendit/payment_method/model/qr_code.py @@ -0,0 +1,334 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.qr_code_channel_code import QRCodeChannelCode + from xendit.payment_method.model.qr_code_channel_properties import QRCodeChannelProperties + from xendit.payment_method.model.qr_code_parameters import QRCodeParameters + globals()['QRCodeChannelCode'] = QRCodeChannelCode + globals()['QRCodeChannelProperties'] = QRCodeChannelProperties + globals()['QRCodeParameters'] = QRCodeParameters + + +class QRCode(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'amount': (float, none_type,), # noqa: E501 + 'currency': (str,), # noqa: E501 + 'channel_code': (QRCodeChannelCode,), # noqa: E501 + 'channel_properties': (QRCodeChannelProperties,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'amount': 'amount', # noqa: E501 + 'currency': 'currency', # noqa: E501 + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """QRCode - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + amount (float, none_type): [optional] # noqa: E501 + currency (str): [optional] # noqa: E501 + channel_code (QRCodeChannelCode): [optional] # noqa: E501 + channel_properties (QRCodeChannelProperties): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """QRCode - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + amount (float, none_type): [optional] # noqa: E501 + currency (str): [optional] # noqa: E501 + channel_code (QRCodeChannelCode): [optional] # noqa: E501 + channel_properties (QRCodeChannelProperties): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + QRCodeParameters, + ], + 'oneOf': [ + ], + } diff --git a/xendit/payment_method/model/qr_code_channel_code.py b/xendit/payment_method/model/qr_code_channel_code.py new file mode 100644 index 00000000..c9599fa3 --- /dev/null +++ b/xendit/payment_method/model/qr_code_channel_code.py @@ -0,0 +1,293 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class QRCodeChannelCode(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'None': None, + 'QRIS': "QRIS", + 'DANA': "DANA", + 'RCBC': "RCBC", + 'PROMPTPAY': "PROMPTPAY", + 'LINKAJA': "LINKAJA", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """QRCodeChannelCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): QR Code Channel Code., must be one of ["QRIS", "DANA", "RCBC", "PROMPTPAY", "LINKAJA", ] # noqa: E501 + + Keyword Args: + value (str): QR Code Channel Code., must be one of ["QRIS", "DANA", "RCBC", "PROMPTPAY", "LINKAJA", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """QRCodeChannelCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): QR Code Channel Code., must be one of ["QRIS", "DANA", "RCBC", "PROMPTPAY", "LINKAJA", ] # noqa: E501 + + Keyword Args: + value (str): QR Code Channel Code., must be one of ["QRIS", "DANA", "RCBC", "PROMPTPAY", "LINKAJA", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_method/model/qr_code_channel_properties.py b/xendit/payment_method/model/qr_code_channel_properties.py new file mode 100644 index 00000000..4eaaf879 --- /dev/null +++ b/xendit/payment_method/model/qr_code_channel_properties.py @@ -0,0 +1,266 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class QRCodeChannelProperties(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'qr_string': (str,), # noqa: E501 + 'expires_at': (datetime,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'qr_string': 'qr_string', # noqa: E501 + 'expires_at': 'expires_at', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """QRCodeChannelProperties - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + qr_string (str): QR string to be rendered for display to end users. QR string to image rendering are commonly available in software libraries (e.g Nodejs, PHP, Java). [optional] # noqa: E501 + expires_at (datetime): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """QRCodeChannelProperties - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + qr_string (str): QR string to be rendered for display to end users. QR string to image rendering are commonly available in software libraries (e.g Nodejs, PHP, Java). [optional] # noqa: E501 + expires_at (datetime): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/qr_code_parameters.py b/xendit/payment_method/model/qr_code_parameters.py new file mode 100644 index 00000000..5a0d35e6 --- /dev/null +++ b/xendit/payment_method/model/qr_code_parameters.py @@ -0,0 +1,282 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.qr_code_channel_code import QRCodeChannelCode + from xendit.payment_method.model.qr_code_channel_properties import QRCodeChannelProperties + globals()['QRCodeChannelCode'] = QRCodeChannelCode + globals()['QRCodeChannelProperties'] = QRCodeChannelProperties + + +class QRCodeParameters(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'amount': (float, none_type,), # noqa: E501 + 'currency': (str,), # noqa: E501 + 'channel_code': (QRCodeChannelCode,), # noqa: E501 + 'channel_properties': (QRCodeChannelProperties,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'amount': 'amount', # noqa: E501 + 'currency': 'currency', # noqa: E501 + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """QRCodeParameters - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + amount (float, none_type): [optional] # noqa: E501 + currency (str): [optional] # noqa: E501 + channel_code (QRCodeChannelCode): [optional] # noqa: E501 + channel_properties (QRCodeChannelProperties): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """QRCodeParameters - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + amount (float, none_type): [optional] # noqa: E501 + currency (str): [optional] # noqa: E501 + channel_code (QRCodeChannelCode): [optional] # noqa: E501 + channel_properties (QRCodeChannelProperties): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/simulate_payment_request.py b/xendit/payment_method/model/simulate_payment_request.py new file mode 100644 index 00000000..89ba21f6 --- /dev/null +++ b/xendit/payment_method/model/simulate_payment_request.py @@ -0,0 +1,262 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class SimulatePaymentRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'amount': (float,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'amount': 'amount', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SimulatePaymentRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + amount (float): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """SimulatePaymentRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + amount (float): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/tokenized_card_information.py b/xendit/payment_method/model/tokenized_card_information.py new file mode 100644 index 00000000..5cdb2de1 --- /dev/null +++ b/xendit/payment_method/model/tokenized_card_information.py @@ -0,0 +1,320 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class TokenizedCardInformation(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'token_id': (str,), # noqa: E501 + 'masked_card_number': (str,), # noqa: E501 + 'expiry_month': (str,), # noqa: E501 + 'expiry_year': (str,), # noqa: E501 + 'fingerprint': (str,), # noqa: E501 + 'type': (str,), # noqa: E501 + 'network': (str,), # noqa: E501 + 'country': (str,), # noqa: E501 + 'issuer': (str,), # noqa: E501 + 'cardholder_name': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'token_id': 'token_id', # noqa: E501 + 'masked_card_number': 'masked_card_number', # noqa: E501 + 'expiry_month': 'expiry_month', # noqa: E501 + 'expiry_year': 'expiry_year', # noqa: E501 + 'fingerprint': 'fingerprint', # noqa: E501 + 'type': 'type', # noqa: E501 + 'network': 'network', # noqa: E501 + 'country': 'country', # noqa: E501 + 'issuer': 'issuer', # noqa: E501 + 'cardholder_name': 'cardholder_name', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, token_id, masked_card_number, expiry_month, expiry_year, fingerprint, type, network, country, issuer, *args, **kwargs): # noqa: E501 + """TokenizedCardInformation - a model defined in OpenAPI + + Args: + token_id (str): + masked_card_number (str): 1st 6 and last 4 digits of the card + expiry_month (str): Card expiry month in MM format + expiry_year (str): Card expiry month in YY format + fingerprint (str): Xendit-generated identifier for the unique card number. Multiple payment method objects can be created for the same account - e.g. if the user first creates a one-time payment request, and then later on creates a multiple-use payment method using the same account. The fingerprint helps to identify the unique account being used. + type (str): Whether the card is a credit or debit card + network (str): Card network - VISA, MASTERCARD, JCB, AMEX, DISCOVER, BCA + country (str): Country where the card was issued ISO 3166-1 Alpha-2 + issuer (str): Issuer of the card, most often an issuing bank For example, “BCA”, “MANDIRI” + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cardholder_name (str, none_type): Cardholder name is optional but recommended for 3DS 2 / AVS verification. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.token_id = token_id + self.masked_card_number = masked_card_number + self.expiry_month = expiry_month + self.expiry_year = expiry_year + self.fingerprint = fingerprint + self.type = type + self.network = network + self.country = country + self.issuer = issuer + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, token_id, masked_card_number, expiry_month, expiry_year, fingerprint, type, network, country, issuer, *args, **kwargs): # noqa: E501 + """TokenizedCardInformation - a model defined in OpenAPI + + Args: + token_id (str): + masked_card_number (str): 1st 6 and last 4 digits of the card + expiry_month (str): Card expiry month in MM format + expiry_year (str): Card expiry month in YY format + fingerprint (str): Xendit-generated identifier for the unique card number. Multiple payment method objects can be created for the same account - e.g. if the user first creates a one-time payment request, and then later on creates a multiple-use payment method using the same account. The fingerprint helps to identify the unique account being used. + type (str): Whether the card is a credit or debit card + network (str): Card network - VISA, MASTERCARD, JCB, AMEX, DISCOVER, BCA + country (str): Country where the card was issued ISO 3166-1 Alpha-2 + issuer (str): Issuer of the card, most often an issuing bank For example, “BCA”, “MANDIRI” + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cardholder_name (str, none_type): Cardholder name is optional but recommended for 3DS 2 / AVS verification. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.token_id = token_id + self.masked_card_number = masked_card_number + self.expiry_month = expiry_month + self.expiry_year = expiry_year + self.fingerprint = fingerprint + self.type = type + self.network = network + self.country = country + self.issuer = issuer + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/virtual_account.py b/xendit/payment_method/model/virtual_account.py new file mode 100644 index 00000000..b8fdede3 --- /dev/null +++ b/xendit/payment_method/model/virtual_account.py @@ -0,0 +1,364 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.virtual_account_all_of import VirtualAccountAllOf + from xendit.payment_method.model.virtual_account_alternative_display import VirtualAccountAlternativeDisplay + from xendit.payment_method.model.virtual_account_channel_code import VirtualAccountChannelCode + from xendit.payment_method.model.virtual_account_channel_properties import VirtualAccountChannelProperties + from xendit.payment_method.model.virtual_account_parameters import VirtualAccountParameters + globals()['VirtualAccountAllOf'] = VirtualAccountAllOf + globals()['VirtualAccountAlternativeDisplay'] = VirtualAccountAlternativeDisplay + globals()['VirtualAccountChannelCode'] = VirtualAccountChannelCode + globals()['VirtualAccountChannelProperties'] = VirtualAccountChannelProperties + globals()['VirtualAccountParameters'] = VirtualAccountParameters + + +class VirtualAccount(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('alternative_display_types',): { + 'QR_STRING': "QR_STRING", + }, + } + + validations = { + ('min_amount',): { + 'inclusive_minimum': 1, + }, + ('max_amount',): { + 'inclusive_minimum': 1, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'channel_code': (VirtualAccountChannelCode,), # noqa: E501 + 'channel_properties': (VirtualAccountChannelProperties,), # noqa: E501 + 'amount': (float, none_type,), # noqa: E501 + 'min_amount': (float, none_type,), # noqa: E501 + 'max_amount': (float, none_type,), # noqa: E501 + 'currency': (str,), # noqa: E501 + 'alternative_display_types': ([str],), # noqa: E501 + 'alternative_displays': ([VirtualAccountAlternativeDisplay],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'amount': 'amount', # noqa: E501 + 'min_amount': 'min_amount', # noqa: E501 + 'max_amount': 'max_amount', # noqa: E501 + 'currency': 'currency', # noqa: E501 + 'alternative_display_types': 'alternative_display_types', # noqa: E501 + 'alternative_displays': 'alternative_displays', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """VirtualAccount - a model defined in OpenAPI + + Keyword Args: + channel_code (VirtualAccountChannelCode): + channel_properties (VirtualAccountChannelProperties): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + amount (float, none_type): [optional] # noqa: E501 + min_amount (float, none_type): [optional] # noqa: E501 + max_amount (float, none_type): [optional] # noqa: E501 + currency (str): [optional] # noqa: E501 + alternative_display_types ([str]): For payments in Vietnam only, alternative display requested for the virtual account. [optional] # noqa: E501 + alternative_displays ([VirtualAccountAlternativeDisplay]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """VirtualAccount - a model defined in OpenAPI + + Keyword Args: + channel_code (VirtualAccountChannelCode): + channel_properties (VirtualAccountChannelProperties): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + amount (float, none_type): [optional] # noqa: E501 + min_amount (float, none_type): [optional] # noqa: E501 + max_amount (float, none_type): [optional] # noqa: E501 + currency (str): [optional] # noqa: E501 + alternative_display_types ([str]): For payments in Vietnam only, alternative display requested for the virtual account. [optional] # noqa: E501 + alternative_displays ([VirtualAccountAlternativeDisplay]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + VirtualAccountAllOf, + VirtualAccountParameters, + ], + 'oneOf': [ + ], + } diff --git a/xendit/payment_method/model/virtual_account_all_of.py b/xendit/payment_method/model/virtual_account_all_of.py new file mode 100644 index 00000000..f4b8c75f --- /dev/null +++ b/xendit/payment_method/model/virtual_account_all_of.py @@ -0,0 +1,268 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.virtual_account_alternative_display import VirtualAccountAlternativeDisplay + globals()['VirtualAccountAlternativeDisplay'] = VirtualAccountAlternativeDisplay + + +class VirtualAccountAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'alternative_displays': ([VirtualAccountAlternativeDisplay],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'alternative_displays': 'alternative_displays', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """VirtualAccountAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + alternative_displays ([VirtualAccountAlternativeDisplay]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """VirtualAccountAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + alternative_displays ([VirtualAccountAlternativeDisplay]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/virtual_account_alternative_display.py b/xendit/payment_method/model/virtual_account_alternative_display.py new file mode 100644 index 00000000..8a65a3ec --- /dev/null +++ b/xendit/payment_method/model/virtual_account_alternative_display.py @@ -0,0 +1,270 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class VirtualAccountAlternativeDisplay(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('type',): { + 'QR_STRING': "QR_STRING", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'type': (str,), # noqa: E501 + 'data': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'type': 'type', # noqa: E501 + 'data': 'data', # noqa: E501 + } + + read_only_vars = { + 'type', # noqa: E501 + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """VirtualAccountAlternativeDisplay - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + type (str): Type of the alternative display. [optional] if omitted the server will use the default value of "QR_STRING" # noqa: E501 + data (str): Data payload of the given alternative display. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """VirtualAccountAlternativeDisplay - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + type (str): Type of the alternative display. [optional] if omitted the server will use the default value of "QR_STRING" # noqa: E501 + data (str): Data payload of the given alternative display. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/virtual_account_channel_code.py b/xendit/payment_method/model/virtual_account_channel_code.py new file mode 100644 index 00000000..fb08750c --- /dev/null +++ b/xendit/payment_method/model/virtual_account_channel_code.py @@ -0,0 +1,302 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class VirtualAccountChannelCode(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'BCA': "BCA", + 'BJB': "BJB", + 'BNI': "BNI", + 'BRI': "BRI", + 'MANDIRI': "MANDIRI", + 'PERMATA': "PERMATA", + 'BSI': "BSI", + 'CIMB': "CIMB", + 'SAHABAT_SAMPOERNA': "SAHABAT_SAMPOERNA", + 'ARTAJASA': "ARTAJASA", + 'PV': "PV", + 'VIETCAPITAL': "VIETCAPITAL", + 'WOORI': "WOORI", + 'MSB': "MSB", + 'STANDARD_CHARTERED': "STANDARD_CHARTERED", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """VirtualAccountChannelCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Virtual Account Channel Code., must be one of ["BCA", "BJB", "BNI", "BRI", "MANDIRI", "PERMATA", "BSI", "CIMB", "SAHABAT_SAMPOERNA", "ARTAJASA", "PV", "VIETCAPITAL", "WOORI", "MSB", "STANDARD_CHARTERED", ] # noqa: E501 + + Keyword Args: + value (str): Virtual Account Channel Code., must be one of ["BCA", "BJB", "BNI", "BRI", "MANDIRI", "PERMATA", "BSI", "CIMB", "SAHABAT_SAMPOERNA", "ARTAJASA", "PV", "VIETCAPITAL", "WOORI", "MSB", "STANDARD_CHARTERED", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """VirtualAccountChannelCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Virtual Account Channel Code., must be one of ["BCA", "BJB", "BNI", "BRI", "MANDIRI", "PERMATA", "BSI", "CIMB", "SAHABAT_SAMPOERNA", "ARTAJASA", "PV", "VIETCAPITAL", "WOORI", "MSB", "STANDARD_CHARTERED", ] # noqa: E501 + + Keyword Args: + value (str): Virtual Account Channel Code., must be one of ["BCA", "BJB", "BNI", "BRI", "MANDIRI", "PERMATA", "BSI", "CIMB", "SAHABAT_SAMPOERNA", "ARTAJASA", "PV", "VIETCAPITAL", "WOORI", "MSB", "STANDARD_CHARTERED", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_method/model/virtual_account_channel_properties.py b/xendit/payment_method/model/virtual_account_channel_properties.py new file mode 100644 index 00000000..cca4a324 --- /dev/null +++ b/xendit/payment_method/model/virtual_account_channel_properties.py @@ -0,0 +1,274 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class VirtualAccountChannelProperties(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'customer_name': (str,), # noqa: E501 + 'virtual_account_number': (str,), # noqa: E501 + 'expires_at': (datetime,), # noqa: E501 + 'suggested_amount': (float,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'customer_name': 'customer_name', # noqa: E501 + 'virtual_account_number': 'virtual_account_number', # noqa: E501 + 'expires_at': 'expires_at', # noqa: E501 + 'suggested_amount': 'suggested_amount', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """VirtualAccountChannelProperties - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + customer_name (str): Name of customer.. [optional] # noqa: E501 + virtual_account_number (str): You can assign specific Virtual Account number using this parameter. If you do not send one, one will be picked at random. Make sure the number you specify is within your Virtual Account range.. [optional] # noqa: E501 + expires_at (datetime): The date and time in ISO 8601 UTC+0 when the virtual account number will be expired. Default: The default expiration date will be 31 years from creation date.. [optional] # noqa: E501 + suggested_amount (float): The suggested amount you want to assign. Note: Suggested amounts is the amounts that can see as a suggestion, but user can still put any numbers (only supported for Mandiri and BRI). [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """VirtualAccountChannelProperties - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + customer_name (str): Name of customer.. [optional] # noqa: E501 + virtual_account_number (str): You can assign specific Virtual Account number using this parameter. If you do not send one, one will be picked at random. Make sure the number you specify is within your Virtual Account range.. [optional] # noqa: E501 + expires_at (datetime): The date and time in ISO 8601 UTC+0 when the virtual account number will be expired. Default: The default expiration date will be 31 years from creation date.. [optional] # noqa: E501 + suggested_amount (float): The suggested amount you want to assign. Note: Suggested amounts is the amounts that can see as a suggestion, but user can still put any numbers (only supported for Mandiri and BRI). [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/virtual_account_channel_properties_patch.py b/xendit/payment_method/model/virtual_account_channel_properties_patch.py new file mode 100644 index 00000000..44e6d21f --- /dev/null +++ b/xendit/payment_method/model/virtual_account_channel_properties_patch.py @@ -0,0 +1,269 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class VirtualAccountChannelPropertiesPatch(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('suggested_amount',): { + 'inclusive_minimum': 1, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'expires_at': (datetime,), # noqa: E501 + 'suggested_amount': (float,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'expires_at': 'expires_at', # noqa: E501 + 'suggested_amount': 'suggested_amount', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """VirtualAccountChannelPropertiesPatch - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + expires_at (datetime): The date and time in ISO 8601 UTC+0 when the virtual account number will be expired. Default: The default expiration date will be 31 years from creation date.. [optional] # noqa: E501 + suggested_amount (float): The suggested amount you want to assign. Note: Suggested amounts is the amounts that can see as a suggestion, but user can still put any numbers (only supported for Mandiri and BRI). [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """VirtualAccountChannelPropertiesPatch - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + expires_at (datetime): The date and time in ISO 8601 UTC+0 when the virtual account number will be expired. Default: The default expiration date will be 31 years from creation date.. [optional] # noqa: E501 + suggested_amount (float): The suggested amount you want to assign. Note: Suggested amounts is the amounts that can see as a suggestion, but user can still put any numbers (only supported for Mandiri and BRI). [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/virtual_account_parameters.py b/xendit/payment_method/model/virtual_account_parameters.py new file mode 100644 index 00000000..c3277f61 --- /dev/null +++ b/xendit/payment_method/model/virtual_account_parameters.py @@ -0,0 +1,311 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.virtual_account_channel_code import VirtualAccountChannelCode + from xendit.payment_method.model.virtual_account_channel_properties import VirtualAccountChannelProperties + globals()['VirtualAccountChannelCode'] = VirtualAccountChannelCode + globals()['VirtualAccountChannelProperties'] = VirtualAccountChannelProperties + + +class VirtualAccountParameters(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('alternative_display_types',): { + 'QR_STRING': "QR_STRING", + }, + } + + validations = { + ('min_amount',): { + 'inclusive_minimum': 1, + }, + ('max_amount',): { + 'inclusive_minimum': 1, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'channel_code': (VirtualAccountChannelCode,), # noqa: E501 + 'channel_properties': (VirtualAccountChannelProperties,), # noqa: E501 + 'amount': (float, none_type,), # noqa: E501 + 'min_amount': (float, none_type,), # noqa: E501 + 'max_amount': (float, none_type,), # noqa: E501 + 'currency': (str,), # noqa: E501 + 'alternative_display_types': ([str],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'amount': 'amount', # noqa: E501 + 'min_amount': 'min_amount', # noqa: E501 + 'max_amount': 'max_amount', # noqa: E501 + 'currency': 'currency', # noqa: E501 + 'alternative_display_types': 'alternative_display_types', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, channel_code, channel_properties, *args, **kwargs): # noqa: E501 + """VirtualAccountParameters - a model defined in OpenAPI + + Args: + channel_code (VirtualAccountChannelCode): + channel_properties (VirtualAccountChannelProperties): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + amount (float, none_type): [optional] # noqa: E501 + min_amount (float, none_type): [optional] # noqa: E501 + max_amount (float, none_type): [optional] # noqa: E501 + currency (str): [optional] # noqa: E501 + alternative_display_types ([str]): For payments in Vietnam only, alternative display requested for the virtual account. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.channel_code = channel_code + self.channel_properties = channel_properties + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, channel_code, channel_properties, *args, **kwargs): # noqa: E501 + """VirtualAccountParameters - a model defined in OpenAPI + + Args: + channel_code (VirtualAccountChannelCode): + channel_properties (VirtualAccountChannelProperties): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + amount (float, none_type): [optional] # noqa: E501 + min_amount (float, none_type): [optional] # noqa: E501 + max_amount (float, none_type): [optional] # noqa: E501 + currency (str): [optional] # noqa: E501 + alternative_display_types ([str]): For payments in Vietnam only, alternative display requested for the virtual account. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.channel_code = channel_code + self.channel_properties = channel_properties + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/model/virtual_account_update_parameters.py b/xendit/payment_method/model/virtual_account_update_parameters.py new file mode 100644 index 00000000..1b3c3778 --- /dev/null +++ b/xendit/payment_method/model/virtual_account_update_parameters.py @@ -0,0 +1,293 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_method.model.virtual_account_channel_properties_patch import VirtualAccountChannelPropertiesPatch + globals()['VirtualAccountChannelPropertiesPatch'] = VirtualAccountChannelPropertiesPatch + + +class VirtualAccountUpdateParameters(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('alternative_display_types',): { + 'QR_STRING': "QR_STRING", + }, + } + + validations = { + ('min_amount',): { + 'inclusive_minimum': 1, + }, + ('max_amount',): { + 'inclusive_minimum': 1, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'amount': (float, none_type,), # noqa: E501 + 'min_amount': (float, none_type,), # noqa: E501 + 'max_amount': (float, none_type,), # noqa: E501 + 'channel_properties': (VirtualAccountChannelPropertiesPatch,), # noqa: E501 + 'alternative_display_types': ([str],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'amount': 'amount', # noqa: E501 + 'min_amount': 'min_amount', # noqa: E501 + 'max_amount': 'max_amount', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'alternative_display_types': 'alternative_display_types', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """VirtualAccountUpdateParameters - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + amount (float, none_type): [optional] # noqa: E501 + min_amount (float, none_type): [optional] # noqa: E501 + max_amount (float, none_type): [optional] # noqa: E501 + channel_properties (VirtualAccountChannelPropertiesPatch): [optional] # noqa: E501 + alternative_display_types ([str]): For payments in Vietnam only, alternative display requested for the virtual account. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """VirtualAccountUpdateParameters - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + amount (float, none_type): [optional] # noqa: E501 + min_amount (float, none_type): [optional] # noqa: E501 + max_amount (float, none_type): [optional] # noqa: E501 + channel_properties (VirtualAccountChannelPropertiesPatch): [optional] # noqa: E501 + alternative_display_types ([str]): For payments in Vietnam only, alternative display requested for the virtual account. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_method/payment_method_api.py b/xendit/payment_method/payment_method_api.py new file mode 100644 index 00000000..c6e4e92e --- /dev/null +++ b/xendit/payment_method/payment_method_api.py @@ -0,0 +1,1393 @@ +""" + Payment Method Service v2 + + This API is used for Payment Method Service v2 # noqa: E501 + + The version of the OpenAPI document: 2.87.2 +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.api_client import ApiClient, Endpoint as _Endpoint +from xendit.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) + +from xendit.payment_method.model import * # noqa: F401,E501 + +class PaymentMethodApi(object): + """NOTE: This class is auto generated by the OpenAPI Generator. + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.auth_payment_method_endpoint = _Endpoint( + settings={ + 'response_type': (PaymentMethod,), + 'auth': [], + 'endpoint_path': '/v2/payment_methods/{paymentMethodId}/auth', + 'operation_id': 'auth_payment_method', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'payment_method_id', + 'payment_method_auth_parameters', + ], + 'required': [ + 'payment_method_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'payment_method_id': + (str,), + 'payment_method_auth_parameters': + (PaymentMethodAuthParameters,), + }, + 'attribute_map': { + 'payment_method_id': 'paymentMethodId', + }, + 'location_map': { + 'payment_method_id': 'path', + 'payment_method_auth_parameters': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.create_payment_method_endpoint = _Endpoint( + settings={ + 'response_type': (PaymentMethod,), + 'auth': [], + 'endpoint_path': '/v2/payment_methods', + 'operation_id': 'create_payment_method', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'payment_method_parameters', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'payment_method_parameters': + (PaymentMethodParameters,), + }, + 'attribute_map': { + }, + 'location_map': { + 'payment_method_parameters': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.expire_payment_method_endpoint = _Endpoint( + settings={ + 'response_type': (PaymentMethod,), + 'auth': [], + 'endpoint_path': '/v2/payment_methods/{paymentMethodId}/expire', + 'operation_id': 'expire_payment_method', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'payment_method_id', + 'payment_method_expire_parameters', + ], + 'required': [ + 'payment_method_id', + ], + 'nullable': [ + 'payment_method_expire_parameters', + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'payment_method_id': + (str,), + 'payment_method_expire_parameters': + (PaymentMethodExpireParameters,), + }, + 'attribute_map': { + 'payment_method_id': 'paymentMethodId', + }, + 'location_map': { + 'payment_method_id': 'path', + 'payment_method_expire_parameters': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.get_all_payment_channels_endpoint = _Endpoint( + settings={ + 'response_type': (PaymentChannelList,), + 'auth': [], + 'endpoint_path': '/v2/payment_methods/channels', + 'operation_id': 'get_all_payment_channels', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'is_activated', + 'type', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + 'is_activated', + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + ('is_activated',): { + + "TRUE": True, + "FALSE": False + }, + }, + 'openapi_types': { + 'is_activated': + (bool,), + 'type': + (str,), + }, + 'attribute_map': { + 'is_activated': 'is_activated', + 'type': 'type', + }, + 'location_map': { + 'is_activated': 'query', + 'type': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.get_all_payment_methods_endpoint = _Endpoint( + settings={ + 'response_type': (PaymentMethodList,), + 'auth': [], + 'endpoint_path': '/v2/payment_methods', + 'operation_id': 'get_all_payment_methods', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'id', + 'type', + 'status', + 'reusability', + 'customer_id', + 'reference_id', + 'after_id', + 'before_id', + 'limit', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'limit', + ] + }, + root_map={ + 'validations': { + ('limit',): { + + 'inclusive_minimum': 1, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'id': + ([str],), + 'type': + ([str],), + 'status': + ([PaymentMethodStatus],), + 'reusability': + (PaymentMethodReusability,), + 'customer_id': + (str,), + 'reference_id': + (str,), + 'after_id': + (str,), + 'before_id': + (str,), + 'limit': + (int,), + }, + 'attribute_map': { + 'id': 'id', + 'type': 'type', + 'status': 'status', + 'reusability': 'reusability', + 'customer_id': 'customer_id', + 'reference_id': 'reference_id', + 'after_id': 'after_id', + 'before_id': 'before_id', + 'limit': 'limit', + }, + 'location_map': { + 'id': 'query', + 'type': 'query', + 'status': 'query', + 'reusability': 'query', + 'customer_id': 'query', + 'reference_id': 'query', + 'after_id': 'query', + 'before_id': 'query', + 'limit': 'query', + }, + 'collection_format_map': { + 'id': 'multi', + 'type': 'multi', + 'status': 'multi', + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.get_payment_method_by_id_endpoint = _Endpoint( + settings={ + 'response_type': (PaymentMethod,), + 'auth': [], + 'endpoint_path': '/v2/payment_methods/{paymentMethodId}', + 'operation_id': 'get_payment_method_by_id', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'payment_method_id', + ], + 'required': [ + 'payment_method_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'payment_method_id': + (str,), + }, + 'attribute_map': { + 'payment_method_id': 'paymentMethodId', + }, + 'location_map': { + 'payment_method_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.get_payments_by_payment_method_id_endpoint = _Endpoint( + settings={ + 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), + 'auth': [], + 'endpoint_path': '/v2/payment_methods/{paymentMethodId}/payments', + 'operation_id': 'get_payments_by_payment_method_id', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'payment_method_id', + 'payment_request_id', + 'payment_method_id2', + 'reference_id', + 'payment_method_type', + 'channel_code', + 'status', + 'currency', + 'created_gte', + 'created_lte', + 'updated_gte', + 'updated_lte', + 'limit', + 'after_id', + 'before_id', + ], + 'required': [ + 'payment_method_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'payment_method_id': + (str,), + 'payment_request_id': + ([str],), + 'payment_method_id2': + ([str],), + 'reference_id': + ([str],), + 'payment_method_type': + ([PaymentMethodType],), + 'channel_code': + ([str],), + 'status': + ([str],), + 'currency': + ([str],), + 'created_gte': + (datetime,), + 'created_lte': + (datetime,), + 'updated_gte': + (datetime,), + 'updated_lte': + (datetime,), + 'limit': + (int,), + 'after_id': + (str,), + 'before_id': + (str,), + }, + 'attribute_map': { + 'payment_method_id': 'paymentMethodId', + 'payment_request_id': 'payment_request_id', + 'payment_method_id2': 'payment_method_id', + 'reference_id': 'reference_id', + 'payment_method_type': 'payment_method_type', + 'channel_code': 'channel_code', + 'status': 'status', + 'currency': 'currency', + 'created_gte': 'created[gte]', + 'created_lte': 'created[lte]', + 'updated_gte': 'updated[gte]', + 'updated_lte': 'updated[lte]', + 'limit': 'limit', + 'after_id': 'after_id', + 'before_id': 'before_id', + }, + 'location_map': { + 'payment_method_id': 'path', + 'payment_request_id': 'query', + 'payment_method_id2': 'query', + 'reference_id': 'query', + 'payment_method_type': 'query', + 'channel_code': 'query', + 'status': 'query', + 'currency': 'query', + 'created_gte': 'query', + 'created_lte': 'query', + 'updated_gte': 'query', + 'updated_lte': 'query', + 'limit': 'query', + 'after_id': 'query', + 'before_id': 'query', + }, + 'collection_format_map': { + 'payment_request_id': 'multi', + 'payment_method_id2': 'multi', + 'reference_id': 'multi', + 'payment_method_type': 'multi', + 'channel_code': 'multi', + 'status': 'multi', + 'currency': 'multi', + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.patch_payment_method_endpoint = _Endpoint( + settings={ + 'response_type': (PaymentMethod,), + 'auth': [], + 'endpoint_path': '/v2/payment_methods/{paymentMethodId}', + 'operation_id': 'patch_payment_method', + 'http_method': 'PATCH', + 'servers': None, + }, + params_map={ + 'all': [ + 'payment_method_id', + 'payment_method_update_parameters', + ], + 'required': [ + 'payment_method_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'payment_method_id': + (str,), + 'payment_method_update_parameters': + (PaymentMethodUpdateParameters,), + }, + 'attribute_map': { + 'payment_method_id': 'paymentMethodId', + }, + 'location_map': { + 'payment_method_id': 'path', + 'payment_method_update_parameters': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.simulate_payment_endpoint = _Endpoint( + settings={ + 'response_type': None, + 'auth': [], + 'endpoint_path': '/v2/payment_methods/{paymentMethodId}/payments/simulate', + 'operation_id': 'simulate_payment', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'payment_method_id', + 'simulate_payment_request', + ], + 'required': [ + 'payment_method_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'payment_method_id': + (str,), + 'simulate_payment_request': + (SimulatePaymentRequest,), + }, + 'attribute_map': { + 'payment_method_id': 'paymentMethodId', + }, + 'location_map': { + 'payment_method_id': 'path', + 'simulate_payment_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + + def auth_payment_method( + self, + payment_method_id, + **kwargs + ): + """Validate a payment method's linking OTP # noqa: E501 + + This endpoint validates a payment method linking OTP # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.auth_payment_method(payment_method_id, async_req=True) + >>> result = thread.get() + + Args: + payment_method_id (str): + + Keyword Args: + payment_method_auth_parameters (PaymentMethodAuthParameters): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + PaymentMethod + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['payment_method_id'] = \ + payment_method_id + return self.auth_payment_method_endpoint.call_with_http_info(**kwargs) + + def create_payment_method( + self, + **kwargs + ): + """Creates payment method # noqa: E501 + + This endpoint initiates creation of payment method # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_payment_method(async_req=True) + >>> result = thread.get() + + + Keyword Args: + payment_method_parameters (PaymentMethodParameters): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + PaymentMethod + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + return self.create_payment_method_endpoint.call_with_http_info(**kwargs) + + def expire_payment_method( + self, + payment_method_id, + **kwargs + ): + """Expires a payment method # noqa: E501 + + This endpoint expires a payment method and performs unlinking if necessary # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.expire_payment_method(payment_method_id, async_req=True) + >>> result = thread.get() + + Args: + payment_method_id (str): + + Keyword Args: + payment_method_expire_parameters (PaymentMethodExpireParameters): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + PaymentMethod + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['payment_method_id'] = \ + payment_method_id + return self.expire_payment_method_endpoint.call_with_http_info(**kwargs) + + def get_all_payment_channels( + self, + **kwargs + ): + """Get all payment channels # noqa: E501 + + Get all payment channels # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_all_payment_channels(async_req=True) + >>> result = thread.get() + + + Keyword Args: + is_activated (bool): [optional] if omitted the server will use the default value of True + type (str): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + PaymentChannelList + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + return self.get_all_payment_channels_endpoint.call_with_http_info(**kwargs) + + def get_all_payment_methods( + self, + **kwargs + ): + """Get all payment methods by filters # noqa: E501 + + Get all payment methods by filters # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_all_payment_methods(async_req=True) + >>> result = thread.get() + + + Keyword Args: + id ([str]): [optional] + type ([str]): [optional] + status ([PaymentMethodStatus]): [optional] + reusability (PaymentMethodReusability): [optional] + customer_id (str): [optional] + reference_id (str): [optional] + after_id (str): [optional] + before_id (str): [optional] + limit (int): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + PaymentMethodList + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + return self.get_all_payment_methods_endpoint.call_with_http_info(**kwargs) + + def get_payment_method_by_id( + self, + payment_method_id, + **kwargs + ): + """Get payment method by ID # noqa: E501 + + Get payment method by ID # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_payment_method_by_id(payment_method_id, async_req=True) + >>> result = thread.get() + + Args: + payment_method_id (str): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + PaymentMethod + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['payment_method_id'] = \ + payment_method_id + return self.get_payment_method_by_id_endpoint.call_with_http_info(**kwargs) + + def get_payments_by_payment_method_id( + self, + payment_method_id, + **kwargs + ): + """Returns payments with matching PaymentMethodID. # noqa: E501 + + Returns payments with matching PaymentMethodID. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_payments_by_payment_method_id(payment_method_id, async_req=True) + >>> result = thread.get() + + Args: + payment_method_id (str): + + Keyword Args: + payment_request_id ([str]): [optional] + payment_method_id2 ([str]): [optional] + reference_id ([str]): [optional] + payment_method_type ([PaymentMethodType]): [optional] + channel_code ([str]): [optional] + status ([str]): [optional] + currency ([str]): [optional] + created_gte (datetime): [optional] + created_lte (datetime): [optional] + updated_gte (datetime): [optional] + updated_lte (datetime): [optional] + limit (int): [optional] + after_id (str): [optional] + before_id (str): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['payment_method_id'] = \ + payment_method_id + return self.get_payments_by_payment_method_id_endpoint.call_with_http_info(**kwargs) + + def patch_payment_method( + self, + payment_method_id, + **kwargs + ): + """Patch payment methods # noqa: E501 + + This endpoint is used to toggle the ```status``` of an e-Wallet or a Direct Debit payment method to ```ACTIVE``` or ```INACTIVE```. This is also used to update the details of an Over-the-Counter or a Virtual Account payment method. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.patch_payment_method(payment_method_id, async_req=True) + >>> result = thread.get() + + Args: + payment_method_id (str): + + Keyword Args: + payment_method_update_parameters (PaymentMethodUpdateParameters): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + PaymentMethod + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['payment_method_id'] = \ + payment_method_id + return self.patch_payment_method_endpoint.call_with_http_info(**kwargs) + + def simulate_payment( + self, + payment_method_id, + **kwargs + ): + """Makes payment with matching PaymentMethodID. # noqa: E501 + + Makes payment with matching PaymentMethodID. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.simulate_payment(payment_method_id, async_req=True) + >>> result = thread.get() + + Args: + payment_method_id (str): + + Keyword Args: + simulate_payment_request (SimulatePaymentRequest): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['payment_method_id'] = \ + payment_method_id + return self.simulate_payment_endpoint.call_with_http_info(**kwargs) + diff --git a/xendit/payment_request/__init__.py b/xendit/payment_request/__init__.py new file mode 100644 index 00000000..d8d553a2 --- /dev/null +++ b/xendit/payment_request/__init__.py @@ -0,0 +1 @@ +from xendit.payment_request.payment_request_api import PaymentRequestApi diff --git a/xendit/payment_request/model/__init__.py b/xendit/payment_request/model/__init__.py new file mode 100644 index 00000000..58d3982b --- /dev/null +++ b/xendit/payment_request/model/__init__.py @@ -0,0 +1,75 @@ +# flake8: noqa + +# import all models into this package +# if you have many models here with many references from one model to another this may +# raise a RecursionError +# to avoid this, import only the models that you directly need like: +# from xendit.payment_request.model.pet import Pet +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + +from xendit.payment_request.model.capture import Capture +from xendit.payment_request.model.capture_list import CaptureList +from xendit.payment_request.model.capture_list_response import CaptureListResponse +from xendit.payment_request.model.capture_parameters import CaptureParameters +from xendit.payment_request.model.card import Card +from xendit.payment_request.model.card_channel_properties import CardChannelProperties +from xendit.payment_request.model.card_information import CardInformation +from xendit.payment_request.model.card_verification_results import CardVerificationResults +from xendit.payment_request.model.card_verification_results_three_d_secure import CardVerificationResultsThreeDSecure +from xendit.payment_request.model.direct_debit import DirectDebit +from xendit.payment_request.model.direct_debit_all_of import DirectDebitAllOf +from xendit.payment_request.model.direct_debit_bank_account import DirectDebitBankAccount +from xendit.payment_request.model.direct_debit_channel_code import DirectDebitChannelCode +from xendit.payment_request.model.direct_debit_channel_properties import DirectDebitChannelProperties +from xendit.payment_request.model.direct_debit_channel_properties_bank_account import DirectDebitChannelPropertiesBankAccount +from xendit.payment_request.model.direct_debit_channel_properties_bank_redirect import DirectDebitChannelPropertiesBankRedirect +from xendit.payment_request.model.direct_debit_channel_properties_debit_card import DirectDebitChannelPropertiesDebitCard +from xendit.payment_request.model.direct_debit_debit_card import DirectDebitDebitCard +from xendit.payment_request.model.direct_debit_parameters import DirectDebitParameters +from xendit.payment_request.model.direct_debit_type import DirectDebitType +from xendit.payment_request.model.e_wallet import EWallet +from xendit.payment_request.model.e_wallet_account import EWalletAccount +from xendit.payment_request.model.e_wallet_all_of import EWalletAllOf +from xendit.payment_request.model.e_wallet_channel_code import EWalletChannelCode +from xendit.payment_request.model.e_wallet_channel_properties import EWalletChannelProperties +from xendit.payment_request.model.e_wallet_parameters import EWalletParameters +from xendit.payment_request.model.error import Error +from xendit.payment_request.model.over_the_counter import OverTheCounter +from xendit.payment_request.model.over_the_counter_channel_code import OverTheCounterChannelCode +from xendit.payment_request.model.over_the_counter_channel_properties import OverTheCounterChannelProperties +from xendit.payment_request.model.over_the_counter_parameters import OverTheCounterParameters +from xendit.payment_request.model.payment_method import PaymentMethod +from xendit.payment_request.model.payment_method_parameters import PaymentMethodParameters +from xendit.payment_request.model.payment_method_reusability import PaymentMethodReusability +from xendit.payment_request.model.payment_method_status import PaymentMethodStatus +from xendit.payment_request.model.payment_method_type import PaymentMethodType +from xendit.payment_request.model.payment_request import PaymentRequest +from xendit.payment_request.model.payment_request_action import PaymentRequestAction +from xendit.payment_request.model.payment_request_auth_parameters import PaymentRequestAuthParameters +from xendit.payment_request.model.payment_request_basket import PaymentRequestBasket +from xendit.payment_request.model.payment_request_basket_item import PaymentRequestBasketItem +from xendit.payment_request.model.payment_request_capture_method import PaymentRequestCaptureMethod +from xendit.payment_request.model.payment_request_card_verification_results import PaymentRequestCardVerificationResults +from xendit.payment_request.model.payment_request_card_verification_results_three_dee_secure import PaymentRequestCardVerificationResultsThreeDeeSecure +from xendit.payment_request.model.payment_request_channel_properties import PaymentRequestChannelProperties +from xendit.payment_request.model.payment_request_country import PaymentRequestCountry +from xendit.payment_request.model.payment_request_currency import PaymentRequestCurrency +from xendit.payment_request.model.payment_request_initiator import PaymentRequestInitiator +from xendit.payment_request.model.payment_request_list_response import PaymentRequestListResponse +from xendit.payment_request.model.payment_request_parameters import PaymentRequestParameters +from xendit.payment_request.model.payment_request_parameters_channel_properties import PaymentRequestParametersChannelProperties +from xendit.payment_request.model.payment_request_parameters_channel_properties_all_of import PaymentRequestParametersChannelPropertiesAllOf +from xendit.payment_request.model.payment_request_shipping_information import PaymentRequestShippingInformation +from xendit.payment_request.model.payment_request_status import PaymentRequestStatus +from xendit.payment_request.model.qr_code import QRCode +from xendit.payment_request.model.qr_code_channel_code import QRCodeChannelCode +from xendit.payment_request.model.qr_code_channel_properties import QRCodeChannelProperties +from xendit.payment_request.model.qr_code_parameters import QRCodeParameters +from xendit.payment_request.model.virtual_account import VirtualAccount +from xendit.payment_request.model.virtual_account_all_of import VirtualAccountAllOf +from xendit.payment_request.model.virtual_account_alternative_display import VirtualAccountAlternativeDisplay +from xendit.payment_request.model.virtual_account_channel_code import VirtualAccountChannelCode +from xendit.payment_request.model.virtual_account_channel_properties import VirtualAccountChannelProperties +from xendit.payment_request.model.virtual_account_parameters import VirtualAccountParameters diff --git a/xendit/payment_request/model/capture.py b/xendit/payment_request/model/capture.py new file mode 100644 index 00000000..28401585 --- /dev/null +++ b/xendit/payment_request/model/capture.py @@ -0,0 +1,362 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.payment_method import PaymentMethod + globals()['PaymentMethod'] = PaymentMethod + + +class Capture(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('status',): { + 'SUCCEEDED': "SUCCEEDED", + 'FAILED': "FAILED", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'id': (str,), # noqa: E501 + 'payment_request_id': (str,), # noqa: E501 + 'payment_id': (str,), # noqa: E501 + 'reference_id': (str,), # noqa: E501 + 'currency': (str,), # noqa: E501 + 'authorized_amount': (float,), # noqa: E501 + 'captured_amount': (float,), # noqa: E501 + 'status': (str,), # noqa: E501 + 'payment_method': (PaymentMethod,), # noqa: E501 + 'failure_code': (str, none_type,), # noqa: E501 + 'customer_id': (str, none_type,), # noqa: E501 + 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 + 'channel_properties': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 + 'created': (str,), # noqa: E501 + 'updated': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'payment_request_id': 'payment_request_id', # noqa: E501 + 'payment_id': 'payment_id', # noqa: E501 + 'reference_id': 'reference_id', # noqa: E501 + 'currency': 'currency', # noqa: E501 + 'authorized_amount': 'authorized_amount', # noqa: E501 + 'captured_amount': 'captured_amount', # noqa: E501 + 'status': 'status', # noqa: E501 + 'payment_method': 'payment_method', # noqa: E501 + 'failure_code': 'failure_code', # noqa: E501 + 'customer_id': 'customer_id', # noqa: E501 + 'metadata': 'metadata', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'created': 'created', # noqa: E501 + 'updated': 'updated', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, payment_request_id, payment_id, reference_id, currency, authorized_amount, captured_amount, status, payment_method, failure_code, customer_id, metadata, channel_properties, created, updated, *args, **kwargs): # noqa: E501 + """Capture - a model defined in OpenAPI + + Args: + id (str): + payment_request_id (str): + payment_id (str): + reference_id (str): + currency (str): + authorized_amount (float): + captured_amount (float): + status (str): + payment_method (PaymentMethod): + failure_code (str, none_type): + customer_id (str, none_type): + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): + channel_properties ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): + created (str): + updated (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.payment_request_id = payment_request_id + self.payment_id = payment_id + self.reference_id = reference_id + self.currency = currency + self.authorized_amount = authorized_amount + self.captured_amount = captured_amount + self.status = status + self.payment_method = payment_method + self.failure_code = failure_code + self.customer_id = customer_id + self.metadata = metadata + self.channel_properties = channel_properties + self.created = created + self.updated = updated + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, id, payment_request_id, payment_id, reference_id, currency, authorized_amount, captured_amount, status, payment_method, failure_code, customer_id, metadata, channel_properties, created, updated, *args, **kwargs): # noqa: E501 + """Capture - a model defined in OpenAPI + + Args: + id (str): + payment_request_id (str): + payment_id (str): + reference_id (str): + currency (str): + authorized_amount (float): + captured_amount (float): + status (str): + payment_method (PaymentMethod): + failure_code (str, none_type): + customer_id (str, none_type): + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): + channel_properties ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): + created (str): + updated (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.payment_request_id = payment_request_id + self.payment_id = payment_id + self.reference_id = reference_id + self.currency = currency + self.authorized_amount = authorized_amount + self.captured_amount = captured_amount + self.status = status + self.payment_method = payment_method + self.failure_code = failure_code + self.customer_id = customer_id + self.metadata = metadata + self.channel_properties = channel_properties + self.created = created + self.updated = updated + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/capture_list.py b/xendit/payment_request/model/capture_list.py new file mode 100644 index 00000000..83d58917 --- /dev/null +++ b/xendit/payment_request/model/capture_list.py @@ -0,0 +1,290 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.capture import Capture + globals()['Capture'] = Capture + + +class CaptureList(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'value': ([Capture],), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """CaptureList - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([Capture]): # noqa: E501 + + Keyword Args: + value ([Capture]): # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """CaptureList - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([Capture]): # noqa: E501 + + Keyword Args: + value ([Capture]): # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_request/model/capture_list_response.py b/xendit/payment_request/model/capture_list_response.py new file mode 100644 index 00000000..2ccd10f0 --- /dev/null +++ b/xendit/payment_request/model/capture_list_response.py @@ -0,0 +1,280 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.capture_list import CaptureList + globals()['CaptureList'] = CaptureList + + +class CaptureListResponse(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'data': (CaptureList,), # noqa: E501 + 'has_more': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'data': 'data', # noqa: E501 + 'has_more': 'has_more', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, has_more, *args, **kwargs): # noqa: E501 + """CaptureListResponse - a model defined in OpenAPI + + Args: + data (CaptureList): + has_more (bool): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + self.has_more = has_more + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, data, has_more, *args, **kwargs): # noqa: E501 + """CaptureListResponse - a model defined in OpenAPI + + Args: + data (CaptureList): + has_more (bool): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + self.has_more = has_more + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/capture_parameters.py b/xendit/payment_request/model/capture_parameters.py new file mode 100644 index 00000000..4dc5c98e --- /dev/null +++ b/xendit/payment_request/model/capture_parameters.py @@ -0,0 +1,272 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class CaptureParameters(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'capture_amount': (float,), # noqa: E501 + 'reference_id': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'capture_amount': 'capture_amount', # noqa: E501 + 'reference_id': 'reference_id', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, capture_amount, *args, **kwargs): # noqa: E501 + """CaptureParameters - a model defined in OpenAPI + + Args: + capture_amount (float): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + reference_id (str, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.capture_amount = capture_amount + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, capture_amount, *args, **kwargs): # noqa: E501 + """CaptureParameters - a model defined in OpenAPI + + Args: + capture_amount (float): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + reference_id (str, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.capture_amount = capture_amount + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/card.py b/xendit/payment_request/model/card.py new file mode 100644 index 00000000..632d1b14 --- /dev/null +++ b/xendit/payment_request/model/card.py @@ -0,0 +1,296 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.card_channel_properties import CardChannelProperties + from xendit.payment_request.model.card_information import CardInformation + from xendit.payment_request.model.card_verification_results import CardVerificationResults + from xendit.payment_request.model.payment_request_currency import PaymentRequestCurrency + globals()['CardChannelProperties'] = CardChannelProperties + globals()['CardInformation'] = CardInformation + globals()['CardVerificationResults'] = CardVerificationResults + globals()['PaymentRequestCurrency'] = PaymentRequestCurrency + + +class Card(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'currency': (PaymentRequestCurrency,), # noqa: E501 + 'channel_properties': (CardChannelProperties,), # noqa: E501 + 'card_information': (CardInformation,), # noqa: E501 + 'card_verification_results': (CardVerificationResults,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'currency': 'currency', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'card_information': 'card_information', # noqa: E501 + 'card_verification_results': 'card_verification_results', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, currency, channel_properties, card_information, *args, **kwargs): # noqa: E501 + """Card - a model defined in OpenAPI + + Args: + currency (PaymentRequestCurrency): + channel_properties (CardChannelProperties): + card_information (CardInformation): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + card_verification_results (CardVerificationResults): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.currency = currency + self.channel_properties = channel_properties + self.card_information = card_information + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, currency, channel_properties, card_information, *args, **kwargs): # noqa: E501 + """Card - a model defined in OpenAPI + + Args: + currency (PaymentRequestCurrency): + channel_properties (CardChannelProperties): + card_information (CardInformation): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + card_verification_results (CardVerificationResults): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.currency = currency + self.channel_properties = channel_properties + self.card_information = card_information + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/card_channel_properties.py b/xendit/payment_request/model/card_channel_properties.py new file mode 100644 index 00000000..857ffb93 --- /dev/null +++ b/xendit/payment_request/model/card_channel_properties.py @@ -0,0 +1,288 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class CardChannelProperties(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('success_return_url',): { + 'regex': { + 'pattern': r'^\S{1,255}:\/\/\S{0,1000}$', # noqa: E501 + }, + }, + ('failure_return_url',): { + 'regex': { + 'pattern': r'^\S{1,255}:\/\/\S{0,1000}$', # noqa: E501 + }, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'skip_three_d_secure': (bool, none_type,), # noqa: E501 + 'success_return_url': (str, none_type,), # noqa: E501 + 'failure_return_url': (str, none_type,), # noqa: E501 + 'cardonfile_type': (str, none_type,), # noqa: E501 + 'merchant_id_tag': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'skip_three_d_secure': 'skip_three_d_secure', # noqa: E501 + 'success_return_url': 'success_return_url', # noqa: E501 + 'failure_return_url': 'failure_return_url', # noqa: E501 + 'cardonfile_type': 'cardonfile_type', # noqa: E501 + 'merchant_id_tag': 'merchant_id_tag', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """CardChannelProperties - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + skip_three_d_secure (bool, none_type): To indicate whether to perform 3DS during the linking phase. [optional] # noqa: E501 + success_return_url (str, none_type): URL where the end-customer is redirected if the authorization is successful. [optional] # noqa: E501 + failure_return_url (str, none_type): URL where the end-customer is redirected if the authorization failed. [optional] # noqa: E501 + cardonfile_type (str, none_type): Type of “credential-on-file” / “card-on-file” payment being made. Indicate that this payment uses a previously linked Payment Method for charging.. [optional] # noqa: E501 + merchant_id_tag (str): Tag for a Merchant ID that you want to associate this payment with. For merchants using their own MIDs to specify which MID they want to use. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """CardChannelProperties - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + skip_three_d_secure (bool, none_type): To indicate whether to perform 3DS during the linking phase. [optional] # noqa: E501 + success_return_url (str, none_type): URL where the end-customer is redirected if the authorization is successful. [optional] # noqa: E501 + failure_return_url (str, none_type): URL where the end-customer is redirected if the authorization failed. [optional] # noqa: E501 + cardonfile_type (str, none_type): Type of “credential-on-file” / “card-on-file” payment being made. Indicate that this payment uses a previously linked Payment Method for charging.. [optional] # noqa: E501 + merchant_id_tag (str): Tag for a Merchant ID that you want to associate this payment with. For merchants using their own MIDs to specify which MID they want to use. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/card_information.py b/xendit/payment_request/model/card_information.py new file mode 100644 index 00000000..02fcd110 --- /dev/null +++ b/xendit/payment_request/model/card_information.py @@ -0,0 +1,317 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class CardInformation(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('network',): { + 'VISA': "VISA", + 'MASTERCARD': "MASTERCARD", + 'JCB': "JCB", + 'AMEX': "AMEX", + 'DISCOVER': "DISCOVER", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'token_id': (str,), # noqa: E501 + 'masked_card_number': (str,), # noqa: E501 + 'expiry_month': (str,), # noqa: E501 + 'expiry_year': (str,), # noqa: E501 + 'cardholder_name': (str, none_type,), # noqa: E501 + 'fingerprint': (str,), # noqa: E501 + 'type': (str,), # noqa: E501 + 'network': (str,), # noqa: E501 + 'country': (str,), # noqa: E501 + 'issuer': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'token_id': 'token_id', # noqa: E501 + 'masked_card_number': 'masked_card_number', # noqa: E501 + 'expiry_month': 'expiry_month', # noqa: E501 + 'expiry_year': 'expiry_year', # noqa: E501 + 'cardholder_name': 'cardholder_name', # noqa: E501 + 'fingerprint': 'fingerprint', # noqa: E501 + 'type': 'type', # noqa: E501 + 'network': 'network', # noqa: E501 + 'country': 'country', # noqa: E501 + 'issuer': 'issuer', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, token_id, masked_card_number, expiry_month, expiry_year, *args, **kwargs): # noqa: E501 + """CardInformation - a model defined in OpenAPI + + Args: + token_id (str): + masked_card_number (str): 1st 6 and last 4 digits of the card + expiry_month (str): Card expiry month in MM format + expiry_year (str): Card expiry month in YY format + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cardholder_name (str, none_type): Cardholder name. [optional] # noqa: E501 + fingerprint (str): [optional] # noqa: E501 + type (str): [optional] # noqa: E501 + network (str): [optional] # noqa: E501 + country (str): [optional] # noqa: E501 + issuer (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.token_id = token_id + self.masked_card_number = masked_card_number + self.expiry_month = expiry_month + self.expiry_year = expiry_year + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, token_id, masked_card_number, expiry_month, expiry_year, *args, **kwargs): # noqa: E501 + """CardInformation - a model defined in OpenAPI + + Args: + token_id (str): + masked_card_number (str): 1st 6 and last 4 digits of the card + expiry_month (str): Card expiry month in MM format + expiry_year (str): Card expiry month in YY format + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cardholder_name (str, none_type): Cardholder name. [optional] # noqa: E501 + fingerprint (str): [optional] # noqa: E501 + type (str): [optional] # noqa: E501 + network (str): [optional] # noqa: E501 + country (str): [optional] # noqa: E501 + issuer (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.token_id = token_id + self.masked_card_number = masked_card_number + self.expiry_month = expiry_month + self.expiry_year = expiry_year + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/card_verification_results.py b/xendit/payment_request/model/card_verification_results.py new file mode 100644 index 00000000..1522b1fe --- /dev/null +++ b/xendit/payment_request/model/card_verification_results.py @@ -0,0 +1,276 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.card_verification_results_three_d_secure import CardVerificationResultsThreeDSecure + globals()['CardVerificationResultsThreeDSecure'] = CardVerificationResultsThreeDSecure + + +class CardVerificationResults(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'three_d_secure': (CardVerificationResultsThreeDSecure,), # noqa: E501 + 'cvv_result': (str, none_type,), # noqa: E501 + 'address_verification_result': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'three_d_secure': 'three_d_secure', # noqa: E501 + 'cvv_result': 'cvv_result', # noqa: E501 + 'address_verification_result': 'address_verification_result', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """CardVerificationResults - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + three_d_secure (CardVerificationResultsThreeDSecure): [optional] # noqa: E501 + cvv_result (str, none_type): [optional] # noqa: E501 + address_verification_result (str, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """CardVerificationResults - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + three_d_secure (CardVerificationResultsThreeDSecure): [optional] # noqa: E501 + cvv_result (str, none_type): [optional] # noqa: E501 + address_verification_result (str, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/card_verification_results_three_d_secure.py b/xendit/payment_request/model/card_verification_results_three_d_secure.py new file mode 100644 index 00000000..081f1687 --- /dev/null +++ b/xendit/payment_request/model/card_verification_results_three_d_secure.py @@ -0,0 +1,283 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class CardVerificationResultsThreeDSecure(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('three_d_secure_flow',): { + 'None': None, + 'CHALLENGE': "CHALLENGE", + 'FRICTIONLESS': "FRICTIONLESS", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'three_d_secure_flow': (str, none_type,), # noqa: E501 + 'eci_code': (str, none_type,), # noqa: E501 + 'three_d_secure_result': (str, none_type,), # noqa: E501 + 'three_d_secure_result_reason': (str, none_type,), # noqa: E501 + 'three_d_secure_version': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'three_d_secure_flow': 'three_d_secure_flow', # noqa: E501 + 'eci_code': 'eci_code', # noqa: E501 + 'three_d_secure_result': 'three_d_secure_result', # noqa: E501 + 'three_d_secure_result_reason': 'three_d_secure_result_reason', # noqa: E501 + 'three_d_secure_version': 'three_d_secure_version', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """CardVerificationResultsThreeDSecure - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + three_d_secure_flow (str, none_type): [optional] # noqa: E501 + eci_code (str, none_type): [optional] # noqa: E501 + three_d_secure_result (str, none_type): [optional] # noqa: E501 + three_d_secure_result_reason (str, none_type): [optional] # noqa: E501 + three_d_secure_version (str, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """CardVerificationResultsThreeDSecure - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + three_d_secure_flow (str, none_type): [optional] # noqa: E501 + eci_code (str, none_type): [optional] # noqa: E501 + three_d_secure_result (str, none_type): [optional] # noqa: E501 + three_d_secure_result_reason (str, none_type): [optional] # noqa: E501 + three_d_secure_version (str, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/direct_debit.py b/xendit/payment_request/model/direct_debit.py new file mode 100644 index 00000000..06b0836b --- /dev/null +++ b/xendit/payment_request/model/direct_debit.py @@ -0,0 +1,347 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.direct_debit_all_of import DirectDebitAllOf + from xendit.payment_request.model.direct_debit_bank_account import DirectDebitBankAccount + from xendit.payment_request.model.direct_debit_channel_code import DirectDebitChannelCode + from xendit.payment_request.model.direct_debit_channel_properties import DirectDebitChannelProperties + from xendit.payment_request.model.direct_debit_debit_card import DirectDebitDebitCard + from xendit.payment_request.model.direct_debit_parameters import DirectDebitParameters + from xendit.payment_request.model.direct_debit_type import DirectDebitType + globals()['DirectDebitAllOf'] = DirectDebitAllOf + globals()['DirectDebitBankAccount'] = DirectDebitBankAccount + globals()['DirectDebitChannelCode'] = DirectDebitChannelCode + globals()['DirectDebitChannelProperties'] = DirectDebitChannelProperties + globals()['DirectDebitDebitCard'] = DirectDebitDebitCard + globals()['DirectDebitParameters'] = DirectDebitParameters + globals()['DirectDebitType'] = DirectDebitType + + +class DirectDebit(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'channel_code': (DirectDebitChannelCode,), # noqa: E501 + 'channel_properties': (DirectDebitChannelProperties,), # noqa: E501 + 'type': (DirectDebitType,), # noqa: E501 + 'bank_account': (DirectDebitBankAccount,), # noqa: E501 + 'debit_card': (DirectDebitDebitCard,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'type': 'type', # noqa: E501 + 'bank_account': 'bank_account', # noqa: E501 + 'debit_card': 'debit_card', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DirectDebit - a model defined in OpenAPI + + Keyword Args: + channel_code (DirectDebitChannelCode): + channel_properties (DirectDebitChannelProperties): + type (DirectDebitType): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + bank_account (DirectDebitBankAccount): [optional] # noqa: E501 + debit_card (DirectDebitDebitCard): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """DirectDebit - a model defined in OpenAPI + + Keyword Args: + channel_code (DirectDebitChannelCode): + channel_properties (DirectDebitChannelProperties): + type (DirectDebitType): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + bank_account (DirectDebitBankAccount): [optional] # noqa: E501 + debit_card (DirectDebitDebitCard): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + DirectDebitAllOf, + DirectDebitParameters, + ], + 'oneOf': [ + ], + } diff --git a/xendit/payment_request/model/direct_debit_all_of.py b/xendit/payment_request/model/direct_debit_all_of.py new file mode 100644 index 00000000..714b0009 --- /dev/null +++ b/xendit/payment_request/model/direct_debit_all_of.py @@ -0,0 +1,286 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.direct_debit_bank_account import DirectDebitBankAccount + from xendit.payment_request.model.direct_debit_debit_card import DirectDebitDebitCard + from xendit.payment_request.model.direct_debit_type import DirectDebitType + globals()['DirectDebitBankAccount'] = DirectDebitBankAccount + globals()['DirectDebitDebitCard'] = DirectDebitDebitCard + globals()['DirectDebitType'] = DirectDebitType + + +class DirectDebitAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'type': (DirectDebitType,), # noqa: E501 + 'bank_account': (DirectDebitBankAccount,), # noqa: E501 + 'debit_card': (DirectDebitDebitCard,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'type': 'type', # noqa: E501 + 'bank_account': 'bank_account', # noqa: E501 + 'debit_card': 'debit_card', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 + """DirectDebitAllOf - a model defined in OpenAPI + + Args: + type (DirectDebitType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + bank_account (DirectDebitBankAccount): [optional] # noqa: E501 + debit_card (DirectDebitDebitCard): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, type, *args, **kwargs): # noqa: E501 + """DirectDebitAllOf - a model defined in OpenAPI + + Args: + type (DirectDebitType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + bank_account (DirectDebitBankAccount): [optional] # noqa: E501 + debit_card (DirectDebitDebitCard): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/direct_debit_bank_account.py b/xendit/payment_request/model/direct_debit_bank_account.py new file mode 100644 index 00000000..1e8eb679 --- /dev/null +++ b/xendit/payment_request/model/direct_debit_bank_account.py @@ -0,0 +1,266 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class DirectDebitBankAccount(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'masked_bank_account_number': (str, none_type,), # noqa: E501 + 'bank_account_hash': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'masked_bank_account_number': 'masked_bank_account_number', # noqa: E501 + 'bank_account_hash': 'bank_account_hash', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DirectDebitBankAccount - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + masked_bank_account_number (str, none_type): [optional] # noqa: E501 + bank_account_hash (str, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """DirectDebitBankAccount - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + masked_bank_account_number (str, none_type): [optional] # noqa: E501 + bank_account_hash (str, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/direct_debit_channel_code.py b/xendit/payment_request/model/direct_debit_channel_code.py new file mode 100644 index 00000000..2eaec09c --- /dev/null +++ b/xendit/payment_request/model/direct_debit_channel_code.py @@ -0,0 +1,350 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class DirectDebitChannelCode(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'BCA_KLIKPAY': "BCA_KLIKPAY", + 'BCA_ONEKLIK': "BCA_ONEKLIK", + 'BRI': "BRI", + 'BNI': "BNI", + 'MANDIRI': "MANDIRI", + 'BPI': "BPI", + 'BDO': "BDO", + 'CIMBNIAGA': "CIMBNIAGA", + 'MTB': "MTB", + 'RCBC': "RCBC", + 'UBP': "UBP", + 'AUTODEBIT_UBP': "AUTODEBIT_UBP", + 'CHINABANK': "CHINABANK", + 'BAY': "BAY", + 'KTB': "KTB", + 'BBL': "BBL", + 'SCB': "SCB", + 'KBANK_MB': "KBANK_MB", + 'BAY_MB': "BAY_MB", + 'KTB_MB': "KTB_MB", + 'BBL_MB': "BBL_MB", + 'SCB_MB': "SCB_MB", + 'BDO_EPAY': "BDO_EPAY", + 'AFFIN_FPX': "AFFIN_FPX", + 'AGRO_FPX': "AGRO_FPX", + 'ALLIANCE_FPX': "ALLIANCE_FPX", + 'AMBANK_FPX': "AMBANK_FPX", + 'ISLAM_FPX': "ISLAM_FPX", + 'MUAMALAT_FPX': "MUAMALAT_FPX", + 'BOC_FPX': "BOC_FPX", + 'RAKYAT_FPX': "RAKYAT_FPX", + 'BSN_FPX': "BSN_FPX", + 'CIMB_FPX': "CIMB_FPX", + 'HLB_FPX': "HLB_FPX", + 'HSBC_FPX': "HSBC_FPX", + 'KFH_FPX': "KFH_FPX", + 'MAYB2E_FPX': "MAYB2E_FPX", + 'MAYB2U_FPX': "MAYB2U_FPX", + 'OCBC_FPX': "OCBC_FPX", + 'PUBLIC_FPX': "PUBLIC_FPX", + 'RHB_FPX': "RHB_FPX", + 'SCH_FPX': "SCH_FPX", + 'UOB_FPX': "UOB_FPX", + 'AFFIN_FPX_BUSINESS': "AFFIN_FPX_BUSINESS", + 'AGRO_FPX_BUSINESS': "AGRO_FPX_BUSINESS", + 'ALLIANCE_FPX_BUSINESS': "ALLIANCE_FPX_BUSINESS", + 'AMBANK_FPX_BUSINESS': "AMBANK_FPX_BUSINESS", + 'ISLAM_FPX_BUSINESS': "ISLAM_FPX_BUSINESS", + 'MUAMALAT_FPX_BUSINESS': "MUAMALAT_FPX_BUSINESS", + 'BNP_FPX_BUSINESS': "BNP_FPX_BUSINESS", + 'CIMB_FPX_BUSINESS': "CIMB_FPX_BUSINESS", + 'CITIBANK_FPX_BUSINESS': "CITIBANK_FPX_BUSINESS", + 'DEUTSCHE_FPX_BUSINESS': "DEUTSCHE_FPX_BUSINESS", + 'HLB_FPX_BUSINESS': "HLB_FPX_BUSINESS", + 'HSBC_FPX_BUSINESS': "HSBC_FPX_BUSINESS", + 'RAKYAT_FPX_BUSINESS': "RAKYAT_FPX_BUSINESS", + 'KFH_FPX_BUSINESS': "KFH_FPX_BUSINESS", + 'MAYB2E_FPX_BUSINESS': "MAYB2E_FPX_BUSINESS", + 'OCBC_FPX_BUSINESS': "OCBC_FPX_BUSINESS", + 'PUBLIC_FPX_BUSINESS': "PUBLIC_FPX_BUSINESS", + 'RHB_FPX_BUSINESS': "RHB_FPX_BUSINESS", + 'SCH_FPX_BUSINESS': "SCH_FPX_BUSINESS", + 'UOB_FPX_BUSINESS': "UOB_FPX_BUSINESS", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """DirectDebitChannelCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Direct Debit Channel Code., must be one of ["BCA_KLIKPAY", "BCA_ONEKLIK", "BRI", "BNI", "MANDIRI", "BPI", "BDO", "CIMBNIAGA", "MTB", "RCBC", "UBP", "AUTODEBIT_UBP", "CHINABANK", "BAY", "KTB", "BBL", "SCB", "KBANK_MB", "BAY_MB", "KTB_MB", "BBL_MB", "SCB_MB", "BDO_EPAY", "AFFIN_FPX", "AGRO_FPX", "ALLIANCE_FPX", "AMBANK_FPX", "ISLAM_FPX", "MUAMALAT_FPX", "BOC_FPX", "RAKYAT_FPX", "BSN_FPX", "CIMB_FPX", "HLB_FPX", "HSBC_FPX", "KFH_FPX", "MAYB2E_FPX", "MAYB2U_FPX", "OCBC_FPX", "PUBLIC_FPX", "RHB_FPX", "SCH_FPX", "UOB_FPX", "AFFIN_FPX_BUSINESS", "AGRO_FPX_BUSINESS", "ALLIANCE_FPX_BUSINESS", "AMBANK_FPX_BUSINESS", "ISLAM_FPX_BUSINESS", "MUAMALAT_FPX_BUSINESS", "BNP_FPX_BUSINESS", "CIMB_FPX_BUSINESS", "CITIBANK_FPX_BUSINESS", "DEUTSCHE_FPX_BUSINESS", "HLB_FPX_BUSINESS", "HSBC_FPX_BUSINESS", "RAKYAT_FPX_BUSINESS", "KFH_FPX_BUSINESS", "MAYB2E_FPX_BUSINESS", "OCBC_FPX_BUSINESS", "PUBLIC_FPX_BUSINESS", "RHB_FPX_BUSINESS", "SCH_FPX_BUSINESS", "UOB_FPX_BUSINESS", ] # noqa: E501 + + Keyword Args: + value (str): Direct Debit Channel Code., must be one of ["BCA_KLIKPAY", "BCA_ONEKLIK", "BRI", "BNI", "MANDIRI", "BPI", "BDO", "CIMBNIAGA", "MTB", "RCBC", "UBP", "AUTODEBIT_UBP", "CHINABANK", "BAY", "KTB", "BBL", "SCB", "KBANK_MB", "BAY_MB", "KTB_MB", "BBL_MB", "SCB_MB", "BDO_EPAY", "AFFIN_FPX", "AGRO_FPX", "ALLIANCE_FPX", "AMBANK_FPX", "ISLAM_FPX", "MUAMALAT_FPX", "BOC_FPX", "RAKYAT_FPX", "BSN_FPX", "CIMB_FPX", "HLB_FPX", "HSBC_FPX", "KFH_FPX", "MAYB2E_FPX", "MAYB2U_FPX", "OCBC_FPX", "PUBLIC_FPX", "RHB_FPX", "SCH_FPX", "UOB_FPX", "AFFIN_FPX_BUSINESS", "AGRO_FPX_BUSINESS", "ALLIANCE_FPX_BUSINESS", "AMBANK_FPX_BUSINESS", "ISLAM_FPX_BUSINESS", "MUAMALAT_FPX_BUSINESS", "BNP_FPX_BUSINESS", "CIMB_FPX_BUSINESS", "CITIBANK_FPX_BUSINESS", "DEUTSCHE_FPX_BUSINESS", "HLB_FPX_BUSINESS", "HSBC_FPX_BUSINESS", "RAKYAT_FPX_BUSINESS", "KFH_FPX_BUSINESS", "MAYB2E_FPX_BUSINESS", "OCBC_FPX_BUSINESS", "PUBLIC_FPX_BUSINESS", "RHB_FPX_BUSINESS", "SCH_FPX_BUSINESS", "UOB_FPX_BUSINESS", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """DirectDebitChannelCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Direct Debit Channel Code., must be one of ["BCA_KLIKPAY", "BCA_ONEKLIK", "BRI", "BNI", "MANDIRI", "BPI", "BDO", "CIMBNIAGA", "MTB", "RCBC", "UBP", "AUTODEBIT_UBP", "CHINABANK", "BAY", "KTB", "BBL", "SCB", "KBANK_MB", "BAY_MB", "KTB_MB", "BBL_MB", "SCB_MB", "BDO_EPAY", "AFFIN_FPX", "AGRO_FPX", "ALLIANCE_FPX", "AMBANK_FPX", "ISLAM_FPX", "MUAMALAT_FPX", "BOC_FPX", "RAKYAT_FPX", "BSN_FPX", "CIMB_FPX", "HLB_FPX", "HSBC_FPX", "KFH_FPX", "MAYB2E_FPX", "MAYB2U_FPX", "OCBC_FPX", "PUBLIC_FPX", "RHB_FPX", "SCH_FPX", "UOB_FPX", "AFFIN_FPX_BUSINESS", "AGRO_FPX_BUSINESS", "ALLIANCE_FPX_BUSINESS", "AMBANK_FPX_BUSINESS", "ISLAM_FPX_BUSINESS", "MUAMALAT_FPX_BUSINESS", "BNP_FPX_BUSINESS", "CIMB_FPX_BUSINESS", "CITIBANK_FPX_BUSINESS", "DEUTSCHE_FPX_BUSINESS", "HLB_FPX_BUSINESS", "HSBC_FPX_BUSINESS", "RAKYAT_FPX_BUSINESS", "KFH_FPX_BUSINESS", "MAYB2E_FPX_BUSINESS", "OCBC_FPX_BUSINESS", "PUBLIC_FPX_BUSINESS", "RHB_FPX_BUSINESS", "SCH_FPX_BUSINESS", "UOB_FPX_BUSINESS", ] # noqa: E501 + + Keyword Args: + value (str): Direct Debit Channel Code., must be one of ["BCA_KLIKPAY", "BCA_ONEKLIK", "BRI", "BNI", "MANDIRI", "BPI", "BDO", "CIMBNIAGA", "MTB", "RCBC", "UBP", "AUTODEBIT_UBP", "CHINABANK", "BAY", "KTB", "BBL", "SCB", "KBANK_MB", "BAY_MB", "KTB_MB", "BBL_MB", "SCB_MB", "BDO_EPAY", "AFFIN_FPX", "AGRO_FPX", "ALLIANCE_FPX", "AMBANK_FPX", "ISLAM_FPX", "MUAMALAT_FPX", "BOC_FPX", "RAKYAT_FPX", "BSN_FPX", "CIMB_FPX", "HLB_FPX", "HSBC_FPX", "KFH_FPX", "MAYB2E_FPX", "MAYB2U_FPX", "OCBC_FPX", "PUBLIC_FPX", "RHB_FPX", "SCH_FPX", "UOB_FPX", "AFFIN_FPX_BUSINESS", "AGRO_FPX_BUSINESS", "ALLIANCE_FPX_BUSINESS", "AMBANK_FPX_BUSINESS", "ISLAM_FPX_BUSINESS", "MUAMALAT_FPX_BUSINESS", "BNP_FPX_BUSINESS", "CIMB_FPX_BUSINESS", "CITIBANK_FPX_BUSINESS", "DEUTSCHE_FPX_BUSINESS", "HLB_FPX_BUSINESS", "HSBC_FPX_BUSINESS", "RAKYAT_FPX_BUSINESS", "KFH_FPX_BUSINESS", "MAYB2E_FPX_BUSINESS", "OCBC_FPX_BUSINESS", "PUBLIC_FPX_BUSINESS", "RHB_FPX_BUSINESS", "SCH_FPX_BUSINESS", "UOB_FPX_BUSINESS", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_request/model/direct_debit_channel_properties.py b/xendit/payment_request/model/direct_debit_channel_properties.py new file mode 100644 index 00000000..836d3760 --- /dev/null +++ b/xendit/payment_request/model/direct_debit_channel_properties.py @@ -0,0 +1,352 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.direct_debit_channel_properties_bank_account import DirectDebitChannelPropertiesBankAccount + from xendit.payment_request.model.direct_debit_channel_properties_bank_redirect import DirectDebitChannelPropertiesBankRedirect + from xendit.payment_request.model.direct_debit_channel_properties_debit_card import DirectDebitChannelPropertiesDebitCard + globals()['DirectDebitChannelPropertiesBankAccount'] = DirectDebitChannelPropertiesBankAccount + globals()['DirectDebitChannelPropertiesBankRedirect'] = DirectDebitChannelPropertiesBankRedirect + globals()['DirectDebitChannelPropertiesDebitCard'] = DirectDebitChannelPropertiesDebitCard + + +class DirectDebitChannelProperties(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'mobile_number': (str,), # noqa: E501 + 'success_return_url': (str,), # noqa: E501 + 'failure_return_url': (str,), # noqa: E501 + 'identity_document_number': (str,), # noqa: E501 + 'account_number': (str,), # noqa: E501 + 'card_last_four': (str,), # noqa: E501 + 'card_expiry': (str,), # noqa: E501 + 'email': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'mobile_number': 'mobile_number', # noqa: E501 + 'success_return_url': 'success_return_url', # noqa: E501 + 'failure_return_url': 'failure_return_url', # noqa: E501 + 'identity_document_number': 'identity_document_number', # noqa: E501 + 'account_number': 'account_number', # noqa: E501 + 'card_last_four': 'card_last_four', # noqa: E501 + 'card_expiry': 'card_expiry', # noqa: E501 + 'email': 'email', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DirectDebitChannelProperties - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + mobile_number (str): Mobile number of the customer registered to the partner channel. [optional] # noqa: E501 + success_return_url (str): [optional] # noqa: E501 + failure_return_url (str): [optional] # noqa: E501 + identity_document_number (str): [optional] # noqa: E501 + account_number (str): [optional] # noqa: E501 + card_last_four (str): Last four digits of the debit card. [optional] # noqa: E501 + card_expiry (str): Expiry month and year of the debit card (in MM/YY format). [optional] # noqa: E501 + email (str): Email address of the customer that is registered to the partner channel. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """DirectDebitChannelProperties - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + mobile_number (str): Mobile number of the customer registered to the partner channel. [optional] # noqa: E501 + success_return_url (str): [optional] # noqa: E501 + failure_return_url (str): [optional] # noqa: E501 + identity_document_number (str): [optional] # noqa: E501 + account_number (str): [optional] # noqa: E501 + card_last_four (str): Last four digits of the debit card. [optional] # noqa: E501 + card_expiry (str): Expiry month and year of the debit card (in MM/YY format). [optional] # noqa: E501 + email (str): Email address of the customer that is registered to the partner channel. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + DirectDebitChannelPropertiesBankAccount, + DirectDebitChannelPropertiesBankRedirect, + DirectDebitChannelPropertiesDebitCard, + ], + 'allOf': [ + ], + 'oneOf': [ + ], + } diff --git a/xendit/payment_request/model/direct_debit_channel_properties_bank_account.py b/xendit/payment_request/model/direct_debit_channel_properties_bank_account.py new file mode 100644 index 00000000..2090cfa5 --- /dev/null +++ b/xendit/payment_request/model/direct_debit_channel_properties_bank_account.py @@ -0,0 +1,274 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class DirectDebitChannelPropertiesBankAccount(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'success_return_url': (str,), # noqa: E501 + 'failure_return_url': (str,), # noqa: E501 + 'mobile_number': (str,), # noqa: E501 + 'identity_document_number': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'success_return_url': 'success_return_url', # noqa: E501 + 'failure_return_url': 'failure_return_url', # noqa: E501 + 'mobile_number': 'mobile_number', # noqa: E501 + 'identity_document_number': 'identity_document_number', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DirectDebitChannelPropertiesBankAccount - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + success_return_url (str): [optional] # noqa: E501 + failure_return_url (str): [optional] # noqa: E501 + mobile_number (str): [optional] # noqa: E501 + identity_document_number (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """DirectDebitChannelPropertiesBankAccount - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + success_return_url (str): [optional] # noqa: E501 + failure_return_url (str): [optional] # noqa: E501 + mobile_number (str): [optional] # noqa: E501 + identity_document_number (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/direct_debit_channel_properties_bank_redirect.py b/xendit/payment_request/model/direct_debit_channel_properties_bank_redirect.py new file mode 100644 index 00000000..9783d7d1 --- /dev/null +++ b/xendit/payment_request/model/direct_debit_channel_properties_bank_redirect.py @@ -0,0 +1,270 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class DirectDebitChannelPropertiesBankRedirect(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'mobile_number': (str,), # noqa: E501 + 'success_return_url': (str,), # noqa: E501 + 'failure_return_url': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'mobile_number': 'mobile_number', # noqa: E501 + 'success_return_url': 'success_return_url', # noqa: E501 + 'failure_return_url': 'failure_return_url', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DirectDebitChannelPropertiesBankRedirect - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + mobile_number (str): Mobile number of the customer that is registered to channel. [optional] # noqa: E501 + success_return_url (str): [optional] # noqa: E501 + failure_return_url (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """DirectDebitChannelPropertiesBankRedirect - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + mobile_number (str): Mobile number of the customer that is registered to channel. [optional] # noqa: E501 + success_return_url (str): [optional] # noqa: E501 + failure_return_url (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/direct_debit_channel_properties_debit_card.py b/xendit/payment_request/model/direct_debit_channel_properties_debit_card.py new file mode 100644 index 00000000..df46b346 --- /dev/null +++ b/xendit/payment_request/model/direct_debit_channel_properties_debit_card.py @@ -0,0 +1,278 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class DirectDebitChannelPropertiesDebitCard(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'mobile_number': (str,), # noqa: E501 + 'account_number': (str,), # noqa: E501 + 'card_last_four': (str,), # noqa: E501 + 'card_expiry': (str,), # noqa: E501 + 'email': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'mobile_number': 'mobile_number', # noqa: E501 + 'account_number': 'account_number', # noqa: E501 + 'card_last_four': 'card_last_four', # noqa: E501 + 'card_expiry': 'card_expiry', # noqa: E501 + 'email': 'email', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DirectDebitChannelPropertiesDebitCard - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + mobile_number (str): Mobile number of the customer registered to the partner channel. [optional] # noqa: E501 + account_number (str): [optional] # noqa: E501 + card_last_four (str): Last four digits of the debit card. [optional] # noqa: E501 + card_expiry (str): Expiry month and year of the debit card (in MM/YY format). [optional] # noqa: E501 + email (str): Email address of the customer that is registered to the partner channel. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """DirectDebitChannelPropertiesDebitCard - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + mobile_number (str): Mobile number of the customer registered to the partner channel. [optional] # noqa: E501 + account_number (str): [optional] # noqa: E501 + card_last_four (str): Last four digits of the debit card. [optional] # noqa: E501 + card_expiry (str): Expiry month and year of the debit card (in MM/YY format). [optional] # noqa: E501 + email (str): Email address of the customer that is registered to the partner channel. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/direct_debit_debit_card.py b/xendit/payment_request/model/direct_debit_debit_card.py new file mode 100644 index 00000000..7df8ff5a --- /dev/null +++ b/xendit/payment_request/model/direct_debit_debit_card.py @@ -0,0 +1,278 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class DirectDebitDebitCard(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'mobile_number': (str, none_type,), # noqa: E501 + 'account_number': (str,), # noqa: E501 + 'card_last_four': (str, none_type,), # noqa: E501 + 'card_expiry': (str, none_type,), # noqa: E501 + 'email': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'mobile_number': 'mobile_number', # noqa: E501 + 'account_number': 'account_number', # noqa: E501 + 'card_last_four': 'card_last_four', # noqa: E501 + 'card_expiry': 'card_expiry', # noqa: E501 + 'email': 'email', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DirectDebitDebitCard - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + mobile_number (str, none_type): Mobile number of the customer registered to the partner channel. [optional] # noqa: E501 + account_number (str): [optional] # noqa: E501 + card_last_four (str, none_type): Last four digits of the debit card. [optional] # noqa: E501 + card_expiry (str, none_type): Expiry month and year of the debit card (in MM/YY format). [optional] # noqa: E501 + email (str, none_type): Email address of the customer that is registered to the partner channel. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """DirectDebitDebitCard - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + mobile_number (str, none_type): Mobile number of the customer registered to the partner channel. [optional] # noqa: E501 + account_number (str): [optional] # noqa: E501 + card_last_four (str, none_type): Last four digits of the debit card. [optional] # noqa: E501 + card_expiry (str, none_type): Expiry month and year of the debit card (in MM/YY format). [optional] # noqa: E501 + email (str, none_type): Email address of the customer that is registered to the partner channel. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/direct_debit_parameters.py b/xendit/payment_request/model/direct_debit_parameters.py new file mode 100644 index 00000000..0ca546ec --- /dev/null +++ b/xendit/payment_request/model/direct_debit_parameters.py @@ -0,0 +1,288 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.direct_debit_channel_code import DirectDebitChannelCode + from xendit.payment_request.model.direct_debit_channel_properties import DirectDebitChannelProperties + from xendit.payment_request.model.direct_debit_type import DirectDebitType + globals()['DirectDebitChannelCode'] = DirectDebitChannelCode + globals()['DirectDebitChannelProperties'] = DirectDebitChannelProperties + globals()['DirectDebitType'] = DirectDebitType + + +class DirectDebitParameters(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'channel_code': (DirectDebitChannelCode,), # noqa: E501 + 'channel_properties': (DirectDebitChannelProperties,), # noqa: E501 + 'type': (DirectDebitType,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'type': 'type', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, channel_code, channel_properties, *args, **kwargs): # noqa: E501 + """DirectDebitParameters - a model defined in OpenAPI + + Args: + channel_code (DirectDebitChannelCode): + channel_properties (DirectDebitChannelProperties): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + type (DirectDebitType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.channel_code = channel_code + self.channel_properties = channel_properties + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, channel_code, channel_properties, *args, **kwargs): # noqa: E501 + """DirectDebitParameters - a model defined in OpenAPI + + Args: + channel_code (DirectDebitChannelCode): + channel_properties (DirectDebitChannelProperties): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + type (DirectDebitType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.channel_code = channel_code + self.channel_properties = channel_properties + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/direct_debit_type.py b/xendit/payment_request/model/direct_debit_type.py new file mode 100644 index 00000000..0532dc01 --- /dev/null +++ b/xendit/payment_request/model/direct_debit_type.py @@ -0,0 +1,290 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class DirectDebitType(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'DEBIT_CARD': "DEBIT_CARD", + 'BANK_ACCOUNT': "BANK_ACCOUNT", + 'BANK_REDIRECT': "BANK_REDIRECT", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """DirectDebitType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["DEBIT_CARD", "BANK_ACCOUNT", "BANK_REDIRECT", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["DEBIT_CARD", "BANK_ACCOUNT", "BANK_REDIRECT", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """DirectDebitType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["DEBIT_CARD", "BANK_ACCOUNT", "BANK_REDIRECT", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["DEBIT_CARD", "BANK_ACCOUNT", "BANK_REDIRECT", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_request/model/e_wallet.py b/xendit/payment_request/model/e_wallet.py new file mode 100644 index 00000000..37fbfab0 --- /dev/null +++ b/xendit/payment_request/model/e_wallet.py @@ -0,0 +1,335 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.e_wallet_account import EWalletAccount + from xendit.payment_request.model.e_wallet_all_of import EWalletAllOf + from xendit.payment_request.model.e_wallet_channel_code import EWalletChannelCode + from xendit.payment_request.model.e_wallet_channel_properties import EWalletChannelProperties + from xendit.payment_request.model.e_wallet_parameters import EWalletParameters + globals()['EWalletAccount'] = EWalletAccount + globals()['EWalletAllOf'] = EWalletAllOf + globals()['EWalletChannelCode'] = EWalletChannelCode + globals()['EWalletChannelProperties'] = EWalletChannelProperties + globals()['EWalletParameters'] = EWalletParameters + + +class EWallet(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'channel_code': (EWalletChannelCode,), # noqa: E501 + 'channel_properties': (EWalletChannelProperties,), # noqa: E501 + 'account': (EWalletAccount,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'account': 'account', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """EWallet - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + channel_code (EWalletChannelCode): [optional] # noqa: E501 + channel_properties (EWalletChannelProperties): [optional] # noqa: E501 + account (EWalletAccount): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """EWallet - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + channel_code (EWalletChannelCode): [optional] # noqa: E501 + channel_properties (EWalletChannelProperties): [optional] # noqa: E501 + account (EWalletAccount): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + EWalletAllOf, + EWalletParameters, + ], + 'oneOf': [ + ], + } diff --git a/xendit/payment_request/model/e_wallet_account.py b/xendit/payment_request/model/e_wallet_account.py new file mode 100644 index 00000000..926bcfcc --- /dev/null +++ b/xendit/payment_request/model/e_wallet_account.py @@ -0,0 +1,274 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class EWalletAccount(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str, none_type,), # noqa: E501 + 'account_details': (str, none_type,), # noqa: E501 + 'balance': (float, none_type,), # noqa: E501 + 'point_balance': (float, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'account_details': 'account_details', # noqa: E501 + 'balance': 'balance', # noqa: E501 + 'point_balance': 'point_balance', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """EWalletAccount - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str, none_type): Name of the eWallet account holder. The value is null if unavailableName of the eWallet account holder. The value is null if unavailable. [optional] # noqa: E501 + account_details (str, none_type): Identifier from eWallet provider e.g. phone number. The value is null if unavailable. [optional] # noqa: E501 + balance (float, none_type): The main balance amount on eWallet account provided from eWallet provider. The value is null if unavailable. [optional] # noqa: E501 + point_balance (float, none_type): The point balance amount on eWallet account. Applicable only on some eWallet provider that has point system. The value is null if unavailabl. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """EWalletAccount - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str, none_type): Name of the eWallet account holder. The value is null if unavailableName of the eWallet account holder. The value is null if unavailable. [optional] # noqa: E501 + account_details (str, none_type): Identifier from eWallet provider e.g. phone number. The value is null if unavailable. [optional] # noqa: E501 + balance (float, none_type): The main balance amount on eWallet account provided from eWallet provider. The value is null if unavailable. [optional] # noqa: E501 + point_balance (float, none_type): The point balance amount on eWallet account. Applicable only on some eWallet provider that has point system. The value is null if unavailabl. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/e_wallet_all_of.py b/xendit/payment_request/model/e_wallet_all_of.py new file mode 100644 index 00000000..9622dd0d --- /dev/null +++ b/xendit/payment_request/model/e_wallet_all_of.py @@ -0,0 +1,268 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.e_wallet_account import EWalletAccount + globals()['EWalletAccount'] = EWalletAccount + + +class EWalletAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'account': (EWalletAccount,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'account': 'account', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """EWalletAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + account (EWalletAccount): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """EWalletAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + account (EWalletAccount): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/e_wallet_channel_code.py b/xendit/payment_request/model/e_wallet_channel_code.py new file mode 100644 index 00000000..47bc30c6 --- /dev/null +++ b/xendit/payment_request/model/e_wallet_channel_code.py @@ -0,0 +1,306 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class EWalletChannelCode(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'GCASH': "GCASH", + 'GRABPAY': "GRABPAY", + 'PAYMAYA': "PAYMAYA", + 'DANA': "DANA", + 'OVO': "OVO", + 'LINKAJA': "LINKAJA", + 'SHOPEEPAY': "SHOPEEPAY", + 'NEXCASH': "NEXCASH", + 'ASTRAPAY': "ASTRAPAY", + 'JENIUSPAY': "JENIUSPAY", + 'APPOTA': "APPOTA", + 'MOMO': "MOMO", + 'VNPTWALLET': "VNPTWALLET", + 'VIETTELPAY': "VIETTELPAY", + 'ZALOPAY': "ZALOPAY", + 'WECHATPAY': "WECHATPAY", + 'LINEPAY': "LINEPAY", + 'TRUEMONEY': "TRUEMONEY", + 'ALIPAY': "ALIPAY", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """EWalletChannelCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Ewallet Channel Code., must be one of ["GCASH", "GRABPAY", "PAYMAYA", "DANA", "OVO", "LINKAJA", "SHOPEEPAY", "NEXCASH", "ASTRAPAY", "JENIUSPAY", "APPOTA", "MOMO", "VNPTWALLET", "VIETTELPAY", "ZALOPAY", "WECHATPAY", "LINEPAY", "TRUEMONEY", "ALIPAY", ] # noqa: E501 + + Keyword Args: + value (str): Ewallet Channel Code., must be one of ["GCASH", "GRABPAY", "PAYMAYA", "DANA", "OVO", "LINKAJA", "SHOPEEPAY", "NEXCASH", "ASTRAPAY", "JENIUSPAY", "APPOTA", "MOMO", "VNPTWALLET", "VIETTELPAY", "ZALOPAY", "WECHATPAY", "LINEPAY", "TRUEMONEY", "ALIPAY", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """EWalletChannelCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Ewallet Channel Code., must be one of ["GCASH", "GRABPAY", "PAYMAYA", "DANA", "OVO", "LINKAJA", "SHOPEEPAY", "NEXCASH", "ASTRAPAY", "JENIUSPAY", "APPOTA", "MOMO", "VNPTWALLET", "VIETTELPAY", "ZALOPAY", "WECHATPAY", "LINEPAY", "TRUEMONEY", "ALIPAY", ] # noqa: E501 + + Keyword Args: + value (str): Ewallet Channel Code., must be one of ["GCASH", "GRABPAY", "PAYMAYA", "DANA", "OVO", "LINKAJA", "SHOPEEPAY", "NEXCASH", "ASTRAPAY", "JENIUSPAY", "APPOTA", "MOMO", "VNPTWALLET", "VIETTELPAY", "ZALOPAY", "WECHATPAY", "LINEPAY", "TRUEMONEY", "ALIPAY", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_request/model/e_wallet_channel_properties.py b/xendit/payment_request/model/e_wallet_channel_properties.py new file mode 100644 index 00000000..e7202727 --- /dev/null +++ b/xendit/payment_request/model/e_wallet_channel_properties.py @@ -0,0 +1,297 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class EWalletChannelProperties(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('success_return_url',): { + 'regex': { + 'pattern': r'^\S{1,255}:\/\/\S{0,1000}$', # noqa: E501 + }, + }, + ('failure_return_url',): { + 'regex': { + 'pattern': r'^\S{1,255}:\/\/\S{0,1000}$', # noqa: E501 + }, + }, + ('cancel_return_url',): { + 'regex': { + 'pattern': r'^\S{1,255}:\/\/\S{0,1000}$', # noqa: E501 + }, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'success_return_url': (str,), # noqa: E501 + 'failure_return_url': (str,), # noqa: E501 + 'cancel_return_url': (str,), # noqa: E501 + 'redeem_points': (str,), # noqa: E501 + 'mobilenumber': (str,), # noqa: E501 + 'cashtag': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'success_return_url': 'success_return_url', # noqa: E501 + 'failure_return_url': 'failure_return_url', # noqa: E501 + 'cancel_return_url': 'cancel_return_url', # noqa: E501 + 'redeem_points': 'redeem_points', # noqa: E501 + 'mobilenumber': 'mobile:number', # noqa: E501 + 'cashtag': 'cashtag', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """EWalletChannelProperties - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + success_return_url (str): URL where the end-customer is redirected if the authorization is successful. [optional] # noqa: E501 + failure_return_url (str): URL where the end-customer is redirected if the authorization failed. [optional] # noqa: E501 + cancel_return_url (str): URL where the end-customer is redirected if the authorization cancelled. [optional] # noqa: E501 + redeem_points (str): REDEEM_NONE will not use any point, REDEEM_ALL will use all available points before cash balance is used. For OVO and ShopeePay tokenized payment use only.. [optional] # noqa: E501 + mobilenumber (str): [optional] # noqa: E501 + cashtag (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """EWalletChannelProperties - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + success_return_url (str): URL where the end-customer is redirected if the authorization is successful. [optional] # noqa: E501 + failure_return_url (str): URL where the end-customer is redirected if the authorization failed. [optional] # noqa: E501 + cancel_return_url (str): URL where the end-customer is redirected if the authorization cancelled. [optional] # noqa: E501 + redeem_points (str): REDEEM_NONE will not use any point, REDEEM_ALL will use all available points before cash balance is used. For OVO and ShopeePay tokenized payment use only.. [optional] # noqa: E501 + mobilenumber (str): [optional] # noqa: E501 + cashtag (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/e_wallet_parameters.py b/xendit/payment_request/model/e_wallet_parameters.py new file mode 100644 index 00000000..0cb47fa6 --- /dev/null +++ b/xendit/payment_request/model/e_wallet_parameters.py @@ -0,0 +1,274 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.e_wallet_channel_code import EWalletChannelCode + from xendit.payment_request.model.e_wallet_channel_properties import EWalletChannelProperties + globals()['EWalletChannelCode'] = EWalletChannelCode + globals()['EWalletChannelProperties'] = EWalletChannelProperties + + +class EWalletParameters(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'channel_code': (EWalletChannelCode,), # noqa: E501 + 'channel_properties': (EWalletChannelProperties,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """EWalletParameters - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + channel_code (EWalletChannelCode): [optional] # noqa: E501 + channel_properties (EWalletChannelProperties): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """EWalletParameters - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + channel_code (EWalletChannelCode): [optional] # noqa: E501 + channel_properties (EWalletChannelProperties): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/error.py b/xendit/payment_request/model/error.py new file mode 100644 index 00000000..2ca6d6bf --- /dev/null +++ b/xendit/payment_request/model/error.py @@ -0,0 +1,324 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class Error(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('error_code',): { + 'None': None, + 'ACCOUNT_ACCESS_BLOCKED': "ACCOUNT_ACCESS_BLOCKED", + 'ADDRESS_VALIDATION_FAILED': "ADDRESS_VALIDATION_FAILED", + 'AMOUNT_MISMATCHED': "AMOUNT_MISMATCHED", + 'API_VALIDATION_ERROR': "API_VALIDATION_ERROR", + 'AUTHENTICATION_FAILED': "AUTHENTICATION_FAILED", + 'AUTHENTICATION_REQUIRED': "AUTHENTICATION_REQUIRED", + 'CARD_DECLINED': "CARD_DECLINED", + 'CHANNEL_CODE_NOT_SUPPORTED_ERROR': "CHANNEL_CODE_NOT_SUPPORTED_ERROR", + 'CHANNEL_NOT_ACTIVATED': "CHANNEL_NOT_ACTIVATED", + 'CHANNEL_UNAVAILABLE': "CHANNEL_UNAVAILABLE", + 'COF_COMBINATION_NOT_ALLOWED_ERROR': "COF_COMBINATION_NOT_ALLOWED_ERROR", + 'CURRENCY_MISMATCHED': "CURRENCY_MISMATCHED", + 'CUSTOMER_NOT_FOUND_ERROR': "CUSTOMER_NOT_FOUND_ERROR", + 'CUSTOMER_PAYMENT_METHOD_MISMATCHED': "CUSTOMER_PAYMENT_METHOD_MISMATCHED", + 'DATA_NOT_FOUND': "DATA_NOT_FOUND", + 'DATA_NOT_FOUND_ERROR': "DATA_NOT_FOUND_ERROR", + 'DECLINED_BY_ISSUER': "DECLINED_BY_ISSUER", + 'DECLINED_BY_PROCESSOR': "DECLINED_BY_PROCESSOR", + 'DENIED_PERSON_LIST_MATCHED': "DENIED_PERSON_LIST_MATCHED", + 'DUPLICATE_ERROR': "DUPLICATE_ERROR", + 'DUPLICATE_REFERENCE': "DUPLICATE_REFERENCE", + 'EXCEEDS_CAPTURABLE_AMOUNT': "EXCEEDS_CAPTURABLE_AMOUNT", + 'EXPIRED_CARD': "EXPIRED_CARD", + 'EXPIRED_OTP_ERROR': "EXPIRED_OTP_ERROR", + 'FEATURE_NOT_ACTIVATED': "FEATURE_NOT_ACTIVATED", + 'IDEMPOTENCY_ERROR': "IDEMPOTENCY_ERROR", + 'INACTIVE_OR_UNAUTHORIZED_CARD': "INACTIVE_OR_UNAUTHORIZED_CARD", + 'INSUFFICIENT_BALANCE': "INSUFFICIENT_BALANCE", + 'INVALID_ACCOUNT_DETAILS': "INVALID_ACCOUNT_DETAILS", + 'INVALID_CVV': "INVALID_CVV", + 'INVALID_OTP_ERROR': "INVALID_OTP_ERROR", + 'INVALID_PAYMENT_METHOD': "INVALID_PAYMENT_METHOD", + 'ISSUER_UNAVAILABLE': "ISSUER_UNAVAILABLE", + 'MANUAL_CAPTURE_NOT_SUPPORTED': "MANUAL_CAPTURE_NOT_SUPPORTED", + 'MAX_ACCOUNT_LINKING': "MAX_ACCOUNT_LINKING", + 'MAX_AMOUNT_LIMIT_ERROR': "MAX_AMOUNT_LIMIT_ERROR", + 'MAX_OTP_ATTEMPTS_ERROR': "MAX_OTP_ATTEMPTS_ERROR", + 'OPERATION_NOT_ALLOWED': "OPERATION_NOT_ALLOWED", + 'OTP_DELIVERY_ERROR': "OTP_DELIVERY_ERROR", + 'PAYMENT_METHOD_NOT_FOUND_ERROR': "PAYMENT_METHOD_NOT_FOUND_ERROR", + 'PAYMENT_REQUEST_ALREADY_COMPLETED': "PAYMENT_REQUEST_ALREADY_COMPLETED", + 'PAYMENT_REQUEST_ALREADY_FAILED': "PAYMENT_REQUEST_ALREADY_FAILED", + 'PAYMENT_REQUEST_ALREADY_FULLY_CAPTURED': "PAYMENT_REQUEST_ALREADY_FULLY_CAPTURED", + 'PAYMENT_STATUS_FAILED': "PAYMENT_STATUS_FAILED", + 'PROCESSOR_CONFIGURATION_ERROR': "PROCESSOR_CONFIGURATION_ERROR", + 'PROCESSOR_ERROR': "PROCESSOR_ERROR", + 'PROCESSOR_TEMPORARILY_UNAVAILABLE': "PROCESSOR_TEMPORARILY_UNAVAILABLE", + 'PROCESSOR_TIMEOUT': "PROCESSOR_TIMEOUT", + 'REJECTED_BY_ACQUIRER': "REJECTED_BY_ACQUIRER", + 'SERVER_ERROR': "SERVER_ERROR", + 'STOLEN_CARD': "STOLEN_CARD", + 'STRONG_CUSTOMER_AUTHENTICATION_REQUIRED': "STRONG_CUSTOMER_AUTHENTICATION_REQUIRED", + 'SUSPECTED_FRAUDULENT': "SUSPECTED_FRAUDULENT", + 'UNAUTHORIZED': "UNAUTHORIZED", + 'DUPLICATED_FIXED_PAYMENT_INSTRUMENT': "DUPLICATED_FIXED_PAYMENT_INSTRUMENT", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'error_code': (str, none_type,), # noqa: E501 + 'message': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'error_code': 'error_code', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Error - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str, none_type): [optional] # noqa: E501 + message (str, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Error - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str, none_type): [optional] # noqa: E501 + message (str, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/over_the_counter.py b/xendit/payment_request/model/over_the_counter.py new file mode 100644 index 00000000..85b418a7 --- /dev/null +++ b/xendit/payment_request/model/over_the_counter.py @@ -0,0 +1,336 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.over_the_counter_channel_code import OverTheCounterChannelCode + from xendit.payment_request.model.over_the_counter_channel_properties import OverTheCounterChannelProperties + from xendit.payment_request.model.over_the_counter_parameters import OverTheCounterParameters + from xendit.payment_request.model.payment_request_currency import PaymentRequestCurrency + globals()['OverTheCounterChannelCode'] = OverTheCounterChannelCode + globals()['OverTheCounterChannelProperties'] = OverTheCounterChannelProperties + globals()['OverTheCounterParameters'] = OverTheCounterParameters + globals()['PaymentRequestCurrency'] = PaymentRequestCurrency + + +class OverTheCounter(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'channel_code': (OverTheCounterChannelCode,), # noqa: E501 + 'channel_properties': (OverTheCounterChannelProperties,), # noqa: E501 + 'amount': (float, none_type,), # noqa: E501 + 'currency': (PaymentRequestCurrency,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'amount': 'amount', # noqa: E501 + 'currency': 'currency', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """OverTheCounter - a model defined in OpenAPI + + Keyword Args: + channel_code (OverTheCounterChannelCode): + channel_properties (OverTheCounterChannelProperties): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + amount (float, none_type): [optional] # noqa: E501 + currency (PaymentRequestCurrency): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """OverTheCounter - a model defined in OpenAPI + + Keyword Args: + channel_code (OverTheCounterChannelCode): + channel_properties (OverTheCounterChannelProperties): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + amount (float, none_type): [optional] # noqa: E501 + currency (PaymentRequestCurrency): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + OverTheCounterParameters, + ], + 'oneOf': [ + ], + } diff --git a/xendit/payment_request/model/over_the_counter_channel_code.py b/xendit/payment_request/model/over_the_counter_channel_code.py new file mode 100644 index 00000000..7140a249 --- /dev/null +++ b/xendit/payment_request/model/over_the_counter_channel_code.py @@ -0,0 +1,303 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class OverTheCounterChannelCode(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + '7ELEVEN': "7ELEVEN", + '7ELEVEN_CLIQQ': "7ELEVEN_CLIQQ", + 'CEBUANA': "CEBUANA", + 'ECPAY': "ECPAY", + 'PALAWAN': "PALAWAN", + 'MLHUILLIER': "MLHUILLIER", + 'ECPAY_DRAGONLOAN': "ECPAY_DRAGONLOAN", + 'LBC': "LBC", + 'ECPAY_SCHOOL': "ECPAY_SCHOOL", + 'RD_PAWNSHOP': "RD_PAWNSHOP", + 'CVM': "CVM", + 'USSC': "USSC", + 'SM_BILLS': "SM_BILLS", + 'ROBINSONS_BILLS': "ROBINSONS_BILLS", + 'ALFAMART': "ALFAMART", + 'INDOMARET': "INDOMARET", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """OverTheCounterChannelCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Over The Counter Channel Code., must be one of ["7ELEVEN", "7ELEVEN_CLIQQ", "CEBUANA", "ECPAY", "PALAWAN", "MLHUILLIER", "ECPAY_DRAGONLOAN", "LBC", "ECPAY_SCHOOL", "RD_PAWNSHOP", "CVM", "USSC", "SM_BILLS", "ROBINSONS_BILLS", "ALFAMART", "INDOMARET", ] # noqa: E501 + + Keyword Args: + value (str): Over The Counter Channel Code., must be one of ["7ELEVEN", "7ELEVEN_CLIQQ", "CEBUANA", "ECPAY", "PALAWAN", "MLHUILLIER", "ECPAY_DRAGONLOAN", "LBC", "ECPAY_SCHOOL", "RD_PAWNSHOP", "CVM", "USSC", "SM_BILLS", "ROBINSONS_BILLS", "ALFAMART", "INDOMARET", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """OverTheCounterChannelCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Over The Counter Channel Code., must be one of ["7ELEVEN", "7ELEVEN_CLIQQ", "CEBUANA", "ECPAY", "PALAWAN", "MLHUILLIER", "ECPAY_DRAGONLOAN", "LBC", "ECPAY_SCHOOL", "RD_PAWNSHOP", "CVM", "USSC", "SM_BILLS", "ROBINSONS_BILLS", "ALFAMART", "INDOMARET", ] # noqa: E501 + + Keyword Args: + value (str): Over The Counter Channel Code., must be one of ["7ELEVEN", "7ELEVEN_CLIQQ", "CEBUANA", "ECPAY", "PALAWAN", "MLHUILLIER", "ECPAY_DRAGONLOAN", "LBC", "ECPAY_SCHOOL", "RD_PAWNSHOP", "CVM", "USSC", "SM_BILLS", "ROBINSONS_BILLS", "ALFAMART", "INDOMARET", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_request/model/over_the_counter_channel_properties.py b/xendit/payment_request/model/over_the_counter_channel_properties.py new file mode 100644 index 00000000..9c1e4d2f --- /dev/null +++ b/xendit/payment_request/model/over_the_counter_channel_properties.py @@ -0,0 +1,276 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class OverTheCounterChannelProperties(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'customer_name': (str,), # noqa: E501 + 'payment_code': (str,), # noqa: E501 + 'expires_at': (datetime,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'customer_name': 'customer_name', # noqa: E501 + 'payment_code': 'payment_code', # noqa: E501 + 'expires_at': 'expires_at', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, customer_name, *args, **kwargs): # noqa: E501 + """OverTheCounterChannelProperties - a model defined in OpenAPI + + Args: + customer_name (str): Name of customer. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + payment_code (str): The payment code that you want to assign, e.g 12345. If you do not send one, one will be picked at random.. [optional] # noqa: E501 + expires_at (datetime): The time when the payment code will be expired. The minimum is 2 hours and the maximum is 9 days for 7ELEVEN. Default expired date will be 2 days from payment code generated.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.customer_name = customer_name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, customer_name, *args, **kwargs): # noqa: E501 + """OverTheCounterChannelProperties - a model defined in OpenAPI + + Args: + customer_name (str): Name of customer. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + payment_code (str): The payment code that you want to assign, e.g 12345. If you do not send one, one will be picked at random.. [optional] # noqa: E501 + expires_at (datetime): The time when the payment code will be expired. The minimum is 2 hours and the maximum is 9 days for 7ELEVEN. Default expired date will be 2 days from payment code generated.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.customer_name = customer_name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/over_the_counter_parameters.py b/xendit/payment_request/model/over_the_counter_parameters.py new file mode 100644 index 00000000..9e7bf3b8 --- /dev/null +++ b/xendit/payment_request/model/over_the_counter_parameters.py @@ -0,0 +1,292 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.over_the_counter_channel_code import OverTheCounterChannelCode + from xendit.payment_request.model.over_the_counter_channel_properties import OverTheCounterChannelProperties + from xendit.payment_request.model.payment_request_currency import PaymentRequestCurrency + globals()['OverTheCounterChannelCode'] = OverTheCounterChannelCode + globals()['OverTheCounterChannelProperties'] = OverTheCounterChannelProperties + globals()['PaymentRequestCurrency'] = PaymentRequestCurrency + + +class OverTheCounterParameters(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'channel_code': (OverTheCounterChannelCode,), # noqa: E501 + 'channel_properties': (OverTheCounterChannelProperties,), # noqa: E501 + 'amount': (float, none_type,), # noqa: E501 + 'currency': (PaymentRequestCurrency,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'amount': 'amount', # noqa: E501 + 'currency': 'currency', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, channel_code, channel_properties, *args, **kwargs): # noqa: E501 + """OverTheCounterParameters - a model defined in OpenAPI + + Args: + channel_code (OverTheCounterChannelCode): + channel_properties (OverTheCounterChannelProperties): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + amount (float, none_type): [optional] # noqa: E501 + currency (PaymentRequestCurrency): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.channel_code = channel_code + self.channel_properties = channel_properties + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, channel_code, channel_properties, *args, **kwargs): # noqa: E501 + """OverTheCounterParameters - a model defined in OpenAPI + + Args: + channel_code (OverTheCounterChannelCode): + channel_properties (OverTheCounterChannelProperties): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + amount (float, none_type): [optional] # noqa: E501 + currency (PaymentRequestCurrency): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.channel_code = channel_code + self.channel_properties = channel_properties + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/payment_method.py b/xendit/payment_request/model/payment_method.py new file mode 100644 index 00000000..e5013e49 --- /dev/null +++ b/xendit/payment_request/model/payment_method.py @@ -0,0 +1,352 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.card import Card + from xendit.payment_request.model.direct_debit import DirectDebit + from xendit.payment_request.model.e_wallet import EWallet + from xendit.payment_request.model.over_the_counter import OverTheCounter + from xendit.payment_request.model.payment_method_reusability import PaymentMethodReusability + from xendit.payment_request.model.payment_method_status import PaymentMethodStatus + from xendit.payment_request.model.payment_method_type import PaymentMethodType + from xendit.payment_request.model.qr_code import QRCode + from xendit.payment_request.model.virtual_account import VirtualAccount + globals()['Card'] = Card + globals()['DirectDebit'] = DirectDebit + globals()['EWallet'] = EWallet + globals()['OverTheCounter'] = OverTheCounter + globals()['PaymentMethodReusability'] = PaymentMethodReusability + globals()['PaymentMethodStatus'] = PaymentMethodStatus + globals()['PaymentMethodType'] = PaymentMethodType + globals()['QRCode'] = QRCode + globals()['VirtualAccount'] = VirtualAccount + + +class PaymentMethod(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'id': (str,), # noqa: E501 + 'type': (PaymentMethodType,), # noqa: E501 + 'reusability': (PaymentMethodReusability,), # noqa: E501 + 'status': (PaymentMethodStatus,), # noqa: E501 + 'created': (str,), # noqa: E501 + 'updated': (str,), # noqa: E501 + 'description': (str, none_type,), # noqa: E501 + 'reference_id': (str,), # noqa: E501 + 'card': (Card,), # noqa: E501 + 'direct_debit': (DirectDebit,), # noqa: E501 + 'ewallet': (EWallet,), # noqa: E501 + 'over_the_counter': (OverTheCounter,), # noqa: E501 + 'virtual_account': (VirtualAccount,), # noqa: E501 + 'qr_code': (QRCode,), # noqa: E501 + 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'type': 'type', # noqa: E501 + 'reusability': 'reusability', # noqa: E501 + 'status': 'status', # noqa: E501 + 'created': 'created', # noqa: E501 + 'updated': 'updated', # noqa: E501 + 'description': 'description', # noqa: E501 + 'reference_id': 'reference_id', # noqa: E501 + 'card': 'card', # noqa: E501 + 'direct_debit': 'direct_debit', # noqa: E501 + 'ewallet': 'ewallet', # noqa: E501 + 'over_the_counter': 'over_the_counter', # noqa: E501 + 'virtual_account': 'virtual_account', # noqa: E501 + 'qr_code': 'qr_code', # noqa: E501 + 'metadata': 'metadata', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, type, reusability, status, *args, **kwargs): # noqa: E501 + """PaymentMethod - a model defined in OpenAPI + + Args: + id (str): + type (PaymentMethodType): + reusability (PaymentMethodReusability): + status (PaymentMethodStatus): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created (str): [optional] # noqa: E501 + updated (str): [optional] # noqa: E501 + description (str, none_type): [optional] # noqa: E501 + reference_id (str): [optional] # noqa: E501 + card (Card): [optional] # noqa: E501 + direct_debit (DirectDebit): [optional] # noqa: E501 + ewallet (EWallet): [optional] # noqa: E501 + over_the_counter (OverTheCounter): [optional] # noqa: E501 + virtual_account (VirtualAccount): [optional] # noqa: E501 + qr_code (QRCode): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.type = type + self.reusability = reusability + self.status = status + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, id, type, reusability, status, *args, **kwargs): # noqa: E501 + """PaymentMethod - a model defined in OpenAPI + + Args: + id (str): + type (PaymentMethodType): + reusability (PaymentMethodReusability): + status (PaymentMethodStatus): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created (str): [optional] # noqa: E501 + updated (str): [optional] # noqa: E501 + description (str, none_type): [optional] # noqa: E501 + reference_id (str): [optional] # noqa: E501 + card (Card): [optional] # noqa: E501 + direct_debit (DirectDebit): [optional] # noqa: E501 + ewallet (EWallet): [optional] # noqa: E501 + over_the_counter (OverTheCounter): [optional] # noqa: E501 + virtual_account (VirtualAccount): [optional] # noqa: E501 + qr_code (QRCode): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.type = type + self.reusability = reusability + self.status = status + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/payment_method_parameters.py b/xendit/payment_request/model/payment_method_parameters.py new file mode 100644 index 00000000..a210d801 --- /dev/null +++ b/xendit/payment_request/model/payment_method_parameters.py @@ -0,0 +1,320 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.direct_debit_parameters import DirectDebitParameters + from xendit.payment_request.model.e_wallet_parameters import EWalletParameters + from xendit.payment_request.model.over_the_counter_parameters import OverTheCounterParameters + from xendit.payment_request.model.payment_method_reusability import PaymentMethodReusability + from xendit.payment_request.model.payment_method_type import PaymentMethodType + from xendit.payment_request.model.qr_code_parameters import QRCodeParameters + from xendit.payment_request.model.virtual_account_parameters import VirtualAccountParameters + globals()['DirectDebitParameters'] = DirectDebitParameters + globals()['EWalletParameters'] = EWalletParameters + globals()['OverTheCounterParameters'] = OverTheCounterParameters + globals()['PaymentMethodReusability'] = PaymentMethodReusability + globals()['PaymentMethodType'] = PaymentMethodType + globals()['QRCodeParameters'] = QRCodeParameters + globals()['VirtualAccountParameters'] = VirtualAccountParameters + + +class PaymentMethodParameters(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'type': (PaymentMethodType,), # noqa: E501 + 'reusability': (PaymentMethodReusability,), # noqa: E501 + 'description': (str, none_type,), # noqa: E501 + 'reference_id': (str,), # noqa: E501 + 'direct_debit': (DirectDebitParameters,), # noqa: E501 + 'ewallet': (EWalletParameters,), # noqa: E501 + 'over_the_counter': (OverTheCounterParameters,), # noqa: E501 + 'virtual_account': (VirtualAccountParameters,), # noqa: E501 + 'qr_code': (QRCodeParameters,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'type': 'type', # noqa: E501 + 'reusability': 'reusability', # noqa: E501 + 'description': 'description', # noqa: E501 + 'reference_id': 'reference_id', # noqa: E501 + 'direct_debit': 'direct_debit', # noqa: E501 + 'ewallet': 'ewallet', # noqa: E501 + 'over_the_counter': 'over_the_counter', # noqa: E501 + 'virtual_account': 'virtual_account', # noqa: E501 + 'qr_code': 'qr_code', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, reusability, *args, **kwargs): # noqa: E501 + """PaymentMethodParameters - a model defined in OpenAPI + + Args: + type (PaymentMethodType): + reusability (PaymentMethodReusability): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + description (str, none_type): [optional] # noqa: E501 + reference_id (str): [optional] # noqa: E501 + direct_debit (DirectDebitParameters): [optional] # noqa: E501 + ewallet (EWalletParameters): [optional] # noqa: E501 + over_the_counter (OverTheCounterParameters): [optional] # noqa: E501 + virtual_account (VirtualAccountParameters): [optional] # noqa: E501 + qr_code (QRCodeParameters): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + self.reusability = reusability + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, type, reusability, *args, **kwargs): # noqa: E501 + """PaymentMethodParameters - a model defined in OpenAPI + + Args: + type (PaymentMethodType): + reusability (PaymentMethodReusability): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + description (str, none_type): [optional] # noqa: E501 + reference_id (str): [optional] # noqa: E501 + direct_debit (DirectDebitParameters): [optional] # noqa: E501 + ewallet (EWalletParameters): [optional] # noqa: E501 + over_the_counter (OverTheCounterParameters): [optional] # noqa: E501 + virtual_account (VirtualAccountParameters): [optional] # noqa: E501 + qr_code (QRCodeParameters): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + self.reusability = reusability + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/payment_method_reusability.py b/xendit/payment_request/model/payment_method_reusability.py new file mode 100644 index 00000000..41b6baf5 --- /dev/null +++ b/xendit/payment_request/model/payment_method_reusability.py @@ -0,0 +1,289 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentMethodReusability(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'MULTIPLE_USE': "MULTIPLE_USE", + 'ONE_TIME_USE': "ONE_TIME_USE", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """PaymentMethodReusability - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["MULTIPLE_USE", "ONE_TIME_USE", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["MULTIPLE_USE", "ONE_TIME_USE", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """PaymentMethodReusability - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["MULTIPLE_USE", "ONE_TIME_USE", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["MULTIPLE_USE", "ONE_TIME_USE", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_request/model/payment_method_status.py b/xendit/payment_request/model/payment_method_status.py new file mode 100644 index 00000000..2f317cdc --- /dev/null +++ b/xendit/payment_request/model/payment_method_status.py @@ -0,0 +1,292 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentMethodStatus(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'ACTIVE': "ACTIVE", + 'INACTIVE': "INACTIVE", + 'PENDING': "PENDING", + 'EXPIRED': "EXPIRED", + 'FAILED': "FAILED", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """PaymentMethodStatus - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["ACTIVE", "INACTIVE", "PENDING", "EXPIRED", "FAILED", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["ACTIVE", "INACTIVE", "PENDING", "EXPIRED", "FAILED", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """PaymentMethodStatus - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["ACTIVE", "INACTIVE", "PENDING", "EXPIRED", "FAILED", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["ACTIVE", "INACTIVE", "PENDING", "EXPIRED", "FAILED", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_request/model/payment_method_type.py b/xendit/payment_request/model/payment_method_type.py new file mode 100644 index 00000000..7a296f8a --- /dev/null +++ b/xendit/payment_request/model/payment_method_type.py @@ -0,0 +1,293 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentMethodType(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'CARD': "CARD", + 'DIRECT_DEBIT': "DIRECT_DEBIT", + 'EWALLET': "EWALLET", + 'OVER_THE_COUNTER': "OVER_THE_COUNTER", + 'QR_CODE': "QR_CODE", + 'VIRTUAL_ACCOUNT': "VIRTUAL_ACCOUNT", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """PaymentMethodType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["CARD", "DIRECT_DEBIT", "EWALLET", "OVER_THE_COUNTER", "QR_CODE", "VIRTUAL_ACCOUNT", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["CARD", "DIRECT_DEBIT", "EWALLET", "OVER_THE_COUNTER", "QR_CODE", "VIRTUAL_ACCOUNT", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """PaymentMethodType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["CARD", "DIRECT_DEBIT", "EWALLET", "OVER_THE_COUNTER", "QR_CODE", "VIRTUAL_ACCOUNT", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["CARD", "DIRECT_DEBIT", "EWALLET", "OVER_THE_COUNTER", "QR_CODE", "VIRTUAL_ACCOUNT", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_request/model/payment_request.py b/xendit/payment_request/model/payment_request.py new file mode 100644 index 00000000..92ede5c4 --- /dev/null +++ b/xendit/payment_request/model/payment_request.py @@ -0,0 +1,394 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.payment_method import PaymentMethod + from xendit.payment_request.model.payment_request_action import PaymentRequestAction + from xendit.payment_request.model.payment_request_basket import PaymentRequestBasket + from xendit.payment_request.model.payment_request_capture_method import PaymentRequestCaptureMethod + from xendit.payment_request.model.payment_request_card_verification_results import PaymentRequestCardVerificationResults + from xendit.payment_request.model.payment_request_country import PaymentRequestCountry + from xendit.payment_request.model.payment_request_currency import PaymentRequestCurrency + from xendit.payment_request.model.payment_request_initiator import PaymentRequestInitiator + from xendit.payment_request.model.payment_request_shipping_information import PaymentRequestShippingInformation + from xendit.payment_request.model.payment_request_status import PaymentRequestStatus + globals()['PaymentMethod'] = PaymentMethod + globals()['PaymentRequestAction'] = PaymentRequestAction + globals()['PaymentRequestBasket'] = PaymentRequestBasket + globals()['PaymentRequestCaptureMethod'] = PaymentRequestCaptureMethod + globals()['PaymentRequestCardVerificationResults'] = PaymentRequestCardVerificationResults + globals()['PaymentRequestCountry'] = PaymentRequestCountry + globals()['PaymentRequestCurrency'] = PaymentRequestCurrency + globals()['PaymentRequestInitiator'] = PaymentRequestInitiator + globals()['PaymentRequestShippingInformation'] = PaymentRequestShippingInformation + globals()['PaymentRequestStatus'] = PaymentRequestStatus + + +class PaymentRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'id': (str,), # noqa: E501 + 'created': (str,), # noqa: E501 + 'updated': (str,), # noqa: E501 + 'reference_id': (str,), # noqa: E501 + 'business_id': (str,), # noqa: E501 + 'currency': (PaymentRequestCurrency,), # noqa: E501 + 'payment_method': (PaymentMethod,), # noqa: E501 + 'status': (PaymentRequestStatus,), # noqa: E501 + 'customer_id': (str, none_type,), # noqa: E501 + 'customer': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 + 'amount': (float,), # noqa: E501 + 'min_amount': (float, none_type,), # noqa: E501 + 'max_amount': (float, none_type,), # noqa: E501 + 'country': (PaymentRequestCountry,), # noqa: E501 + 'description': (str, none_type,), # noqa: E501 + 'failure_code': (str, none_type,), # noqa: E501 + 'capture_method': (PaymentRequestCaptureMethod,), # noqa: E501 + 'initiator': (PaymentRequestInitiator,), # noqa: E501 + 'card_verification_results': (PaymentRequestCardVerificationResults,), # noqa: E501 + 'actions': ([PaymentRequestAction],), # noqa: E501 + 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 + 'shipping_information': (PaymentRequestShippingInformation,), # noqa: E501 + 'items': (PaymentRequestBasket,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'created': 'created', # noqa: E501 + 'updated': 'updated', # noqa: E501 + 'reference_id': 'reference_id', # noqa: E501 + 'business_id': 'business_id', # noqa: E501 + 'currency': 'currency', # noqa: E501 + 'payment_method': 'payment_method', # noqa: E501 + 'status': 'status', # noqa: E501 + 'customer_id': 'customer_id', # noqa: E501 + 'customer': 'customer', # noqa: E501 + 'amount': 'amount', # noqa: E501 + 'min_amount': 'min_amount', # noqa: E501 + 'max_amount': 'max_amount', # noqa: E501 + 'country': 'country', # noqa: E501 + 'description': 'description', # noqa: E501 + 'failure_code': 'failure_code', # noqa: E501 + 'capture_method': 'capture_method', # noqa: E501 + 'initiator': 'initiator', # noqa: E501 + 'card_verification_results': 'card_verification_results', # noqa: E501 + 'actions': 'actions', # noqa: E501 + 'metadata': 'metadata', # noqa: E501 + 'shipping_information': 'shipping_information', # noqa: E501 + 'items': 'items', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, created, updated, reference_id, business_id, currency, payment_method, status, *args, **kwargs): # noqa: E501 + """PaymentRequest - a model defined in OpenAPI + + Args: + id (str): + created (str): + updated (str): + reference_id (str): + business_id (str): + currency (PaymentRequestCurrency): + payment_method (PaymentMethod): + status (PaymentRequestStatus): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + customer_id (str, none_type): [optional] # noqa: E501 + customer ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + amount (float): [optional] # noqa: E501 + min_amount (float, none_type): [optional] # noqa: E501 + max_amount (float, none_type): [optional] # noqa: E501 + country (PaymentRequestCountry): [optional] # noqa: E501 + description (str, none_type): [optional] # noqa: E501 + failure_code (str, none_type): [optional] # noqa: E501 + capture_method (PaymentRequestCaptureMethod): [optional] # noqa: E501 + initiator (PaymentRequestInitiator): [optional] # noqa: E501 + card_verification_results (PaymentRequestCardVerificationResults): [optional] # noqa: E501 + actions ([PaymentRequestAction]): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + shipping_information (PaymentRequestShippingInformation): [optional] # noqa: E501 + items (PaymentRequestBasket): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.created = created + self.updated = updated + self.reference_id = reference_id + self.business_id = business_id + self.currency = currency + self.payment_method = payment_method + self.status = status + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, id, created, updated, reference_id, business_id, currency, payment_method, status, *args, **kwargs): # noqa: E501 + """PaymentRequest - a model defined in OpenAPI + + Args: + id (str): + created (str): + updated (str): + reference_id (str): + business_id (str): + currency (PaymentRequestCurrency): + payment_method (PaymentMethod): + status (PaymentRequestStatus): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + customer_id (str, none_type): [optional] # noqa: E501 + customer ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + amount (float): [optional] # noqa: E501 + min_amount (float, none_type): [optional] # noqa: E501 + max_amount (float, none_type): [optional] # noqa: E501 + country (PaymentRequestCountry): [optional] # noqa: E501 + description (str, none_type): [optional] # noqa: E501 + failure_code (str, none_type): [optional] # noqa: E501 + capture_method (PaymentRequestCaptureMethod): [optional] # noqa: E501 + initiator (PaymentRequestInitiator): [optional] # noqa: E501 + card_verification_results (PaymentRequestCardVerificationResults): [optional] # noqa: E501 + actions ([PaymentRequestAction]): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + shipping_information (PaymentRequestShippingInformation): [optional] # noqa: E501 + items (PaymentRequestBasket): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.created = created + self.updated = updated + self.reference_id = reference_id + self.business_id = business_id + self.currency = currency + self.payment_method = payment_method + self.status = status + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/payment_request_action.py b/xendit/payment_request/model/payment_request_action.py new file mode 100644 index 00000000..435de1ac --- /dev/null +++ b/xendit/payment_request/model/payment_request_action.py @@ -0,0 +1,305 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentRequestAction(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('action',): { + 'AUTH': "AUTH", + 'RESEND_AUTH': "RESEND_AUTH", + 'CAPTURE': "CAPTURE", + 'CANCEL': "CANCEL", + 'PRESENT_TO_CUSTOMER': "PRESENT_TO_CUSTOMER", + }, + ('url_type',): { + 'API': "API", + 'WEB': "WEB", + 'MOBILE': "MOBILE", + 'DEEPLINK': "DEEPLINK", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'action': (str,), # noqa: E501 + 'url_type': (str,), # noqa: E501 + 'method': (str, none_type,), # noqa: E501 + 'url': (str, none_type,), # noqa: E501 + 'qr_code': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'action': 'action', # noqa: E501 + 'url_type': 'url_type', # noqa: E501 + 'method': 'method', # noqa: E501 + 'url': 'url', # noqa: E501 + 'qr_code': 'qr_code', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, action, url_type, method, url, qr_code, *args, **kwargs): # noqa: E501 + """PaymentRequestAction - a model defined in OpenAPI + + Args: + action (str): + url_type (str): + method (str, none_type): + url (str, none_type): + qr_code (str, none_type): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.action = action + self.url_type = url_type + self.method = method + self.url = url + self.qr_code = qr_code + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, action, url_type, method, url, qr_code, *args, **kwargs): # noqa: E501 + """PaymentRequestAction - a model defined in OpenAPI + + Args: + action (str): + url_type (str): + method (str, none_type): + url (str, none_type): + qr_code (str, none_type): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.action = action + self.url_type = url_type + self.method = method + self.url = url + self.qr_code = qr_code + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/payment_request_auth_parameters.py b/xendit/payment_request/model/payment_request_auth_parameters.py new file mode 100644 index 00000000..203e794d --- /dev/null +++ b/xendit/payment_request/model/payment_request_auth_parameters.py @@ -0,0 +1,268 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentRequestAuthParameters(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'auth_code': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'auth_code': 'auth_code', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, auth_code, *args, **kwargs): # noqa: E501 + """PaymentRequestAuthParameters - a model defined in OpenAPI + + Args: + auth_code (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.auth_code = auth_code + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, auth_code, *args, **kwargs): # noqa: E501 + """PaymentRequestAuthParameters - a model defined in OpenAPI + + Args: + auth_code (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.auth_code = auth_code + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/payment_request_basket.py b/xendit/payment_request/model/payment_request_basket.py new file mode 100644 index 00000000..1745ee77 --- /dev/null +++ b/xendit/payment_request/model/payment_request_basket.py @@ -0,0 +1,290 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.payment_request_basket_item import PaymentRequestBasketItem + globals()['PaymentRequestBasketItem'] = PaymentRequestBasketItem + + +class PaymentRequestBasket(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'value': ([PaymentRequestBasketItem], none_type,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """PaymentRequestBasket - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([PaymentRequestBasketItem], none_type): # noqa: E501 + + Keyword Args: + value ([PaymentRequestBasketItem], none_type): # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """PaymentRequestBasket - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([PaymentRequestBasketItem], none_type): # noqa: E501 + + Keyword Args: + value ([PaymentRequestBasketItem], none_type): # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_request/model/payment_request_basket_item.py b/xendit/payment_request/model/payment_request_basket_item.py new file mode 100644 index 00000000..badf1662 --- /dev/null +++ b/xendit/payment_request/model/payment_request_basket_item.py @@ -0,0 +1,324 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentRequestBasketItem(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'name': (str,), # noqa: E501 + 'category': (str,), # noqa: E501 + 'currency': (str,), # noqa: E501 + 'quantity': (float,), # noqa: E501 + 'price': (float,), # noqa: E501 + 'reference_id': (str,), # noqa: E501 + 'description': (str,), # noqa: E501 + 'type': (str,), # noqa: E501 + 'sub_category': (str,), # noqa: E501 + 'payer_charged_currency': (str,), # noqa: E501 + 'payer_charged_price': (float,), # noqa: E501 + 'url': (str,), # noqa: E501 + 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'name': 'name', # noqa: E501 + 'category': 'category', # noqa: E501 + 'currency': 'currency', # noqa: E501 + 'quantity': 'quantity', # noqa: E501 + 'price': 'price', # noqa: E501 + 'reference_id': 'reference_id', # noqa: E501 + 'description': 'description', # noqa: E501 + 'type': 'type', # noqa: E501 + 'sub_category': 'sub_category', # noqa: E501 + 'payer_charged_currency': 'payer_charged_currency', # noqa: E501 + 'payer_charged_price': 'payer_charged_price', # noqa: E501 + 'url': 'url', # noqa: E501 + 'metadata': 'metadata', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, category, currency, quantity, price, *args, **kwargs): # noqa: E501 + """PaymentRequestBasketItem - a model defined in OpenAPI + + Args: + name (str): + category (str): + currency (str): + quantity (float): + price (float): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + reference_id (str): [optional] # noqa: E501 + description (str): [optional] # noqa: E501 + type (str): [optional] # noqa: E501 + sub_category (str): [optional] # noqa: E501 + payer_charged_currency (str): [optional] # noqa: E501 + payer_charged_price (float): [optional] # noqa: E501 + url (str): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + self.category = category + self.currency = currency + self.quantity = quantity + self.price = price + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, name, category, currency, quantity, price, *args, **kwargs): # noqa: E501 + """PaymentRequestBasketItem - a model defined in OpenAPI + + Args: + name (str): + category (str): + currency (str): + quantity (float): + price (float): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + reference_id (str): [optional] # noqa: E501 + description (str): [optional] # noqa: E501 + type (str): [optional] # noqa: E501 + sub_category (str): [optional] # noqa: E501 + payer_charged_currency (str): [optional] # noqa: E501 + payer_charged_price (float): [optional] # noqa: E501 + url (str): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + self.category = category + self.currency = currency + self.quantity = quantity + self.price = price + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/payment_request_capture_method.py b/xendit/payment_request/model/payment_request_capture_method.py new file mode 100644 index 00000000..7323d4f7 --- /dev/null +++ b/xendit/payment_request/model/payment_request_capture_method.py @@ -0,0 +1,290 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentRequestCaptureMethod(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'None': None, + 'AUTOMATIC': "AUTOMATIC", + 'MANUAL': "MANUAL", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """PaymentRequestCaptureMethod - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["AUTOMATIC", "MANUAL", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["AUTOMATIC", "MANUAL", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """PaymentRequestCaptureMethod - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["AUTOMATIC", "MANUAL", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["AUTOMATIC", "MANUAL", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_request/model/payment_request_card_verification_results.py b/xendit/payment_request/model/payment_request_card_verification_results.py new file mode 100644 index 00000000..daec1d5f --- /dev/null +++ b/xendit/payment_request/model/payment_request_card_verification_results.py @@ -0,0 +1,282 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.payment_request_card_verification_results_three_dee_secure import PaymentRequestCardVerificationResultsThreeDeeSecure + globals()['PaymentRequestCardVerificationResultsThreeDeeSecure'] = PaymentRequestCardVerificationResultsThreeDeeSecure + + +class PaymentRequestCardVerificationResults(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'three_d_secure': (PaymentRequestCardVerificationResultsThreeDeeSecure,), # noqa: E501 + 'cvv_result': (str, none_type,), # noqa: E501 + 'address_verification_result': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'three_d_secure': 'three_d_secure', # noqa: E501 + 'cvv_result': 'cvv_result', # noqa: E501 + 'address_verification_result': 'address_verification_result', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, three_d_secure, *args, **kwargs): # noqa: E501 + """PaymentRequestCardVerificationResults - a model defined in OpenAPI + + Args: + three_d_secure (PaymentRequestCardVerificationResultsThreeDeeSecure): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cvv_result (str, none_type): [optional] # noqa: E501 + address_verification_result (str, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.three_d_secure = three_d_secure + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, three_d_secure, *args, **kwargs): # noqa: E501 + """PaymentRequestCardVerificationResults - a model defined in OpenAPI + + Args: + three_d_secure (PaymentRequestCardVerificationResultsThreeDeeSecure): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cvv_result (str, none_type): [optional] # noqa: E501 + address_verification_result (str, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.three_d_secure = three_d_secure + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/payment_request_card_verification_results_three_dee_secure.py b/xendit/payment_request/model/payment_request_card_verification_results_three_dee_secure.py new file mode 100644 index 00000000..e08b637c --- /dev/null +++ b/xendit/payment_request/model/payment_request_card_verification_results_three_dee_secure.py @@ -0,0 +1,278 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentRequestCardVerificationResultsThreeDeeSecure(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'three_d_secure_flow': (str,), # noqa: E501 + 'eci_code': (str,), # noqa: E501 + 'three_d_secure_result': (str,), # noqa: E501 + 'three_d_secure_result_reason': (str, none_type,), # noqa: E501 + 'three_d_secure_version': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'three_d_secure_flow': 'three_d_secure_flow', # noqa: E501 + 'eci_code': 'eci_code', # noqa: E501 + 'three_d_secure_result': 'three_d_secure_result', # noqa: E501 + 'three_d_secure_result_reason': 'three_d_secure_result_reason', # noqa: E501 + 'three_d_secure_version': 'three_d_secure_version', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PaymentRequestCardVerificationResultsThreeDeeSecure - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + three_d_secure_flow (str): [optional] # noqa: E501 + eci_code (str): [optional] # noqa: E501 + three_d_secure_result (str): [optional] # noqa: E501 + three_d_secure_result_reason (str, none_type): [optional] # noqa: E501 + three_d_secure_version (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """PaymentRequestCardVerificationResultsThreeDeeSecure - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + three_d_secure_flow (str): [optional] # noqa: E501 + eci_code (str): [optional] # noqa: E501 + three_d_secure_result (str): [optional] # noqa: E501 + three_d_secure_result_reason (str, none_type): [optional] # noqa: E501 + three_d_secure_version (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/payment_request_channel_properties.py b/xendit/payment_request/model/payment_request_channel_properties.py new file mode 100644 index 00000000..cf898b8d --- /dev/null +++ b/xendit/payment_request/model/payment_request_channel_properties.py @@ -0,0 +1,301 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentRequestChannelProperties(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('success_return_url',): { + 'regex': { + 'pattern': r'^\S{1,255}:\/\/\S{0,1000}$', # noqa: E501 + }, + }, + ('failure_return_url',): { + 'regex': { + 'pattern': r'^\S{1,255}:\/\/\S{0,1000}$', # noqa: E501 + }, + }, + ('cancel_return_url',): { + 'regex': { + 'pattern': r'^\S{1,255}:\/\/\S{0,1000}$', # noqa: E501 + }, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'success_return_url': (str,), # noqa: E501 + 'failure_return_url': (str,), # noqa: E501 + 'cancel_return_url': (str,), # noqa: E501 + 'redeem_points': (str,), # noqa: E501 + 'require_auth': (bool,), # noqa: E501 + 'merchant_id_tag': (str,), # noqa: E501 + 'cardonfile_type': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'success_return_url': 'success_return_url', # noqa: E501 + 'failure_return_url': 'failure_return_url', # noqa: E501 + 'cancel_return_url': 'cancel_return_url', # noqa: E501 + 'redeem_points': 'redeem_points', # noqa: E501 + 'require_auth': 'require_auth', # noqa: E501 + 'merchant_id_tag': 'merchant_id_tag', # noqa: E501 + 'cardonfile_type': 'cardonfile_type', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PaymentRequestChannelProperties - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + success_return_url (str): URL where the end-customer is redirected if the authorization is successful. [optional] # noqa: E501 + failure_return_url (str): URL where the end-customer is redirected if the authorization failed. [optional] # noqa: E501 + cancel_return_url (str): URL where the end-customer is redirected if the authorization cancelled. [optional] # noqa: E501 + redeem_points (str): REDEEM_NONE will not use any point, REDEEM_ALL will use all available points before cash balance is used. For OVO and ShopeePay tokenized payment use only.. [optional] # noqa: E501 + require_auth (bool): Toggle used to require end-customer to input undergo OTP validation before completing a payment. OTP will always be required for transactions greater than 1,000,000 IDR. For BRI tokenized payment use only.. [optional] # noqa: E501 + merchant_id_tag (str): Tag for a Merchant ID that you want to associate this payment with. For merchants using their own MIDs to specify which MID they want to use . [optional] # noqa: E501 + cardonfile_type (str, none_type): Type of “credential-on-file” / “card-on-file” payment being made. Indicate that this payment uses a previously linked Payment Method for charging.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """PaymentRequestChannelProperties - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + success_return_url (str): URL where the end-customer is redirected if the authorization is successful. [optional] # noqa: E501 + failure_return_url (str): URL where the end-customer is redirected if the authorization failed. [optional] # noqa: E501 + cancel_return_url (str): URL where the end-customer is redirected if the authorization cancelled. [optional] # noqa: E501 + redeem_points (str): REDEEM_NONE will not use any point, REDEEM_ALL will use all available points before cash balance is used. For OVO and ShopeePay tokenized payment use only.. [optional] # noqa: E501 + require_auth (bool): Toggle used to require end-customer to input undergo OTP validation before completing a payment. OTP will always be required for transactions greater than 1,000,000 IDR. For BRI tokenized payment use only.. [optional] # noqa: E501 + merchant_id_tag (str): Tag for a Merchant ID that you want to associate this payment with. For merchants using their own MIDs to specify which MID they want to use . [optional] # noqa: E501 + cardonfile_type (str, none_type): Type of “credential-on-file” / “card-on-file” payment being made. Indicate that this payment uses a previously linked Payment Method for charging.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/payment_request_country.py b/xendit/payment_request/model/payment_request_country.py new file mode 100644 index 00000000..32162179 --- /dev/null +++ b/xendit/payment_request/model/payment_request_country.py @@ -0,0 +1,292 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentRequestCountry(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'ID': "ID", + 'PH': "PH", + 'VN': "VN", + 'TH': "TH", + 'MY': "MY", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """PaymentRequestCountry - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["ID", "PH", "VN", "TH", "MY", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["ID", "PH", "VN", "TH", "MY", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """PaymentRequestCountry - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["ID", "PH", "VN", "TH", "MY", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["ID", "PH", "VN", "TH", "MY", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_request/model/payment_request_currency.py b/xendit/payment_request/model/payment_request_currency.py new file mode 100644 index 00000000..28ab1009 --- /dev/null +++ b/xendit/payment_request/model/payment_request_currency.py @@ -0,0 +1,292 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentRequestCurrency(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'IDR': "IDR", + 'PHP': "PHP", + 'VND': "VND", + 'THB': "THB", + 'MYR': "MYR", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """PaymentRequestCurrency - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["IDR", "PHP", "VND", "THB", "MYR", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["IDR", "PHP", "VND", "THB", "MYR", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """PaymentRequestCurrency - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["IDR", "PHP", "VND", "THB", "MYR", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["IDR", "PHP", "VND", "THB", "MYR", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_request/model/payment_request_initiator.py b/xendit/payment_request/model/payment_request_initiator.py new file mode 100644 index 00000000..1347d907 --- /dev/null +++ b/xendit/payment_request/model/payment_request_initiator.py @@ -0,0 +1,290 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentRequestInitiator(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'None': None, + 'CUSTOMER': "CUSTOMER", + 'MERCHANT': "MERCHANT", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """PaymentRequestInitiator - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["CUSTOMER", "MERCHANT", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["CUSTOMER", "MERCHANT", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """PaymentRequestInitiator - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["CUSTOMER", "MERCHANT", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["CUSTOMER", "MERCHANT", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_request/model/payment_request_list_response.py b/xendit/payment_request/model/payment_request_list_response.py new file mode 100644 index 00000000..c3d110d7 --- /dev/null +++ b/xendit/payment_request/model/payment_request_list_response.py @@ -0,0 +1,280 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.payment_request import PaymentRequest + globals()['PaymentRequest'] = PaymentRequest + + +class PaymentRequestListResponse(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'data': ([PaymentRequest],), # noqa: E501 + 'has_more': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'data': 'data', # noqa: E501 + 'has_more': 'has_more', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, has_more, *args, **kwargs): # noqa: E501 + """PaymentRequestListResponse - a model defined in OpenAPI + + Args: + data ([PaymentRequest]): + has_more (bool): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + self.has_more = has_more + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, data, has_more, *args, **kwargs): # noqa: E501 + """PaymentRequestListResponse - a model defined in OpenAPI + + Args: + data ([PaymentRequest]): + has_more (bool): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + self.has_more = has_more + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/payment_request_parameters.py b/xendit/payment_request/model/payment_request_parameters.py new file mode 100644 index 00000000..0cc80a14 --- /dev/null +++ b/xendit/payment_request/model/payment_request_parameters.py @@ -0,0 +1,338 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.payment_method_parameters import PaymentMethodParameters + from xendit.payment_request.model.payment_request_basket import PaymentRequestBasket + from xendit.payment_request.model.payment_request_capture_method import PaymentRequestCaptureMethod + from xendit.payment_request.model.payment_request_currency import PaymentRequestCurrency + from xendit.payment_request.model.payment_request_initiator import PaymentRequestInitiator + from xendit.payment_request.model.payment_request_parameters_channel_properties import PaymentRequestParametersChannelProperties + from xendit.payment_request.model.payment_request_shipping_information import PaymentRequestShippingInformation + globals()['PaymentMethodParameters'] = PaymentMethodParameters + globals()['PaymentRequestBasket'] = PaymentRequestBasket + globals()['PaymentRequestCaptureMethod'] = PaymentRequestCaptureMethod + globals()['PaymentRequestCurrency'] = PaymentRequestCurrency + globals()['PaymentRequestInitiator'] = PaymentRequestInitiator + globals()['PaymentRequestParametersChannelProperties'] = PaymentRequestParametersChannelProperties + globals()['PaymentRequestShippingInformation'] = PaymentRequestShippingInformation + + +class PaymentRequestParameters(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'currency': (PaymentRequestCurrency,), # noqa: E501 + 'reference_id': (str,), # noqa: E501 + 'amount': (float,), # noqa: E501 + 'payment_method': (PaymentMethodParameters,), # noqa: E501 + 'description': (str, none_type,), # noqa: E501 + 'capture_method': (PaymentRequestCaptureMethod,), # noqa: E501 + 'initiator': (PaymentRequestInitiator,), # noqa: E501 + 'payment_method_id': (str,), # noqa: E501 + 'channel_properties': (PaymentRequestParametersChannelProperties,), # noqa: E501 + 'shipping_information': (PaymentRequestShippingInformation,), # noqa: E501 + 'items': (PaymentRequestBasket,), # noqa: E501 + 'customer_id': (str, none_type,), # noqa: E501 + 'customer': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 + 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'currency': 'currency', # noqa: E501 + 'reference_id': 'reference_id', # noqa: E501 + 'amount': 'amount', # noqa: E501 + 'payment_method': 'payment_method', # noqa: E501 + 'description': 'description', # noqa: E501 + 'capture_method': 'capture_method', # noqa: E501 + 'initiator': 'initiator', # noqa: E501 + 'payment_method_id': 'payment_method_id', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'shipping_information': 'shipping_information', # noqa: E501 + 'items': 'items', # noqa: E501 + 'customer_id': 'customer_id', # noqa: E501 + 'customer': 'customer', # noqa: E501 + 'metadata': 'metadata', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, currency, *args, **kwargs): # noqa: E501 + """PaymentRequestParameters - a model defined in OpenAPI + + Args: + currency (PaymentRequestCurrency): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + reference_id (str): [optional] # noqa: E501 + amount (float): [optional] # noqa: E501 + payment_method (PaymentMethodParameters): [optional] # noqa: E501 + description (str, none_type): [optional] # noqa: E501 + capture_method (PaymentRequestCaptureMethod): [optional] # noqa: E501 + initiator (PaymentRequestInitiator): [optional] # noqa: E501 + payment_method_id (str): [optional] # noqa: E501 + channel_properties (PaymentRequestParametersChannelProperties): [optional] # noqa: E501 + shipping_information (PaymentRequestShippingInformation): [optional] # noqa: E501 + items (PaymentRequestBasket): [optional] # noqa: E501 + customer_id (str, none_type): [optional] # noqa: E501 + customer ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.currency = currency + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, currency, *args, **kwargs): # noqa: E501 + """PaymentRequestParameters - a model defined in OpenAPI + + Args: + currency (PaymentRequestCurrency): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + reference_id (str): [optional] # noqa: E501 + amount (float): [optional] # noqa: E501 + payment_method (PaymentMethodParameters): [optional] # noqa: E501 + description (str, none_type): [optional] # noqa: E501 + capture_method (PaymentRequestCaptureMethod): [optional] # noqa: E501 + initiator (PaymentRequestInitiator): [optional] # noqa: E501 + payment_method_id (str): [optional] # noqa: E501 + channel_properties (PaymentRequestParametersChannelProperties): [optional] # noqa: E501 + shipping_information (PaymentRequestShippingInformation): [optional] # noqa: E501 + items (PaymentRequestBasket): [optional] # noqa: E501 + customer_id (str, none_type): [optional] # noqa: E501 + customer ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.currency = currency + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/payment_request_parameters_channel_properties.py b/xendit/payment_request/model/payment_request_parameters_channel_properties.py new file mode 100644 index 00000000..feb03adc --- /dev/null +++ b/xendit/payment_request/model/payment_request_parameters_channel_properties.py @@ -0,0 +1,364 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.payment_request_channel_properties import PaymentRequestChannelProperties + from xendit.payment_request.model.payment_request_parameters_channel_properties_all_of import PaymentRequestParametersChannelPropertiesAllOf + globals()['PaymentRequestChannelProperties'] = PaymentRequestChannelProperties + globals()['PaymentRequestParametersChannelPropertiesAllOf'] = PaymentRequestParametersChannelPropertiesAllOf + + +class PaymentRequestParametersChannelProperties(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('success_return_url',): { + 'regex': { + 'pattern': r'^\S{1,255}:\/\/\S{0,1000}$', # noqa: E501 + }, + }, + ('failure_return_url',): { + 'regex': { + 'pattern': r'^\S{1,255}:\/\/\S{0,1000}$', # noqa: E501 + }, + }, + ('cancel_return_url',): { + 'regex': { + 'pattern': r'^\S{1,255}:\/\/\S{0,1000}$', # noqa: E501 + }, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'success_return_url': (str,), # noqa: E501 + 'failure_return_url': (str,), # noqa: E501 + 'cancel_return_url': (str,), # noqa: E501 + 'redeem_points': (str,), # noqa: E501 + 'require_auth': (bool,), # noqa: E501 + 'merchant_id_tag': (str,), # noqa: E501 + 'cardonfile_type': (str, none_type,), # noqa: E501 + 'cvv': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'success_return_url': 'success_return_url', # noqa: E501 + 'failure_return_url': 'failure_return_url', # noqa: E501 + 'cancel_return_url': 'cancel_return_url', # noqa: E501 + 'redeem_points': 'redeem_points', # noqa: E501 + 'require_auth': 'require_auth', # noqa: E501 + 'merchant_id_tag': 'merchant_id_tag', # noqa: E501 + 'cardonfile_type': 'cardonfile_type', # noqa: E501 + 'cvv': 'cvv', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PaymentRequestParametersChannelProperties - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + success_return_url (str): URL where the end-customer is redirected if the authorization is successful. [optional] # noqa: E501 + failure_return_url (str): URL where the end-customer is redirected if the authorization failed. [optional] # noqa: E501 + cancel_return_url (str): URL where the end-customer is redirected if the authorization cancelled. [optional] # noqa: E501 + redeem_points (str): REDEEM_NONE will not use any point, REDEEM_ALL will use all available points before cash balance is used. For OVO and ShopeePay tokenized payment use only.. [optional] # noqa: E501 + require_auth (bool): Toggle used to require end-customer to input undergo OTP validation before completing a payment. OTP will always be required for transactions greater than 1,000,000 IDR. For BRI tokenized payment use only.. [optional] # noqa: E501 + merchant_id_tag (str): Tag for a Merchant ID that you want to associate this payment with. For merchants using their own MIDs to specify which MID they want to use . [optional] # noqa: E501 + cardonfile_type (str, none_type): Type of “credential-on-file” / “card-on-file” payment being made. Indicate that this payment uses a previously linked Payment Method for charging.. [optional] # noqa: E501 + cvv (str): Three digit code written on the back of the card (usually called CVV/CVN).. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """PaymentRequestParametersChannelProperties - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + success_return_url (str): URL where the end-customer is redirected if the authorization is successful. [optional] # noqa: E501 + failure_return_url (str): URL where the end-customer is redirected if the authorization failed. [optional] # noqa: E501 + cancel_return_url (str): URL where the end-customer is redirected if the authorization cancelled. [optional] # noqa: E501 + redeem_points (str): REDEEM_NONE will not use any point, REDEEM_ALL will use all available points before cash balance is used. For OVO and ShopeePay tokenized payment use only.. [optional] # noqa: E501 + require_auth (bool): Toggle used to require end-customer to input undergo OTP validation before completing a payment. OTP will always be required for transactions greater than 1,000,000 IDR. For BRI tokenized payment use only.. [optional] # noqa: E501 + merchant_id_tag (str): Tag for a Merchant ID that you want to associate this payment with. For merchants using their own MIDs to specify which MID they want to use . [optional] # noqa: E501 + cardonfile_type (str, none_type): Type of “credential-on-file” / “card-on-file” payment being made. Indicate that this payment uses a previously linked Payment Method for charging.. [optional] # noqa: E501 + cvv (str): Three digit code written on the back of the card (usually called CVV/CVN).. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + PaymentRequestChannelProperties, + PaymentRequestParametersChannelPropertiesAllOf, + ], + 'oneOf': [ + ], + } diff --git a/xendit/payment_request/model/payment_request_parameters_channel_properties_all_of.py b/xendit/payment_request/model/payment_request_parameters_channel_properties_all_of.py new file mode 100644 index 00000000..c8ca2b25 --- /dev/null +++ b/xendit/payment_request/model/payment_request_parameters_channel_properties_all_of.py @@ -0,0 +1,262 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentRequestParametersChannelPropertiesAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'cvv': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'cvv': 'cvv', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PaymentRequestParametersChannelPropertiesAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cvv (str): Three digit code written on the back of the card (usually called CVV/CVN).. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """PaymentRequestParametersChannelPropertiesAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cvv (str): Three digit code written on the back of the card (usually called CVV/CVN).. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/payment_request_shipping_information.py b/xendit/payment_request/model/payment_request_shipping_information.py new file mode 100644 index 00000000..ba77a456 --- /dev/null +++ b/xendit/payment_request/model/payment_request_shipping_information.py @@ -0,0 +1,288 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentRequestShippingInformation(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'country': (str,), # noqa: E501 + 'street_line1': (str,), # noqa: E501 + 'street_line2': (str,), # noqa: E501 + 'city': (str,), # noqa: E501 + 'province_state': (str,), # noqa: E501 + 'postal_code': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'country': 'country', # noqa: E501 + 'street_line1': 'street_line1', # noqa: E501 + 'street_line2': 'street_line2', # noqa: E501 + 'city': 'city', # noqa: E501 + 'province_state': 'province_state', # noqa: E501 + 'postal_code': 'postal_code', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, country, *args, **kwargs): # noqa: E501 + """PaymentRequestShippingInformation - a model defined in OpenAPI + + Args: + country (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + street_line1 (str): [optional] # noqa: E501 + street_line2 (str): [optional] # noqa: E501 + city (str): [optional] # noqa: E501 + province_state (str): [optional] # noqa: E501 + postal_code (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.country = country + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, country, *args, **kwargs): # noqa: E501 + """PaymentRequestShippingInformation - a model defined in OpenAPI + + Args: + country (str): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + street_line1 (str): [optional] # noqa: E501 + street_line2 (str): [optional] # noqa: E501 + city (str): [optional] # noqa: E501 + province_state (str): [optional] # noqa: E501 + postal_code (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.country = country + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/payment_request_status.py b/xendit/payment_request/model/payment_request_status.py new file mode 100644 index 00000000..c921dc92 --- /dev/null +++ b/xendit/payment_request/model/payment_request_status.py @@ -0,0 +1,295 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PaymentRequestStatus(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'PENDING': "PENDING", + 'REQUIRES_ACTION': "REQUIRES_ACTION", + 'CANCELED': "CANCELED", + 'SUCCEEDED': "SUCCEEDED", + 'FAILED': "FAILED", + 'VOIDED': "VOIDED", + 'UNKNOWN': "UNKNOWN", + 'AWAITING_CAPTURE': "AWAITING_CAPTURE", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """PaymentRequestStatus - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["PENDING", "REQUIRES_ACTION", "CANCELED", "SUCCEEDED", "FAILED", "VOIDED", "UNKNOWN", "AWAITING_CAPTURE", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["PENDING", "REQUIRES_ACTION", "CANCELED", "SUCCEEDED", "FAILED", "VOIDED", "UNKNOWN", "AWAITING_CAPTURE", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """PaymentRequestStatus - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str):, must be one of ["PENDING", "REQUIRES_ACTION", "CANCELED", "SUCCEEDED", "FAILED", "VOIDED", "UNKNOWN", "AWAITING_CAPTURE", ] # noqa: E501 + + Keyword Args: + value (str):, must be one of ["PENDING", "REQUIRES_ACTION", "CANCELED", "SUCCEEDED", "FAILED", "VOIDED", "UNKNOWN", "AWAITING_CAPTURE", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_request/model/qr_code.py b/xendit/payment_request/model/qr_code.py new file mode 100644 index 00000000..55384ce0 --- /dev/null +++ b/xendit/payment_request/model/qr_code.py @@ -0,0 +1,326 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.qr_code_channel_code import QRCodeChannelCode + from xendit.payment_request.model.qr_code_channel_properties import QRCodeChannelProperties + from xendit.payment_request.model.qr_code_parameters import QRCodeParameters + globals()['QRCodeChannelCode'] = QRCodeChannelCode + globals()['QRCodeChannelProperties'] = QRCodeChannelProperties + globals()['QRCodeParameters'] = QRCodeParameters + + +class QRCode(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'channel_code': (QRCodeChannelCode,), # noqa: E501 + 'channel_properties': (QRCodeChannelProperties,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """QRCode - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + channel_code (QRCodeChannelCode): [optional] # noqa: E501 + channel_properties (QRCodeChannelProperties): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """QRCode - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + channel_code (QRCodeChannelCode): [optional] # noqa: E501 + channel_properties (QRCodeChannelProperties): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + QRCodeParameters, + ], + 'oneOf': [ + ], + } diff --git a/xendit/payment_request/model/qr_code_channel_code.py b/xendit/payment_request/model/qr_code_channel_code.py new file mode 100644 index 00000000..27a0a9ef --- /dev/null +++ b/xendit/payment_request/model/qr_code_channel_code.py @@ -0,0 +1,292 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class QRCodeChannelCode(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'None': None, + 'DANA': "DANA", + 'RCBC': "RCBC", + 'LINKAJA': "LINKAJA", + 'PROMPTPAY': "PROMPTPAY", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """QRCodeChannelCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): QR Code Channel Code., must be one of ["DANA", "RCBC", "LINKAJA", "PROMPTPAY", ] # noqa: E501 + + Keyword Args: + value (str): QR Code Channel Code., must be one of ["DANA", "RCBC", "LINKAJA", "PROMPTPAY", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """QRCodeChannelCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): QR Code Channel Code., must be one of ["DANA", "RCBC", "LINKAJA", "PROMPTPAY", ] # noqa: E501 + + Keyword Args: + value (str): QR Code Channel Code., must be one of ["DANA", "RCBC", "LINKAJA", "PROMPTPAY", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_request/model/qr_code_channel_properties.py b/xendit/payment_request/model/qr_code_channel_properties.py new file mode 100644 index 00000000..d7ec1d29 --- /dev/null +++ b/xendit/payment_request/model/qr_code_channel_properties.py @@ -0,0 +1,266 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class QRCodeChannelProperties(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'qr_string': (str,), # noqa: E501 + 'expires_at': (datetime,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'qr_string': 'qr_string', # noqa: E501 + 'expires_at': 'expires_at', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """QRCodeChannelProperties - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + qr_string (str): [optional] # noqa: E501 + expires_at (datetime): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """QRCodeChannelProperties - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + qr_string (str): [optional] # noqa: E501 + expires_at (datetime): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/qr_code_parameters.py b/xendit/payment_request/model/qr_code_parameters.py new file mode 100644 index 00000000..f839ba86 --- /dev/null +++ b/xendit/payment_request/model/qr_code_parameters.py @@ -0,0 +1,274 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.qr_code_channel_code import QRCodeChannelCode + from xendit.payment_request.model.qr_code_channel_properties import QRCodeChannelProperties + globals()['QRCodeChannelCode'] = QRCodeChannelCode + globals()['QRCodeChannelProperties'] = QRCodeChannelProperties + + +class QRCodeParameters(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'channel_code': (QRCodeChannelCode,), # noqa: E501 + 'channel_properties': (QRCodeChannelProperties,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """QRCodeParameters - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + channel_code (QRCodeChannelCode): [optional] # noqa: E501 + channel_properties (QRCodeChannelProperties): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """QRCodeParameters - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + channel_code (QRCodeChannelCode): [optional] # noqa: E501 + channel_properties (QRCodeChannelProperties): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/virtual_account.py b/xendit/payment_request/model/virtual_account.py new file mode 100644 index 00000000..7700307b --- /dev/null +++ b/xendit/payment_request/model/virtual_account.py @@ -0,0 +1,360 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.payment_request_currency import PaymentRequestCurrency + from xendit.payment_request.model.virtual_account_all_of import VirtualAccountAllOf + from xendit.payment_request.model.virtual_account_alternative_display import VirtualAccountAlternativeDisplay + from xendit.payment_request.model.virtual_account_channel_code import VirtualAccountChannelCode + from xendit.payment_request.model.virtual_account_channel_properties import VirtualAccountChannelProperties + from xendit.payment_request.model.virtual_account_parameters import VirtualAccountParameters + globals()['PaymentRequestCurrency'] = PaymentRequestCurrency + globals()['VirtualAccountAllOf'] = VirtualAccountAllOf + globals()['VirtualAccountAlternativeDisplay'] = VirtualAccountAlternativeDisplay + globals()['VirtualAccountChannelCode'] = VirtualAccountChannelCode + globals()['VirtualAccountChannelProperties'] = VirtualAccountChannelProperties + globals()['VirtualAccountParameters'] = VirtualAccountParameters + + +class VirtualAccount(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('alternative_display_types',): { + 'QR_STRING': "QR_STRING", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'channel_code': (VirtualAccountChannelCode,), # noqa: E501 + 'channel_properties': (VirtualAccountChannelProperties,), # noqa: E501 + 'min_amount': (float, none_type,), # noqa: E501 + 'max_amount': (float, none_type,), # noqa: E501 + 'amount': (float, none_type,), # noqa: E501 + 'currency': (PaymentRequestCurrency,), # noqa: E501 + 'alternative_display_types': ([str],), # noqa: E501 + 'alternative_displays': ([VirtualAccountAlternativeDisplay],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'min_amount': 'min_amount', # noqa: E501 + 'max_amount': 'max_amount', # noqa: E501 + 'amount': 'amount', # noqa: E501 + 'currency': 'currency', # noqa: E501 + 'alternative_display_types': 'alternative_display_types', # noqa: E501 + 'alternative_displays': 'alternative_displays', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """VirtualAccount - a model defined in OpenAPI + + Keyword Args: + channel_code (VirtualAccountChannelCode): + channel_properties (VirtualAccountChannelProperties): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + min_amount (float, none_type): [optional] # noqa: E501 + max_amount (float, none_type): [optional] # noqa: E501 + amount (float, none_type): [optional] # noqa: E501 + currency (PaymentRequestCurrency): [optional] # noqa: E501 + alternative_display_types ([str]): Alternative display requested for the virtual account. [optional] # noqa: E501 + alternative_displays ([VirtualAccountAlternativeDisplay]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """VirtualAccount - a model defined in OpenAPI + + Keyword Args: + channel_code (VirtualAccountChannelCode): + channel_properties (VirtualAccountChannelProperties): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + min_amount (float, none_type): [optional] # noqa: E501 + max_amount (float, none_type): [optional] # noqa: E501 + amount (float, none_type): [optional] # noqa: E501 + currency (PaymentRequestCurrency): [optional] # noqa: E501 + alternative_display_types ([str]): Alternative display requested for the virtual account. [optional] # noqa: E501 + alternative_displays ([VirtualAccountAlternativeDisplay]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + VirtualAccountAllOf, + VirtualAccountParameters, + ], + 'oneOf': [ + ], + } diff --git a/xendit/payment_request/model/virtual_account_all_of.py b/xendit/payment_request/model/virtual_account_all_of.py new file mode 100644 index 00000000..f5248c4f --- /dev/null +++ b/xendit/payment_request/model/virtual_account_all_of.py @@ -0,0 +1,268 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.virtual_account_alternative_display import VirtualAccountAlternativeDisplay + globals()['VirtualAccountAlternativeDisplay'] = VirtualAccountAlternativeDisplay + + +class VirtualAccountAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'alternative_displays': ([VirtualAccountAlternativeDisplay],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'alternative_displays': 'alternative_displays', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """VirtualAccountAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + alternative_displays ([VirtualAccountAlternativeDisplay]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """VirtualAccountAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + alternative_displays ([VirtualAccountAlternativeDisplay]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/virtual_account_alternative_display.py b/xendit/payment_request/model/virtual_account_alternative_display.py new file mode 100644 index 00000000..3213aa30 --- /dev/null +++ b/xendit/payment_request/model/virtual_account_alternative_display.py @@ -0,0 +1,270 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class VirtualAccountAlternativeDisplay(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('type',): { + 'QR_STRING': "QR_STRING", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'type': (str,), # noqa: E501 + 'data': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'type': 'type', # noqa: E501 + 'data': 'data', # noqa: E501 + } + + read_only_vars = { + 'type', # noqa: E501 + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """VirtualAccountAlternativeDisplay - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + type (str): Type of the alternative display. [optional] if omitted the server will use the default value of "QR_STRING" # noqa: E501 + data (str): Data payload of the given alternative display. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """VirtualAccountAlternativeDisplay - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + type (str): Type of the alternative display. [optional] if omitted the server will use the default value of "QR_STRING" # noqa: E501 + data (str): Data payload of the given alternative display. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/virtual_account_channel_code.py b/xendit/payment_request/model/virtual_account_channel_code.py new file mode 100644 index 00000000..f9371992 --- /dev/null +++ b/xendit/payment_request/model/virtual_account_channel_code.py @@ -0,0 +1,302 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class VirtualAccountChannelCode(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'BCA': "BCA", + 'BJB': "BJB", + 'BNI': "BNI", + 'BRI': "BRI", + 'MANDIRI': "MANDIRI", + 'PERMATA': "PERMATA", + 'BSI': "BSI", + 'CIMB': "CIMB", + 'SAHABAT_SAMPOERNA': "SAHABAT_SAMPOERNA", + 'ARTAJASA': "ARTAJASA", + 'PV': "PV", + 'VIETCAPITAL': "VIETCAPITAL", + 'WOORI': "WOORI", + 'MSB': "MSB", + 'STANDARD_CHARTERED': "STANDARD_CHARTERED", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """VirtualAccountChannelCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Virtual Account Channel Code., must be one of ["BCA", "BJB", "BNI", "BRI", "MANDIRI", "PERMATA", "BSI", "CIMB", "SAHABAT_SAMPOERNA", "ARTAJASA", "PV", "VIETCAPITAL", "WOORI", "MSB", "STANDARD_CHARTERED", ] # noqa: E501 + + Keyword Args: + value (str): Virtual Account Channel Code., must be one of ["BCA", "BJB", "BNI", "BRI", "MANDIRI", "PERMATA", "BSI", "CIMB", "SAHABAT_SAMPOERNA", "ARTAJASA", "PV", "VIETCAPITAL", "WOORI", "MSB", "STANDARD_CHARTERED", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """VirtualAccountChannelCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Virtual Account Channel Code., must be one of ["BCA", "BJB", "BNI", "BRI", "MANDIRI", "PERMATA", "BSI", "CIMB", "SAHABAT_SAMPOERNA", "ARTAJASA", "PV", "VIETCAPITAL", "WOORI", "MSB", "STANDARD_CHARTERED", ] # noqa: E501 + + Keyword Args: + value (str): Virtual Account Channel Code., must be one of ["BCA", "BJB", "BNI", "BRI", "MANDIRI", "PERMATA", "BSI", "CIMB", "SAHABAT_SAMPOERNA", "ARTAJASA", "PV", "VIETCAPITAL", "WOORI", "MSB", "STANDARD_CHARTERED", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payment_request/model/virtual_account_channel_properties.py b/xendit/payment_request/model/virtual_account_channel_properties.py new file mode 100644 index 00000000..148d1541 --- /dev/null +++ b/xendit/payment_request/model/virtual_account_channel_properties.py @@ -0,0 +1,280 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class VirtualAccountChannelProperties(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'customer_name': (str,), # noqa: E501 + 'virtual_account_number': (str,), # noqa: E501 + 'expires_at': (datetime,), # noqa: E501 + 'suggested_amount': (float,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'customer_name': 'customer_name', # noqa: E501 + 'virtual_account_number': 'virtual_account_number', # noqa: E501 + 'expires_at': 'expires_at', # noqa: E501 + 'suggested_amount': 'suggested_amount', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, customer_name, *args, **kwargs): # noqa: E501 + """VirtualAccountChannelProperties - a model defined in OpenAPI + + Args: + customer_name (str): Name of customer. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + virtual_account_number (str): You can assign specific Virtual Account number using this parameter. If you do not send one, one will be picked at random. Make sure the number you specify is within your Virtual Account range.. [optional] # noqa: E501 + expires_at (datetime): The date and time in ISO 8601 UTC+0 when the virtual account number will be expired. Default: The default expiration date will be 31 years from creation date.. [optional] # noqa: E501 + suggested_amount (float): The suggested amount you want to assign. Note: Suggested amounts is the amounts that can see as a suggestion, but user can still put any numbers (only supported for Mandiri and BRI). [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.customer_name = customer_name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, customer_name, *args, **kwargs): # noqa: E501 + """VirtualAccountChannelProperties - a model defined in OpenAPI + + Args: + customer_name (str): Name of customer. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + virtual_account_number (str): You can assign specific Virtual Account number using this parameter. If you do not send one, one will be picked at random. Make sure the number you specify is within your Virtual Account range.. [optional] # noqa: E501 + expires_at (datetime): The date and time in ISO 8601 UTC+0 when the virtual account number will be expired. Default: The default expiration date will be 31 years from creation date.. [optional] # noqa: E501 + suggested_amount (float): The suggested amount you want to assign. Note: Suggested amounts is the amounts that can see as a suggestion, but user can still put any numbers (only supported for Mandiri and BRI). [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.customer_name = customer_name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/model/virtual_account_parameters.py b/xendit/payment_request/model/virtual_account_parameters.py new file mode 100644 index 00000000..008414bc --- /dev/null +++ b/xendit/payment_request/model/virtual_account_parameters.py @@ -0,0 +1,307 @@ +""" + The version of the XENDIT API: 1.42.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payment_request.model.payment_request_currency import PaymentRequestCurrency + from xendit.payment_request.model.virtual_account_channel_code import VirtualAccountChannelCode + from xendit.payment_request.model.virtual_account_channel_properties import VirtualAccountChannelProperties + globals()['PaymentRequestCurrency'] = PaymentRequestCurrency + globals()['VirtualAccountChannelCode'] = VirtualAccountChannelCode + globals()['VirtualAccountChannelProperties'] = VirtualAccountChannelProperties + + +class VirtualAccountParameters(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('alternative_display_types',): { + 'QR_STRING': "QR_STRING", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'channel_code': (VirtualAccountChannelCode,), # noqa: E501 + 'channel_properties': (VirtualAccountChannelProperties,), # noqa: E501 + 'min_amount': (float, none_type,), # noqa: E501 + 'max_amount': (float, none_type,), # noqa: E501 + 'amount': (float, none_type,), # noqa: E501 + 'currency': (PaymentRequestCurrency,), # noqa: E501 + 'alternative_display_types': ([str],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'min_amount': 'min_amount', # noqa: E501 + 'max_amount': 'max_amount', # noqa: E501 + 'amount': 'amount', # noqa: E501 + 'currency': 'currency', # noqa: E501 + 'alternative_display_types': 'alternative_display_types', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, channel_code, channel_properties, *args, **kwargs): # noqa: E501 + """VirtualAccountParameters - a model defined in OpenAPI + + Args: + channel_code (VirtualAccountChannelCode): + channel_properties (VirtualAccountChannelProperties): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + min_amount (float, none_type): [optional] # noqa: E501 + max_amount (float, none_type): [optional] # noqa: E501 + amount (float, none_type): [optional] # noqa: E501 + currency (PaymentRequestCurrency): [optional] # noqa: E501 + alternative_display_types ([str]): Alternative display requested for the virtual account. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.channel_code = channel_code + self.channel_properties = channel_properties + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, channel_code, channel_properties, *args, **kwargs): # noqa: E501 + """VirtualAccountParameters - a model defined in OpenAPI + + Args: + channel_code (VirtualAccountChannelCode): + channel_properties (VirtualAccountChannelProperties): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + min_amount (float, none_type): [optional] # noqa: E501 + max_amount (float, none_type): [optional] # noqa: E501 + amount (float, none_type): [optional] # noqa: E501 + currency (PaymentRequestCurrency): [optional] # noqa: E501 + alternative_display_types ([str]): Alternative display requested for the virtual account. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.channel_code = channel_code + self.channel_properties = channel_properties + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payment_request/payment_request_api.py b/xendit/payment_request/payment_request_api.py new file mode 100644 index 00000000..7f902793 --- /dev/null +++ b/xendit/payment_request/payment_request_api.py @@ -0,0 +1,1018 @@ +""" + Payment Requests + + This API is used for Payment Requests # noqa: E501 + + The version of the OpenAPI document: 1.42.3 +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.api_client import ApiClient, Endpoint as _Endpoint +from xendit.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) + +from xendit.payment_request.model import * # noqa: F401,E501 + +class PaymentRequestApi(object): + """NOTE: This class is auto generated by the OpenAPI Generator. + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.authorize_payment_request_endpoint = _Endpoint( + settings={ + 'response_type': (PaymentRequest,), + 'auth': [], + 'endpoint_path': '/payment_requests/{paymentRequestId}/auth', + 'operation_id': 'authorize_payment_request', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'payment_request_id', + 'payment_request_auth_parameters', + ], + 'required': [ + 'payment_request_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'payment_request_id': + (str,), + 'payment_request_auth_parameters': + (PaymentRequestAuthParameters,), + }, + 'attribute_map': { + 'payment_request_id': 'paymentRequestId', + }, + 'location_map': { + 'payment_request_id': 'path', + 'payment_request_auth_parameters': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.capture_payment_request_endpoint = _Endpoint( + settings={ + 'response_type': (Capture,), + 'auth': [], + 'endpoint_path': '/payment_requests/{paymentRequestId}/captures', + 'operation_id': 'capture_payment_request', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'payment_request_id', + 'capture_parameters', + ], + 'required': [ + 'payment_request_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'payment_request_id': + (str,), + 'capture_parameters': + (CaptureParameters,), + }, + 'attribute_map': { + 'payment_request_id': 'paymentRequestId', + }, + 'location_map': { + 'payment_request_id': 'path', + 'capture_parameters': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.create_payment_request_endpoint = _Endpoint( + settings={ + 'response_type': (PaymentRequest,), + 'auth': [], + 'endpoint_path': '/payment_requests', + 'operation_id': 'create_payment_request', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'idempotency_key', + 'payment_request_parameters', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'idempotency_key': + (str,), + 'payment_request_parameters': + (PaymentRequestParameters,), + }, + 'attribute_map': { + 'idempotency_key': 'idempotency-key', + }, + 'location_map': { + 'idempotency_key': 'header', + 'payment_request_parameters': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.get_all_payment_requests_endpoint = _Endpoint( + settings={ + 'response_type': (PaymentRequestListResponse,), + 'auth': [], + 'endpoint_path': '/payment_requests', + 'operation_id': 'get_all_payment_requests', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'reference_id', + 'id', + 'customer_id', + 'limit', + 'before_id', + 'after_id', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'reference_id': + ([str],), + 'id': + ([str],), + 'customer_id': + ([str],), + 'limit': + (int,), + 'before_id': + (str,), + 'after_id': + (str,), + }, + 'attribute_map': { + 'reference_id': 'reference_id', + 'id': 'id', + 'customer_id': 'customer_id', + 'limit': 'limit', + 'before_id': 'before_id', + 'after_id': 'after_id', + }, + 'location_map': { + 'reference_id': 'query', + 'id': 'query', + 'customer_id': 'query', + 'limit': 'query', + 'before_id': 'query', + 'after_id': 'query', + }, + 'collection_format_map': { + 'reference_id': 'multi', + 'id': 'multi', + 'customer_id': 'multi', + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.get_payment_request_by_id_endpoint = _Endpoint( + settings={ + 'response_type': (PaymentRequest,), + 'auth': [], + 'endpoint_path': '/payment_requests/{paymentRequestId}', + 'operation_id': 'get_payment_request_by_id', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'payment_request_id', + ], + 'required': [ + 'payment_request_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'payment_request_id': + (str,), + }, + 'attribute_map': { + 'payment_request_id': 'paymentRequestId', + }, + 'location_map': { + 'payment_request_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.get_payment_request_captures_endpoint = _Endpoint( + settings={ + 'response_type': (CaptureListResponse,), + 'auth': [], + 'endpoint_path': '/payment_requests/{paymentRequestId}/captures', + 'operation_id': 'get_payment_request_captures', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'payment_request_id', + 'limit', + 'after_id', + 'before_id', + ], + 'required': [ + 'payment_request_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'payment_request_id': + (str,), + 'limit': + (int,), + 'after_id': + (str,), + 'before_id': + (str,), + }, + 'attribute_map': { + 'payment_request_id': 'paymentRequestId', + 'limit': 'limit', + 'after_id': 'after_id', + 'before_id': 'before_id', + }, + 'location_map': { + 'payment_request_id': 'path', + 'limit': 'query', + 'after_id': 'query', + 'before_id': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.resend_payment_request_auth_endpoint = _Endpoint( + settings={ + 'response_type': (PaymentRequest,), + 'auth': [], + 'endpoint_path': '/payment_requests/{paymentRequestId}/auth/resend', + 'operation_id': 'resend_payment_request_auth', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'payment_request_id', + ], + 'required': [ + 'payment_request_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'payment_request_id': + (str,), + }, + 'attribute_map': { + 'payment_request_id': 'paymentRequestId', + }, + 'location_map': { + 'payment_request_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + + def authorize_payment_request( + self, + payment_request_id, + **kwargs + ): + """Payment Request Authorize # noqa: E501 + + Payment Request Authorize # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.authorize_payment_request(payment_request_id, async_req=True) + >>> result = thread.get() + + Args: + payment_request_id (str): + + Keyword Args: + payment_request_auth_parameters (PaymentRequestAuthParameters): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + PaymentRequest + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['payment_request_id'] = \ + payment_request_id + return self.authorize_payment_request_endpoint.call_with_http_info(**kwargs) + + def capture_payment_request( + self, + payment_request_id, + **kwargs + ): + """Payment Request Capture # noqa: E501 + + Payment Request Capture # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.capture_payment_request(payment_request_id, async_req=True) + >>> result = thread.get() + + Args: + payment_request_id (str): + + Keyword Args: + capture_parameters (CaptureParameters): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + Capture + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['payment_request_id'] = \ + payment_request_id + return self.capture_payment_request_endpoint.call_with_http_info(**kwargs) + + def create_payment_request( + self, + **kwargs + ): + """Create Payment Request # noqa: E501 + + Create Payment Request # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_payment_request(async_req=True) + >>> result = thread.get() + + + Keyword Args: + idempotency_key (str): [optional] + payment_request_parameters (PaymentRequestParameters): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + PaymentRequest + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + return self.create_payment_request_endpoint.call_with_http_info(**kwargs) + + def get_all_payment_requests( + self, + **kwargs + ): + """Get all payment requests by filter # noqa: E501 + + Get all payment requests by filter # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_all_payment_requests(async_req=True) + >>> result = thread.get() + + + Keyword Args: + reference_id ([str]): [optional] + id ([str]): [optional] + customer_id ([str]): [optional] + limit (int): [optional] + before_id (str): [optional] + after_id (str): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + PaymentRequestListResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + return self.get_all_payment_requests_endpoint.call_with_http_info(**kwargs) + + def get_payment_request_by_id( + self, + payment_request_id, + **kwargs + ): + """Get payment request by ID # noqa: E501 + + Get payment request by ID # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_payment_request_by_id(payment_request_id, async_req=True) + >>> result = thread.get() + + Args: + payment_request_id (str): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + PaymentRequest + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['payment_request_id'] = \ + payment_request_id + return self.get_payment_request_by_id_endpoint.call_with_http_info(**kwargs) + + def get_payment_request_captures( + self, + payment_request_id, + **kwargs + ): + """Get Payment Request Capture # noqa: E501 + + Get Payment Request Capture # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_payment_request_captures(payment_request_id, async_req=True) + >>> result = thread.get() + + Args: + payment_request_id (str): + + Keyword Args: + limit (int): [optional] + after_id (str): [optional] + before_id (str): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + CaptureListResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['payment_request_id'] = \ + payment_request_id + return self.get_payment_request_captures_endpoint.call_with_http_info(**kwargs) + + def resend_payment_request_auth( + self, + payment_request_id, + **kwargs + ): + """Payment Request Resend Auth # noqa: E501 + + Payment Request Resend Auth # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.resend_payment_request_auth(payment_request_id, async_req=True) + >>> result = thread.get() + + Args: + payment_request_id (str): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + PaymentRequest + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['payment_request_id'] = \ + payment_request_id + return self.resend_payment_request_auth_endpoint.call_with_http_info(**kwargs) + diff --git a/xendit/payout/__init__.py b/xendit/payout/__init__.py new file mode 100644 index 00000000..9647c12f --- /dev/null +++ b/xendit/payout/__init__.py @@ -0,0 +1 @@ +from xendit.payout.payout_api import PayoutApi diff --git a/xendit/payout/model/__init__.py b/xendit/payout/model/__init__.py new file mode 100644 index 00000000..119045f1 --- /dev/null +++ b/xendit/payout/model/__init__.py @@ -0,0 +1,25 @@ +# flake8: noqa + +# import all models into this package +# if you have many models here with many references from one model to another this may +# raise a RecursionError +# to avoid this, import only the models that you directly need like: +# from xendit.payout.model.pet import Pet +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + +from xendit.payout.model.channel import Channel +from xendit.payout.model.channel_account_type import ChannelAccountType +from xendit.payout.model.channel_amount_limits import ChannelAmountLimits +from xendit.payout.model.channel_category import ChannelCategory +from xendit.payout.model.create_payout_request import CreatePayoutRequest +from xendit.payout.model.digital_payout_channel_properties import DigitalPayoutChannelProperties +from xendit.payout.model.error import Error +from xendit.payout.model.error_errors_inner import ErrorErrorsInner +from xendit.payout.model.get_payouts200_response import GetPayouts200Response +from xendit.payout.model.get_payouts200_response_data_inner import GetPayouts200ResponseDataInner +from xendit.payout.model.get_payouts200_response_links import GetPayouts200ResponseLinks +from xendit.payout.model.payout import Payout +from xendit.payout.model.payout_all_of import PayoutAllOf +from xendit.payout.model.receipt_notification import ReceiptNotification diff --git a/xendit/payout/model/channel.py b/xendit/payout/model/channel.py new file mode 100644 index 00000000..a62f2efc --- /dev/null +++ b/xendit/payout/model/channel.py @@ -0,0 +1,300 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payout.model.channel_amount_limits import ChannelAmountLimits + from xendit.payout.model.channel_category import ChannelCategory + globals()['ChannelAmountLimits'] = ChannelAmountLimits + globals()['ChannelCategory'] = ChannelCategory + + +class Channel(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'channel_code': (str,), # noqa: E501 + 'channel_category': (ChannelCategory,), # noqa: E501 + 'currency': (str,), # noqa: E501 + 'channel_name': (str,), # noqa: E501 + 'amount_limits': (ChannelAmountLimits,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'channel_code': 'channel_code', # noqa: E501 + 'channel_category': 'channel_category', # noqa: E501 + 'currency': 'currency', # noqa: E501 + 'channel_name': 'channel_name', # noqa: E501 + 'amount_limits': 'amount_limits', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, channel_code, channel_category, currency, channel_name, amount_limits, *args, **kwargs): # noqa: E501 + """Channel - a model defined in OpenAPI + + Args: + channel_code (str): Destination channel to send the money to, prefixed by ISO-3166 country code + channel_category (ChannelCategory): + currency (str): Currency of the destination channel using ISO-4217 currency code + channel_name (str): Name of the destination channel + amount_limits (ChannelAmountLimits): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.channel_code = channel_code + self.channel_category = channel_category + self.currency = currency + self.channel_name = channel_name + self.amount_limits = amount_limits + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, channel_code, channel_category, currency, channel_name, amount_limits, *args, **kwargs): # noqa: E501 + """Channel - a model defined in OpenAPI + + Args: + channel_code (str): Destination channel to send the money to, prefixed by ISO-3166 country code + channel_category (ChannelCategory): + currency (str): Currency of the destination channel using ISO-4217 currency code + channel_name (str): Name of the destination channel + amount_limits (ChannelAmountLimits): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.channel_code = channel_code + self.channel_category = channel_category + self.currency = currency + self.channel_name = channel_name + self.amount_limits = amount_limits + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payout/model/channel_account_type.py b/xendit/payout/model/channel_account_type.py new file mode 100644 index 00000000..748d4e51 --- /dev/null +++ b/xendit/payout/model/channel_account_type.py @@ -0,0 +1,292 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class ChannelAccountType(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'NATIONAL_ID': "NATIONAL_ID", + 'MOBILE_NO': "MOBILE_NO", + 'PASSPORT': "PASSPORT", + 'BUSINESS_REGISTRATION': "BUSINESS_REGISTRATION", + 'BANK_ACCOUNT': "BANK_ACCOUNT", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """ChannelAccountType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Available account types (applicable for MY_DUITNOW)., must be one of ["NATIONAL_ID", "MOBILE_NO", "PASSPORT", "BUSINESS_REGISTRATION", "BANK_ACCOUNT", ] # noqa: E501 + + Keyword Args: + value (str): Available account types (applicable for MY_DUITNOW)., must be one of ["NATIONAL_ID", "MOBILE_NO", "PASSPORT", "BUSINESS_REGISTRATION", "BANK_ACCOUNT", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ChannelAccountType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Available account types (applicable for MY_DUITNOW)., must be one of ["NATIONAL_ID", "MOBILE_NO", "PASSPORT", "BUSINESS_REGISTRATION", "BANK_ACCOUNT", ] # noqa: E501 + + Keyword Args: + value (str): Available account types (applicable for MY_DUITNOW)., must be one of ["NATIONAL_ID", "MOBILE_NO", "PASSPORT", "BUSINESS_REGISTRATION", "BANK_ACCOUNT", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payout/model/channel_amount_limits.py b/xendit/payout/model/channel_amount_limits.py new file mode 100644 index 00000000..9b0be153 --- /dev/null +++ b/xendit/payout/model/channel_amount_limits.py @@ -0,0 +1,280 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class ChannelAmountLimits(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'minimum': (float,), # noqa: E501 + 'maximum': (float,), # noqa: E501 + 'minimum_increment': (float,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'minimum': 'minimum', # noqa: E501 + 'maximum': 'maximum', # noqa: E501 + 'minimum_increment': 'minimum_increment', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, minimum, maximum, minimum_increment, *args, **kwargs): # noqa: E501 + """ChannelAmountLimits - a model defined in OpenAPI + + Args: + minimum (float): Lowest amount supported for a payout to this channel + maximum (float): Highest amount supported for a payout to this channel + minimum_increment (float): Supported increments + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.minimum = minimum + self.maximum = maximum + self.minimum_increment = minimum_increment + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, minimum, maximum, minimum_increment, *args, **kwargs): # noqa: E501 + """ChannelAmountLimits - a model defined in OpenAPI + + Args: + minimum (float): Lowest amount supported for a payout to this channel + maximum (float): Highest amount supported for a payout to this channel + minimum_increment (float): Supported increments + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.minimum = minimum + self.maximum = maximum + self.minimum_increment = minimum_increment + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payout/model/channel_category.py b/xendit/payout/model/channel_category.py new file mode 100644 index 00000000..e6001aed --- /dev/null +++ b/xendit/payout/model/channel_category.py @@ -0,0 +1,290 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class ChannelCategory(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'BANK': "BANK", + 'EWALLET': "EWALLET", + 'OTC': "OTC", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """ChannelCategory - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Category of channel code, as some channels might require more fields during processing., must be one of ["BANK", "EWALLET", "OTC", ] # noqa: E501 + + Keyword Args: + value (str): Category of channel code, as some channels might require more fields during processing., must be one of ["BANK", "EWALLET", "OTC", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ChannelCategory - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Category of channel code, as some channels might require more fields during processing., must be one of ["BANK", "EWALLET", "OTC", ] # noqa: E501 + + Keyword Args: + value (str): Category of channel code, as some channels might require more fields during processing., must be one of ["BANK", "EWALLET", "OTC", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/xendit/payout/model/create_payout_request.py b/xendit/payout/model/create_payout_request.py new file mode 100644 index 00000000..5be7b56f --- /dev/null +++ b/xendit/payout/model/create_payout_request.py @@ -0,0 +1,315 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payout.model.digital_payout_channel_properties import DigitalPayoutChannelProperties + from xendit.payout.model.receipt_notification import ReceiptNotification + globals()['DigitalPayoutChannelProperties'] = DigitalPayoutChannelProperties + globals()['ReceiptNotification'] = ReceiptNotification + + +class CreatePayoutRequest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('reference_id',): { + 'min_length': 1, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'reference_id': (str,), # noqa: E501 + 'channel_code': (str,), # noqa: E501 + 'channel_properties': (DigitalPayoutChannelProperties,), # noqa: E501 + 'amount': (float,), # noqa: E501 + 'currency': (str,), # noqa: E501 + 'description': (str,), # noqa: E501 + 'receipt_notification': (ReceiptNotification,), # noqa: E501 + 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'reference_id': 'reference_id', # noqa: E501 + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'amount': 'amount', # noqa: E501 + 'currency': 'currency', # noqa: E501 + 'description': 'description', # noqa: E501 + 'receipt_notification': 'receipt_notification', # noqa: E501 + 'metadata': 'metadata', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, reference_id, channel_code, channel_properties, amount, currency, *args, **kwargs): # noqa: E501 + """CreatePayoutRequest - a model defined in OpenAPI + + Args: + reference_id (str): A client defined payout identifier + channel_code (str): Channel code of selected destination bank or e-wallet + channel_properties (DigitalPayoutChannelProperties): + amount (float): Amount to be sent to the destination account and should be a multiple of the minimum increment for the selected channel + currency (str): Currency of the destination channel using ISO-4217 currency code + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + description (str): Description to send with the payout, the recipient may see this e.g., in their bank statement (if supported) or in email receipts we send on your behalf. [optional] # noqa: E501 + receipt_notification (ReceiptNotification): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Object of additional information you may use. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.reference_id = reference_id + self.channel_code = channel_code + self.channel_properties = channel_properties + self.amount = amount + self.currency = currency + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, reference_id, channel_code, channel_properties, amount, currency, *args, **kwargs): # noqa: E501 + """CreatePayoutRequest - a model defined in OpenAPI + + Args: + reference_id (str): A client defined payout identifier + channel_code (str): Channel code of selected destination bank or e-wallet + channel_properties (DigitalPayoutChannelProperties): + amount (float): Amount to be sent to the destination account and should be a multiple of the minimum increment for the selected channel + currency (str): Currency of the destination channel using ISO-4217 currency code + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + description (str): Description to send with the payout, the recipient may see this e.g., in their bank statement (if supported) or in email receipts we send on your behalf. [optional] # noqa: E501 + receipt_notification (ReceiptNotification): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Object of additional information you may use. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.reference_id = reference_id + self.channel_code = channel_code + self.channel_properties = channel_properties + self.amount = amount + self.currency = currency + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payout/model/digital_payout_channel_properties.py b/xendit/payout/model/digital_payout_channel_properties.py new file mode 100644 index 00000000..bc3c045b --- /dev/null +++ b/xendit/payout/model/digital_payout_channel_properties.py @@ -0,0 +1,282 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payout.model.channel_account_type import ChannelAccountType + globals()['ChannelAccountType'] = ChannelAccountType + + +class DigitalPayoutChannelProperties(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'account_number': (str,), # noqa: E501 + 'account_holder_name': (str, none_type,), # noqa: E501 + 'account_type': (ChannelAccountType,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'account_number': 'account_number', # noqa: E501 + 'account_holder_name': 'account_holder_name', # noqa: E501 + 'account_type': 'account_type', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, account_number, *args, **kwargs): # noqa: E501 + """DigitalPayoutChannelProperties - a model defined in OpenAPI + + Args: + account_number (str): Registered account number + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + account_holder_name (str, none_type): Registered account name. [optional] # noqa: E501 + account_type (ChannelAccountType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.account_number = account_number + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, account_number, *args, **kwargs): # noqa: E501 + """DigitalPayoutChannelProperties - a model defined in OpenAPI + + Args: + account_number (str): Registered account number + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + account_holder_name (str, none_type): Registered account name. [optional] # noqa: E501 + account_type (ChannelAccountType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.account_number = account_number + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payout/model/error.py b/xendit/payout/model/error.py new file mode 100644 index 00000000..6e3bf141 --- /dev/null +++ b/xendit/payout/model/error.py @@ -0,0 +1,284 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payout.model.error_errors_inner import ErrorErrorsInner + globals()['ErrorErrorsInner'] = ErrorErrorsInner + + +class Error(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'error_code': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + 'errors': ([ErrorErrorsInner],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'error_code': 'error_code', # noqa: E501 + 'message': 'message', # noqa: E501 + 'errors': 'errors', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, error_code, message, *args, **kwargs): # noqa: E501 + """Error - a model defined in OpenAPI + + Args: + error_code (str): Specific error encountered when processing the request, can refer to the API documentation on proper handling of each available error code https://developers.xendit.co/api-reference/#payouts + message (str): Human readable error message + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + errors ([ErrorErrorsInner]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.error_code = error_code + self.message = message + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, error_code, message, *args, **kwargs): # noqa: E501 + """Error - a model defined in OpenAPI + + Args: + error_code (str): Specific error encountered when processing the request, can refer to the API documentation on proper handling of each available error code https://developers.xendit.co/api-reference/#payouts + message (str): Human readable error message + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + errors ([ErrorErrorsInner]): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.error_code = error_code + self.message = message + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payout/model/error_errors_inner.py b/xendit/payout/model/error_errors_inner.py new file mode 100644 index 00000000..97d4739d --- /dev/null +++ b/xendit/payout/model/error_errors_inner.py @@ -0,0 +1,274 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class ErrorErrorsInner(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'path': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'path': 'path', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, path, message, *args, **kwargs): # noqa: E501 + """ErrorErrorsInner - a model defined in OpenAPI + + Args: + path (str): Precise location of the error + message (str): Specific description of the error + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.path = path + self.message = message + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, path, message, *args, **kwargs): # noqa: E501 + """ErrorErrorsInner - a model defined in OpenAPI + + Args: + path (str): Precise location of the error + message (str): Specific description of the error + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.path = path + self.message = message + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payout/model/get_payouts200_response.py b/xendit/payout/model/get_payouts200_response.py new file mode 100644 index 00000000..dd81e0cb --- /dev/null +++ b/xendit/payout/model/get_payouts200_response.py @@ -0,0 +1,278 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payout.model.get_payouts200_response_data_inner import GetPayouts200ResponseDataInner + from xendit.payout.model.get_payouts200_response_links import GetPayouts200ResponseLinks + globals()['GetPayouts200ResponseDataInner'] = GetPayouts200ResponseDataInner + globals()['GetPayouts200ResponseLinks'] = GetPayouts200ResponseLinks + + +class GetPayouts200Response(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'data': ([GetPayouts200ResponseDataInner],), # noqa: E501 + 'has_more': (bool,), # noqa: E501 + 'links': (GetPayouts200ResponseLinks,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'data': 'data', # noqa: E501 + 'has_more': 'has_more', # noqa: E501 + 'links': 'links', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """GetPayouts200Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([GetPayouts200ResponseDataInner]): [optional] # noqa: E501 + has_more (bool): [optional] # noqa: E501 + links (GetPayouts200ResponseLinks): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """GetPayouts200Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([GetPayouts200ResponseDataInner]): [optional] # noqa: E501 + has_more (bool): [optional] # noqa: E501 + links (GetPayouts200ResponseLinks): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payout/model/get_payouts200_response_data_inner.py b/xendit/payout/model/get_payouts200_response_data_inner.py new file mode 100644 index 00000000..3c9e5d8a --- /dev/null +++ b/xendit/payout/model/get_payouts200_response_data_inner.py @@ -0,0 +1,397 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payout.model.digital_payout_channel_properties import DigitalPayoutChannelProperties + from xendit.payout.model.payout import Payout + from xendit.payout.model.receipt_notification import ReceiptNotification + globals()['DigitalPayoutChannelProperties'] = DigitalPayoutChannelProperties + globals()['Payout'] = Payout + globals()['ReceiptNotification'] = ReceiptNotification + + +class GetPayouts200ResponseDataInner(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('failure_code',): { + 'INSUFFICIENT_BALANCE': "INSUFFICIENT_BALANCE", + 'REJECTED_BY_CHANNEL': "REJECTED_BY_CHANNEL", + 'TEMPORARY_TRANSFER_ERROR': "TEMPORARY_TRANSFER_ERROR", + 'INVALID_DESTINATION': "INVALID_DESTINATION", + 'TRANSFER_ERROR': "TRANSFER_ERROR", + }, + ('status',): { + 'SUCCEEDED': "SUCCEEDED", + 'FAILED': "FAILED", + 'ACCEPTED': "ACCEPTED", + 'REQUESTED': "REQUESTED", + 'LOCKED': "LOCKED", + 'CANCELLED': "CANCELLED", + 'REVERSED': "REVERSED", + }, + } + + validations = { + ('reference_id',): { + 'min_length': 1, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'description': (str,), # noqa: E501 + 'receipt_notification': (ReceiptNotification,), # noqa: E501 + 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + 'failure_code': (str,), # noqa: E501 + 'estimated_arrival_time': (datetime,), # noqa: E501 + 'reference_id': (str,), # noqa: E501 + 'channel_code': (str,), # noqa: E501 + 'channel_properties': (DigitalPayoutChannelProperties,), # noqa: E501 + 'amount': (float,), # noqa: E501 + 'currency': (str,), # noqa: E501 + 'id': (str,), # noqa: E501 + 'created': (datetime,), # noqa: E501 + 'updated': (datetime,), # noqa: E501 + 'business_id': (str,), # noqa: E501 + 'status': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'description': 'description', # noqa: E501 + 'receipt_notification': 'receipt_notification', # noqa: E501 + 'metadata': 'metadata', # noqa: E501 + 'failure_code': 'failure_code', # noqa: E501 + 'estimated_arrival_time': 'estimated_arrival_time', # noqa: E501 + 'reference_id': 'reference_id', # noqa: E501 + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'amount': 'amount', # noqa: E501 + 'currency': 'currency', # noqa: E501 + 'id': 'id', # noqa: E501 + 'created': 'created', # noqa: E501 + 'updated': 'updated', # noqa: E501 + 'business_id': 'business_id', # noqa: E501 + 'status': 'status', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """GetPayouts200ResponseDataInner - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + description (str): Description to send with the payout, the recipient may see this e.g., in their bank statement (if supported) or in email receipts we send on your behalf. [optional] # noqa: E501 + receipt_notification (ReceiptNotification): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Object of additional information you may use. [optional] # noqa: E501 + failure_code (str): If the Payout failed, we include a failure code for more details on the failure.. [optional] # noqa: E501 + estimated_arrival_time (datetime): Our estimated time on to when your payout is reflected to the destination account. [optional] # noqa: E501 + reference_id (str): A client defined payout identifier. [optional] # noqa: E501 + channel_code (str): Channel code of selected destination bank or e-wallet. [optional] # noqa: E501 + channel_properties (DigitalPayoutChannelProperties): [optional] # noqa: E501 + amount (float): Amount to be sent to the destination account and should be a multiple of the minimum increment for the selected channel. [optional] # noqa: E501 + currency (str): Currency of the destination channel using ISO-4217 currency code. [optional] # noqa: E501 + id (str): Xendit-generated unique identifier for each payout. [optional] # noqa: E501 + created (datetime): The time payout was created on Xendit's system, in ISO 8601 format. [optional] # noqa: E501 + updated (datetime): The time payout was last updated on Xendit's system, in ISO 8601 format. [optional] # noqa: E501 + business_id (str): Xendit Business ID. [optional] # noqa: E501 + status (str): Status of payout. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """GetPayouts200ResponseDataInner - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + description (str): Description to send with the payout, the recipient may see this e.g., in their bank statement (if supported) or in email receipts we send on your behalf. [optional] # noqa: E501 + receipt_notification (ReceiptNotification): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Object of additional information you may use. [optional] # noqa: E501 + failure_code (str): If the Payout failed, we include a failure code for more details on the failure.. [optional] # noqa: E501 + estimated_arrival_time (datetime): Our estimated time on to when your payout is reflected to the destination account. [optional] # noqa: E501 + reference_id (str): A client defined payout identifier. [optional] # noqa: E501 + channel_code (str): Channel code of selected destination bank or e-wallet. [optional] # noqa: E501 + channel_properties (DigitalPayoutChannelProperties): [optional] # noqa: E501 + amount (float): Amount to be sent to the destination account and should be a multiple of the minimum increment for the selected channel. [optional] # noqa: E501 + currency (str): Currency of the destination channel using ISO-4217 currency code. [optional] # noqa: E501 + id (str): Xendit-generated unique identifier for each payout. [optional] # noqa: E501 + created (datetime): The time payout was created on Xendit's system, in ISO 8601 format. [optional] # noqa: E501 + updated (datetime): The time payout was last updated on Xendit's system, in ISO 8601 format. [optional] # noqa: E501 + business_id (str): Xendit Business ID. [optional] # noqa: E501 + status (str): Status of payout. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + Payout, + ], + 'allOf': [ + ], + 'oneOf': [ + ], + } diff --git a/xendit/payout/model/get_payouts200_response_links.py b/xendit/payout/model/get_payouts200_response_links.py new file mode 100644 index 00000000..8f42b2eb --- /dev/null +++ b/xendit/payout/model/get_payouts200_response_links.py @@ -0,0 +1,270 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class GetPayouts200ResponseLinks(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'href': (str,), # noqa: E501 + 'rel': (str,), # noqa: E501 + 'method': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'href': 'href', # noqa: E501 + 'rel': 'rel', # noqa: E501 + 'method': 'method', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """GetPayouts200ResponseLinks - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + href (str): [optional] # noqa: E501 + rel (str): [optional] # noqa: E501 + method (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """GetPayouts200ResponseLinks - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + href (str): [optional] # noqa: E501 + rel (str): [optional] # noqa: E501 + method (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payout/model/payout.py b/xendit/payout/model/payout.py new file mode 100644 index 00000000..5473bed3 --- /dev/null +++ b/xendit/payout/model/payout.py @@ -0,0 +1,400 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.payout.model.create_payout_request import CreatePayoutRequest + from xendit.payout.model.digital_payout_channel_properties import DigitalPayoutChannelProperties + from xendit.payout.model.payout_all_of import PayoutAllOf + from xendit.payout.model.receipt_notification import ReceiptNotification + globals()['CreatePayoutRequest'] = CreatePayoutRequest + globals()['DigitalPayoutChannelProperties'] = DigitalPayoutChannelProperties + globals()['PayoutAllOf'] = PayoutAllOf + globals()['ReceiptNotification'] = ReceiptNotification + + +class Payout(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('status',): { + 'SUCCEEDED': "SUCCEEDED", + 'FAILED': "FAILED", + 'ACCEPTED': "ACCEPTED", + 'REQUESTED': "REQUESTED", + 'LOCKED': "LOCKED", + 'CANCELLED': "CANCELLED", + 'REVERSED': "REVERSED", + }, + ('failure_code',): { + 'INSUFFICIENT_BALANCE': "INSUFFICIENT_BALANCE", + 'REJECTED_BY_CHANNEL': "REJECTED_BY_CHANNEL", + 'TEMPORARY_TRANSFER_ERROR': "TEMPORARY_TRANSFER_ERROR", + 'INVALID_DESTINATION': "INVALID_DESTINATION", + 'TRANSFER_ERROR': "TRANSFER_ERROR", + }, + } + + validations = { + ('reference_id',): { + 'min_length': 1, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'reference_id': (str,), # noqa: E501 + 'channel_code': (str,), # noqa: E501 + 'channel_properties': (DigitalPayoutChannelProperties,), # noqa: E501 + 'amount': (float,), # noqa: E501 + 'currency': (str,), # noqa: E501 + 'id': (str,), # noqa: E501 + 'created': (datetime,), # noqa: E501 + 'updated': (datetime,), # noqa: E501 + 'business_id': (str,), # noqa: E501 + 'status': (str,), # noqa: E501 + 'description': (str,), # noqa: E501 + 'receipt_notification': (ReceiptNotification,), # noqa: E501 + 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + 'failure_code': (str,), # noqa: E501 + 'estimated_arrival_time': (datetime,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'reference_id': 'reference_id', # noqa: E501 + 'channel_code': 'channel_code', # noqa: E501 + 'channel_properties': 'channel_properties', # noqa: E501 + 'amount': 'amount', # noqa: E501 + 'currency': 'currency', # noqa: E501 + 'id': 'id', # noqa: E501 + 'created': 'created', # noqa: E501 + 'updated': 'updated', # noqa: E501 + 'business_id': 'business_id', # noqa: E501 + 'status': 'status', # noqa: E501 + 'description': 'description', # noqa: E501 + 'receipt_notification': 'receipt_notification', # noqa: E501 + 'metadata': 'metadata', # noqa: E501 + 'failure_code': 'failure_code', # noqa: E501 + 'estimated_arrival_time': 'estimated_arrival_time', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Payout - a model defined in OpenAPI + + Keyword Args: + reference_id (str): A client defined payout identifier + channel_code (str): Channel code of selected destination bank or e-wallet + channel_properties (DigitalPayoutChannelProperties): + amount (float): Amount to be sent to the destination account and should be a multiple of the minimum increment for the selected channel + currency (str): Currency of the destination channel using ISO-4217 currency code + id (str): Xendit-generated unique identifier for each payout + created (datetime): The time payout was created on Xendit's system, in ISO 8601 format + updated (datetime): The time payout was last updated on Xendit's system, in ISO 8601 format + business_id (str): Xendit Business ID + status (str): Status of payout + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + description (str): Description to send with the payout, the recipient may see this e.g., in their bank statement (if supported) or in email receipts we send on your behalf. [optional] # noqa: E501 + receipt_notification (ReceiptNotification): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Object of additional information you may use. [optional] # noqa: E501 + failure_code (str): If the Payout failed, we include a failure code for more details on the failure.. [optional] # noqa: E501 + estimated_arrival_time (datetime): Our estimated time on to when your payout is reflected to the destination account. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Payout - a model defined in OpenAPI + + Keyword Args: + reference_id (str): A client defined payout identifier + channel_code (str): Channel code of selected destination bank or e-wallet + channel_properties (DigitalPayoutChannelProperties): + amount (float): Amount to be sent to the destination account and should be a multiple of the minimum increment for the selected channel + currency (str): Currency of the destination channel using ISO-4217 currency code + id (str): Xendit-generated unique identifier for each payout + created (datetime): The time payout was created on Xendit's system, in ISO 8601 format + updated (datetime): The time payout was last updated on Xendit's system, in ISO 8601 format + business_id (str): Xendit Business ID + status (str): Status of payout + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + description (str): Description to send with the payout, the recipient may see this e.g., in their bank statement (if supported) or in email receipts we send on your behalf. [optional] # noqa: E501 + receipt_notification (ReceiptNotification): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Object of additional information you may use. [optional] # noqa: E501 + failure_code (str): If the Payout failed, we include a failure code for more details on the failure.. [optional] # noqa: E501 + estimated_arrival_time (datetime): Our estimated time on to when your payout is reflected to the destination account. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + CreatePayoutRequest, + PayoutAllOf, + ], + 'oneOf': [ + ], + } diff --git a/xendit/payout/model/payout_all_of.py b/xendit/payout/model/payout_all_of.py new file mode 100644 index 00000000..3b95353d --- /dev/null +++ b/xendit/payout/model/payout_all_of.py @@ -0,0 +1,316 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class PayoutAllOf(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('status',): { + 'SUCCEEDED': "SUCCEEDED", + 'FAILED': "FAILED", + 'ACCEPTED': "ACCEPTED", + 'REQUESTED': "REQUESTED", + 'LOCKED': "LOCKED", + 'CANCELLED': "CANCELLED", + 'REVERSED': "REVERSED", + }, + ('failure_code',): { + 'INSUFFICIENT_BALANCE': "INSUFFICIENT_BALANCE", + 'REJECTED_BY_CHANNEL': "REJECTED_BY_CHANNEL", + 'TEMPORARY_TRANSFER_ERROR': "TEMPORARY_TRANSFER_ERROR", + 'INVALID_DESTINATION': "INVALID_DESTINATION", + 'TRANSFER_ERROR': "TRANSFER_ERROR", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'id': (str,), # noqa: E501 + 'created': (datetime,), # noqa: E501 + 'updated': (datetime,), # noqa: E501 + 'business_id': (str,), # noqa: E501 + 'status': (str,), # noqa: E501 + 'failure_code': (str,), # noqa: E501 + 'estimated_arrival_time': (datetime,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'created': 'created', # noqa: E501 + 'updated': 'updated', # noqa: E501 + 'business_id': 'business_id', # noqa: E501 + 'status': 'status', # noqa: E501 + 'failure_code': 'failure_code', # noqa: E501 + 'estimated_arrival_time': 'estimated_arrival_time', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, created, updated, business_id, status, *args, **kwargs): # noqa: E501 + """PayoutAllOf - a model defined in OpenAPI + + Args: + id (str): Xendit-generated unique identifier for each payout + created (datetime): The time payout was created on Xendit's system, in ISO 8601 format + updated (datetime): The time payout was last updated on Xendit's system, in ISO 8601 format + business_id (str): Xendit Business ID + status (str): Status of payout + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + failure_code (str): If the Payout failed, we include a failure code for more details on the failure.. [optional] # noqa: E501 + estimated_arrival_time (datetime): Our estimated time on to when your payout is reflected to the destination account. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.created = created + self.updated = updated + self.business_id = business_id + self.status = status + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, id, created, updated, business_id, status, *args, **kwargs): # noqa: E501 + """PayoutAllOf - a model defined in OpenAPI + + Args: + id (str): Xendit-generated unique identifier for each payout + created (datetime): The time payout was created on Xendit's system, in ISO 8601 format + updated (datetime): The time payout was last updated on Xendit's system, in ISO 8601 format + business_id (str): Xendit Business ID + status (str): Status of payout + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + failure_code (str): If the Payout failed, we include a failure code for more details on the failure.. [optional] # noqa: E501 + estimated_arrival_time (datetime): Our estimated time on to when your payout is reflected to the destination account. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.created = created + self.updated = updated + self.business_id = business_id + self.status = status + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payout/model/receipt_notification.py b/xendit/payout/model/receipt_notification.py new file mode 100644 index 00000000..240d3a8e --- /dev/null +++ b/xendit/payout/model/receipt_notification.py @@ -0,0 +1,270 @@ +""" + The version of the XENDIT API: 1.0.0 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class ReceiptNotification(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'email_to': ([str], none_type,), # noqa: E501 + 'email_cc': ([str], none_type,), # noqa: E501 + 'email_bcc': ([str], none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'email_to': 'email_to', # noqa: E501 + 'email_cc': 'email_cc', # noqa: E501 + 'email_bcc': 'email_bcc', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ReceiptNotification - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + email_to ([str], none_type): Valid email address to send the payout receipt. [optional] # noqa: E501 + email_cc ([str], none_type): Valid email address to cc the payout receipt. [optional] # noqa: E501 + email_bcc ([str], none_type): Valid email address to bcc the payout receipt. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """ReceiptNotification - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + email_to ([str], none_type): Valid email address to send the payout receipt. [optional] # noqa: E501 + email_cc ([str], none_type): Valid email address to cc the payout receipt. [optional] # noqa: E501 + email_bcc ([str], none_type): Valid email address to bcc the payout receipt. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/payout/payout_api.py b/xendit/payout/payout_api.py new file mode 100644 index 00000000..f39a8c39 --- /dev/null +++ b/xendit/payout/payout_api.py @@ -0,0 +1,727 @@ +""" + Payout Service + + This API allows Xendit to send money from an account to a channel (banks, eWallets, retail outlets) from across regions # noqa: E501 + + The version of the OpenAPI document: 1.0.0 +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.api_client import ApiClient, Endpoint as _Endpoint +from xendit.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) + +from xendit.payout.model import * # noqa: F401,E501 + +class PayoutApi(object): + """NOTE: This class is auto generated by the OpenAPI Generator. + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.cancel_payout_endpoint = _Endpoint( + settings={ + 'response_type': (GetPayouts200ResponseDataInner,), + 'auth': [], + 'endpoint_path': '/v2/payouts/{id}/cancel', + 'operation_id': 'cancel_payout', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'id', + ], + 'required': [ + 'id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'id': + (str,), + }, + 'attribute_map': { + 'id': 'id', + }, + 'location_map': { + 'id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.create_payout_endpoint = _Endpoint( + settings={ + 'response_type': (GetPayouts200ResponseDataInner,), + 'auth': [], + 'endpoint_path': '/v2/payouts', + 'operation_id': 'create_payout', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'idempotency_key', + 'for_user_id', + 'create_payout_request', + ], + 'required': [ + 'idempotency_key', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'idempotency_key': + (str,), + 'for_user_id': + (str,), + 'create_payout_request': + (CreatePayoutRequest,), + }, + 'attribute_map': { + 'idempotency_key': 'idempotency-key', + 'for_user_id': 'for-user-id', + }, + 'location_map': { + 'idempotency_key': 'header', + 'for_user_id': 'header', + 'create_payout_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.get_payout_by_id_endpoint = _Endpoint( + settings={ + 'response_type': (GetPayouts200ResponseDataInner,), + 'auth': [], + 'endpoint_path': '/v2/payouts/{id}', + 'operation_id': 'get_payout_by_id', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'id', + ], + 'required': [ + 'id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'id': + (str,), + }, + 'attribute_map': { + 'id': 'id', + }, + 'location_map': { + 'id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.get_payout_channels_endpoint = _Endpoint( + settings={ + 'response_type': ([Channel],), + 'auth': [], + 'endpoint_path': '/payouts_channels', + 'operation_id': 'get_payout_channels', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'currency', + 'channel_category', + 'channel_code', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'currency': + (str,), + 'channel_category': + ([ChannelCategory],), + 'channel_code': + (str,), + }, + 'attribute_map': { + 'currency': 'currency', + 'channel_category': 'channel_category', + 'channel_code': 'channel_code', + }, + 'location_map': { + 'currency': 'query', + 'channel_category': 'query', + 'channel_code': 'query', + }, + 'collection_format_map': { + 'channel_category': 'csv', + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.get_payouts_endpoint = _Endpoint( + settings={ + 'response_type': (GetPayouts200Response,), + 'auth': [], + 'endpoint_path': '/v2/payouts', + 'operation_id': 'get_payouts', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'reference_id', + 'limit', + 'after_id', + 'before_id', + ], + 'required': [ + 'reference_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'reference_id': + (str,), + 'limit': + (float,), + 'after_id': + (str,), + 'before_id': + (str,), + }, + 'attribute_map': { + 'reference_id': 'reference_id', + 'limit': 'limit', + 'after_id': 'after_id', + 'before_id': 'before_id', + }, + 'location_map': { + 'reference_id': 'query', + 'limit': 'query', + 'after_id': 'query', + 'before_id': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + + def cancel_payout( + self, + id, + **kwargs + ): + """API to cancel requested payouts that have not yet been sent to partner banks and e-wallets. Cancellation is possible if the payout has not been sent out via our partner and when payout status is ACCEPTED. # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.cancel_payout(id, async_req=True) + >>> result = thread.get() + + Args: + id (str): Payout id returned from the response of /v2/payouts + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + GetPayouts200ResponseDataInner + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['id'] = \ + id + return self.cancel_payout_endpoint.call_with_http_info(**kwargs) + + def create_payout( + self, + idempotency_key, + **kwargs + ): + """API to send money at scale to bank accounts & eWallets # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_payout(idempotency_key, async_req=True) + >>> result = thread.get() + + Args: + idempotency_key (str): A unique key to prevent duplicate requests from pushing through our system. No expiration. + + Keyword Args: + for_user_id (str): The sub-account user-id that you want to make this transaction for. This header is only used if you have access to xenPlatform. See xenPlatform for more information.. [optional] + create_payout_request (CreatePayoutRequest): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + GetPayouts200ResponseDataInner + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['idempotency_key'] = \ + idempotency_key + return self.create_payout_endpoint.call_with_http_info(**kwargs) + + def get_payout_by_id( + self, + id, + **kwargs + ): + """API to fetch the current status, or details of the payout # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_payout_by_id(id, async_req=True) + >>> result = thread.get() + + Args: + id (str): Payout id returned from the response of /v2/payouts + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + GetPayouts200ResponseDataInner + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['id'] = \ + id + return self.get_payout_by_id_endpoint.call_with_http_info(**kwargs) + + def get_payout_channels( + self, + **kwargs + ): + """API providing the current list of banks and e-wallets we support for payouts for both regions # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_payout_channels(async_req=True) + >>> result = thread.get() + + + Keyword Args: + currency (str): Filter channels by currency from ISO-4217 values. [optional] + channel_category ([ChannelCategory]): Filter channels by category. [optional] + channel_code (str): Filter channels by channel code, prefixed by ISO-3166 country code. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + [Channel] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + return self.get_payout_channels_endpoint.call_with_http_info(**kwargs) + + def get_payouts( + self, + reference_id, + **kwargs + ): + """API to retrieve all matching payouts with reference ID # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_payouts(reference_id, async_req=True) + >>> result = thread.get() + + Args: + reference_id (str): Reference_id provided when creating the payout + + Keyword Args: + limit (float): Number of records to fetch per API call. [optional] + after_id (str): Used to fetch record after this payout unique id. [optional] + before_id (str): Used to fetch record before this payout unique id. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + GetPayouts200Response + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['reference_id'] = \ + reference_id + return self.get_payouts_endpoint.call_with_http_info(**kwargs) + diff --git a/xendit/refund/__init__.py b/xendit/refund/__init__.py new file mode 100644 index 00000000..a624a920 --- /dev/null +++ b/xendit/refund/__init__.py @@ -0,0 +1 @@ +from xendit.refund.refund_api import RefundApi diff --git a/xendit/refund/model/__init__.py b/xendit/refund/model/__init__.py new file mode 100644 index 00000000..db6bbecd --- /dev/null +++ b/xendit/refund/model/__init__.py @@ -0,0 +1,20 @@ +# flake8: noqa + +# import all models into this package +# if you have many models here with many references from one model to another this may +# raise a RecursionError +# to avoid this, import only the models that you directly need like: +# from xendit.refund.model.pet import Pet +# or import this package, but before doing it, use: +# import sys +# sys.setrecursionlimit(n) + +from xendit.refund.model.create_refund import CreateRefund +from xendit.refund.model.create_refund400_response import CreateRefund400Response +from xendit.refund.model.create_refund403_response import CreateRefund403Response +from xendit.refund.model.create_refund404_response import CreateRefund404Response +from xendit.refund.model.create_refund409_response import CreateRefund409Response +from xendit.refund.model.create_refund503_response import CreateRefund503Response +from xendit.refund.model.create_refund_default_response import CreateRefundDefaultResponse +from xendit.refund.model.refund import Refund +from xendit.refund.model.refund_list import RefundList diff --git a/xendit/refund/model/create_refund.py b/xendit/refund/model/create_refund.py new file mode 100644 index 00000000..1688b4c8 --- /dev/null +++ b/xendit/refund/model/create_refund.py @@ -0,0 +1,293 @@ +""" + The version of the XENDIT API: 1.2.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class CreateRefund(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('reason',): { + 'FRAUDULENT': "FRAUDULENT", + 'DUPLICATE': "DUPLICATE", + 'REQUESTED_BY_CUSTOMER': "REQUESTED_BY_CUSTOMER", + 'CANCELLATION': "CANCELLATION", + 'OTHERS': "OTHERS", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'payment_request_id': (str,), # noqa: E501 + 'invoice_id': (str,), # noqa: E501 + 'reference_id': (str,), # noqa: E501 + 'amount': (float,), # noqa: E501 + 'currency': (str,), # noqa: E501 + 'reason': (str,), # noqa: E501 + 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'payment_request_id': 'payment_request_id', # noqa: E501 + 'invoice_id': 'invoice_id', # noqa: E501 + 'reference_id': 'reference_id', # noqa: E501 + 'amount': 'amount', # noqa: E501 + 'currency': 'currency', # noqa: E501 + 'reason': 'reason', # noqa: E501 + 'metadata': 'metadata', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """CreateRefund - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + payment_request_id (str): [optional] # noqa: E501 + invoice_id (str): [optional] # noqa: E501 + reference_id (str): [optional] # noqa: E501 + amount (float): [optional] # noqa: E501 + currency (str): [optional] # noqa: E501 + reason (str): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """CreateRefund - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + payment_request_id (str): [optional] # noqa: E501 + invoice_id (str): [optional] # noqa: E501 + reference_id (str): [optional] # noqa: E501 + amount (float): [optional] # noqa: E501 + currency (str): [optional] # noqa: E501 + reason (str): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/refund/model/create_refund400_response.py b/xendit/refund/model/create_refund400_response.py new file mode 100644 index 00000000..1dcb8322 --- /dev/null +++ b/xendit/refund/model/create_refund400_response.py @@ -0,0 +1,275 @@ +""" + The version of the XENDIT API: 1.2.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class CreateRefund400Response(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('error_code',): { + 'API_VALIDATION_ERROR': "API_VALIDATION_ERROR", + 'INELIGIBLE_TRANSACTION': "INELIGIBLE_TRANSACTION", + 'INSUFFICIENT_BALANCE': "INSUFFICIENT_BALANCE", + 'MAXIMUM_REFUND_AMOUNT_REACHED': "MAXIMUM_REFUND_AMOUNT_REACHED", + 'PARTIAL_REFUND_NOT_SUPPORTED': "PARTIAL_REFUND_NOT_SUPPORTED", + 'REFUND_NOT_SUPPORTED': "REFUND_NOT_SUPPORTED", + 'TRANSACTION_NOT_FOUND': "TRANSACTION_NOT_FOUND", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'error_code': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'error_code': 'error_code', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """CreateRefund400Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """CreateRefund400Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/refund/model/create_refund403_response.py b/xendit/refund/model/create_refund403_response.py new file mode 100644 index 00000000..63878000 --- /dev/null +++ b/xendit/refund/model/create_refund403_response.py @@ -0,0 +1,269 @@ +""" + The version of the XENDIT API: 1.2.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class CreateRefund403Response(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('error_code',): { + 'UNAUTHORIZED': "UNAUTHORIZED", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'error_code': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'error_code': 'error_code', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """CreateRefund403Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] if omitted the server will use the default value of "UNAUTHORIZED" # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """CreateRefund403Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] if omitted the server will use the default value of "UNAUTHORIZED" # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/refund/model/create_refund404_response.py b/xendit/refund/model/create_refund404_response.py new file mode 100644 index 00000000..135020c4 --- /dev/null +++ b/xendit/refund/model/create_refund404_response.py @@ -0,0 +1,269 @@ +""" + The version of the XENDIT API: 1.2.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class CreateRefund404Response(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('error_code',): { + 'DATA_NOT_FOUND': "DATA_NOT_FOUND", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'error_code': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'error_code': 'error_code', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """CreateRefund404Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] if omitted the server will use the default value of "DATA_NOT_FOUND" # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """CreateRefund404Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] if omitted the server will use the default value of "DATA_NOT_FOUND" # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/refund/model/create_refund409_response.py b/xendit/refund/model/create_refund409_response.py new file mode 100644 index 00000000..ef067803 --- /dev/null +++ b/xendit/refund/model/create_refund409_response.py @@ -0,0 +1,270 @@ +""" + The version of the XENDIT API: 1.2.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class CreateRefund409Response(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('error_code',): { + 'DUPLICATE_ERROR': "DUPLICATE_ERROR", + 'IDEMPOTENCY_ERROR': "IDEMPOTENCY_ERROR", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'error_code': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'error_code': 'error_code', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """CreateRefund409Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """CreateRefund409Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/refund/model/create_refund503_response.py b/xendit/refund/model/create_refund503_response.py new file mode 100644 index 00000000..05265044 --- /dev/null +++ b/xendit/refund/model/create_refund503_response.py @@ -0,0 +1,270 @@ +""" + The version of the XENDIT API: 1.2.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class CreateRefund503Response(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('error_code',): { + 'CHANNEL_UNAVAILABLE': "CHANNEL_UNAVAILABLE", + 'OTP_DELIVERY_ERROR': "OTP_DELIVERY_ERROR", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'error_code': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'error_code': 'error_code', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """CreateRefund503Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """CreateRefund503Response - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/refund/model/create_refund_default_response.py b/xendit/refund/model/create_refund_default_response.py new file mode 100644 index 00000000..c124efcd --- /dev/null +++ b/xendit/refund/model/create_refund_default_response.py @@ -0,0 +1,266 @@ +""" + The version of the XENDIT API: 1.2.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class CreateRefundDefaultResponse(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'error_code': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'error_code': 'error_code', # noqa: E501 + 'message': 'message', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """CreateRefundDefaultResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """CreateRefundDefaultResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_code (str): [optional] # noqa: E501 + message (str): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/refund/model/refund.py b/xendit/refund/model/refund.py new file mode 100644 index 00000000..7adfdd37 --- /dev/null +++ b/xendit/refund/model/refund.py @@ -0,0 +1,306 @@ +""" + The version of the XENDIT API: 1.2.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + + +class Refund(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'id': (str,), # noqa: E501 + 'payment_request_id': (str,), # noqa: E501 + 'amount': (float,), # noqa: E501 + 'channel_code': (str,), # noqa: E501 + 'country': (str,), # noqa: E501 + 'currency': (str,), # noqa: E501 + 'reference_id': (str, none_type,), # noqa: E501 + 'failure_code': (str, none_type,), # noqa: E501 + 'refund_fee_amount': (float, none_type,), # noqa: E501 + 'created': (str,), # noqa: E501 + 'updated': (str,), # noqa: E501 + 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'payment_request_id': 'payment_request_id', # noqa: E501 + 'amount': 'amount', # noqa: E501 + 'channel_code': 'channel_code', # noqa: E501 + 'country': 'country', # noqa: E501 + 'currency': 'currency', # noqa: E501 + 'reference_id': 'reference_id', # noqa: E501 + 'failure_code': 'failure_code', # noqa: E501 + 'refund_fee_amount': 'refund_fee_amount', # noqa: E501 + 'created': 'created', # noqa: E501 + 'updated': 'updated', # noqa: E501 + 'metadata': 'metadata', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Refund - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (str): [optional] # noqa: E501 + payment_request_id (str): [optional] # noqa: E501 + amount (float): [optional] # noqa: E501 + channel_code (str): [optional] # noqa: E501 + country (str): [optional] # noqa: E501 + currency (str): [optional] # noqa: E501 + reference_id (str, none_type): [optional] # noqa: E501 + failure_code (str, none_type): [optional] # noqa: E501 + refund_fee_amount (float, none_type): [optional] # noqa: E501 + created (str): [optional] # noqa: E501 + updated (str): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """Refund - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (str): [optional] # noqa: E501 + payment_request_id (str): [optional] # noqa: E501 + amount (float): [optional] # noqa: E501 + channel_code (str): [optional] # noqa: E501 + country (str): [optional] # noqa: E501 + currency (str): [optional] # noqa: E501 + reference_id (str, none_type): [optional] # noqa: E501 + failure_code (str, none_type): [optional] # noqa: E501 + refund_fee_amount (float, none_type): [optional] # noqa: E501 + created (str): [optional] # noqa: E501 + updated (str): [optional] # noqa: E501 + metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/refund/model/refund_list.py b/xendit/refund/model/refund_list.py new file mode 100644 index 00000000..4d20f01a --- /dev/null +++ b/xendit/refund/model/refund_list.py @@ -0,0 +1,278 @@ +""" + The version of the XENDIT API: 1.2.3 +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from xendit.exceptions import ApiAttributeError + + +def lazy_import(): + from xendit.refund.model.refund import Refund + globals()['Refund'] = Refund + + +class RefundList(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'data': ([Refund],), # noqa: E501 + 'has_more': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'data': 'data', # noqa: E501 + 'has_more': 'has_more', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """RefundList - a model defined in OpenAPI + + Args: + data ([Refund]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + has_more (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, data, *args, **kwargs): # noqa: E501 + """RefundList - a model defined in OpenAPI + + Args: + data ([Refund]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + has_more (bool): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + elif isinstance(arg, str): + kwargs.update({"value": arg}) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/xendit/refund/refund_api.py b/xendit/refund/refund_api.py new file mode 100644 index 00000000..ac154f33 --- /dev/null +++ b/xendit/refund/refund_api.py @@ -0,0 +1,559 @@ +""" + Refund Service + + This API is used for the unified refund service # noqa: E501 + + The version of the OpenAPI document: 1.2.3 +""" + +import re # noqa: F401 +import sys # noqa: F401 + +from xendit.api_client import ApiClient, Endpoint as _Endpoint +from xendit.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) + +from xendit.refund.model import * # noqa: F401,E501 + +class RefundApi(object): + """NOTE: This class is auto generated by the OpenAPI Generator. + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.cancel_refund_endpoint = _Endpoint( + settings={ + 'response_type': (Refund,), + 'auth': [], + 'endpoint_path': '/refunds/{refundID}/cancel', + 'operation_id': 'cancel_refund', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'refund_id', + 'idempotency_key', + ], + 'required': [ + 'refund_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'refund_id': + (str,), + 'idempotency_key': + (str,), + }, + 'attribute_map': { + 'refund_id': 'refundID', + 'idempotency_key': 'idempotency-key', + }, + 'location_map': { + 'refund_id': 'path', + 'idempotency_key': 'header', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.create_refund_endpoint = _Endpoint( + settings={ + 'response_type': (Refund,), + 'auth': [], + 'endpoint_path': '/refunds', + 'operation_id': 'create_refund', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'idempotency_key', + 'create_refund', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'idempotency_key': + (str,), + 'create_refund': + (CreateRefund,), + }, + 'attribute_map': { + 'idempotency_key': 'idempotency-key', + }, + 'location_map': { + 'idempotency_key': 'header', + 'create_refund': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.get_all_refunds_endpoint = _Endpoint( + settings={ + 'response_type': (RefundList,), + 'auth': [], + 'endpoint_path': '/refunds/', + 'operation_id': 'get_all_refunds', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + }, + 'attribute_map': { + }, + 'location_map': { + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.get_refund_endpoint = _Endpoint( + settings={ + 'response_type': (Refund,), + 'auth': [], + 'endpoint_path': '/refunds/{refundID}', + 'operation_id': 'get_refund', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'refund_id', + 'idempotency_key', + ], + 'required': [ + 'refund_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'refund_id': + (str,), + 'idempotency_key': + (str,), + }, + 'attribute_map': { + 'refund_id': 'refundID', + 'idempotency_key': 'idempotency-key', + }, + 'location_map': { + 'refund_id': 'path', + 'idempotency_key': 'header', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + + def cancel_refund( + self, + refund_id, + **kwargs + ): + """cancel_refund # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.cancel_refund(refund_id, async_req=True) + >>> result = thread.get() + + Args: + refund_id (str): + + Keyword Args: + idempotency_key (str): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + Refund + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['refund_id'] = \ + refund_id + return self.cancel_refund_endpoint.call_with_http_info(**kwargs) + + def create_refund( + self, + **kwargs + ): + """create_refund # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_refund(async_req=True) + >>> result = thread.get() + + + Keyword Args: + idempotency_key (str): [optional] + create_refund (CreateRefund): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + Refund + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + return self.create_refund_endpoint.call_with_http_info(**kwargs) + + def get_all_refunds( + self, + **kwargs + ): + """get_all_refunds # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_all_refunds(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + RefundList + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + return self.get_all_refunds_endpoint.call_with_http_info(**kwargs) + + def get_refund( + self, + refund_id, + **kwargs + ): + """get_refund # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_refund(refund_id, async_req=True) + >>> result = thread.get() + + Args: + refund_id (str): + + Keyword Args: + idempotency_key (str): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + Refund + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['refund_id'] = \ + refund_id + return self.get_refund_endpoint.call_with_http_info(**kwargs) + diff --git a/xendit/rest.py b/xendit/rest.py new file mode 100644 index 00000000..b0c89e9a --- /dev/null +++ b/xendit/rest.py @@ -0,0 +1,353 @@ +""" + The version of the XENDIT API: 2.87.2 +""" + + +import io +import json +import logging +import re +import ssl +from urllib.parse import urlencode +from urllib.parse import urlparse +from urllib.request import proxy_bypass_environment +import urllib3 +import ipaddress + +from xendit.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError + + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.urllib3_response.getheaders() + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.urllib3_response.getheader(name, default) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + self.configuration = configuration + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if configuration.retries is not None: + addition_pool_args['retries'] = configuration.retries + + if configuration.tls_server_name: + addition_pool_args['server_hostname'] = configuration.tls_server_name + + + if configuration.socket_options is not None: + addition_pool_args['socket_options'] = configuration.socket_options + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy and not should_bypass_proxies( + configuration.host, no_proxy=configuration.no_proxy or ''): + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=configuration.ssl_ca_cert, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + proxy_headers=configuration.proxy_headers, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=configuration.ssl_ca_cert, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, + _request_timeout=None): + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, float)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=_request_timeout) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests + if (method != 'DELETE') and ('Content-Type' not in headers): + headers['Content-Type'] = 'application/json' + if query_params: + url += '?' + urlencode(query_params) + if ('Content-Type' not in headers) or (re.search('json', + headers['Content-Type'], re.IGNORECASE)): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=True, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str) or isinstance(body, bytes): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if _preload_content: + r = RESTResponse(r) + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + if r.status == 401: + raise UnauthorizedException(http_resp=r) + + if r.status == 403: + raise ForbiddenException(http_resp=r) + + if r.status == 404: + raise NotFoundException(http_resp=r) + + if 500 <= r.status <= 599: + raise ServiceException(http_resp=r) + + raise ApiException(http_resp=r) + + return r + + def GET(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, + _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + +# end of class RESTClientObject + + +def is_ipv4(target): + """ Test if IPv4 address or not + """ + try: + chk = ipaddress.IPv4Address(target) + return True + except ipaddress.AddressValueError: + return False + + +def in_ipv4net(target, net): + """ Test if target belongs to given IPv4 network + """ + try: + nw = ipaddress.IPv4Network(net) + ip = ipaddress.IPv4Address(target) + if ip in nw: + return True + return False + except ipaddress.AddressValueError: + return False + except ipaddress.NetmaskValueError: + return False + + +def should_bypass_proxies(url, no_proxy=None): + """ Yet another requests.should_bypass_proxies + Test if proxies should not be used for a particular url. + """ + + parsed = urlparse(url) + + # special cases + if parsed.hostname in [None, '']: + return True + + # special cases + if no_proxy in [None, '']: + return False + if no_proxy == '*': + return True + + no_proxy = no_proxy.lower().replace(' ', ''); + entries = ( + host for host in no_proxy.split(',') if host + ) + + if is_ipv4(parsed.hostname): + for item in entries: + if in_ipv4net(parsed.hostname, item): + return True + return proxy_bypass_environment(parsed.hostname, {'no': no_proxy}) diff --git a/xendit/xendit.py b/xendit/xendit.py deleted file mode 100644 index ad8a8015..00000000 --- a/xendit/xendit.py +++ /dev/null @@ -1,36 +0,0 @@ -import requests - -from ._xendit_param_injector import _XenditParamInjector - -from .network import HTTPClientInterface - - -class Xendit: - """Xendit instance. Initialize this with your API Key.""" - - def __init__( - self, - api_key, - base_url="https://api.xendit.co/", - http_client: HTTPClientInterface = requests, - ): - injected_params = (api_key, base_url, http_client) - param_injector = _XenditParamInjector(injected_params) - - self.Balance = param_injector.instantiate_balance() - self.BatchDisbursement = param_injector.instantiate_batch_disbursement() - self.CardlessCredit = param_injector.instantiate_cardless_credit() - self.CreditCard = param_injector.instantiate_credit_card() - self.DirectDebit = param_injector.instantiate_direct_debit() - self.Disbursement = param_injector.instantiate_disbursement() - self.EWallet = param_injector.instantiate_ewallet() - self.Invoice = param_injector.instantiate_invoice() - self.PaymentMethod = param_injector.instantiate_payment_method() - self.PaymentRequest = param_injector.instantiate_payment_request() - self.Refund = param_injector.instantiate_refund() - self.Payout = param_injector.instantiate_payout() - self.QRCode = param_injector.instantiate_qrcode() - self.RecurringPayment = param_injector.instantiate_recurring_payment() - self.RetailOutlet = param_injector.instantiate_retail_outlet() - self.VirtualAccount = param_injector.instantiate_virtual_account() - self.XenPlatform = param_injector.instantiate_xenplatform() \ No newline at end of file diff --git a/xendit/xendit_error.py b/xendit/xendit_error.py deleted file mode 100644 index 272a935b..00000000 --- a/xendit/xendit_error.py +++ /dev/null @@ -1,13 +0,0 @@ -class XenditError(Exception): - """Error that will be given when status code != 200.""" - - def __init__(self, xendit_response): - try: - super(XenditError, self).__init__(xendit_response.body["message"]) - except KeyError: - super(XenditError, self).__init__( - xendit_response.body["errors"][0]["message"] - ) - self.status_code = xendit_response.status_code - self.error_code = xendit_response.body["error_code"] - self.errors = xendit_response.body.get("errors", None)