bitpesa-sdk 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +92 -0
- data/LICENSE +7 -0
- data/README.md +264 -0
- data/Rakefile +10 -0
- data/bitpesa-sdk.gemspec +46 -0
- data/docs/APILogsApi.md +141 -0
- data/docs/Account.md +9 -0
- data/docs/AccountBase.md +9 -0
- data/docs/AccountDebitsApi.md +199 -0
- data/docs/AccountListResponse.md +9 -0
- data/docs/AccountMeta.md +8 -0
- data/docs/AccountResponse.md +9 -0
- data/docs/AccountValidationApi.md +70 -0
- data/docs/AccountValidationError.md +8 -0
- data/docs/AccountValidationRequest.md +12 -0
- data/docs/AccountValidationResponse.md +9 -0
- data/docs/AccountValidationResult.md +8 -0
- data/docs/AccountsApi.md +128 -0
- data/docs/ApiLog.md +16 -0
- data/docs/ApiLogBase.md +16 -0
- data/docs/ApiLogListResponse.md +9 -0
- data/docs/ApiLogResponse.md +8 -0
- data/docs/Body.md +12 -0
- data/docs/Currency.md +17 -0
- data/docs/CurrencyBase.md +17 -0
- data/docs/CurrencyExchange.md +18 -0
- data/docs/CurrencyExchangeListResponse.md +8 -0
- data/docs/CurrencyInfoApi.md +182 -0
- data/docs/CurrencyListResponse.md +8 -0
- data/docs/CurrencyOpposite.md +18 -0
- data/docs/Debit.md +17 -0
- data/docs/DebitBase.md +12 -0
- data/docs/DebitErrorResponse.md +13 -0
- data/docs/DebitListRequest.md +8 -0
- data/docs/DebitListResponse.md +9 -0
- data/docs/DebitRequest.md +8 -0
- data/docs/DebitRequestWrapper.md +8 -0
- data/docs/DebitResponse.md +8 -0
- data/docs/DebitValidResponse.md +16 -0
- data/docs/DefaultDocument.md +16 -0
- data/docs/DefaultRecipient.md +11 -0
- data/docs/DefaultSender.md +24 -0
- data/docs/DefaultWebhook.md +11 -0
- data/docs/Document.md +17 -0
- data/docs/DocumentBase.md +15 -0
- data/docs/DocumentErrorResponse.md +16 -0
- data/docs/DocumentListResponse.md +9 -0
- data/docs/DocumentRequest.md +8 -0
- data/docs/DocumentResponse.md +8 -0
- data/docs/DocumentValidResponse.md +16 -0
- data/docs/DocumentWebhook.md +10 -0
- data/docs/DocumentsApi.md +199 -0
- data/docs/ErrorStatus.md +9 -0
- data/docs/FieldDescription.md +9 -0
- data/docs/FieldSelectValidation.md +9 -0
- data/docs/FieldValidation.md +10 -0
- data/docs/FullInvalidTransaction.md +12 -0
- data/docs/FullInvalidTransactionRequest.md +14 -0
- data/docs/FullValidTransaction.md +11 -0
- data/docs/FullValidTransactionRequest.md +12 -0
- data/docs/InlineResponse200.md +9 -0
- data/docs/InlineResponse2001.md +8 -0
- data/docs/InlineResponse20010.md +9 -0
- data/docs/InlineResponse20011.md +9 -0
- data/docs/InlineResponse20012.md +8 -0
- data/docs/InlineResponse20013.md +9 -0
- data/docs/InlineResponse20014.md +9 -0
- data/docs/InlineResponse20015.md +8 -0
- data/docs/InlineResponse20016.md +9 -0
- data/docs/InlineResponse20017.md +8 -0
- data/docs/InlineResponse20018.md +9 -0
- data/docs/InlineResponse20019.md +9 -0
- data/docs/InlineResponse2002.md +9 -0
- data/docs/InlineResponse20020.md +9 -0
- data/docs/InlineResponse20021.md +8 -0
- data/docs/InlineResponse20021Object.md +8 -0
- data/docs/InlineResponse20022.md +8 -0
- data/docs/InlineResponse20022Object.md +8 -0
- data/docs/InlineResponse20023.md +9 -0
- data/docs/InlineResponse20023Object.md +8 -0
- data/docs/InlineResponse20024.md +8 -0
- data/docs/InlineResponse20025.md +8 -0
- data/docs/InlineResponse20026.md +8 -0
- data/docs/InlineResponse20027.md +9 -0
- data/docs/InlineResponse20028.md +8 -0
- data/docs/InlineResponse20029.md +9 -0
- data/docs/InlineResponse2002Object.md +8 -0
- data/docs/InlineResponse2003.md +8 -0
- data/docs/InlineResponse20030.md +8 -0
- data/docs/InlineResponse20031.md +9 -0
- data/docs/InlineResponse20032.md +9 -0
- data/docs/InlineResponse20033.md +8 -0
- data/docs/InlineResponse20034.md +9 -0
- data/docs/InlineResponse20035.md +9 -0
- data/docs/InlineResponse20036.md +8 -0
- data/docs/InlineResponse20037.md +9 -0
- data/docs/InlineResponse20038.md +8 -0
- data/docs/InlineResponse20039.md +9 -0
- data/docs/InlineResponse2004.md +8 -0
- data/docs/InlineResponse20040.md +8 -0
- data/docs/InlineResponse2004Object.md +8 -0
- data/docs/InlineResponse2005.md +8 -0
- data/docs/InlineResponse2006.md +9 -0
- data/docs/InlineResponse2007.md +8 -0
- data/docs/InlineResponse2008.md +9 -0
- data/docs/InlineResponse2009.md +8 -0
- data/docs/InlineResponse201.md +8 -0
- data/docs/InlineResponse2011.md +8 -0
- data/docs/InlineResponse20110.md +8 -0
- data/docs/InlineResponse20111.md +8 -0
- data/docs/InlineResponse2012.md +8 -0
- data/docs/InlineResponse2013.md +8 -0
- data/docs/InlineResponse2014.md +8 -0
- data/docs/InlineResponse2015.md +8 -0
- data/docs/InlineResponse2016.md +8 -0
- data/docs/InlineResponse2017.md +8 -0
- data/docs/InlineResponse2018.md +8 -0
- data/docs/InlineResponse2019.md +8 -0
- data/docs/InlineResponse400.md +9 -0
- data/docs/InlineResponse4001.md +9 -0
- data/docs/InlineResponse422.md +8 -0
- data/docs/InlineResponse4221.md +8 -0
- data/docs/InlineResponse42210.md +8 -0
- data/docs/InlineResponse42211.md +8 -0
- data/docs/InlineResponse42212.md +8 -0
- data/docs/InlineResponse42213.md +8 -0
- data/docs/InlineResponse42214.md +8 -0
- data/docs/InlineResponse4221Meta.md +8 -0
- data/docs/InlineResponse4221Object.md +8 -0
- data/docs/InlineResponse4222.md +8 -0
- data/docs/InlineResponse4223.md +8 -0
- data/docs/InlineResponse4224.md +8 -0
- data/docs/InlineResponse4225.md +8 -0
- data/docs/InlineResponse4226.md +8 -0
- data/docs/InlineResponse4227.md +8 -0
- data/docs/InlineResponse4227Meta.md +8 -0
- data/docs/InlineResponse4228.md +8 -0
- data/docs/InlineResponse4228Meta.md +8 -0
- data/docs/InlineResponse4228Object.md +8 -0
- data/docs/InlineResponse4229.md +8 -0
- data/docs/InlineResponse422Meta.md +8 -0
- data/docs/InlineResponse422Object.md +8 -0
- data/docs/InvalidDebit.md +14 -0
- data/docs/InvalidDocument.md +17 -0
- data/docs/InvalidRecipient.md +12 -0
- data/docs/InvalidSender.md +25 -0
- data/docs/InvalidWebhook.md +11 -0
- data/docs/LogsApi.md +141 -0
- data/docs/Meta.md +8 -0
- data/docs/Meta2.md +8 -0
- data/docs/Meta2Pagination.md +12 -0
- data/docs/MetaPagination.md +12 -0
- data/docs/Object.md +9 -0
- data/docs/OppositePaymentMethod.md +13 -0
- data/docs/OppositePaymentMethodBase.md +13 -0
- data/docs/Pagination.md +12 -0
- data/docs/PaginationMeta.md +8 -0
- data/docs/PaginationPagination.md +12 -0
- data/docs/PayinMethod.md +12 -0
- data/docs/PayinMethodBase.md +12 -0
- data/docs/PayinMethodDetails.md +10 -0
- data/docs/PayinMethodDetailsBase.md +7 -0
- data/docs/PayinMethodDetailsMobile.md +9 -0
- data/docs/PayinMethodDetailsNGNBank.md +8 -0
- data/docs/PayinMethodRequest.md +8 -0
- data/docs/PayinMethodType.md +8 -0
- data/docs/PayinMethodTypeBase.md +8 -0
- data/docs/PaymentMethod.md +13 -0
- data/docs/PaymentMethodBase.md +15 -0
- data/docs/PaymentMethodListResponse.md +8 -0
- data/docs/PaymentMethodOpposite.md +14 -0
- data/docs/PaymentMethodsApi.md +124 -0
- data/docs/PayoutMethod.md +13 -0
- data/docs/PayoutMethodBankAccountTypeEnum.md +7 -0
- data/docs/PayoutMethodBase.md +10 -0
- data/docs/PayoutMethodDetails.md +26 -0
- data/docs/PayoutMethodDetailsBalance.md +8 -0
- data/docs/PayoutMethodDetailsBase.md +7 -0
- data/docs/PayoutMethodDetailsGHSBank.md +11 -0
- data/docs/PayoutMethodDetailsIBAN.md +12 -0
- data/docs/PayoutMethodDetailsMADCash.md +18 -0
- data/docs/PayoutMethodDetailsMobile.md +10 -0
- data/docs/PayoutMethodDetailsNGNBank.md +12 -0
- data/docs/PayoutMethodDetailsXOFMobile.md +11 -0
- data/docs/PayoutMethodErrorResponse.md +11 -0
- data/docs/PayoutMethodGenderEnum.md +7 -0
- data/docs/PayoutMethodIdentityCardTypeEnum.md +7 -0
- data/docs/PayoutMethodListResponse.md +9 -0
- data/docs/PayoutMethodMobileProviderEnum.md +7 -0
- data/docs/PayoutMethodRequest.md +8 -0
- data/docs/PayoutMethodResponse.md +8 -0
- data/docs/PayoutMethodValidResponse.md +11 -0
- data/docs/PayoutMethodWebhook.md +10 -0
- data/docs/PayoutMethodsApi.md +334 -0
- data/docs/Recipient.md +27 -0
- data/docs/RecipientBase.md +11 -0
- data/docs/RecipientErrorResponse.md +26 -0
- data/docs/RecipientListResponse.md +9 -0
- data/docs/RecipientRequest.md +8 -0
- data/docs/RecipientResponse.md +8 -0
- data/docs/RecipientState.md +7 -0
- data/docs/RecipientValidResponse.md +26 -0
- data/docs/RecipientWebhook.md +10 -0
- data/docs/RecipientsApi.md +212 -0
- data/docs/Sender.md +32 -0
- data/docs/SenderBase.md +30 -0
- data/docs/SenderErrorResponse.md +32 -0
- data/docs/SenderExistingRequest.md +8 -0
- data/docs/SenderFullRequest.md +30 -0
- data/docs/SenderListResponse.md +9 -0
- data/docs/SenderRequest.md +8 -0
- data/docs/SenderResponse.md +8 -0
- data/docs/SenderState.md +7 -0
- data/docs/SenderValidResponse.md +32 -0
- data/docs/SenderWebhook.md +10 -0
- data/docs/SendersApi.md +328 -0
- data/docs/Transaction.md +22 -0
- data/docs/TransactionBase.md +13 -0
- data/docs/TransactionErrorResponse.md +21 -0
- data/docs/TransactionListResponse.md +9 -0
- data/docs/TransactionRequest.md +8 -0
- data/docs/TransactionRequestBase.md +9 -0
- data/docs/TransactionRequestErrorResponse.md +10 -0
- data/docs/TransactionRequestRequest.md +9 -0
- data/docs/TransactionRequestValidResponse.md +10 -0
- data/docs/TransactionRequestsApi.md +199 -0
- data/docs/TransactionResponse.md +8 -0
- data/docs/TransactionState.md +7 -0
- data/docs/TransactionTraits.md +9 -0
- data/docs/TransactionValidResponse.md +21 -0
- data/docs/TransactionWebhook.md +10 -0
- data/docs/TransactionsApi.md +448 -0
- data/docs/ValidDebit.md +16 -0
- data/docs/ValidationErrorDescription.md +8 -0
- data/docs/Webhook.md +10 -0
- data/docs/WebhookBase.md +10 -0
- data/docs/WebhookDefinition.md +12 -0
- data/docs/WebhookDefinitionBase.md +10 -0
- data/docs/WebhookDefinitionErrorResponse.md +11 -0
- data/docs/WebhookDefinitionEventListResponse.md +8 -0
- data/docs/WebhookDefinitionListResponse.md +9 -0
- data/docs/WebhookDefinitionRequest.md +8 -0
- data/docs/WebhookDefinitionResponse.md +8 -0
- data/docs/WebhookDefinitionValidResponse.md +11 -0
- data/docs/WebhookErrorResponse.md +11 -0
- data/docs/WebhookLog.md +13 -0
- data/docs/WebhookLogBase.md +13 -0
- data/docs/WebhookLogBaseMetadata.md +17 -0
- data/docs/WebhookLogBaseMetadataParams.md +8 -0
- data/docs/WebhookLogBaseMetadataRequest.md +10 -0
- data/docs/WebhookLogBaseMetadataResponse.md +10 -0
- data/docs/WebhookLogListResponse.md +9 -0
- data/docs/WebhookLogMetadata.md +17 -0
- data/docs/WebhookLogMetadataParams.md +8 -0
- data/docs/WebhookLogMetadataRequest.md +10 -0
- data/docs/WebhookLogMetadataResponse.md +10 -0
- data/docs/WebhookLogResponse.md +8 -0
- data/docs/WebhookRequest.md +10 -0
- data/docs/WebhookValidResponse.md +11 -0
- data/docs/WebhooksApi.md +319 -0
- data/example/.LICENSE.un~ +0 -0
- data/example/.client.rb.un~ +0 -0
- data/example/client.rb +395 -0
- data/git_push.sh +55 -0
- data/lib/bitpesa-sdk/api/account_debits_api.rb +187 -0
- data/lib/bitpesa-sdk/api/account_validation_api.rb +79 -0
- data/lib/bitpesa-sdk/api/accounts_api.rb +135 -0
- data/lib/bitpesa-sdk/api/api_logs_api.rb +137 -0
- data/lib/bitpesa-sdk/api/currency_info_api.rb +167 -0
- data/lib/bitpesa-sdk/api/documents_api.rb +197 -0
- data/lib/bitpesa-sdk/api/logs_api.rb +137 -0
- data/lib/bitpesa-sdk/api/payment_methods_api.rb +119 -0
- data/lib/bitpesa-sdk/api/payout_methods_api.rb +321 -0
- data/lib/bitpesa-sdk/api/recipients_api.rb +221 -0
- data/lib/bitpesa-sdk/api/senders_api.rb +319 -0
- data/lib/bitpesa-sdk/api/transactions_api.rb +425 -0
- data/lib/bitpesa-sdk/api/webhooks_api.rb +299 -0
- data/lib/bitpesa-sdk/api_client.rb +449 -0
- data/lib/bitpesa-sdk/api_error.rb +61 -0
- data/lib/bitpesa-sdk/configuration.rb +220 -0
- data/lib/bitpesa-sdk/models/account.rb +206 -0
- data/lib/bitpesa-sdk/models/account_list_response.rb +206 -0
- data/lib/bitpesa-sdk/models/account_meta.rb +196 -0
- data/lib/bitpesa-sdk/models/account_response.rb +204 -0
- data/lib/bitpesa-sdk/models/account_validation_error.rb +196 -0
- data/lib/bitpesa-sdk/models/account_validation_request.rb +319 -0
- data/lib/bitpesa-sdk/models/account_validation_response.rb +204 -0
- data/lib/bitpesa-sdk/models/account_validation_result.rb +196 -0
- data/lib/bitpesa-sdk/models/api_log.rb +281 -0
- data/lib/bitpesa-sdk/models/api_log_list_response.rb +207 -0
- data/lib/bitpesa-sdk/models/api_log_response.rb +195 -0
- data/lib/bitpesa-sdk/models/currency.rb +286 -0
- data/lib/bitpesa-sdk/models/currency_exchange.rb +305 -0
- data/lib/bitpesa-sdk/models/currency_exchange_list_response.rb +198 -0
- data/lib/bitpesa-sdk/models/currency_list_response.rb +198 -0
- data/lib/bitpesa-sdk/models/currency_opposite.rb +303 -0
- data/lib/bitpesa-sdk/models/debit.rb +303 -0
- data/lib/bitpesa-sdk/models/debit_list_request.rb +197 -0
- data/lib/bitpesa-sdk/models/debit_list_response.rb +206 -0
- data/lib/bitpesa-sdk/models/debit_request.rb +195 -0
- data/lib/bitpesa-sdk/models/debit_request_wrapper.rb +221 -0
- data/lib/bitpesa-sdk/models/debit_response.rb +195 -0
- data/lib/bitpesa-sdk/models/document.rb +329 -0
- data/lib/bitpesa-sdk/models/document_list_response.rb +206 -0
- data/lib/bitpesa-sdk/models/document_request.rb +195 -0
- data/lib/bitpesa-sdk/models/document_response.rb +195 -0
- data/lib/bitpesa-sdk/models/document_webhook.rb +237 -0
- data/lib/bitpesa-sdk/models/error_status.rb +204 -0
- data/lib/bitpesa-sdk/models/field_description.rb +239 -0
- data/lib/bitpesa-sdk/models/field_select_validation.rb +206 -0
- data/lib/bitpesa-sdk/models/field_validation.rb +215 -0
- data/lib/bitpesa-sdk/models/pagination.rb +236 -0
- data/lib/bitpesa-sdk/models/pagination_meta.rb +195 -0
- data/lib/bitpesa-sdk/models/payin_method.rb +236 -0
- data/lib/bitpesa-sdk/models/payin_method_details.rb +251 -0
- data/lib/bitpesa-sdk/models/payin_method_details_mobile.rb +212 -0
- data/lib/bitpesa-sdk/models/payin_method_details_ngn_bank.rb +202 -0
- data/lib/bitpesa-sdk/models/payin_method_request.rb +195 -0
- data/lib/bitpesa-sdk/models/payment_method.rb +251 -0
- data/lib/bitpesa-sdk/models/payment_method_list_response.rb +197 -0
- data/lib/bitpesa-sdk/models/payment_method_opposite.rb +269 -0
- data/lib/bitpesa-sdk/models/payout_method.rb +249 -0
- data/lib/bitpesa-sdk/models/payout_method_bank_account_type_enum.rb +38 -0
- data/lib/bitpesa-sdk/models/payout_method_details.rb +456 -0
- data/lib/bitpesa-sdk/models/payout_method_details_balance.rb +196 -0
- data/lib/bitpesa-sdk/models/payout_method_details_ghs_bank.rb +243 -0
- data/lib/bitpesa-sdk/models/payout_method_details_iban.rb +252 -0
- data/lib/bitpesa-sdk/models/payout_method_details_mad_cash.rb +326 -0
- data/lib/bitpesa-sdk/models/payout_method_details_mobile.rb +229 -0
- data/lib/bitpesa-sdk/models/payout_method_details_ngn_bank.rb +257 -0
- data/lib/bitpesa-sdk/models/payout_method_details_xof_mobile.rb +243 -0
- data/lib/bitpesa-sdk/models/payout_method_gender_enum.rb +38 -0
- data/lib/bitpesa-sdk/models/payout_method_identity_card_type_enum.rb +39 -0
- data/lib/bitpesa-sdk/models/payout_method_list_response.rb +206 -0
- data/lib/bitpesa-sdk/models/payout_method_mobile_provider_enum.rb +38 -0
- data/lib/bitpesa-sdk/models/payout_method_request.rb +195 -0
- data/lib/bitpesa-sdk/models/payout_method_response.rb +195 -0
- data/lib/bitpesa-sdk/models/payout_method_webhook.rb +237 -0
- data/lib/bitpesa-sdk/models/recipient.rb +400 -0
- data/lib/bitpesa-sdk/models/recipient_list_response.rb +206 -0
- data/lib/bitpesa-sdk/models/recipient_request.rb +195 -0
- data/lib/bitpesa-sdk/models/recipient_response.rb +195 -0
- data/lib/bitpesa-sdk/models/recipient_state.rb +46 -0
- data/lib/bitpesa-sdk/models/recipient_webhook.rb +237 -0
- data/lib/bitpesa-sdk/models/sender.rb +513 -0
- data/lib/bitpesa-sdk/models/sender_list_response.rb +206 -0
- data/lib/bitpesa-sdk/models/sender_request.rb +195 -0
- data/lib/bitpesa-sdk/models/sender_response.rb +195 -0
- data/lib/bitpesa-sdk/models/sender_state.rb +42 -0
- data/lib/bitpesa-sdk/models/sender_webhook.rb +237 -0
- data/lib/bitpesa-sdk/models/transaction.rb +354 -0
- data/lib/bitpesa-sdk/models/transaction_list_response.rb +206 -0
- data/lib/bitpesa-sdk/models/transaction_request.rb +195 -0
- data/lib/bitpesa-sdk/models/transaction_response.rb +195 -0
- data/lib/bitpesa-sdk/models/transaction_state.rb +46 -0
- data/lib/bitpesa-sdk/models/transaction_traits.rb +207 -0
- data/lib/bitpesa-sdk/models/transaction_webhook.rb +237 -0
- data/lib/bitpesa-sdk/models/validation_error_description.rb +197 -0
- data/lib/bitpesa-sdk/models/webhook.rb +232 -0
- data/lib/bitpesa-sdk/models/webhook_definition.rb +250 -0
- data/lib/bitpesa-sdk/models/webhook_definition_event_list_response.rb +197 -0
- data/lib/bitpesa-sdk/models/webhook_definition_list_response.rb +206 -0
- data/lib/bitpesa-sdk/models/webhook_definition_request.rb +195 -0
- data/lib/bitpesa-sdk/models/webhook_definition_response.rb +195 -0
- data/lib/bitpesa-sdk/models/webhook_log.rb +243 -0
- data/lib/bitpesa-sdk/models/webhook_log_list_response.rb +207 -0
- data/lib/bitpesa-sdk/models/webhook_log_metadata.rb +283 -0
- data/lib/bitpesa-sdk/models/webhook_log_metadata_request.rb +218 -0
- data/lib/bitpesa-sdk/models/webhook_log_metadata_response.rb +219 -0
- data/lib/bitpesa-sdk/models/webhook_log_response.rb +195 -0
- data/lib/bitpesa-sdk/version.rb +15 -0
- data/lib/bitpesa-sdk.rb +142 -0
- data/spec/api/account_debits_api_spec.rb +70 -0
- data/spec/api/account_validation_api_spec.rb +47 -0
- data/spec/api/accounts_api_spec.rb +58 -0
- data/spec/api/api_logs_api_spec.rb +58 -0
- data/spec/api/currency_info_api_spec.rb +68 -0
- data/spec/api/documents_api_spec.rb +70 -0
- data/spec/api/logs_api_spec.rb +58 -0
- data/spec/api/payment_methods_api_spec.rb +57 -0
- data/spec/api/payout_methods_api_spec.rb +58 -0
- data/spec/api/recipients_api_spec.rb +74 -0
- data/spec/api/senders_api_spec.rb +95 -0
- data/spec/api/transaction_requests_api_spec.rb +76 -0
- data/spec/api/transactions_api_spec.rb +96 -0
- data/spec/api/webhooks_api_spec.rb +95 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/account_base_spec.rb +48 -0
- data/spec/models/account_list_response_spec.rb +47 -0
- data/spec/models/account_meta_spec.rb +42 -0
- data/spec/models/account_response_spec.rb +47 -0
- data/spec/models/account_spec.rb +47 -0
- data/spec/models/account_validation_error_spec.rb +41 -0
- data/spec/models/account_validation_request_spec.rb +77 -0
- data/spec/models/account_validation_response_spec.rb +47 -0
- data/spec/models/account_validation_result_spec.rb +41 -0
- data/spec/models/api_log_base_spec.rb +90 -0
- data/spec/models/api_log_list_response_spec.rb +47 -0
- data/spec/models/api_log_response_spec.rb +41 -0
- data/spec/models/api_log_spec.rb +90 -0
- data/spec/models/body_spec.rb +58 -0
- data/spec/models/currency_base_spec.rb +84 -0
- data/spec/models/currency_exchange_list_response_spec.rb +41 -0
- data/spec/models/currency_exchange_spec.rb +101 -0
- data/spec/models/currency_list_response_spec.rb +41 -0
- data/spec/models/currency_opposite_spec.rb +101 -0
- data/spec/models/currency_spec.rb +84 -0
- data/spec/models/debit_base_spec.rb +66 -0
- data/spec/models/debit_error_response_spec.rb +72 -0
- data/spec/models/debit_list_request_spec.rb +41 -0
- data/spec/models/debit_list_response_spec.rb +47 -0
- data/spec/models/debit_request_spec.rb +66 -0
- data/spec/models/debit_request_wrapper_spec.rb +41 -0
- data/spec/models/debit_response_spec.rb +41 -0
- data/spec/models/debit_spec.rb +66 -0
- data/spec/models/debit_valid_response_spec.rb +72 -0
- data/spec/models/default_document_spec.rb +94 -0
- data/spec/models/default_recipient_spec.rb +60 -0
- data/spec/models/default_sender_spec.rb +142 -0
- data/spec/models/default_webhook_spec.rb +60 -0
- data/spec/models/document_base_spec.rb +88 -0
- data/spec/models/document_error_response_spec.rb +94 -0
- data/spec/models/document_list_response_spec.rb +47 -0
- data/spec/models/document_request_spec.rb +88 -0
- data/spec/models/document_response_spec.rb +41 -0
- data/spec/models/document_spec.rb +36 -0
- data/spec/models/document_valid_response_spec.rb +94 -0
- data/spec/models/document_webhook_spec.rb +53 -0
- data/spec/models/error_status_spec.rb +47 -0
- data/spec/models/field_description_spec.rb +51 -0
- data/spec/models/field_select_validation_spec.rb +47 -0
- data/spec/models/field_validation_spec.rb +53 -0
- data/spec/models/full_invalid_transaction_request_spec.rb +78 -0
- data/spec/models/full_invalid_transaction_spec.rb +66 -0
- data/spec/models/full_valid_transaction_request_spec.rb +66 -0
- data/spec/models/full_valid_transaction_spec.rb +60 -0
- data/spec/models/inline_response_200_10_spec.rb +42 -0
- data/spec/models/inline_response_200_11_spec.rb +48 -0
- data/spec/models/inline_response_200_12_spec.rb +42 -0
- data/spec/models/inline_response_200_13_spec.rb +48 -0
- data/spec/models/inline_response_200_14_spec.rb +42 -0
- data/spec/models/inline_response_200_15_spec.rb +48 -0
- data/spec/models/inline_response_200_16_spec.rb +48 -0
- data/spec/models/inline_response_200_17_spec.rb +48 -0
- data/spec/models/inline_response_200_18_spec.rb +42 -0
- data/spec/models/inline_response_200_19_spec.rb +48 -0
- data/spec/models/inline_response_200_1_spec.rb +48 -0
- data/spec/models/inline_response_200_20_spec.rb +42 -0
- data/spec/models/inline_response_200_21_object_spec.rb +42 -0
- data/spec/models/inline_response_200_21_spec.rb +42 -0
- data/spec/models/inline_response_200_22_object_spec.rb +42 -0
- data/spec/models/inline_response_200_22_spec.rb +42 -0
- data/spec/models/inline_response_200_23_object_spec.rb +42 -0
- data/spec/models/inline_response_200_23_spec.rb +48 -0
- data/spec/models/inline_response_200_24_spec.rb +42 -0
- data/spec/models/inline_response_200_25_spec.rb +42 -0
- data/spec/models/inline_response_200_26_spec.rb +42 -0
- data/spec/models/inline_response_200_27_spec.rb +48 -0
- data/spec/models/inline_response_200_28_spec.rb +42 -0
- data/spec/models/inline_response_200_29_spec.rb +48 -0
- data/spec/models/inline_response_200_2_object_spec.rb +42 -0
- data/spec/models/inline_response_200_2_spec.rb +42 -0
- data/spec/models/inline_response_200_30_spec.rb +42 -0
- data/spec/models/inline_response_200_31_spec.rb +48 -0
- data/spec/models/inline_response_200_32_spec.rb +42 -0
- data/spec/models/inline_response_200_33_spec.rb +48 -0
- data/spec/models/inline_response_200_34_spec.rb +42 -0
- data/spec/models/inline_response_200_35_spec.rb +48 -0
- data/spec/models/inline_response_200_36_spec.rb +48 -0
- data/spec/models/inline_response_200_37_spec.rb +48 -0
- data/spec/models/inline_response_200_38_spec.rb +42 -0
- data/spec/models/inline_response_200_39_spec.rb +48 -0
- data/spec/models/inline_response_200_3_spec.rb +48 -0
- data/spec/models/inline_response_200_40_spec.rb +42 -0
- data/spec/models/inline_response_200_4_object_spec.rb +42 -0
- data/spec/models/inline_response_200_4_spec.rb +42 -0
- data/spec/models/inline_response_200_5_spec.rb +42 -0
- data/spec/models/inline_response_200_6_spec.rb +42 -0
- data/spec/models/inline_response_200_7_spec.rb +48 -0
- data/spec/models/inline_response_200_8_spec.rb +42 -0
- data/spec/models/inline_response_200_9_spec.rb +48 -0
- data/spec/models/inline_response_200_spec.rb +48 -0
- data/spec/models/inline_response_201_10_spec.rb +42 -0
- data/spec/models/inline_response_201_11_spec.rb +42 -0
- data/spec/models/inline_response_201_1_spec.rb +42 -0
- data/spec/models/inline_response_201_2_spec.rb +42 -0
- data/spec/models/inline_response_201_3_spec.rb +42 -0
- data/spec/models/inline_response_201_4_spec.rb +42 -0
- data/spec/models/inline_response_201_5_spec.rb +42 -0
- data/spec/models/inline_response_201_6_spec.rb +42 -0
- data/spec/models/inline_response_201_7_spec.rb +42 -0
- data/spec/models/inline_response_201_8_spec.rb +42 -0
- data/spec/models/inline_response_201_9_spec.rb +42 -0
- data/spec/models/inline_response_201_spec.rb +42 -0
- data/spec/models/inline_response_400_1_spec.rb +48 -0
- data/spec/models/inline_response_400_spec.rb +48 -0
- data/spec/models/inline_response_422_10_spec.rb +42 -0
- data/spec/models/inline_response_422_11_spec.rb +42 -0
- data/spec/models/inline_response_422_12_spec.rb +42 -0
- data/spec/models/inline_response_422_13_spec.rb +42 -0
- data/spec/models/inline_response_422_14_spec.rb +42 -0
- data/spec/models/inline_response_422_1_meta_spec.rb +42 -0
- data/spec/models/inline_response_422_1_object_spec.rb +42 -0
- data/spec/models/inline_response_422_1_spec.rb +42 -0
- data/spec/models/inline_response_422_2_spec.rb +42 -0
- data/spec/models/inline_response_422_3_spec.rb +42 -0
- data/spec/models/inline_response_422_4_spec.rb +42 -0
- data/spec/models/inline_response_422_5_spec.rb +42 -0
- data/spec/models/inline_response_422_6_spec.rb +42 -0
- data/spec/models/inline_response_422_7_meta_spec.rb +42 -0
- data/spec/models/inline_response_422_7_spec.rb +42 -0
- data/spec/models/inline_response_422_8_meta_spec.rb +42 -0
- data/spec/models/inline_response_422_8_object_spec.rb +42 -0
- data/spec/models/inline_response_422_8_spec.rb +48 -0
- data/spec/models/inline_response_422_9_spec.rb +42 -0
- data/spec/models/inline_response_422_meta_spec.rb +42 -0
- data/spec/models/inline_response_422_object_spec.rb +42 -0
- data/spec/models/inline_response_422_spec.rb +48 -0
- data/spec/models/invalid_debit_spec.rb +78 -0
- data/spec/models/invalid_document_spec.rb +100 -0
- data/spec/models/invalid_recipient_spec.rb +66 -0
- data/spec/models/invalid_sender_spec.rb +148 -0
- data/spec/models/invalid_webhook_spec.rb +60 -0
- data/spec/models/meta_2_pagination_spec.rb +66 -0
- data/spec/models/meta_2_spec.rb +42 -0
- data/spec/models/meta_pagination_spec.rb +66 -0
- data/spec/models/meta_spec.rb +42 -0
- data/spec/models/object_spec.rb +48 -0
- data/spec/models/opposite_payment_method_base_spec.rb +72 -0
- data/spec/models/opposite_payment_method_spec.rb +72 -0
- data/spec/models/pagination_meta_spec.rb +41 -0
- data/spec/models/pagination_pagination_spec.rb +66 -0
- data/spec/models/pagination_spec.rb +42 -0
- data/spec/models/payin_method_base_spec.rb +66 -0
- data/spec/models/payin_method_details_base_spec.rb +36 -0
- data/spec/models/payin_method_details_mobile_spec.rb +48 -0
- data/spec/models/payin_method_details_ngn_bank_spec.rb +42 -0
- data/spec/models/payin_method_details_spec.rb +53 -0
- data/spec/models/payin_method_request_spec.rb +41 -0
- data/spec/models/payin_method_spec.rb +65 -0
- data/spec/models/payin_method_type_base_spec.rb +42 -0
- data/spec/models/payin_method_type_spec.rb +42 -0
- data/spec/models/payment_method_base_spec.rb +66 -0
- data/spec/models/payment_method_list_response_spec.rb +41 -0
- data/spec/models/payment_method_opposite_spec.rb +77 -0
- data/spec/models/payment_method_spec.rb +66 -0
- data/spec/models/payout_method_bank_account_type_enum_spec.rb +35 -0
- data/spec/models/payout_method_base_spec.rb +54 -0
- data/spec/models/payout_method_details_balance_spec.rb +42 -0
- data/spec/models/payout_method_details_base_spec.rb +36 -0
- data/spec/models/payout_method_details_ghs_bank_spec.rb +60 -0
- data/spec/models/payout_method_details_iban_spec.rb +66 -0
- data/spec/models/payout_method_details_mad_cash_spec.rb +110 -0
- data/spec/models/payout_method_details_mobile_spec.rb +54 -0
- data/spec/models/payout_method_details_ngn_bank_spec.rb +70 -0
- data/spec/models/payout_method_details_spec.rb +149 -0
- data/spec/models/payout_method_details_xof_mobile_spec.rb +64 -0
- data/spec/models/payout_method_error_response_spec.rb +60 -0
- data/spec/models/payout_method_gender_enum_spec.rb +35 -0
- data/spec/models/payout_method_identity_card_type_enum_spec.rb +35 -0
- data/spec/models/payout_method_list_response_spec.rb +47 -0
- data/spec/models/payout_method_mobile_provider_enum_spec.rb +35 -0
- data/spec/models/payout_method_request_spec.rb +54 -0
- data/spec/models/payout_method_response_spec.rb +54 -0
- data/spec/models/payout_method_spec.rb +72 -0
- data/spec/models/payout_method_valid_response_spec.rb +60 -0
- data/spec/models/payout_method_webhook_spec.rb +53 -0
- data/spec/models/recipient_base_spec.rb +54 -0
- data/spec/models/recipient_error_response_spec.rb +60 -0
- data/spec/models/recipient_list_response_spec.rb +47 -0
- data/spec/models/recipient_request_spec.rb +60 -0
- data/spec/models/recipient_response_spec.rb +138 -0
- data/spec/models/recipient_spec.rb +36 -0
- data/spec/models/recipient_state_spec.rb +35 -0
- data/spec/models/recipient_valid_response_spec.rb +60 -0
- data/spec/models/recipient_webhook_spec.rb +53 -0
- data/spec/models/sender_base_spec.rb +136 -0
- data/spec/models/sender_error_response_spec.rb +142 -0
- data/spec/models/sender_existing_request_spec.rb +42 -0
- data/spec/models/sender_full_request_spec.rb +136 -0
- data/spec/models/sender_list_response_spec.rb +47 -0
- data/spec/models/sender_request_spec.rb +136 -0
- data/spec/models/sender_response_spec.rb +142 -0
- data/spec/models/sender_spec.rb +36 -0
- data/spec/models/sender_state_spec.rb +35 -0
- data/spec/models/sender_valid_response_spec.rb +142 -0
- data/spec/models/sender_webhook_spec.rb +53 -0
- data/spec/models/transaction_base_spec.rb +60 -0
- data/spec/models/transaction_error_response_spec.rb +66 -0
- data/spec/models/transaction_list_response_spec.rb +47 -0
- data/spec/models/transaction_request_base_spec.rb +48 -0
- data/spec/models/transaction_request_error_response_spec.rb +54 -0
- data/spec/models/transaction_request_request_spec.rb +48 -0
- data/spec/models/transaction_request_spec.rb +48 -0
- data/spec/models/transaction_request_valid_response_spec.rb +54 -0
- data/spec/models/transaction_response_spec.rb +114 -0
- data/spec/models/transaction_spec.rb +60 -0
- data/spec/models/transaction_state_spec.rb +35 -0
- data/spec/models/transaction_traits_spec.rb +48 -0
- data/spec/models/transaction_valid_response_spec.rb +66 -0
- data/spec/models/transaction_webhook_spec.rb +53 -0
- data/spec/models/valid_debit_spec.rb +90 -0
- data/spec/models/validation_error_description_spec.rb +41 -0
- data/spec/models/webhook_base_spec.rb +54 -0
- data/spec/models/webhook_definition_base_spec.rb +54 -0
- data/spec/models/webhook_definition_error_response_spec.rb +60 -0
- data/spec/models/webhook_definition_event_list_response_spec.rb +41 -0
- data/spec/models/webhook_definition_list_response_spec.rb +47 -0
- data/spec/models/webhook_definition_request_spec.rb +54 -0
- data/spec/models/webhook_definition_response_spec.rb +41 -0
- data/spec/models/webhook_definition_spec.rb +65 -0
- data/spec/models/webhook_definition_valid_response_spec.rb +60 -0
- data/spec/models/webhook_error_response_spec.rb +60 -0
- data/spec/models/webhook_log_base_metadata_params_spec.rb +42 -0
- data/spec/models/webhook_log_base_metadata_request_spec.rb +54 -0
- data/spec/models/webhook_log_base_metadata_response_spec.rb +54 -0
- data/spec/models/webhook_log_base_metadata_spec.rb +96 -0
- data/spec/models/webhook_log_base_spec.rb +72 -0
- data/spec/models/webhook_log_list_response_spec.rb +47 -0
- data/spec/models/webhook_log_metadata_params_spec.rb +42 -0
- data/spec/models/webhook_log_metadata_request_spec.rb +54 -0
- data/spec/models/webhook_log_metadata_response_spec.rb +54 -0
- data/spec/models/webhook_log_metadata_spec.rb +96 -0
- data/spec/models/webhook_log_response_spec.rb +41 -0
- data/spec/models/webhook_log_spec.rb +72 -0
- data/spec/models/webhook_request_spec.rb +54 -0
- data/spec/models/webhook_spec.rb +54 -0
- data/spec/models/webhook_valid_response_spec.rb +60 -0
- data/spec/spec_helper.rb +111 -0
- metadata +1127 -0
@@ -0,0 +1,195 @@
|
|
1
|
+
=begin
|
2
|
+
#BitPesa API
|
3
|
+
|
4
|
+
#Reference documentation for the BitPesa API V1
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.0-beta2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module Bitpesa
|
16
|
+
class WebhookDefinitionResponse
|
17
|
+
attr_accessor :object
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
:'object' => :'object'
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Attribute type mapping.
|
27
|
+
def self.openapi_types
|
28
|
+
{
|
29
|
+
:'object' => :'WebhookDefinition'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Initializes the object
|
34
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
35
|
+
def initialize(attributes = {})
|
36
|
+
return unless attributes.is_a?(Hash)
|
37
|
+
|
38
|
+
# convert string to symbol for hash key
|
39
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
40
|
+
|
41
|
+
if attributes.has_key?(:'object')
|
42
|
+
self.object = attributes[:'object']
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
47
|
+
# @return Array for valid properties with the reasons
|
48
|
+
def list_invalid_properties
|
49
|
+
invalid_properties = Array.new
|
50
|
+
invalid_properties
|
51
|
+
end
|
52
|
+
|
53
|
+
# Check to see if the all the properties in the model are valid
|
54
|
+
# @return true if the model is valid
|
55
|
+
def valid?
|
56
|
+
true
|
57
|
+
end
|
58
|
+
|
59
|
+
# Checks equality by comparing each attribute.
|
60
|
+
# @param [Object] Object to be compared
|
61
|
+
def ==(o)
|
62
|
+
return true if self.equal?(o)
|
63
|
+
self.class == o.class &&
|
64
|
+
object == o.object
|
65
|
+
end
|
66
|
+
|
67
|
+
# @see the `==` method
|
68
|
+
# @param [Object] Object to be compared
|
69
|
+
def eql?(o)
|
70
|
+
self == o
|
71
|
+
end
|
72
|
+
|
73
|
+
# Calculates hash code according to all attributes.
|
74
|
+
# @return [Fixnum] Hash code
|
75
|
+
def hash
|
76
|
+
[object].hash
|
77
|
+
end
|
78
|
+
|
79
|
+
require 'active_support/core_ext/hash'
|
80
|
+
require 'active_support/hash_with_indifferent_access.rb'
|
81
|
+
# Builds the object from hash
|
82
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
83
|
+
# @return [Object] Returns the model itself
|
84
|
+
def build_from_hash(attributes)
|
85
|
+
return nil unless attributes.is_a?(Hash)
|
86
|
+
self.class.openapi_types.each_pair do |key, type|
|
87
|
+
if type =~ /\AArray<(.*)>/i
|
88
|
+
# check to ensure the input is an array given that the the attribute
|
89
|
+
# is documented as an array but the input is not
|
90
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
91
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
92
|
+
end
|
93
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
94
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
95
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
96
|
+
end
|
97
|
+
|
98
|
+
self
|
99
|
+
end
|
100
|
+
|
101
|
+
# Deserializes the data based on type
|
102
|
+
# @param string type Data type
|
103
|
+
# @param string value Value to be deserialized
|
104
|
+
# @return [Object] Deserialized data
|
105
|
+
def _deserialize(type, value)
|
106
|
+
case type.to_sym
|
107
|
+
when :DateTime
|
108
|
+
DateTime.parse(value)
|
109
|
+
when :Date
|
110
|
+
Date.parse(value)
|
111
|
+
when :String
|
112
|
+
value.to_s
|
113
|
+
when :Integer
|
114
|
+
value.to_i
|
115
|
+
when :Float
|
116
|
+
value.to_f
|
117
|
+
when :BOOLEAN
|
118
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
119
|
+
true
|
120
|
+
else
|
121
|
+
false
|
122
|
+
end
|
123
|
+
when :Object
|
124
|
+
# generic object (usually a Hash), return directly
|
125
|
+
value
|
126
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
127
|
+
inner_type = Regexp.last_match[:inner_type]
|
128
|
+
value.map { |v| _deserialize(inner_type, v) }
|
129
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
130
|
+
k_type = Regexp.last_match[:k_type]
|
131
|
+
v_type = Regexp.last_match[:v_type]
|
132
|
+
{}.tap do |hash|
|
133
|
+
value.each do |k, v|
|
134
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
135
|
+
end
|
136
|
+
end
|
137
|
+
else # model
|
138
|
+
temp_model = Bitpesa.const_get(type).new
|
139
|
+
temp_model.build_from_hash(value)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
# Returns the string representation of the object
|
144
|
+
# @return [String] String presentation of the object
|
145
|
+
def to_s
|
146
|
+
to_hash.to_s
|
147
|
+
end
|
148
|
+
|
149
|
+
# to_body is an alias to to_hash (backward compatibility)
|
150
|
+
# @return [Hash] Returns the object in the form of hash
|
151
|
+
def to_body
|
152
|
+
to_hash
|
153
|
+
end
|
154
|
+
|
155
|
+
# Returns the object in the form of hash
|
156
|
+
# @return [Hash] Returns the object in the form of hash
|
157
|
+
def to_hash
|
158
|
+
hash = {}
|
159
|
+
self.class.attribute_map.each_pair do |attr, param|
|
160
|
+
value = self.send(attr)
|
161
|
+
next if value.nil?
|
162
|
+
hash[param] = _to_hash(value)
|
163
|
+
end
|
164
|
+
::ActiveSupport::HashWithIndifferentAccess.new(hash)
|
165
|
+
end
|
166
|
+
|
167
|
+
def [](key)
|
168
|
+
to_hash[key]
|
169
|
+
end
|
170
|
+
|
171
|
+
def dig(*args)
|
172
|
+
to_hash.dig(*args)
|
173
|
+
end
|
174
|
+
|
175
|
+
# Outputs non-array value in the form of hash
|
176
|
+
# For object, use to_hash. Otherwise, just return the value
|
177
|
+
# @param [Object] value Any valid value
|
178
|
+
# @return [Hash] Returns the value in the form of hash
|
179
|
+
def _to_hash(value)
|
180
|
+
if value.is_a?(Array)
|
181
|
+
value.compact.map { |v| _to_hash(v) }
|
182
|
+
elsif value.is_a?(Hash)
|
183
|
+
{}.tap do |hash|
|
184
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
185
|
+
end
|
186
|
+
elsif value.respond_to? :to_hash
|
187
|
+
value.to_hash
|
188
|
+
else
|
189
|
+
value
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
end
|
194
|
+
|
195
|
+
end
|
@@ -0,0 +1,243 @@
|
|
1
|
+
=begin
|
2
|
+
#BitPesa API
|
3
|
+
|
4
|
+
#Reference documentation for the BitPesa API V1
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.0-beta2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module Bitpesa
|
16
|
+
class WebhookLog
|
17
|
+
# ID of the webhook log
|
18
|
+
attr_accessor :id
|
19
|
+
|
20
|
+
# Message detailing webhook event
|
21
|
+
attr_accessor :message
|
22
|
+
|
23
|
+
attr_accessor :metadata
|
24
|
+
|
25
|
+
# Date and time of response
|
26
|
+
attr_accessor :created_at
|
27
|
+
|
28
|
+
attr_accessor :parent_id
|
29
|
+
|
30
|
+
attr_accessor :parent_type
|
31
|
+
|
32
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
33
|
+
def self.attribute_map
|
34
|
+
{
|
35
|
+
:'id' => :'id',
|
36
|
+
:'message' => :'message',
|
37
|
+
:'metadata' => :'metadata',
|
38
|
+
:'created_at' => :'created_at',
|
39
|
+
:'parent_id' => :'parent_id',
|
40
|
+
:'parent_type' => :'parent_type'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# Attribute type mapping.
|
45
|
+
def self.openapi_types
|
46
|
+
{
|
47
|
+
:'id' => :'String',
|
48
|
+
:'message' => :'String',
|
49
|
+
:'metadata' => :'WebhookLogMetadata',
|
50
|
+
:'created_at' => :'String',
|
51
|
+
:'parent_id' => :'String',
|
52
|
+
:'parent_type' => :'String'
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
# Initializes the object
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
58
|
+
def initialize(attributes = {})
|
59
|
+
return unless attributes.is_a?(Hash)
|
60
|
+
|
61
|
+
# convert string to symbol for hash key
|
62
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
63
|
+
|
64
|
+
if attributes.has_key?(:'id')
|
65
|
+
self.id = attributes[:'id']
|
66
|
+
end
|
67
|
+
|
68
|
+
if attributes.has_key?(:'message')
|
69
|
+
self.message = attributes[:'message']
|
70
|
+
end
|
71
|
+
|
72
|
+
if attributes.has_key?(:'metadata')
|
73
|
+
self.metadata = attributes[:'metadata']
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes.has_key?(:'created_at')
|
77
|
+
self.created_at = attributes[:'created_at']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.has_key?(:'parent_id')
|
81
|
+
self.parent_id = attributes[:'parent_id']
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.has_key?(:'parent_type')
|
85
|
+
self.parent_type = attributes[:'parent_type']
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
90
|
+
# @return Array for valid properties with the reasons
|
91
|
+
def list_invalid_properties
|
92
|
+
invalid_properties = Array.new
|
93
|
+
invalid_properties
|
94
|
+
end
|
95
|
+
|
96
|
+
# Check to see if the all the properties in the model are valid
|
97
|
+
# @return true if the model is valid
|
98
|
+
def valid?
|
99
|
+
true
|
100
|
+
end
|
101
|
+
|
102
|
+
# Checks equality by comparing each attribute.
|
103
|
+
# @param [Object] Object to be compared
|
104
|
+
def ==(o)
|
105
|
+
return true if self.equal?(o)
|
106
|
+
self.class == o.class &&
|
107
|
+
id == o.id &&
|
108
|
+
message == o.message &&
|
109
|
+
metadata == o.metadata &&
|
110
|
+
created_at == o.created_at &&
|
111
|
+
parent_id == o.parent_id &&
|
112
|
+
parent_type == o.parent_type
|
113
|
+
end
|
114
|
+
|
115
|
+
# @see the `==` method
|
116
|
+
# @param [Object] Object to be compared
|
117
|
+
def eql?(o)
|
118
|
+
self == o
|
119
|
+
end
|
120
|
+
|
121
|
+
# Calculates hash code according to all attributes.
|
122
|
+
# @return [Fixnum] Hash code
|
123
|
+
def hash
|
124
|
+
[id, message, metadata, created_at, parent_id, parent_type].hash
|
125
|
+
end
|
126
|
+
|
127
|
+
require 'active_support/core_ext/hash'
|
128
|
+
require 'active_support/hash_with_indifferent_access.rb'
|
129
|
+
# Builds the object from hash
|
130
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
131
|
+
# @return [Object] Returns the model itself
|
132
|
+
def build_from_hash(attributes)
|
133
|
+
return nil unless attributes.is_a?(Hash)
|
134
|
+
self.class.openapi_types.each_pair do |key, type|
|
135
|
+
if type =~ /\AArray<(.*)>/i
|
136
|
+
# check to ensure the input is an array given that the the attribute
|
137
|
+
# is documented as an array but the input is not
|
138
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
139
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
140
|
+
end
|
141
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
142
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
143
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
144
|
+
end
|
145
|
+
|
146
|
+
self
|
147
|
+
end
|
148
|
+
|
149
|
+
# Deserializes the data based on type
|
150
|
+
# @param string type Data type
|
151
|
+
# @param string value Value to be deserialized
|
152
|
+
# @return [Object] Deserialized data
|
153
|
+
def _deserialize(type, value)
|
154
|
+
case type.to_sym
|
155
|
+
when :DateTime
|
156
|
+
DateTime.parse(value)
|
157
|
+
when :Date
|
158
|
+
Date.parse(value)
|
159
|
+
when :String
|
160
|
+
value.to_s
|
161
|
+
when :Integer
|
162
|
+
value.to_i
|
163
|
+
when :Float
|
164
|
+
value.to_f
|
165
|
+
when :BOOLEAN
|
166
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
167
|
+
true
|
168
|
+
else
|
169
|
+
false
|
170
|
+
end
|
171
|
+
when :Object
|
172
|
+
# generic object (usually a Hash), return directly
|
173
|
+
value
|
174
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
175
|
+
inner_type = Regexp.last_match[:inner_type]
|
176
|
+
value.map { |v| _deserialize(inner_type, v) }
|
177
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
178
|
+
k_type = Regexp.last_match[:k_type]
|
179
|
+
v_type = Regexp.last_match[:v_type]
|
180
|
+
{}.tap do |hash|
|
181
|
+
value.each do |k, v|
|
182
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
else # model
|
186
|
+
temp_model = Bitpesa.const_get(type).new
|
187
|
+
temp_model.build_from_hash(value)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
# Returns the string representation of the object
|
192
|
+
# @return [String] String presentation of the object
|
193
|
+
def to_s
|
194
|
+
to_hash.to_s
|
195
|
+
end
|
196
|
+
|
197
|
+
# to_body is an alias to to_hash (backward compatibility)
|
198
|
+
# @return [Hash] Returns the object in the form of hash
|
199
|
+
def to_body
|
200
|
+
to_hash
|
201
|
+
end
|
202
|
+
|
203
|
+
# Returns the object in the form of hash
|
204
|
+
# @return [Hash] Returns the object in the form of hash
|
205
|
+
def to_hash
|
206
|
+
hash = {}
|
207
|
+
self.class.attribute_map.each_pair do |attr, param|
|
208
|
+
value = self.send(attr)
|
209
|
+
next if value.nil?
|
210
|
+
hash[param] = _to_hash(value)
|
211
|
+
end
|
212
|
+
::ActiveSupport::HashWithIndifferentAccess.new(hash)
|
213
|
+
end
|
214
|
+
|
215
|
+
def [](key)
|
216
|
+
to_hash[key]
|
217
|
+
end
|
218
|
+
|
219
|
+
def dig(*args)
|
220
|
+
to_hash.dig(*args)
|
221
|
+
end
|
222
|
+
|
223
|
+
# Outputs non-array value in the form of hash
|
224
|
+
# For object, use to_hash. Otherwise, just return the value
|
225
|
+
# @param [Object] value Any valid value
|
226
|
+
# @return [Hash] Returns the value in the form of hash
|
227
|
+
def _to_hash(value)
|
228
|
+
if value.is_a?(Array)
|
229
|
+
value.compact.map { |v| _to_hash(v) }
|
230
|
+
elsif value.is_a?(Hash)
|
231
|
+
{}.tap do |hash|
|
232
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
233
|
+
end
|
234
|
+
elsif value.respond_to? :to_hash
|
235
|
+
value.to_hash
|
236
|
+
else
|
237
|
+
value
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
end
|
242
|
+
|
243
|
+
end
|
@@ -0,0 +1,207 @@
|
|
1
|
+
=begin
|
2
|
+
#BitPesa API
|
3
|
+
|
4
|
+
#Reference documentation for the BitPesa API V1
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.0.0-beta2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module Bitpesa
|
16
|
+
class WebhookLogListResponse
|
17
|
+
# Array of webhook log objects
|
18
|
+
attr_accessor :object
|
19
|
+
|
20
|
+
attr_accessor :meta
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'object' => :'object',
|
26
|
+
:'meta' => :'meta'
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# Attribute type mapping.
|
31
|
+
def self.openapi_types
|
32
|
+
{
|
33
|
+
:'object' => :'Array<WebhookLog>',
|
34
|
+
:'meta' => :'PaginationMeta'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Initializes the object
|
39
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
40
|
+
def initialize(attributes = {})
|
41
|
+
return unless attributes.is_a?(Hash)
|
42
|
+
|
43
|
+
# convert string to symbol for hash key
|
44
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
45
|
+
|
46
|
+
if attributes.has_key?(:'object')
|
47
|
+
if (value = attributes[:'object']).is_a?(Array)
|
48
|
+
self.object = value
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
if attributes.has_key?(:'meta')
|
53
|
+
self.meta = attributes[:'meta']
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
58
|
+
# @return Array for valid properties with the reasons
|
59
|
+
def list_invalid_properties
|
60
|
+
invalid_properties = Array.new
|
61
|
+
invalid_properties
|
62
|
+
end
|
63
|
+
|
64
|
+
# Check to see if the all the properties in the model are valid
|
65
|
+
# @return true if the model is valid
|
66
|
+
def valid?
|
67
|
+
true
|
68
|
+
end
|
69
|
+
|
70
|
+
# Checks equality by comparing each attribute.
|
71
|
+
# @param [Object] Object to be compared
|
72
|
+
def ==(o)
|
73
|
+
return true if self.equal?(o)
|
74
|
+
self.class == o.class &&
|
75
|
+
object == o.object &&
|
76
|
+
meta == o.meta
|
77
|
+
end
|
78
|
+
|
79
|
+
# @see the `==` method
|
80
|
+
# @param [Object] Object to be compared
|
81
|
+
def eql?(o)
|
82
|
+
self == o
|
83
|
+
end
|
84
|
+
|
85
|
+
# Calculates hash code according to all attributes.
|
86
|
+
# @return [Fixnum] Hash code
|
87
|
+
def hash
|
88
|
+
[object, meta].hash
|
89
|
+
end
|
90
|
+
|
91
|
+
require 'active_support/core_ext/hash'
|
92
|
+
require 'active_support/hash_with_indifferent_access.rb'
|
93
|
+
# Builds the object from hash
|
94
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
95
|
+
# @return [Object] Returns the model itself
|
96
|
+
def build_from_hash(attributes)
|
97
|
+
return nil unless attributes.is_a?(Hash)
|
98
|
+
self.class.openapi_types.each_pair do |key, type|
|
99
|
+
if type =~ /\AArray<(.*)>/i
|
100
|
+
# check to ensure the input is an array given that the the attribute
|
101
|
+
# is documented as an array but the input is not
|
102
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
103
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
104
|
+
end
|
105
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
106
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
107
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
108
|
+
end
|
109
|
+
|
110
|
+
self
|
111
|
+
end
|
112
|
+
|
113
|
+
# Deserializes the data based on type
|
114
|
+
# @param string type Data type
|
115
|
+
# @param string value Value to be deserialized
|
116
|
+
# @return [Object] Deserialized data
|
117
|
+
def _deserialize(type, value)
|
118
|
+
case type.to_sym
|
119
|
+
when :DateTime
|
120
|
+
DateTime.parse(value)
|
121
|
+
when :Date
|
122
|
+
Date.parse(value)
|
123
|
+
when :String
|
124
|
+
value.to_s
|
125
|
+
when :Integer
|
126
|
+
value.to_i
|
127
|
+
when :Float
|
128
|
+
value.to_f
|
129
|
+
when :BOOLEAN
|
130
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
131
|
+
true
|
132
|
+
else
|
133
|
+
false
|
134
|
+
end
|
135
|
+
when :Object
|
136
|
+
# generic object (usually a Hash), return directly
|
137
|
+
value
|
138
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
139
|
+
inner_type = Regexp.last_match[:inner_type]
|
140
|
+
value.map { |v| _deserialize(inner_type, v) }
|
141
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
142
|
+
k_type = Regexp.last_match[:k_type]
|
143
|
+
v_type = Regexp.last_match[:v_type]
|
144
|
+
{}.tap do |hash|
|
145
|
+
value.each do |k, v|
|
146
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
147
|
+
end
|
148
|
+
end
|
149
|
+
else # model
|
150
|
+
temp_model = Bitpesa.const_get(type).new
|
151
|
+
temp_model.build_from_hash(value)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
# Returns the string representation of the object
|
156
|
+
# @return [String] String presentation of the object
|
157
|
+
def to_s
|
158
|
+
to_hash.to_s
|
159
|
+
end
|
160
|
+
|
161
|
+
# to_body is an alias to to_hash (backward compatibility)
|
162
|
+
# @return [Hash] Returns the object in the form of hash
|
163
|
+
def to_body
|
164
|
+
to_hash
|
165
|
+
end
|
166
|
+
|
167
|
+
# Returns the object in the form of hash
|
168
|
+
# @return [Hash] Returns the object in the form of hash
|
169
|
+
def to_hash
|
170
|
+
hash = {}
|
171
|
+
self.class.attribute_map.each_pair do |attr, param|
|
172
|
+
value = self.send(attr)
|
173
|
+
next if value.nil?
|
174
|
+
hash[param] = _to_hash(value)
|
175
|
+
end
|
176
|
+
::ActiveSupport::HashWithIndifferentAccess.new(hash)
|
177
|
+
end
|
178
|
+
|
179
|
+
def [](key)
|
180
|
+
to_hash[key]
|
181
|
+
end
|
182
|
+
|
183
|
+
def dig(*args)
|
184
|
+
to_hash.dig(*args)
|
185
|
+
end
|
186
|
+
|
187
|
+
# Outputs non-array value in the form of hash
|
188
|
+
# For object, use to_hash. Otherwise, just return the value
|
189
|
+
# @param [Object] value Any valid value
|
190
|
+
# @return [Hash] Returns the value in the form of hash
|
191
|
+
def _to_hash(value)
|
192
|
+
if value.is_a?(Array)
|
193
|
+
value.compact.map { |v| _to_hash(v) }
|
194
|
+
elsif value.is_a?(Hash)
|
195
|
+
{}.tap do |hash|
|
196
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
197
|
+
end
|
198
|
+
elsif value.respond_to? :to_hash
|
199
|
+
value.to_hash
|
200
|
+
else
|
201
|
+
value
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
end
|
206
|
+
|
207
|
+
end
|