From 3fe2bd1705038306ee5f3c7facfc76184b181c38 Mon Sep 17 00:00:00 2001 From: Kervin Christianata Date: Mon, 23 Oct 2023 15:04:10 +0700 Subject: [PATCH 1/2] Doitpay Go SDK --- .gitignore | 29 + .openapi-generator-ignore | 23 + .openapi-generator/FILES | 69 ++ .openapi-generator/VERSION | 1 + LICENSE | 222 +---- README.md | 436 ++++++++- balance/api_balance.go | 131 +++ balance/model_balance.go | 161 ++++ balance/model_balance_standard_meta.go | 161 ++++ balance/model_balance_standard_response.go | 269 ++++++ client.go | 487 ++++++++++ common/common.go | 138 +++ configuration.go | 217 +++++ ...bControllersMerchantApiv1BalanceBalance.md | 82 ++ ...rollersMerchantApiv1BalanceStandardMeta.md | 82 ++ ...ersMerchantApiv1BalanceStandardResponse.md | 160 ++++ docs/balance/PublicBalanceAPI.md | 70 ++ ...ControllersMerchantApiv1InvoiceCustomer.md | 264 ++++++ ...rchantApiv1InvoiceInvoiceDetailResponse.md | 446 +++++++++ ...llersMerchantApiv1InvoiceInvoiceRequest.md | 342 +++++++ ...lWebControllersMerchantApiv1InvoiceItem.md | 160 ++++ ...ollersMerchantApiv1InvoicePaymentMethod.md | 108 +++ ...trollersMerchantApiv1InvoiceRedirectURL.md | 82 ++ ...rollersMerchantApiv1InvoiceStandardMeta.md | 82 ++ ...tApiv1InvoiceStandardMetaWithPagination.md | 108 +++ ...iv1InvoiceStandardPaymentMethodResponse.md | 160 ++++ ...ersMerchantApiv1InvoiceStandardResponse.md | 160 ++++ ...v1InvoiceStandardResponseWithPagination.md | 160 ++++ docs/invoice/PublicInvoiceAPI.md | 503 ++++++++++ ...ersMerchantApiv1SimulateSimulateRequest.md | 82 ++ docs/simulate/PublicSimulateAPI.md | 73 ++ ...rtualaccountCreateVirtualAccountRequest.md | 368 ++++++++ ...MerchantApiv1VirtualaccountStandardMeta.md | 82 ++ ...irtualaccountStandardMetaWithPagination.md | 108 +++ ...hantApiv1VirtualaccountStandardResponse.md | 160 ++++ ...alaccountStandardResponseWithPagination.md | 160 ++++ ...iv1VirtualaccountVirtualAccountCustomer.md | 108 +++ ...iv1VirtualaccountVirtualAccountResponse.md | 420 +++++++++ .../virtualaccount/PublicVirtualAccountAPI.md | 288 ++++++ doitpay.go | 2 + go.mod | 18 + go.sum | 369 ++++++++ invoice/api_invoice.go | 872 ++++++++++++++++++ invoice/model_invoice_customer.go | 413 +++++++++ invoice/model_invoice_detail_response.go | 665 +++++++++++++ invoice/model_invoice_item.go | 269 ++++++ invoice/model_invoice_payment_method.go | 197 ++++ invoice/model_invoice_redirect_url.go | 161 ++++ invoice/model_invoice_request.go | 521 +++++++++++ invoice/model_invoice_standard_meta.go | 161 ++++ ...l_invoice_standard_meta_with_pagination.go | 197 ++++ ...nvoice_standard_payment_method_response.go | 269 ++++++ invoice/model_invoice_standard_response.go | 269 ++++++ ...voice_standard_response_with_pagination.go | 269 ++++++ invoice/model_invoice_status.go | 116 +++ invoice/model_render_app_pagination_header.go | 233 +++++ response.go | 46 + simulate/api_simulate.go | 132 +++ simulate/model_simulate_request.go | 161 ++++ test/api_balance_test.go | 41 + test/api_invoice_test.go | 109 +++ test/api_simulate_test.go | 40 + test/api_virtual_account_test.go | 75 ++ utils/helpers.go | 205 ++++ utils/utils.go | 346 +++++++ virtualaccount/api_virtual_account.go | 502 ++++++++++ .../model_render_app_pagination_header.go | 233 +++++ ...laccount_create_virtual_account_request.go | 557 +++++++++++ .../model_virtualaccount_standard_meta.go | 161 ++++ ...alaccount_standard_meta_with_pagination.go | 197 ++++ .../model_virtualaccount_standard_response.go | 269 ++++++ ...count_standard_response_with_pagination.go | 269 ++++++ virtualaccount/model_virtualaccount_status.go | 114 +++ ...virtualaccount_virtual_account_customer.go | 197 ++++ ...virtualaccount_virtual_account_response.go | 629 +++++++++++++ 75 files changed, 16243 insertions(+), 203 deletions(-) create mode 100644 .gitignore create mode 100644 .openapi-generator-ignore create mode 100644 .openapi-generator/FILES create mode 100644 .openapi-generator/VERSION create mode 100644 balance/api_balance.go create mode 100644 balance/model_balance.go create mode 100644 balance/model_balance_standard_meta.go create mode 100644 balance/model_balance_standard_response.go create mode 100644 client.go create mode 100644 common/common.go create mode 100644 configuration.go create mode 100644 docs/balance/InternalWebControllersMerchantApiv1BalanceBalance.md create mode 100644 docs/balance/InternalWebControllersMerchantApiv1BalanceStandardMeta.md create mode 100644 docs/balance/InternalWebControllersMerchantApiv1BalanceStandardResponse.md create mode 100644 docs/balance/PublicBalanceAPI.md create mode 100644 docs/invoice/InternalWebControllersMerchantApiv1InvoiceCustomer.md create mode 100644 docs/invoice/InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse.md create mode 100644 docs/invoice/InternalWebControllersMerchantApiv1InvoiceInvoiceRequest.md create mode 100644 docs/invoice/InternalWebControllersMerchantApiv1InvoiceItem.md create mode 100644 docs/invoice/InternalWebControllersMerchantApiv1InvoicePaymentMethod.md create mode 100644 docs/invoice/InternalWebControllersMerchantApiv1InvoiceRedirectURL.md create mode 100644 docs/invoice/InternalWebControllersMerchantApiv1InvoiceStandardMeta.md create mode 100644 docs/invoice/InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination.md create mode 100644 docs/invoice/InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse.md create mode 100644 docs/invoice/InternalWebControllersMerchantApiv1InvoiceStandardResponse.md create mode 100644 docs/invoice/InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination.md create mode 100644 docs/invoice/PublicInvoiceAPI.md create mode 100644 docs/simulate/InternalWebControllersMerchantApiv1SimulateSimulateRequest.md create mode 100644 docs/simulate/PublicSimulateAPI.md create mode 100644 docs/virtualaccount/InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest.md create mode 100644 docs/virtualaccount/InternalWebControllersMerchantApiv1VirtualaccountStandardMeta.md create mode 100644 docs/virtualaccount/InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination.md create mode 100644 docs/virtualaccount/InternalWebControllersMerchantApiv1VirtualaccountStandardResponse.md create mode 100644 docs/virtualaccount/InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination.md create mode 100644 docs/virtualaccount/InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer.md create mode 100644 docs/virtualaccount/InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse.md create mode 100644 docs/virtualaccount/PublicVirtualAccountAPI.md create mode 100644 doitpay.go create mode 100644 go.mod create mode 100644 go.sum create mode 100644 invoice/api_invoice.go create mode 100644 invoice/model_invoice_customer.go create mode 100644 invoice/model_invoice_detail_response.go create mode 100644 invoice/model_invoice_item.go create mode 100644 invoice/model_invoice_payment_method.go create mode 100644 invoice/model_invoice_redirect_url.go create mode 100644 invoice/model_invoice_request.go create mode 100644 invoice/model_invoice_standard_meta.go create mode 100644 invoice/model_invoice_standard_meta_with_pagination.go create mode 100644 invoice/model_invoice_standard_payment_method_response.go create mode 100644 invoice/model_invoice_standard_response.go create mode 100644 invoice/model_invoice_standard_response_with_pagination.go create mode 100644 invoice/model_invoice_status.go create mode 100644 invoice/model_render_app_pagination_header.go create mode 100644 response.go create mode 100644 simulate/api_simulate.go create mode 100644 simulate/model_simulate_request.go create mode 100644 test/api_balance_test.go create mode 100644 test/api_invoice_test.go create mode 100644 test/api_simulate_test.go create mode 100644 test/api_virtual_account_test.go create mode 100644 utils/helpers.go create mode 100644 utils/utils.go create mode 100644 virtualaccount/api_virtual_account.go create mode 100644 virtualaccount/model_render_app_pagination_header.go create mode 100644 virtualaccount/model_virtualaccount_create_virtual_account_request.go create mode 100644 virtualaccount/model_virtualaccount_standard_meta.go create mode 100644 virtualaccount/model_virtualaccount_standard_meta_with_pagination.go create mode 100644 virtualaccount/model_virtualaccount_standard_response.go create mode 100644 virtualaccount/model_virtualaccount_standard_response_with_pagination.go create mode 100644 virtualaccount/model_virtualaccount_status.go create mode 100644 virtualaccount/model_virtualaccount_virtual_account_customer.go create mode 100644 virtualaccount/model_virtualaccount_virtual_account_response.go diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4e7d83f --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof + +.env +.travis.yml +api +git_push.sh diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /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 0000000..3a11afb --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,69 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +balance/api_balance.go +invoice/api_invoice.go +simulate/api_simulate.go +virtualaccount/api_virtual_account.go +client.go +configuration.go +docs/InternalWebControllersMerchantApiv1BalanceBalance.md +docs/InternalWebControllersMerchantApiv1BalanceStandardMeta.md +docs/InternalWebControllersMerchantApiv1BalanceStandardResponse.md +docs/InternalWebControllersMerchantApiv1InvoiceCustomer.md +docs/InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse.md +docs/InternalWebControllersMerchantApiv1InvoiceInvoiceRequest.md +docs/InternalWebControllersMerchantApiv1InvoiceItem.md +docs/InternalWebControllersMerchantApiv1InvoicePaymentMethod.md +docs/InternalWebControllersMerchantApiv1InvoiceRedirectURL.md +docs/InternalWebControllersMerchantApiv1InvoiceStandardMeta.md +docs/InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination.md +docs/InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse.md +docs/InternalWebControllersMerchantApiv1InvoiceStandardResponse.md +docs/InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination.md +docs/InternalWebControllersMerchantApiv1SimulateSimulateRequest.md +docs/InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest.md +docs/InternalWebControllersMerchantApiv1VirtualaccountStandardMeta.md +docs/InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination.md +docs/InternalWebControllersMerchantApiv1VirtualaccountStandardResponse.md +docs/InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination.md +docs/InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer.md +docs/InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse.md +docs/PublicBalanceAPI.md +docs/PublicInvoiceAPI.md +docs/PublicSimulateAPI.md +docs/PublicVirtualAccountAPI.md +git_push.sh +go.mod +go.sum +model_internal_web_controllers_merchant_apiv1_balance_balance.go +model_internal_web_controllers_merchant_apiv1_balance_standard_meta.go +model_internal_web_controllers_merchant_apiv1_balance_standard_response.go +model_internal_web_controllers_merchant_apiv1_invoice_customer.go +model_internal_web_controllers_merchant_apiv1_invoice_invoice_detail_response.go +model_internal_web_controllers_merchant_apiv1_invoice_invoice_request.go +model_internal_web_controllers_merchant_apiv1_invoice_item.go +model_internal_web_controllers_merchant_apiv1_invoice_payment_method.go +model_internal_web_controllers_merchant_apiv1_invoice_redirect_url.go +model_internal_web_controllers_merchant_apiv1_invoice_standard_meta.go +model_internal_web_controllers_merchant_apiv1_invoice_standard_meta_with_pagination.go +model_internal_web_controllers_merchant_apiv1_invoice_standard_payment_method_response.go +model_internal_web_controllers_merchant_apiv1_invoice_standard_response.go +model_internal_web_controllers_merchant_apiv1_invoice_standard_response_with_pagination.go +model_internal_web_controllers_merchant_apiv1_simulate_simulate_request.go +model_internal_web_controllers_merchant_apiv1_virtualaccount_create_virtual_account_request.go +model_internal_web_controllers_merchant_apiv1_virtualaccount_standard_meta.go +model_internal_web_controllers_merchant_apiv1_virtualaccount_standard_meta_with_pagination.go +model_internal_web_controllers_merchant_apiv1_virtualaccount_standard_response.go +model_internal_web_controllers_merchant_apiv1_virtualaccount_standard_response_with_pagination.go +model_internal_web_controllers_merchant_apiv1_virtualaccount_virtual_account_customer.go +model_internal_web_controllers_merchant_apiv1_virtualaccount_virtual_account_response.go +response.go +test/api_balance_test.go +test/api_invoice_test.go +test/api_simulate_test.go +test/api_virtual_account_test.go +helpers.go +utils.go diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 0000000..73a86b1 --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.0.1 \ No newline at end of file diff --git a/LICENSE b/LICENSE index 261eeb9..73ae8ed 100644 --- a/LICENSE +++ b/LICENSE @@ -1,201 +1,21 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +MIT License + +Copyright (c) 2023 Doitpay + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +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. \ No newline at end of file diff --git a/README.md b/README.md index 8c8551d..9c9853c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,436 @@ -# Doitpay Go SDK +# Go API client for doitpay -The official Doitpay Go SDK provides a simple and convenient way to call Doitpay's REST API in applications written in Go. +This is the payment gateway API server for Doitpay. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen +For more information, please visit [http://doitpay.co.id/support](http://doitpay.co.id/support) + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/oauth2 +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import doitpay "github.com/automotechnologies/doitpay" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), doitpay.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), doitpay.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), doitpay.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), doitpay.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AdminAPI* | [**AdminBusinessInvoiceBusinessIdGet**](docs/AdminAPI.md#adminbusinessinvoicebusinessidget) | **Get** /admin/business/invoice/:business_id | get business detail with teams and users +*AdminAPI* | [**AdminListTransaction**](docs/AdminAPI.md#adminlisttransaction) | **Get** /dashboard/v1/admin/transaction/:businessId | List all created Transaction data by business id +*AdminAPI* | [**AdminUserUserIdDetailGet**](docs/AdminAPI.md#adminuseruseriddetailget) | **Get** /admin/user/{userId}/detail | get user detail by id +*AdminAPI* | [**ApiV1AdminBusinessApprovePost**](docs/AdminAPI.md#apiv1adminbusinessapprovepost) | **Post** /api/v1/admin/business/approve | Approve business document and send approval email to owner +*AdminAPI* | [**ApiV1AdminBusinessBusinessIdGet**](docs/AdminAPI.md#apiv1adminbusinessbusinessidget) | **Get** /api/v1/admin/business/{businessId} | get business detail by id +*AdminAPI* | [**ApiV1AdminBusinessGet**](docs/AdminAPI.md#apiv1adminbusinessget) | **Get** /api/v1/admin/business | fetch list of registration users +*AdminAPI* | [**ApiV1AdminBusinessRejectPost**](docs/AdminAPI.md#apiv1adminbusinessrejectpost) | **Post** /api/v1/admin/business/reject | Reject business document and send rejected email to owner +*AdminAPI* | [**ApiV1AdminBusinessUsersGet**](docs/AdminAPI.md#apiv1adminbusinessusersget) | **Get** /api/v1/admin/business/users | get business detail with teams and users +*AdminAPI* | [**ApiV1AdminBusinessVirtualAccountBusinessIdGet**](docs/AdminAPI.md#apiv1adminbusinessvirtualaccountbusinessidget) | **Get** /api/v1/admin/business/virtual-account/{businessId} | Get Virtual Account Business config for create Virtual Account +*AdminAPI* | [**ApiV1AdminBusinessVirtualAccountBusinessIdPost**](docs/AdminAPI.md#apiv1adminbusinessvirtualaccountbusinessidpost) | **Post** /api/v1/admin/business/virtual-account/{businessId} | Create Virtual Account Business config for create Virtual Account +*AdminSettlementAPI* | [**ApiV1AdminSettlementApprovePost**](docs/AdminSettlementAPI.md#apiv1adminsettlementapprovepost) | **Post** /api/v1/admin/settlement/approve | Approve settlement for transaction +*AdminSettlementAPI* | [**ApiV1AdminSettlementRejectPost**](docs/AdminSettlementAPI.md#apiv1adminsettlementrejectpost) | **Post** /api/v1/admin/settlement/reject | Reject settlement for transaction +*ApiKeyAPI* | [**CreateSecretApiKey**](docs/ApiKeyAPI.md#createsecretapikey) | **Post** /dashboard/v1/secret-api-key | Create secret api key for a business +*ApiKeyAPI* | [**DeleteSecretApiKey**](docs/ApiKeyAPI.md#deletesecretapikey) | **Delete** /dashboard/v1/secret-api-key/{api_key_id} | Delete an API key +*ApiKeyAPI* | [**ListSecretApiKey**](docs/ApiKeyAPI.md#listsecretapikey) | **Get** /dashboard/v1/secret-api-key | Generate secret api key for a business +*AuthenticateAPI* | [**CheckForgotPasswordToken**](docs/AuthenticateAPI.md#checkforgotpasswordtoken) | **Get** /dashboard/v1/authenticate/forgot-password/{token} | Check forgot password token status +*AuthenticateAPI* | [**ForgotPassword**](docs/AuthenticateAPI.md#forgotpassword) | **Post** /dashboard/v1/authenticate/forgot-password | ForgotPassword user +*AuthenticateAPI* | [**RegisterMember**](docs/AuthenticateAPI.md#registermember) | **Post** /dashboard/v1/authenticate/register/member/:token | Register member +*AuthenticateAPI* | [**ResendVerifyEmail**](docs/AuthenticateAPI.md#resendverifyemail) | **Post** /dashboard/v1/authenticate/verify-email/resend | Resend Verification Email for un-verify email +*AuthenticateAPI* | [**ResetPassword**](docs/AuthenticateAPI.md#resetpassword) | **Put** /dashboard/v1/authenticate/reset-password | Reset Password user +*AuthenticateAPI* | [**VerifyEmailOwner**](docs/AuthenticateAPI.md#verifyemailowner) | **Put** /dashboard/v1/authenticate/verify-email/:token | Verify email owner +*BalanceAPI* | [**FetchOneTransactionBalanceHistory**](docs/BalanceAPI.md#fetchonetransactionbalancehistory) | **Get** /api/v1/balance/history/{balance_id} | Fetch One balance history detail +*BalanceAPI* | [**GetBalanceDashboard**](docs/BalanceAPI.md#getbalancedashboard) | **Get** /api/v1/balance | Get Balance by business +*BalanceAPI* | [**ListOfTransactionBalanceHistory**](docs/BalanceAPI.md#listoftransactionbalancehistory) | **Get** /api/v1/balance/history | List all created Transaction Balance History data +*BankAPI* | [**DashboardV1BankGet**](docs/BankAPI.md#dashboardv1bankget) | **Get** /dashboard/v1/bank | get bank list +*BusinessAPI* | [**ApiV1BusinessPost**](docs/BusinessAPI.md#apiv1businesspost) | **Post** /api/v1/business | Register business +*BusinessAPI* | [**ApiV1BusinessUsersGet**](docs/BusinessAPI.md#apiv1businessusersget) | **Get** /api/v1/business/users | Get users under business +*BusinessAPI* | [**DashboardV1AdminBusinessUserPost**](docs/BusinessAPI.md#dashboardv1adminbusinessuserpost) | **Post** /dashboard/v1/admin/business/user | Register new user to business team +*BusinessAPI* | [**DashboardV1BusinessCommissionPost**](docs/BusinessAPI.md#dashboardv1businesscommissionpost) | **Post** /dashboard/v1/business/commission | Assign Commission for business +*BusinessAPI* | [**DashboardV1BusinessDetailGet**](docs/BusinessAPI.md#dashboardv1businessdetailget) | **Get** /dashboard/v1/business/detail | get business detail +*BusinessAPI* | [**DashboardV1BusinessInviteUserPost**](docs/BusinessAPI.md#dashboardv1businessinviteuserpost) | **Post** /dashboard/v1/business/invite/user | Invite email newuser to business team +*BusinessAPI* | [**DashboardV1BusinessUpdatePut**](docs/BusinessAPI.md#dashboardv1businessupdateput) | **Put** /dashboard/v1/business/update | Register business +*BusinessAPI* | [**DashboardV1BusinessUserDeleteUserIdDelete**](docs/BusinessAPI.md#dashboardv1businessuserdeleteuseriddelete) | **Delete** /dashboard/v1/business/user/delete/{userId} | Delete user from team business +*CheckoutAPI* | [**CheckoutV1InvoiceNumberCustomerPut**](docs/CheckoutAPI.md#checkoutv1invoicenumbercustomerput) | **Put** /checkout/v1/{invoice_number}/customer | Update invoice customer on checkout +*CheckoutAPI* | [**CheckoutV1InvoiceNumberDetailGet**](docs/CheckoutAPI.md#checkoutv1invoicenumberdetailget) | **Get** /checkout/v1/{invoice_number}/detail | Get Invoice Detail for checkout +*CheckoutAPI* | [**CheckoutV1InvoiceNumberPaymentPost**](docs/CheckoutAPI.md#checkoutv1invoicenumberpaymentpost) | **Post** /checkout/v1/{invoice_number}/payment | Create transaction on checkout +*DefaultAPI* | [**AccessToken**](docs/DefaultAPI.md#accesstoken) | **Post** /api/v1/authenticate/access-token | Generate new access token from refresh token +*DefaultAPI* | [**CheckHealthz**](docs/DefaultAPI.md#checkhealthz) | **Get** /internal/healthz | Get Application Healthz +*DefaultAPI* | [**ExecuteCallbackScheduler**](docs/DefaultAPI.md#executecallbackscheduler) | **Post** /subscriber/v1/execute_callback_scheduler | Consume message and proceed callback scheduelr +*DefaultAPI* | [**FetchAllInvoiceDataByBusinessId**](docs/DefaultAPI.md#fetchallinvoicedatabybusinessid) | **Get** /api/v1/invoice | List all created Invoice data +*DefaultAPI* | [**FetchOneInvoiceDataByInvoiceId**](docs/DefaultAPI.md#fetchoneinvoicedatabyinvoiceid) | **Get** /api/v1/invoice/{invoice_id} | Fetch One Invoice +*DefaultAPI* | [**FetchPaymentMethodForOneInvoice**](docs/DefaultAPI.md#fetchpaymentmethodforoneinvoice) | **Get** /api/v1/invoice/{invoice_id}/payment-method | Fetch PaymentMethod Only For 1 Invoice +*DefaultAPI* | [**GenerateInvoiceData**](docs/DefaultAPI.md#generateinvoicedata) | **Post** /api/v1/invoice | Create invoice for a payment +*DefaultAPI* | [**GenerateVirtualAccountData**](docs/DefaultAPI.md#generatevirtualaccountdata) | **Post** /dashboard/v1/payment/virtual-account | Create Virtual Account for a payment +*DefaultAPI* | [**GetAllVirtualAccountDataByBusiness**](docs/DefaultAPI.md#getallvirtualaccountdatabybusiness) | **Get** /dashboard/v1/payment/virtual-account | Get All Virtual Account for a payment +*DefaultAPI* | [**GetStatus**](docs/DefaultAPI.md#getstatus) | **Get** /api/v1/status | Get Application Status +*DefaultAPI* | [**GetVirtualAccountData**](docs/DefaultAPI.md#getvirtualaccountdata) | **Get** /dashboard/v1/payment/virtual-account/:va_id | Get Virtual Account for a payment +*DefaultAPI* | [**IntrospectToken**](docs/DefaultAPI.md#introspecttoken) | **Post** /api/v1/authenticate/introspect | Introspect bearer token for access or refresh token +*DefaultAPI* | [**Login**](docs/DefaultAPI.md#login) | **Post** /api/v1/authenticate/login | User Login to service +*DefaultAPI* | [**ProceedCallbackRetry**](docs/DefaultAPI.md#proceedcallbackretry) | **Post** /subscriber/v1/proceed_callback_retry_event | Consume message and proceed retry callback to merchant +*DefaultAPI* | [**Register**](docs/DefaultAPI.md#register) | **Post** /api/v1/authenticate/register | Register new user +*DefaultAPI* | [**SendCallbackEvent**](docs/DefaultAPI.md#sendcallbackevent) | **Post** /subscriber/v1/send_callback_event | Consume message and proceed sending callback to merchant +*DefaultAPI* | [**SimulatePayment**](docs/DefaultAPI.md#simulatepayment) | **Post** /api/v1/simulate_payment | SimulatePayment is handler for simulate payment system +*DefaultAPI* | [**VerifyCallbackDummy**](docs/DefaultAPI.md#verifycallbackdummy) | **Post** /api/v1/dummy_callback | VerifyCallback is handler for mock callback +*FileAPI* | [**DashboardV1PrivateFilePost**](docs/FileAPI.md#dashboardv1privatefilepost) | **Post** /dashboard/v1/private/file | Upload Private File Image/Document +*FileAPI* | [**DashboardV1PrivateFileReadGet**](docs/FileAPI.md#dashboardv1privatefilereadget) | **Get** /dashboard/v1/private/file/read | Read Private File Image/Document +*FileAPI* | [**DashboardV1PublicFilePost**](docs/FileAPI.md#dashboardv1publicfilepost) | **Post** /dashboard/v1/public/file | Upload Public File Image/Document +*FileAPI* | [**DashboardV1PublicFileReadGet**](docs/FileAPI.md#dashboardv1publicfilereadget) | **Get** /dashboard/v1/public/file/read | Read Public File Image/Document +*NotificationAPI* | [**CreateOfNotification**](docs/NotificationAPI.md#createofnotification) | **Post** /api/v1/notification | Create created Notification data data +*NotificationAPI* | [**ListOfNotification**](docs/NotificationAPI.md#listofnotification) | **Get** /api/v1/notification | List all created Notification data data +*NotificationAPI* | [**RemoveOfNotification**](docs/NotificationAPI.md#removeofnotification) | **Delete** /api/v1/notification | Remove created Notification data data +*OTPAPI* | [**DashboardV1OtpSendTypePost**](docs/OTPAPI.md#dashboardv1otpsendtypepost) | **Post** /dashboard/v1/otp/send/{type} | Send OTP to user +*OTPAPI* | [**DashboardV1OtpVerifyPost**](docs/OTPAPI.md#dashboardv1otpverifypost) | **Post** /dashboard/v1/otp/verify | Verify OTP code from user +*ProfileAPI* | [**ApiV1ProfileGet**](docs/ProfileAPI.md#apiv1profileget) | **Get** /api/v1/profile | Get user profile by token +*ProfileAPI* | [**ChangePassword**](docs/ProfileAPI.md#changepassword) | **Post** /api/v1/profile/change-password | Use this endpoint to change user password +*PublicBalanceAPI* | [**GetBalance**](docs/PublicBalanceAPI.md#getbalance) | **Get** /merchant/v1/balance | Get Balance. +*PublicInvoiceAPI* | [**CreateInvoice**](docs/PublicInvoiceAPI.md#createinvoice) | **Post** /merchant/v1/invoice | Create invoice for a payment. +*PublicInvoiceAPI* | [**DownloadInvoice**](docs/PublicInvoiceAPI.md#downloadinvoice) | **Get** /merchant/v1/invoice/download/csv | Download CSV file. +*PublicInvoiceAPI* | [**ExpireInvoice**](docs/PublicInvoiceAPI.md#expireinvoice) | **Post** /merchant/v1/invoice/{invoice_id}/expire | Expire invoice by invoice ID. +*PublicInvoiceAPI* | [**GetInvoiceById**](docs/PublicInvoiceAPI.md#getinvoicebyid) | **Get** /merchant/v1/invoice/{invoice_id} | Fetch invoice data by ID. +*PublicInvoiceAPI* | [**GetInvoices**](docs/PublicInvoiceAPI.md#getinvoices) | **Get** /merchant/v1/invoice | List all created invoice data +*PublicInvoiceAPI* | [**GetPaymentMethodById**](docs/PublicInvoiceAPI.md#getpaymentmethodbyid) | **Get** /merchant/v1/invoice/{invoice_id}/payment-method | Fetch payment method by invoice ID. +*PublicInvoiceAPI* | [**UpdateInvoiceById**](docs/PublicInvoiceAPI.md#updateinvoicebyid) | **Put** /merchant/v1/invoice/{invoice_id}/update | Update pending invoice +*PublicSimulateAPI* | [**SimulatePayment**](docs/PublicSimulateAPI.md#simulatepayment) | **Post** /merchant/v1/simulate-payment | SimulatePayment is handler for simulate payment system. +*PublicVirtualAccountAPI* | [**CreateVirtualAccount**](docs/PublicVirtualAccountAPI.md#createvirtualaccount) | **Post** /merchant/v1/virtual-account | Create virtual account data. +*PublicVirtualAccountAPI* | [**GetVirtualAccountById**](docs/PublicVirtualAccountAPI.md#getvirtualaccountbyid) | **Get** /merchant/v1/virtual-account/{virtualAccountId} | Fetch virtual account data by ID. +*PublicVirtualAccountAPI* | [**GetVirtualAccountByNumber**](docs/PublicVirtualAccountAPI.md#getvirtualaccountbynumber) | **Get** /merchant/v1/virtual-account/number/{virtualAccountNumber} | Fetch virtual account data by virtual account number. +*PublicVirtualAccountAPI* | [**GetVirtualAccounts**](docs/PublicVirtualAccountAPI.md#getvirtualaccounts) | **Get** /merchant/v1/virtual-account | List all created virtual account data. +*PubsubAPI* | [**SendOfNotificationEvent**](docs/PubsubAPI.md#sendofnotificationevent) | **Post** /internal/v1/send_notification_event | SendNotificationEvent send Notification data via pubsub +*StatisticsAPI* | [**GetOfStatisticsBusiness**](docs/StatisticsAPI.md#getofstatisticsbusiness) | **Get** /api/v1/statistics/dashboard | Get All Calculation Statistics of Dashboard Business +*TransactionAPI* | [**FetchOneTransaction**](docs/TransactionAPI.md#fetchonetransaction) | **Get** /transaction/{transaction_id} | Fetch One Invoice +*TransactionAPI* | [**ListOfTransaction**](docs/TransactionAPI.md#listoftransaction) | **Get** /api/v1/transaction | List all created Transaction data +*WebhookAPI* | [**DeleteCallbackData**](docs/WebhookAPI.md#deletecallbackdata) | **Delete** /dashboard/v1/callback | Delete callback for a merchant +*WebhookAPI* | [**GenerateCallbackData**](docs/WebhookAPI.md#generatecallbackdata) | **Post** /dashboard/v1/callback | Create callback for a merchant +*WebhookAPI* | [**GetCallbackDataMerchant**](docs/WebhookAPI.md#getcallbackdatamerchant) | **Get** /dashboard/v1/callback | Get callback from a merchant +*WebhookAPI* | [**GetCallbackWebhookDetail**](docs/WebhookAPI.md#getcallbackwebhookdetail) | **Get** /dashboard/v1/callback/webhook/detail/:id | Get detail of webhook by id +*WebhookAPI* | [**UpdateCallbackData**](docs/WebhookAPI.md#updatecallbackdata) | **Put** /dashboard/v1/callback | Update callback for a merchant +*WebhookAPI* | [**WebhooksGet**](docs/WebhookAPI.md#webhooksget) | **Get** /webhooks | Get webhooks + + +## Documentation For Models + + - [GithubComAutomotechnologiesDoitpayInternalAppBuildInfo](docs/GithubComAutomotechnologiesDoitpayInternalAppBuildInfo.md) + - [GithubComAutomotechnologiesDoitpayInternalModelsBusiness](docs/GithubComAutomotechnologiesDoitpayInternalModelsBusiness.md) + - [GithubComAutomotechnologiesDoitpayInternalModelsBusinessKycDocument](docs/GithubComAutomotechnologiesDoitpayInternalModelsBusinessKycDocument.md) + - [GithubComAutomotechnologiesDoitpayInternalModelsBusinessStatus](docs/GithubComAutomotechnologiesDoitpayInternalModelsBusinessStatus.md) + - [GithubComAutomotechnologiesDoitpayInternalModelsCommission](docs/GithubComAutomotechnologiesDoitpayInternalModelsCommission.md) + - [GithubComAutomotechnologiesDoitpayInternalModelsCommissionType](docs/GithubComAutomotechnologiesDoitpayInternalModelsCommissionType.md) + - [GithubComAutomotechnologiesDoitpayInternalModelsDocType](docs/GithubComAutomotechnologiesDoitpayInternalModelsDocType.md) + - [GithubComAutomotechnologiesDoitpayInternalModelsInvoiceCustomer](docs/GithubComAutomotechnologiesDoitpayInternalModelsInvoiceCustomer.md) + - [GithubComAutomotechnologiesDoitpayInternalModelsMasterBankAccount](docs/GithubComAutomotechnologiesDoitpayInternalModelsMasterBankAccount.md) + - [GithubComAutomotechnologiesDoitpayInternalModelsMerchantType](docs/GithubComAutomotechnologiesDoitpayInternalModelsMerchantType.md) + - [GithubComAutomotechnologiesDoitpayInternalModelsPartnerType](docs/GithubComAutomotechnologiesDoitpayInternalModelsPartnerType.md) + - [GithubComAutomotechnologiesDoitpayInternalModelsPaymentMethod](docs/GithubComAutomotechnologiesDoitpayInternalModelsPaymentMethod.md) + - [GithubComAutomotechnologiesDoitpayInternalModelsPaymentMethodStatus](docs/GithubComAutomotechnologiesDoitpayInternalModelsPaymentMethodStatus.md) + - [GithubComAutomotechnologiesDoitpayInternalModelsPaymentMethodType](docs/GithubComAutomotechnologiesDoitpayInternalModelsPaymentMethodType.md) + - [GithubComAutomotechnologiesDoitpayInternalModelsTeam](docs/GithubComAutomotechnologiesDoitpayInternalModelsTeam.md) + - [GithubComAutomotechnologiesDoitpayInternalModelsTeamRole](docs/GithubComAutomotechnologiesDoitpayInternalModelsTeamRole.md) + - [GithubComAutomotechnologiesDoitpayInternalModelsTransaction](docs/GithubComAutomotechnologiesDoitpayInternalModelsTransaction.md) + - [GithubComAutomotechnologiesDoitpayInternalModelsTransactionPaymentChannel](docs/GithubComAutomotechnologiesDoitpayInternalModelsTransactionPaymentChannel.md) + - [GithubComAutomotechnologiesDoitpayInternalModelsTransactionStatus](docs/GithubComAutomotechnologiesDoitpayInternalModelsTransactionStatus.md) + - [GithubComAutomotechnologiesDoitpayInternalModelsTransactionType](docs/GithubComAutomotechnologiesDoitpayInternalModelsTransactionType.md) + - [GithubComAutomotechnologiesDoitpayInternalModelsUser](docs/GithubComAutomotechnologiesDoitpayInternalModelsUser.md) + - [GithubComAutomotechnologiesDoitpayInternalUsecaseBusinessDetail](docs/GithubComAutomotechnologiesDoitpayInternalUsecaseBusinessDetail.md) + - [GithubComAutomotechnologiesDoitpayInternalUsecaseBusinessInfo](docs/GithubComAutomotechnologiesDoitpayInternalUsecaseBusinessInfo.md) + - [GithubComAutomotechnologiesDoitpayInternalUsecaseTeamDetail](docs/GithubComAutomotechnologiesDoitpayInternalUsecaseTeamDetail.md) + - [GithubComAutomotechnologiesDoitpayInternalUsecaseUserProfile](docs/GithubComAutomotechnologiesDoitpayInternalUsecaseUserProfile.md) + - [GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader](docs/GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader.md) + - [InternalWebControllersCheckoutApiv1InvoiceBankDetail](docs/InternalWebControllersCheckoutApiv1InvoiceBankDetail.md) + - [InternalWebControllersCheckoutApiv1InvoiceCustomer](docs/InternalWebControllersCheckoutApiv1InvoiceCustomer.md) + - [InternalWebControllersCheckoutApiv1InvoiceInvoiceDetailResponse](docs/InternalWebControllersCheckoutApiv1InvoiceInvoiceDetailResponse.md) + - [InternalWebControllersCheckoutApiv1InvoiceItem](docs/InternalWebControllersCheckoutApiv1InvoiceItem.md) + - [InternalWebControllersCheckoutApiv1InvoicePaymentDetail](docs/InternalWebControllersCheckoutApiv1InvoicePaymentDetail.md) + - [InternalWebControllersCheckoutApiv1InvoicePaymentMethod](docs/InternalWebControllersCheckoutApiv1InvoicePaymentMethod.md) + - [InternalWebControllersCheckoutApiv1InvoiceRedirectURL](docs/InternalWebControllersCheckoutApiv1InvoiceRedirectURL.md) + - [InternalWebControllersCheckoutApiv1InvoiceRequestCreateTransaction](docs/InternalWebControllersCheckoutApiv1InvoiceRequestCreateTransaction.md) + - [InternalWebControllersCheckoutApiv1InvoiceRequestInvoiceCustomer](docs/InternalWebControllersCheckoutApiv1InvoiceRequestInvoiceCustomer.md) + - [InternalWebControllersCheckoutApiv1InvoiceTemplates](docs/InternalWebControllersCheckoutApiv1InvoiceTemplates.md) + - [InternalWebControllersDashboardApiv1AdminAddUserRequest](docs/InternalWebControllersDashboardApiv1AdminAddUserRequest.md) + - [InternalWebControllersDashboardApiv1AdminApprovalRequest](docs/InternalWebControllersDashboardApiv1AdminApprovalRequest.md) + - [InternalWebControllersDashboardApiv1AdminBusinessDetailResponse](docs/InternalWebControllersDashboardApiv1AdminBusinessDetailResponse.md) + - [InternalWebControllersDashboardApiv1AdminSettlementSettlementApprovalRequest](docs/InternalWebControllersDashboardApiv1AdminSettlementSettlementApprovalRequest.md) + - [InternalWebControllersDashboardApiv1ApikeyCreateRequest](docs/InternalWebControllersDashboardApiv1ApikeyCreateRequest.md) + - [InternalWebControllersDashboardApiv1AuthenticateAccessToken](docs/InternalWebControllersDashboardApiv1AuthenticateAccessToken.md) + - [InternalWebControllersDashboardApiv1AuthenticateResetPasswordRequest](docs/InternalWebControllersDashboardApiv1AuthenticateResetPasswordRequest.md) + - [InternalWebControllersDashboardApiv1AuthenticateVerificationRequest](docs/InternalWebControllersDashboardApiv1AuthenticateVerificationRequest.md) + - [InternalWebControllersDashboardApiv1BalanceBalanceDetail](docs/InternalWebControllersDashboardApiv1BalanceBalanceDetail.md) + - [InternalWebControllersDashboardApiv1BalanceTransactionBalanceDetail](docs/InternalWebControllersDashboardApiv1BalanceTransactionBalanceDetail.md) + - [InternalWebControllersDashboardApiv1BusinessAssignCommissionRequest](docs/InternalWebControllersDashboardApiv1BusinessAssignCommissionRequest.md) + - [InternalWebControllersDashboardApiv1BusinessBusinessUpdate](docs/InternalWebControllersDashboardApiv1BusinessBusinessUpdate.md) + - [InternalWebControllersDashboardApiv1BusinessRegisterToTeam](docs/InternalWebControllersDashboardApiv1BusinessRegisterToTeam.md) + - [InternalWebControllersDashboardApiv1CallbackWebhookLogs](docs/InternalWebControllersDashboardApiv1CallbackWebhookLogs.md) + - [InternalWebControllersDashboardApiv1NotificationNotificationDetail](docs/InternalWebControllersDashboardApiv1NotificationNotificationDetail.md) + - [InternalWebControllersDashboardApiv1NotificationNotificationRequest](docs/InternalWebControllersDashboardApiv1NotificationNotificationRequest.md) + - [InternalWebControllersDashboardApiv1OtpVerifyOtpRequest](docs/InternalWebControllersDashboardApiv1OtpVerifyOtpRequest.md) + - [InternalWebControllersDashboardApiv1ProfileBusinessInfo](docs/InternalWebControllersDashboardApiv1ProfileBusinessInfo.md) + - [InternalWebControllersDashboardApiv1ProfileRequestChangePasswordRequest](docs/InternalWebControllersDashboardApiv1ProfileRequestChangePasswordRequest.md) + - [InternalWebControllersDashboardApiv1ProfileUserProfileResponse](docs/InternalWebControllersDashboardApiv1ProfileUserProfileResponse.md) + - [InternalWebControllersDashboardApiv1StatusResponse](docs/InternalWebControllersDashboardApiv1StatusResponse.md) + - [InternalWebControllersDashboardApiv1StatusResponseDoc](docs/InternalWebControllersDashboardApiv1StatusResponseDoc.md) + - [InternalWebControllersDashboardApiv1StatusResponseDocData](docs/InternalWebControllersDashboardApiv1StatusResponseDocData.md) + - [InternalWebControllersDashboardApiv1TransactionTransactionBalance](docs/InternalWebControllersDashboardApiv1TransactionTransactionBalance.md) + - [InternalWebControllersDashboardApiv1TransactionTransactionDetail](docs/InternalWebControllersDashboardApiv1TransactionTransactionDetail.md) + - [InternalWebControllersDashboardApiv1TransactionTransactionHistory](docs/InternalWebControllersDashboardApiv1TransactionTransactionHistory.md) + - [InternalWebControllersMerchantApiv1BalanceBalance](docs/InternalWebControllersMerchantApiv1BalanceBalance.md) + - [InternalWebControllersMerchantApiv1BalanceStandardMeta](docs/InternalWebControllersMerchantApiv1BalanceStandardMeta.md) + - [InternalWebControllersMerchantApiv1BalanceStandardResponse](docs/InternalWebControllersMerchantApiv1BalanceStandardResponse.md) + - [InternalWebControllersMerchantApiv1InvoiceCustomer](docs/InternalWebControllersMerchantApiv1InvoiceCustomer.md) + - [InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse](docs/InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse.md) + - [InternalWebControllersMerchantApiv1InvoiceInvoiceRequest](docs/InternalWebControllersMerchantApiv1InvoiceInvoiceRequest.md) + - [InternalWebControllersMerchantApiv1InvoiceItem](docs/InternalWebControllersMerchantApiv1InvoiceItem.md) + - [InternalWebControllersMerchantApiv1InvoicePaymentMethod](docs/InternalWebControllersMerchantApiv1InvoicePaymentMethod.md) + - [InternalWebControllersMerchantApiv1InvoiceRedirectURL](docs/InternalWebControllersMerchantApiv1InvoiceRedirectURL.md) + - [InternalWebControllersMerchantApiv1InvoiceStandardMeta](docs/InternalWebControllersMerchantApiv1InvoiceStandardMeta.md) + - [InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination](docs/InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination.md) + - [InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse](docs/InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse.md) + - [InternalWebControllersMerchantApiv1InvoiceStandardResponse](docs/InternalWebControllersMerchantApiv1InvoiceStandardResponse.md) + - [InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination](docs/InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination.md) + - [InternalWebControllersMerchantApiv1SimulateSimulateRequest](docs/InternalWebControllersMerchantApiv1SimulateSimulateRequest.md) + - [InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest](docs/InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest.md) + - [InternalWebControllersMerchantApiv1VirtualaccountStandardMeta](docs/InternalWebControllersMerchantApiv1VirtualaccountStandardMeta.md) + - [InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination](docs/InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination.md) + - [InternalWebControllersMerchantApiv1VirtualaccountStandardResponse](docs/InternalWebControllersMerchantApiv1VirtualaccountStandardResponse.md) + - [InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination](docs/InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination.md) + - [InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer](docs/InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer.md) + - [InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse](docs/InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse.md) + - [InternalWebControllersPrivateAsynchandlerApiv1SendnotificationSendNotificationRequest](docs/InternalWebControllersPrivateAsynchandlerApiv1SendnotificationSendNotificationRequest.md) + + +## Documentation For Authorization + + +Authentication schemes defined for the API: +### ApiKeyAuth + +- **Type**: API key +- **API key parameter name**: Authorization +- **Location**: HTTP header + +Note, each API key must be added to a map of `map[string]APIKey` where the key is: Authorization and passed in as the auth context for each request. + +Example + +```golang +auth := context.WithValue( + context.Background(), + sw.ContextAPIKeys, + map[string]sw.APIKey{ + "Authorization": {Key: "API_KEY_STRING"}, + }, + ) +r, err := client.Service.Operation(auth, args) +``` + +### BasicAuth + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + +### OAuth2AccessCode + + +- **Type**: OAuth +- **Flow**: accessCode +- **Authorization URL**: https://example.com/oauth/authorize +- **Scopes**: + - **admin**: Grants read and write access to administrative information + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING") +r, err := client.Service.Operation(auth, args) +``` + +Or via OAuth2 module to automatically refresh tokens and perform user authentication. + +```golang +import "golang.org/x/oauth2" + +/* Perform OAuth2 round trip request and obtain a token */ + +tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) +auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) +r, err := client.Service.Operation(auth, args) +``` + +### OAuth2Application + + +- **Type**: OAuth +- **Flow**: application +- **Authorization URL**: +- **Scopes**: + - **admin**: Grants read and write access to administrative information + - **write**: Grants write access + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING") +r, err := client.Service.Operation(auth, args) +``` + +Or via OAuth2 module to automatically refresh tokens and perform user authentication. + +```golang +import "golang.org/x/oauth2" + +/* Perform OAuth2 round trip request and obtain a token */ + +tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) +auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) +r, err := client.Service.Operation(auth, args) +``` + +### OAuth2Implicit + + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: https://example.com/oauth/authorize +- **Scopes**: + - **admin**: Grants read and write access to administrative information + - **write**: Grants write access + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING") +r, err := client.Service.Operation(auth, args) +``` + +Or via OAuth2 module to automatically refresh tokens and perform user authentication. + +```golang +import "golang.org/x/oauth2" + +/* Perform OAuth2 round trip request and obtain a token */ + +tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) +auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) +r, err := client.Service.Operation(auth, args) +``` + +### OAuth2Password + + +- **Type**: OAuth +- **Flow**: password +- **Authorization URL**: +- **Scopes**: + - **admin**: Grants read and write access to administrative information + - **read**: Grants read access + - **write**: Grants write access + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING") +r, err := client.Service.Operation(auth, args) +``` + +Or via OAuth2 module to automatically refresh tokens and perform user authentication. + +```golang +import "golang.org/x/oauth2" + +/* Perform OAuth2 round trip request and obtain a token */ + +tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) +auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) +r, err := client.Service.Operation(auth, args) +``` + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + +support@doitpay.co.id diff --git a/balance/api_balance.go b/balance/api_balance.go new file mode 100644 index 0000000..f36e7c3 --- /dev/null +++ b/balance/api_balance.go @@ -0,0 +1,131 @@ +package balance + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strconv" + + "github.com/automotechnologies/doitpay-go/common" + "github.com/automotechnologies/doitpay-go/utils" +) + +type PublicBalanceAPI interface { + + /* + GetBalance Get Balance. + + Get net & gross balance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetBalanceRequest + */ + GetBalance(ctx context.Context) ApiGetBalanceRequest + + // GetBalanceExecute executes the request + // @return InternalWebControllersMerchantApiv1BalanceStandardResponse + GetBalanceExecute(r ApiGetBalanceRequest) (*InternalWebControllersMerchantApiv1BalanceStandardResponse, *http.Response, error) +} + +type BalanceApiService struct { + client common.IClient +} + +// NewBalanceApi Create a new BalanceApi service +func NewBalanceApi(client common.IClient) PublicBalanceAPI { + return &BalanceApiService{ + client: client, + } +} + +type ApiGetBalanceRequest struct { + ctx context.Context + ApiService PublicBalanceAPI +} + +func (r ApiGetBalanceRequest) Execute() (*InternalWebControllersMerchantApiv1BalanceStandardResponse, *http.Response, error) { + return r.ApiService.GetBalanceExecute(r) +} + +/* +GetBalance Get Balance. + +Get net & gross balance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetBalanceRequest +*/ +func (a *BalanceApiService) GetBalance(ctx context.Context) ApiGetBalanceRequest { + return ApiGetBalanceRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return InternalWebControllersMerchantApiv1BalanceStandardResponse +func (a *BalanceApiService) GetBalanceExecute(r ApiGetBalanceRequest) (*InternalWebControllersMerchantApiv1BalanceStandardResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *InternalWebControllersMerchantApiv1BalanceStandardResponse + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "BalanceApiService.GetBalance") + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: BalanceApiService.GetBalanceExecute") + } + + localVarPath := localBasePath + "/merchant/v1/balance" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: BalanceApiService.GetBalanceExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/balance/model_balance.go b/balance/model_balance.go new file mode 100644 index 0000000..cc93014 --- /dev/null +++ b/balance/model_balance.go @@ -0,0 +1,161 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package balance + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the InternalWebControllersMerchantApiv1BalanceBalance type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &InternalWebControllersMerchantApiv1BalanceBalance{} + +// InternalWebControllersMerchantApiv1BalanceBalance struct for InternalWebControllersMerchantApiv1BalanceBalance +type InternalWebControllersMerchantApiv1BalanceBalance struct { + Gross *float32 `json:"gross,omitempty"` + Net *float32 `json:"net,omitempty"` +} + +// NewInternalWebControllersMerchantApiv1BalanceBalance instantiates a new InternalWebControllersMerchantApiv1BalanceBalance object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalWebControllersMerchantApiv1BalanceBalance() *InternalWebControllersMerchantApiv1BalanceBalance { + this := InternalWebControllersMerchantApiv1BalanceBalance{} + return &this +} + +// NewInternalWebControllersMerchantApiv1BalanceBalanceWithDefaults instantiates a new InternalWebControllersMerchantApiv1BalanceBalance object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalWebControllersMerchantApiv1BalanceBalanceWithDefaults() *InternalWebControllersMerchantApiv1BalanceBalance { + this := InternalWebControllersMerchantApiv1BalanceBalance{} + return &this +} + +// GetGross returns the Gross field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1BalanceBalance) GetGross() float32 { + if o == nil || utils.IsNil(o.Gross) { + var ret float32 + return ret + } + return *o.Gross +} + +// GetGrossOk returns a tuple with the Gross field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1BalanceBalance) GetGrossOk() (*float32, bool) { + if o == nil || utils.IsNil(o.Gross) { + return nil, false + } + return o.Gross, true +} + +// HasGross returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1BalanceBalance) HasGross() bool { + if o != nil && !utils.IsNil(o.Gross) { + return true + } + + return false +} + +// SetGross gets a reference to the given float32 and assigns it to the Gross field. +func (o *InternalWebControllersMerchantApiv1BalanceBalance) SetGross(v float32) { + o.Gross = &v +} + +// GetNet returns the Net field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1BalanceBalance) GetNet() float32 { + if o == nil || utils.IsNil(o.Net) { + var ret float32 + return ret + } + return *o.Net +} + +// GetNetOk returns a tuple with the Net field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1BalanceBalance) GetNetOk() (*float32, bool) { + if o == nil || utils.IsNil(o.Net) { + return nil, false + } + return o.Net, true +} + +// HasNet returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1BalanceBalance) HasNet() bool { + if o != nil && !utils.IsNil(o.Net) { + return true + } + + return false +} + +// SetNet gets a reference to the given float32 and assigns it to the Net field. +func (o *InternalWebControllersMerchantApiv1BalanceBalance) SetNet(v float32) { + o.Net = &v +} + +func (o InternalWebControllersMerchantApiv1BalanceBalance) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalWebControllersMerchantApiv1BalanceBalance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Gross) { + toSerialize["gross"] = o.Gross + } + if !utils.IsNil(o.Net) { + toSerialize["net"] = o.Net + } + return toSerialize, nil +} + +type NullableInternalWebControllersMerchantApiv1BalanceBalance struct { + value *InternalWebControllersMerchantApiv1BalanceBalance + isSet bool +} + +func (v NullableInternalWebControllersMerchantApiv1BalanceBalance) Get() *InternalWebControllersMerchantApiv1BalanceBalance { + return v.value +} + +func (v *NullableInternalWebControllersMerchantApiv1BalanceBalance) Set(val *InternalWebControllersMerchantApiv1BalanceBalance) { + v.value = val + v.isSet = true +} + +func (v NullableInternalWebControllersMerchantApiv1BalanceBalance) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalWebControllersMerchantApiv1BalanceBalance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalWebControllersMerchantApiv1BalanceBalance(val *InternalWebControllersMerchantApiv1BalanceBalance) *NullableInternalWebControllersMerchantApiv1BalanceBalance { + return &NullableInternalWebControllersMerchantApiv1BalanceBalance{value: val, isSet: true} +} + +func (v NullableInternalWebControllersMerchantApiv1BalanceBalance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalWebControllersMerchantApiv1BalanceBalance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/balance/model_balance_standard_meta.go b/balance/model_balance_standard_meta.go new file mode 100644 index 0000000..5d73a5a --- /dev/null +++ b/balance/model_balance_standard_meta.go @@ -0,0 +1,161 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package balance + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the InternalWebControllersMerchantApiv1BalanceStandardMeta type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &InternalWebControllersMerchantApiv1BalanceStandardMeta{} + +// InternalWebControllersMerchantApiv1BalanceStandardMeta struct for InternalWebControllersMerchantApiv1BalanceStandardMeta +type InternalWebControllersMerchantApiv1BalanceStandardMeta struct { + ProcessingTime *string `json:"processing_time,omitempty"` + VersionApi *string `json:"version_api,omitempty"` +} + +// NewInternalWebControllersMerchantApiv1BalanceStandardMeta instantiates a new InternalWebControllersMerchantApiv1BalanceStandardMeta object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalWebControllersMerchantApiv1BalanceStandardMeta() *InternalWebControllersMerchantApiv1BalanceStandardMeta { + this := InternalWebControllersMerchantApiv1BalanceStandardMeta{} + return &this +} + +// NewInternalWebControllersMerchantApiv1BalanceStandardMetaWithDefaults instantiates a new InternalWebControllersMerchantApiv1BalanceStandardMeta object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalWebControllersMerchantApiv1BalanceStandardMetaWithDefaults() *InternalWebControllersMerchantApiv1BalanceStandardMeta { + this := InternalWebControllersMerchantApiv1BalanceStandardMeta{} + return &this +} + +// GetProcessingTime returns the ProcessingTime field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1BalanceStandardMeta) GetProcessingTime() string { + if o == nil || utils.IsNil(o.ProcessingTime) { + var ret string + return ret + } + return *o.ProcessingTime +} + +// GetProcessingTimeOk returns a tuple with the ProcessingTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1BalanceStandardMeta) GetProcessingTimeOk() (*string, bool) { + if o == nil || utils.IsNil(o.ProcessingTime) { + return nil, false + } + return o.ProcessingTime, true +} + +// HasProcessingTime returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1BalanceStandardMeta) HasProcessingTime() bool { + if o != nil && !utils.IsNil(o.ProcessingTime) { + return true + } + + return false +} + +// SetProcessingTime gets a reference to the given string and assigns it to the ProcessingTime field. +func (o *InternalWebControllersMerchantApiv1BalanceStandardMeta) SetProcessingTime(v string) { + o.ProcessingTime = &v +} + +// GetVersionApi returns the VersionApi field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1BalanceStandardMeta) GetVersionApi() string { + if o == nil || utils.IsNil(o.VersionApi) { + var ret string + return ret + } + return *o.VersionApi +} + +// GetVersionApiOk returns a tuple with the VersionApi field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1BalanceStandardMeta) GetVersionApiOk() (*string, bool) { + if o == nil || utils.IsNil(o.VersionApi) { + return nil, false + } + return o.VersionApi, true +} + +// HasVersionApi returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1BalanceStandardMeta) HasVersionApi() bool { + if o != nil && !utils.IsNil(o.VersionApi) { + return true + } + + return false +} + +// SetVersionApi gets a reference to the given string and assigns it to the VersionApi field. +func (o *InternalWebControllersMerchantApiv1BalanceStandardMeta) SetVersionApi(v string) { + o.VersionApi = &v +} + +func (o InternalWebControllersMerchantApiv1BalanceStandardMeta) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalWebControllersMerchantApiv1BalanceStandardMeta) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ProcessingTime) { + toSerialize["processing_time"] = o.ProcessingTime + } + if !utils.IsNil(o.VersionApi) { + toSerialize["version_api"] = o.VersionApi + } + return toSerialize, nil +} + +type NullableInternalWebControllersMerchantApiv1BalanceStandardMeta struct { + value *InternalWebControllersMerchantApiv1BalanceStandardMeta + isSet bool +} + +func (v NullableInternalWebControllersMerchantApiv1BalanceStandardMeta) Get() *InternalWebControllersMerchantApiv1BalanceStandardMeta { + return v.value +} + +func (v *NullableInternalWebControllersMerchantApiv1BalanceStandardMeta) Set(val *InternalWebControllersMerchantApiv1BalanceStandardMeta) { + v.value = val + v.isSet = true +} + +func (v NullableInternalWebControllersMerchantApiv1BalanceStandardMeta) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalWebControllersMerchantApiv1BalanceStandardMeta) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalWebControllersMerchantApiv1BalanceStandardMeta(val *InternalWebControllersMerchantApiv1BalanceStandardMeta) *NullableInternalWebControllersMerchantApiv1BalanceStandardMeta { + return &NullableInternalWebControllersMerchantApiv1BalanceStandardMeta{value: val, isSet: true} +} + +func (v NullableInternalWebControllersMerchantApiv1BalanceStandardMeta) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalWebControllersMerchantApiv1BalanceStandardMeta) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/balance/model_balance_standard_response.go b/balance/model_balance_standard_response.go new file mode 100644 index 0000000..dec35a9 --- /dev/null +++ b/balance/model_balance_standard_response.go @@ -0,0 +1,269 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package balance + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the InternalWebControllersMerchantApiv1BalanceStandardResponse type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &InternalWebControllersMerchantApiv1BalanceStandardResponse{} + +// InternalWebControllersMerchantApiv1BalanceStandardResponse struct for InternalWebControllersMerchantApiv1BalanceStandardResponse +type InternalWebControllersMerchantApiv1BalanceStandardResponse struct { + Code *int32 `json:"code,omitempty"` + Data *InternalWebControllersMerchantApiv1BalanceBalance `json:"data,omitempty"` + Message *string `json:"message,omitempty"` + Meta *InternalWebControllersMerchantApiv1BalanceStandardMeta `json:"meta,omitempty"` + Status *string `json:"status,omitempty"` +} + +// NewInternalWebControllersMerchantApiv1BalanceStandardResponse instantiates a new InternalWebControllersMerchantApiv1BalanceStandardResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalWebControllersMerchantApiv1BalanceStandardResponse() *InternalWebControllersMerchantApiv1BalanceStandardResponse { + this := InternalWebControllersMerchantApiv1BalanceStandardResponse{} + return &this +} + +// NewInternalWebControllersMerchantApiv1BalanceStandardResponseWithDefaults instantiates a new InternalWebControllersMerchantApiv1BalanceStandardResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalWebControllersMerchantApiv1BalanceStandardResponseWithDefaults() *InternalWebControllersMerchantApiv1BalanceStandardResponse { + this := InternalWebControllersMerchantApiv1BalanceStandardResponse{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) GetCode() int32 { + if o == nil || utils.IsNil(o.Code) { + var ret int32 + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) GetCodeOk() (*int32, bool) { + if o == nil || utils.IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) HasCode() bool { + if o != nil && !utils.IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given int32 and assigns it to the Code field. +func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) SetCode(v int32) { + o.Code = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) GetData() InternalWebControllersMerchantApiv1BalanceBalance { + if o == nil || utils.IsNil(o.Data) { + var ret InternalWebControllersMerchantApiv1BalanceBalance + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) GetDataOk() (*InternalWebControllersMerchantApiv1BalanceBalance, bool) { + if o == nil || utils.IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) HasData() bool { + if o != nil && !utils.IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given InternalWebControllersMerchantApiv1BalanceBalance and assigns it to the Data field. +func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) SetData(v InternalWebControllersMerchantApiv1BalanceBalance) { + o.Data = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) GetMessage() string { + if o == nil || utils.IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) GetMessageOk() (*string, bool) { + if o == nil || utils.IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) HasMessage() bool { + if o != nil && !utils.IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) SetMessage(v string) { + o.Message = &v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) GetMeta() InternalWebControllersMerchantApiv1BalanceStandardMeta { + if o == nil || utils.IsNil(o.Meta) { + var ret InternalWebControllersMerchantApiv1BalanceStandardMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) GetMetaOk() (*InternalWebControllersMerchantApiv1BalanceStandardMeta, bool) { + if o == nil || utils.IsNil(o.Meta) { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) HasMeta() bool { + if o != nil && !utils.IsNil(o.Meta) { + return true + } + + return false +} + +// SetMeta gets a reference to the given InternalWebControllersMerchantApiv1BalanceStandardMeta and assigns it to the Meta field. +func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) SetMeta(v InternalWebControllersMerchantApiv1BalanceStandardMeta) { + o.Meta = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) GetStatus() string { + if o == nil || utils.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) GetStatusOk() (*string, bool) { + if o == nil || utils.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) HasStatus() bool { + if o != nil && !utils.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) SetStatus(v string) { + o.Status = &v +} + +func (o InternalWebControllersMerchantApiv1BalanceStandardResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalWebControllersMerchantApiv1BalanceStandardResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !utils.IsNil(o.Data) { + toSerialize["data"] = o.Data + } + if !utils.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + if !utils.IsNil(o.Meta) { + toSerialize["meta"] = o.Meta + } + if !utils.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil +} + +type NullableInternalWebControllersMerchantApiv1BalanceStandardResponse struct { + value *InternalWebControllersMerchantApiv1BalanceStandardResponse + isSet bool +} + +func (v NullableInternalWebControllersMerchantApiv1BalanceStandardResponse) Get() *InternalWebControllersMerchantApiv1BalanceStandardResponse { + return v.value +} + +func (v *NullableInternalWebControllersMerchantApiv1BalanceStandardResponse) Set(val *InternalWebControllersMerchantApiv1BalanceStandardResponse) { + v.value = val + v.isSet = true +} + +func (v NullableInternalWebControllersMerchantApiv1BalanceStandardResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalWebControllersMerchantApiv1BalanceStandardResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalWebControllersMerchantApiv1BalanceStandardResponse(val *InternalWebControllersMerchantApiv1BalanceStandardResponse) *NullableInternalWebControllersMerchantApiv1BalanceStandardResponse { + return &NullableInternalWebControllersMerchantApiv1BalanceStandardResponse{value: val, isSet: true} +} + +func (v NullableInternalWebControllersMerchantApiv1BalanceStandardResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalWebControllersMerchantApiv1BalanceStandardResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/client.go b/client.go new file mode 100644 index 0000000..92e05e0 --- /dev/null +++ b/client.go @@ -0,0 +1,487 @@ +package doitpay + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strings" + "time" + + "github.com/automotechnologies/doitpay-go/balance" + "github.com/automotechnologies/doitpay-go/common" + "github.com/automotechnologies/doitpay-go/invoice" + "github.com/automotechnologies/doitpay-go/simulate" + "github.com/automotechnologies/doitpay-go/virtualaccount" + "golang.org/x/oauth2" +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the Doitpay API API v1.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + apiKey string + + // API Services + BalanceAPI balance.PublicBalanceAPI + InvoiceAPI invoice.PublicInvoiceAPI + SimulateAPI simulate.PublicSimulateAPI + VirtualAccountAPI virtualaccount.PublicVirtualAccountAPI +} + +// NewClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewClient(apiKey string) *APIClient { + cfg := NewConfiguration() + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.apiKey = apiKey + + // API Services + c.BalanceAPI = balance.NewBalanceApi(c) + c.InvoiceAPI = invoice.NewInvoiceApi(c) + c.SimulateAPI = simulate.NewSimulateApi(c) + c.VirtualAccountAPI = virtualaccount.NewVirtualAccountApi(c) + + return c +} + +// CallAPI do the request. +func (c *APIClient) CallAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Get API Key. +func (c *APIClient) GetAPIKey() string { + return c.apiKey +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() common.IConfiguration { + return c.cfg +} + +// PrepareRequest build the request +func (c *APIClient) PrepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []common.FormFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("cannot specify postBody and multipart form at the same time") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.FileBytes) > 0 && formFile.FileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.FormFileName, filepath.Base(formFile.FileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.FileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("cannot specify postBody and x-www-form-urlencoded form at the same time") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + // OAuth2 authentication + if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { + // We were able to grab an oauth2 token from the context + var latestToken *oauth2.Token + if latestToken, err = tok.Token(); err != nil { + return nil, err + } + + latestToken.SetAuthHeader(localVarRequest) + } + + // Basic HTTP Authentication + if c.apiKey != "" { + localVarRequest.SetBasicAuth(c.apiKey, "") + } + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) Decode(v interface{}, b []byte, contentType string) error { + if len(b) == 0 { + return nil + } + + switch target := v.(type) { + case *string: + *target = string(b) + return nil + + case *os.File: + var err error + if target, err = os.CreateTemp("", "HttpClientFile"); err != nil { + return err + } + defer os.Remove(target.Name()) + + if _, err = target.Write(b); err != nil { + return err + } + if _, err = target.Seek(0, io.SeekStart); err != nil { + return err + } + + return nil + + case **os.File: + var err error + *target, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return err + } + defer os.Remove((*target).Name()) + + if _, err = (*target).Write(b); err != nil { + return err + } + if _, err = (*target).Seek(0, io.SeekStart); err != nil { + return err + } + + return nil + + default: + if xmlCheck.MatchString(contentType) { + return xml.Unmarshal(b, v) + } else if jsonCheck.MatchString(contentType) { + switch obj := v.(type) { + case interface { + GetActualInstance() interface{} + UnmarshalJSON([]byte) error + }: + return obj.UnmarshalJSON(b) + case interface { + GetActualInstance() interface{} + }: + return errors.New("unknown type with GetActualInstance but no UnmarshalJSON defined") + default: + return json.Unmarshal(b, v) + } + } + return errors.New("undefined response type") + } +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +// GenericDoitpayError Provides access to the body, error and model on returned errors. +type GenericDoitpayError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericDoitpayError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericDoitpayError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericDoitpayError) Model() interface{} { + return e.model +} diff --git a/common/common.go b/common/common.go new file mode 100644 index 0000000..2e256d4 --- /dev/null +++ b/common/common.go @@ -0,0 +1,138 @@ +package common + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "net/url" +) + +type IConfiguration interface { + AddDefaultHeader(key string, value string) + ServerURL(index int, variables map[string]string) (string, error) + ServerURLWithContext(ctx context.Context, endpoint string) (string, error) +} + +type IClient interface { + GetConfig() IConfiguration + PrepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []FormFile) (localVarRequest *http.Request, err error) + CallAPI(request *http.Request) (*http.Response, error) + Decode(v interface{}, b []byte, contentType string) (err error) +} + +type FormFile struct { + FileBytes []byte + FileName string + FormFileName string +} + +type DoitpaySdkError struct { + rawResponse map[string]interface{} + status string + errorCode string + errorMessage string +} + +func NewDoitpaySdkError(response *[]byte, paramStatus string, paramStatusText string) *DoitpaySdkError { + var _rawResponse map[string]interface{} + + err := json.Unmarshal(*response, &_rawResponse) + if err != nil { + _rawResponse = map[string]interface{}{} + } + + _status := paramStatus + + if _status == "" { + if val, ok := _rawResponse["status"]; ok { + _status = fmt.Sprintf("%v", val) + } + } + if _status == "" { + if val, ok := _rawResponse["status_code"]; ok { + _status = fmt.Sprintf("%v", val) + } + } + if _status == "" { + if val, ok := _rawResponse["statusCode"]; ok { + _status = fmt.Sprintf("%v", val) + } + } + + _errorCode := "" + if _errorCode == "" { + if val, ok := _rawResponse["error"]; ok { + _errorCode = fmt.Sprintf("%v", val) + } + } + if _errorCode == "" { + if val, ok := _rawResponse["error_code"]; ok { + _errorCode = fmt.Sprintf("%v", val) + } + } + if _errorCode == "" { + if val, ok := _rawResponse["errorCode"]; ok { + _errorCode = fmt.Sprintf("%v", val) + } + } + + _errorMessage := "" + if _errorMessage == "" { + if val, ok := _rawResponse["message"]; ok { + _errorMessage = fmt.Sprintf("%v", val) + } + } + if _errorMessage == "" { + if val, ok := _rawResponse["error_message"]; ok { + _errorMessage = fmt.Sprintf("%v", val) + } + } + if _errorMessage == "" { + if val, ok := _rawResponse["errorMessage"]; ok { + _errorMessage = fmt.Sprintf("%v", val) + } + } + if _errorMessage == "" { + _errorMessage = paramStatusText + } + + return &DoitpaySdkError{ + rawResponse: _rawResponse, + status: _status, + errorCode: _errorCode, + errorMessage: _errorMessage, + } +} + +func (e DoitpaySdkError) Error() string { + return e.errorMessage +} + +func (e DoitpaySdkError) ErrorCode() string { + return e.errorCode +} + +func (e DoitpaySdkError) RawResponse() map[string]interface{} { + return e.rawResponse +} + +func (e DoitpaySdkError) Status() string { + return e.status +} + +func (e DoitpaySdkError) FullError() map[string]interface{} { + return map[string]interface{}{ + "rawResponse": e.rawResponse, + "status": e.status, + "errorCode": e.errorCode, + "errorMessage": e.errorMessage, + } +} diff --git a/configuration.go b/configuration.go new file mode 100644 index 0000000..71230de --- /dev/null +++ b/configuration.go @@ -0,0 +1,217 @@ +package doitpay + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. + ContextOAuth2 = contextKey("token") + + // ContextBasicAuth takes BasicAuth as authentication for the request. + ContextBasicAuth = contextKey("basic") + + // ContextAPIKeys takes a string apikey as authentication for the request + ContextAPIKeys = contextKey("apiKeys") + + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "http://localhost:8000", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{}, + } + return cfg +} + +func (c *Configuration) GetConfig() Configuration { + return *NewConfiguration() +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/docs/balance/InternalWebControllersMerchantApiv1BalanceBalance.md b/docs/balance/InternalWebControllersMerchantApiv1BalanceBalance.md new file mode 100644 index 0000000..aed2928 --- /dev/null +++ b/docs/balance/InternalWebControllersMerchantApiv1BalanceBalance.md @@ -0,0 +1,82 @@ +# InternalWebControllersMerchantApiv1BalanceBalance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Gross** | Pointer to **float32** | | [optional] +**Net** | Pointer to **float32** | | [optional] + +## Methods + +### NewInternalWebControllersMerchantApiv1BalanceBalance + +`func NewInternalWebControllersMerchantApiv1BalanceBalance() *InternalWebControllersMerchantApiv1BalanceBalance` + +NewInternalWebControllersMerchantApiv1BalanceBalance instantiates a new InternalWebControllersMerchantApiv1BalanceBalance object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalWebControllersMerchantApiv1BalanceBalanceWithDefaults + +`func NewInternalWebControllersMerchantApiv1BalanceBalanceWithDefaults() *InternalWebControllersMerchantApiv1BalanceBalance` + +NewInternalWebControllersMerchantApiv1BalanceBalanceWithDefaults instantiates a new InternalWebControllersMerchantApiv1BalanceBalance object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetGross + +`func (o *InternalWebControllersMerchantApiv1BalanceBalance) GetGross() float32` + +GetGross returns the Gross field if non-nil, zero value otherwise. + +### GetGrossOk + +`func (o *InternalWebControllersMerchantApiv1BalanceBalance) GetGrossOk() (*float32, bool)` + +GetGrossOk returns a tuple with the Gross field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGross + +`func (o *InternalWebControllersMerchantApiv1BalanceBalance) SetGross(v float32)` + +SetGross sets Gross field to given value. + +### HasGross + +`func (o *InternalWebControllersMerchantApiv1BalanceBalance) HasGross() bool` + +HasGross returns a boolean if a field has been set. + +### GetNet + +`func (o *InternalWebControllersMerchantApiv1BalanceBalance) GetNet() float32` + +GetNet returns the Net field if non-nil, zero value otherwise. + +### GetNetOk + +`func (o *InternalWebControllersMerchantApiv1BalanceBalance) GetNetOk() (*float32, bool)` + +GetNetOk returns a tuple with the Net field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNet + +`func (o *InternalWebControllersMerchantApiv1BalanceBalance) SetNet(v float32)` + +SetNet sets Net field to given value. + +### HasNet + +`func (o *InternalWebControllersMerchantApiv1BalanceBalance) HasNet() bool` + +HasNet returns a boolean if a field has been set. + + +[[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/InternalWebControllersMerchantApiv1BalanceStandardMeta.md b/docs/balance/InternalWebControllersMerchantApiv1BalanceStandardMeta.md new file mode 100644 index 0000000..3dfae4d --- /dev/null +++ b/docs/balance/InternalWebControllersMerchantApiv1BalanceStandardMeta.md @@ -0,0 +1,82 @@ +# InternalWebControllersMerchantApiv1BalanceStandardMeta + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ProcessingTime** | Pointer to **string** | | [optional] +**VersionApi** | Pointer to **string** | | [optional] + +## Methods + +### NewInternalWebControllersMerchantApiv1BalanceStandardMeta + +`func NewInternalWebControllersMerchantApiv1BalanceStandardMeta() *InternalWebControllersMerchantApiv1BalanceStandardMeta` + +NewInternalWebControllersMerchantApiv1BalanceStandardMeta instantiates a new InternalWebControllersMerchantApiv1BalanceStandardMeta object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalWebControllersMerchantApiv1BalanceStandardMetaWithDefaults + +`func NewInternalWebControllersMerchantApiv1BalanceStandardMetaWithDefaults() *InternalWebControllersMerchantApiv1BalanceStandardMeta` + +NewInternalWebControllersMerchantApiv1BalanceStandardMetaWithDefaults instantiates a new InternalWebControllersMerchantApiv1BalanceStandardMeta object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetProcessingTime + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardMeta) GetProcessingTime() string` + +GetProcessingTime returns the ProcessingTime field if non-nil, zero value otherwise. + +### GetProcessingTimeOk + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardMeta) GetProcessingTimeOk() (*string, bool)` + +GetProcessingTimeOk returns a tuple with the ProcessingTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProcessingTime + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardMeta) SetProcessingTime(v string)` + +SetProcessingTime sets ProcessingTime field to given value. + +### HasProcessingTime + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardMeta) HasProcessingTime() bool` + +HasProcessingTime returns a boolean if a field has been set. + +### GetVersionApi + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardMeta) GetVersionApi() string` + +GetVersionApi returns the VersionApi field if non-nil, zero value otherwise. + +### GetVersionApiOk + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardMeta) GetVersionApiOk() (*string, bool)` + +GetVersionApiOk returns a tuple with the VersionApi field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersionApi + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardMeta) SetVersionApi(v string)` + +SetVersionApi sets VersionApi field to given value. + +### HasVersionApi + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardMeta) HasVersionApi() bool` + +HasVersionApi returns a boolean if a field has been set. + + +[[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/InternalWebControllersMerchantApiv1BalanceStandardResponse.md b/docs/balance/InternalWebControllersMerchantApiv1BalanceStandardResponse.md new file mode 100644 index 0000000..7c70173 --- /dev/null +++ b/docs/balance/InternalWebControllersMerchantApiv1BalanceStandardResponse.md @@ -0,0 +1,160 @@ +# InternalWebControllersMerchantApiv1BalanceStandardResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | Pointer to **int32** | | [optional] +**Data** | Pointer to [**InternalWebControllersMerchantApiv1BalanceBalance**](InternalWebControllersMerchantApiv1BalanceBalance.md) | | [optional] +**Message** | Pointer to **string** | | [optional] +**Meta** | Pointer to [**InternalWebControllersMerchantApiv1BalanceStandardMeta**](InternalWebControllersMerchantApiv1BalanceStandardMeta.md) | | [optional] +**Status** | Pointer to **string** | | [optional] + +## Methods + +### NewInternalWebControllersMerchantApiv1BalanceStandardResponse + +`func NewInternalWebControllersMerchantApiv1BalanceStandardResponse() *InternalWebControllersMerchantApiv1BalanceStandardResponse` + +NewInternalWebControllersMerchantApiv1BalanceStandardResponse instantiates a new InternalWebControllersMerchantApiv1BalanceStandardResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalWebControllersMerchantApiv1BalanceStandardResponseWithDefaults + +`func NewInternalWebControllersMerchantApiv1BalanceStandardResponseWithDefaults() *InternalWebControllersMerchantApiv1BalanceStandardResponse` + +NewInternalWebControllersMerchantApiv1BalanceStandardResponseWithDefaults instantiates a new InternalWebControllersMerchantApiv1BalanceStandardResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) GetCode() int32` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) GetCodeOk() (*int32, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) SetCode(v int32)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetData + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) GetData() InternalWebControllersMerchantApiv1BalanceBalance` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) GetDataOk() (*InternalWebControllersMerchantApiv1BalanceBalance, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) SetData(v InternalWebControllersMerchantApiv1BalanceBalance)` + +SetData sets Data field to given value. + +### HasData + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) HasData() bool` + +HasData returns a boolean if a field has been set. + +### GetMessage + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + +### GetMeta + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) GetMeta() InternalWebControllersMerchantApiv1BalanceStandardMeta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) GetMetaOk() (*InternalWebControllersMerchantApiv1BalanceStandardMeta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) SetMeta(v InternalWebControllersMerchantApiv1BalanceStandardMeta)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) HasMeta() bool` + +HasMeta returns a boolean if a field has been set. + +### GetStatus + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *InternalWebControllersMerchantApiv1BalanceStandardResponse) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + + +[[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/PublicBalanceAPI.md b/docs/balance/PublicBalanceAPI.md new file mode 100644 index 0000000..fef0a8c --- /dev/null +++ b/docs/balance/PublicBalanceAPI.md @@ -0,0 +1,70 @@ +# \PublicBalanceAPI + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetBalance**](PublicBalanceAPI.md#GetBalance) | **Get** /merchant/v1/balance | Get Balance. + + + +## GetBalance + +> InternalWebControllersMerchantApiv1BalanceStandardResponse GetBalance(ctx).Execute() + +Get Balance. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/automotechnologies/doitpay" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicBalanceAPI.GetBalance(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicBalanceAPI.GetBalance``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetBalance`: InternalWebControllersMerchantApiv1BalanceStandardResponse + fmt.Fprintf(os.Stdout, "Response from `PublicBalanceAPI.GetBalance`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetBalanceRequest struct via the builder pattern + + +### Return type + +[**InternalWebControllersMerchantApiv1BalanceStandardResponse**](InternalWebControllersMerchantApiv1BalanceStandardResponse.md) + +### Authorization + +[BasicAuth](../README.md#BasicAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/invoice/InternalWebControllersMerchantApiv1InvoiceCustomer.md b/docs/invoice/InternalWebControllersMerchantApiv1InvoiceCustomer.md new file mode 100644 index 0000000..f4093c9 --- /dev/null +++ b/docs/invoice/InternalWebControllersMerchantApiv1InvoiceCustomer.md @@ -0,0 +1,264 @@ +# InternalWebControllersMerchantApiv1InvoiceCustomer + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Addresses** | Pointer to **string** | | [optional] +**City** | Pointer to **string** | | [optional] +**Country** | Pointer to **string** | | [optional] +**CustomerRefId** | Pointer to **string** | | [optional] +**Email** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] +**Notes** | Pointer to **string** | | [optional] +**Phone** | Pointer to **string** | | [optional] +**PostalCode** | Pointer to **int32** | | [optional] + +## Methods + +### NewInternalWebControllersMerchantApiv1InvoiceCustomer + +`func NewInternalWebControllersMerchantApiv1InvoiceCustomer() *InternalWebControllersMerchantApiv1InvoiceCustomer` + +NewInternalWebControllersMerchantApiv1InvoiceCustomer instantiates a new InternalWebControllersMerchantApiv1InvoiceCustomer object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalWebControllersMerchantApiv1InvoiceCustomerWithDefaults + +`func NewInternalWebControllersMerchantApiv1InvoiceCustomerWithDefaults() *InternalWebControllersMerchantApiv1InvoiceCustomer` + +NewInternalWebControllersMerchantApiv1InvoiceCustomerWithDefaults instantiates a new InternalWebControllersMerchantApiv1InvoiceCustomer object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddresses + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetAddresses() string` + +GetAddresses returns the Addresses field if non-nil, zero value otherwise. + +### GetAddressesOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetAddressesOk() (*string, bool)` + +GetAddressesOk returns a tuple with the Addresses field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddresses + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) SetAddresses(v string)` + +SetAddresses sets Addresses field to given value. + +### HasAddresses + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) HasAddresses() bool` + +HasAddresses returns a boolean if a field has been set. + +### GetCity + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetCity() string` + +GetCity returns the City field if non-nil, zero value otherwise. + +### GetCityOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetCityOk() (*string, bool)` + +GetCityOk returns a tuple with the City field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCity + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) SetCity(v string)` + +SetCity sets City field to given value. + +### HasCity + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) HasCity() bool` + +HasCity returns a boolean if a field has been set. + +### GetCountry + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) SetCountry(v string)` + +SetCountry sets Country field to given value. + +### HasCountry + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) HasCountry() bool` + +HasCountry returns a boolean if a field has been set. + +### GetCustomerRefId + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetCustomerRefId() string` + +GetCustomerRefId returns the CustomerRefId field if non-nil, zero value otherwise. + +### GetCustomerRefIdOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetCustomerRefIdOk() (*string, bool)` + +GetCustomerRefIdOk returns a tuple with the CustomerRefId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerRefId + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) SetCustomerRefId(v string)` + +SetCustomerRefId sets CustomerRefId field to given value. + +### HasCustomerRefId + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) HasCustomerRefId() bool` + +HasCustomerRefId returns a boolean if a field has been set. + +### GetEmail + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetEmail() string` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetEmailOk() (*string, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmail + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) SetEmail(v string)` + +SetEmail sets Email field to given value. + +### HasEmail + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) HasEmail() bool` + +HasEmail returns a boolean if a field has been set. + +### GetName + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetNotes + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetNotes() string` + +GetNotes returns the Notes field if non-nil, zero value otherwise. + +### GetNotesOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetNotesOk() (*string, bool)` + +GetNotesOk returns a tuple with the Notes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotes + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) SetNotes(v string)` + +SetNotes sets Notes field to given value. + +### HasNotes + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) HasNotes() bool` + +HasNotes returns a boolean if a field has been set. + +### GetPhone + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetPhone() string` + +GetPhone returns the Phone field if non-nil, zero value otherwise. + +### GetPhoneOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetPhoneOk() (*string, bool)` + +GetPhoneOk returns a tuple with the Phone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPhone + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) SetPhone(v string)` + +SetPhone sets Phone field to given value. + +### HasPhone + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) HasPhone() bool` + +HasPhone returns a boolean if a field has been set. + +### GetPostalCode + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetPostalCode() int32` + +GetPostalCode returns the PostalCode field if non-nil, zero value otherwise. + +### GetPostalCodeOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetPostalCodeOk() (*int32, bool)` + +GetPostalCodeOk returns a tuple with the PostalCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPostalCode + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) SetPostalCode(v int32)` + +SetPostalCode sets PostalCode field to given value. + +### HasPostalCode + +`func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) HasPostalCode() bool` + +HasPostalCode returns a boolean if a field has been set. + + +[[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/InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse.md b/docs/invoice/InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse.md new file mode 100644 index 0000000..0ea474a --- /dev/null +++ b/docs/invoice/InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse.md @@ -0,0 +1,446 @@ +# InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Amount** | Pointer to **float32** | | [optional] +**AmountCurrency** | Pointer to **string** | | [optional] +**Country** | Pointer to **string** | | [optional] +**Customer** | Pointer to [**InternalWebControllersMerchantApiv1InvoiceCustomer**](InternalWebControllersMerchantApiv1InvoiceCustomer.md) | | [optional] +**CustomerNotification** | Pointer to **[]string** | | [optional] +**ExternalId** | Pointer to **string** | | [optional] +**InvoiceLinkId** | Pointer to **string** | | [optional] +**Items** | Pointer to [**[]InternalWebControllersMerchantApiv1InvoiceItem**](InternalWebControllersMerchantApiv1InvoiceItem.md) | | [optional] +**MerchantLogo** | Pointer to **string** | | [optional] +**MerchantName** | Pointer to **string** | | [optional] +**Notes** | Pointer to **string** | | [optional] +**PaymentMethods** | Pointer to [**[]InternalWebControllersMerchantApiv1InvoicePaymentMethod**](InternalWebControllersMerchantApiv1InvoicePaymentMethod.md) | | [optional] +**RedirectUrl** | Pointer to [**InternalWebControllersMerchantApiv1InvoiceRedirectURL**](InternalWebControllersMerchantApiv1InvoiceRedirectURL.md) | | [optional] +**Status** | Pointer to **string** | | [optional] +**TimeBegin** | Pointer to **string** | | [optional] +**TimeEnd** | Pointer to **string** | | [optional] + +## Methods + +### NewInternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse + +`func NewInternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse() *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse` + +NewInternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse instantiates a new InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponseWithDefaults + +`func NewInternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponseWithDefaults() *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse` + +NewInternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponseWithDefaults instantiates a new InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAmount + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetAmount() float32` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetAmountOk() (*float32, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetAmount(v float32)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### GetAmountCurrency + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetAmountCurrency() string` + +GetAmountCurrency returns the AmountCurrency field if non-nil, zero value otherwise. + +### GetAmountCurrencyOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetAmountCurrencyOk() (*string, bool)` + +GetAmountCurrencyOk returns a tuple with the AmountCurrency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmountCurrency + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetAmountCurrency(v string)` + +SetAmountCurrency sets AmountCurrency field to given value. + +### HasAmountCurrency + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasAmountCurrency() bool` + +HasAmountCurrency returns a boolean if a field has been set. + +### GetCountry + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetCountry(v string)` + +SetCountry sets Country field to given value. + +### HasCountry + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasCountry() bool` + +HasCountry returns a boolean if a field has been set. + +### GetCustomer + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetCustomer() InternalWebControllersMerchantApiv1InvoiceCustomer` + +GetCustomer returns the Customer field if non-nil, zero value otherwise. + +### GetCustomerOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetCustomerOk() (*InternalWebControllersMerchantApiv1InvoiceCustomer, bool)` + +GetCustomerOk returns a tuple with the Customer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomer + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetCustomer(v InternalWebControllersMerchantApiv1InvoiceCustomer)` + +SetCustomer sets Customer field to given value. + +### HasCustomer + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasCustomer() bool` + +HasCustomer returns a boolean if a field has been set. + +### GetCustomerNotification + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetCustomerNotification() []string` + +GetCustomerNotification returns the CustomerNotification field if non-nil, zero value otherwise. + +### GetCustomerNotificationOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetCustomerNotificationOk() (*[]string, bool)` + +GetCustomerNotificationOk returns a tuple with the CustomerNotification field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerNotification + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetCustomerNotification(v []string)` + +SetCustomerNotification sets CustomerNotification field to given value. + +### HasCustomerNotification + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasCustomerNotification() bool` + +HasCustomerNotification returns a boolean if a field has been set. + +### GetExternalId + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetExternalId() string` + +GetExternalId returns the ExternalId field if non-nil, zero value otherwise. + +### GetExternalIdOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetExternalIdOk() (*string, bool)` + +GetExternalIdOk returns a tuple with the ExternalId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExternalId + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetExternalId(v string)` + +SetExternalId sets ExternalId field to given value. + +### HasExternalId + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasExternalId() bool` + +HasExternalId returns a boolean if a field has been set. + +### GetInvoiceLinkId + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetInvoiceLinkId() string` + +GetInvoiceLinkId returns the InvoiceLinkId field if non-nil, zero value otherwise. + +### GetInvoiceLinkIdOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetInvoiceLinkIdOk() (*string, bool)` + +GetInvoiceLinkIdOk returns a tuple with the InvoiceLinkId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInvoiceLinkId + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetInvoiceLinkId(v string)` + +SetInvoiceLinkId sets InvoiceLinkId field to given value. + +### HasInvoiceLinkId + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasInvoiceLinkId() bool` + +HasInvoiceLinkId returns a boolean if a field has been set. + +### GetItems + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetItems() []InternalWebControllersMerchantApiv1InvoiceItem` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetItemsOk() (*[]InternalWebControllersMerchantApiv1InvoiceItem, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetItems(v []InternalWebControllersMerchantApiv1InvoiceItem)` + +SetItems sets Items field to given value. + +### HasItems + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasItems() bool` + +HasItems returns a boolean if a field has been set. + +### GetMerchantLogo + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetMerchantLogo() string` + +GetMerchantLogo returns the MerchantLogo field if non-nil, zero value otherwise. + +### GetMerchantLogoOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetMerchantLogoOk() (*string, bool)` + +GetMerchantLogoOk returns a tuple with the MerchantLogo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantLogo + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetMerchantLogo(v string)` + +SetMerchantLogo sets MerchantLogo field to given value. + +### HasMerchantLogo + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasMerchantLogo() bool` + +HasMerchantLogo returns a boolean if a field has been set. + +### GetMerchantName + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetMerchantName() string` + +GetMerchantName returns the MerchantName field if non-nil, zero value otherwise. + +### GetMerchantNameOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetMerchantNameOk() (*string, bool)` + +GetMerchantNameOk returns a tuple with the MerchantName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantName + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetMerchantName(v string)` + +SetMerchantName sets MerchantName field to given value. + +### HasMerchantName + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasMerchantName() bool` + +HasMerchantName returns a boolean if a field has been set. + +### GetNotes + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetNotes() string` + +GetNotes returns the Notes field if non-nil, zero value otherwise. + +### GetNotesOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetNotesOk() (*string, bool)` + +GetNotesOk returns a tuple with the Notes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotes + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetNotes(v string)` + +SetNotes sets Notes field to given value. + +### HasNotes + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasNotes() bool` + +HasNotes returns a boolean if a field has been set. + +### GetPaymentMethods + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetPaymentMethods() []InternalWebControllersMerchantApiv1InvoicePaymentMethod` + +GetPaymentMethods returns the PaymentMethods field if non-nil, zero value otherwise. + +### GetPaymentMethodsOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetPaymentMethodsOk() (*[]InternalWebControllersMerchantApiv1InvoicePaymentMethod, bool)` + +GetPaymentMethodsOk returns a tuple with the PaymentMethods field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentMethods + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetPaymentMethods(v []InternalWebControllersMerchantApiv1InvoicePaymentMethod)` + +SetPaymentMethods sets PaymentMethods field to given value. + +### HasPaymentMethods + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasPaymentMethods() bool` + +HasPaymentMethods returns a boolean if a field has been set. + +### GetRedirectUrl + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetRedirectUrl() InternalWebControllersMerchantApiv1InvoiceRedirectURL` + +GetRedirectUrl returns the RedirectUrl field if non-nil, zero value otherwise. + +### GetRedirectUrlOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetRedirectUrlOk() (*InternalWebControllersMerchantApiv1InvoiceRedirectURL, bool)` + +GetRedirectUrlOk returns a tuple with the RedirectUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRedirectUrl + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetRedirectUrl(v InternalWebControllersMerchantApiv1InvoiceRedirectURL)` + +SetRedirectUrl sets RedirectUrl field to given value. + +### HasRedirectUrl + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasRedirectUrl() bool` + +HasRedirectUrl returns a boolean if a field has been set. + +### GetStatus + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetTimeBegin + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetTimeBegin() string` + +GetTimeBegin returns the TimeBegin field if non-nil, zero value otherwise. + +### GetTimeBeginOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetTimeBeginOk() (*string, bool)` + +GetTimeBeginOk returns a tuple with the TimeBegin field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeBegin + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetTimeBegin(v string)` + +SetTimeBegin sets TimeBegin field to given value. + +### HasTimeBegin + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasTimeBegin() bool` + +HasTimeBegin returns a boolean if a field has been set. + +### GetTimeEnd + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetTimeEnd() string` + +GetTimeEnd returns the TimeEnd field if non-nil, zero value otherwise. + +### GetTimeEndOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetTimeEndOk() (*string, bool)` + +GetTimeEndOk returns a tuple with the TimeEnd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeEnd + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetTimeEnd(v string)` + +SetTimeEnd sets TimeEnd field to given value. + +### HasTimeEnd + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasTimeEnd() bool` + +HasTimeEnd returns a boolean if a field has been set. + + +[[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/InternalWebControllersMerchantApiv1InvoiceInvoiceRequest.md b/docs/invoice/InternalWebControllersMerchantApiv1InvoiceInvoiceRequest.md new file mode 100644 index 0000000..b242a5f --- /dev/null +++ b/docs/invoice/InternalWebControllersMerchantApiv1InvoiceInvoiceRequest.md @@ -0,0 +1,342 @@ +# InternalWebControllersMerchantApiv1InvoiceInvoiceRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Amount** | Pointer to **float32** | | [optional] +**AmountCurrency** | Pointer to **string** | | [optional] +**Country** | Pointer to **string** | | [optional] +**Customer** | Pointer to [**InternalWebControllersMerchantApiv1InvoiceCustomer**](InternalWebControllersMerchantApiv1InvoiceCustomer.md) | | [optional] +**CustomerNotification** | Pointer to **[]string** | | [optional] +**ExternalId** | Pointer to **string** | | [optional] +**Items** | Pointer to [**[]InternalWebControllersMerchantApiv1InvoiceItem**](InternalWebControllersMerchantApiv1InvoiceItem.md) | | [optional] +**Notes** | Pointer to **string** | | [optional] +**PaymentMethods** | Pointer to [**[]InternalWebControllersMerchantApiv1InvoicePaymentMethod**](InternalWebControllersMerchantApiv1InvoicePaymentMethod.md) | | [optional] +**RedirectUrl** | Pointer to [**InternalWebControllersMerchantApiv1InvoiceRedirectURL**](InternalWebControllersMerchantApiv1InvoiceRedirectURL.md) | | [optional] +**TimeBegin** | Pointer to **string** | | [optional] +**TimeEnd** | Pointer to **string** | | [optional] + +## Methods + +### NewInternalWebControllersMerchantApiv1InvoiceInvoiceRequest + +`func NewInternalWebControllersMerchantApiv1InvoiceInvoiceRequest() *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest` + +NewInternalWebControllersMerchantApiv1InvoiceInvoiceRequest instantiates a new InternalWebControllersMerchantApiv1InvoiceInvoiceRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalWebControllersMerchantApiv1InvoiceInvoiceRequestWithDefaults + +`func NewInternalWebControllersMerchantApiv1InvoiceInvoiceRequestWithDefaults() *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest` + +NewInternalWebControllersMerchantApiv1InvoiceInvoiceRequestWithDefaults instantiates a new InternalWebControllersMerchantApiv1InvoiceInvoiceRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAmount + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetAmount() float32` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetAmountOk() (*float32, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetAmount(v float32)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### GetAmountCurrency + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetAmountCurrency() string` + +GetAmountCurrency returns the AmountCurrency field if non-nil, zero value otherwise. + +### GetAmountCurrencyOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetAmountCurrencyOk() (*string, bool)` + +GetAmountCurrencyOk returns a tuple with the AmountCurrency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmountCurrency + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetAmountCurrency(v string)` + +SetAmountCurrency sets AmountCurrency field to given value. + +### HasAmountCurrency + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasAmountCurrency() bool` + +HasAmountCurrency returns a boolean if a field has been set. + +### GetCountry + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetCountry(v string)` + +SetCountry sets Country field to given value. + +### HasCountry + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasCountry() bool` + +HasCountry returns a boolean if a field has been set. + +### GetCustomer + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetCustomer() InternalWebControllersMerchantApiv1InvoiceCustomer` + +GetCustomer returns the Customer field if non-nil, zero value otherwise. + +### GetCustomerOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetCustomerOk() (*InternalWebControllersMerchantApiv1InvoiceCustomer, bool)` + +GetCustomerOk returns a tuple with the Customer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomer + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetCustomer(v InternalWebControllersMerchantApiv1InvoiceCustomer)` + +SetCustomer sets Customer field to given value. + +### HasCustomer + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasCustomer() bool` + +HasCustomer returns a boolean if a field has been set. + +### GetCustomerNotification + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetCustomerNotification() []string` + +GetCustomerNotification returns the CustomerNotification field if non-nil, zero value otherwise. + +### GetCustomerNotificationOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetCustomerNotificationOk() (*[]string, bool)` + +GetCustomerNotificationOk returns a tuple with the CustomerNotification field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerNotification + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetCustomerNotification(v []string)` + +SetCustomerNotification sets CustomerNotification field to given value. + +### HasCustomerNotification + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasCustomerNotification() bool` + +HasCustomerNotification returns a boolean if a field has been set. + +### GetExternalId + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetExternalId() string` + +GetExternalId returns the ExternalId field if non-nil, zero value otherwise. + +### GetExternalIdOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetExternalIdOk() (*string, bool)` + +GetExternalIdOk returns a tuple with the ExternalId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExternalId + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetExternalId(v string)` + +SetExternalId sets ExternalId field to given value. + +### HasExternalId + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasExternalId() bool` + +HasExternalId returns a boolean if a field has been set. + +### GetItems + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetItems() []InternalWebControllersMerchantApiv1InvoiceItem` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetItemsOk() (*[]InternalWebControllersMerchantApiv1InvoiceItem, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetItems(v []InternalWebControllersMerchantApiv1InvoiceItem)` + +SetItems sets Items field to given value. + +### HasItems + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasItems() bool` + +HasItems returns a boolean if a field has been set. + +### GetNotes + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetNotes() string` + +GetNotes returns the Notes field if non-nil, zero value otherwise. + +### GetNotesOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetNotesOk() (*string, bool)` + +GetNotesOk returns a tuple with the Notes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotes + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetNotes(v string)` + +SetNotes sets Notes field to given value. + +### HasNotes + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasNotes() bool` + +HasNotes returns a boolean if a field has been set. + +### GetPaymentMethods + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetPaymentMethods() []InternalWebControllersMerchantApiv1InvoicePaymentMethod` + +GetPaymentMethods returns the PaymentMethods field if non-nil, zero value otherwise. + +### GetPaymentMethodsOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetPaymentMethodsOk() (*[]InternalWebControllersMerchantApiv1InvoicePaymentMethod, bool)` + +GetPaymentMethodsOk returns a tuple with the PaymentMethods field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentMethods + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetPaymentMethods(v []InternalWebControllersMerchantApiv1InvoicePaymentMethod)` + +SetPaymentMethods sets PaymentMethods field to given value. + +### HasPaymentMethods + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasPaymentMethods() bool` + +HasPaymentMethods returns a boolean if a field has been set. + +### GetRedirectUrl + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetRedirectUrl() InternalWebControllersMerchantApiv1InvoiceRedirectURL` + +GetRedirectUrl returns the RedirectUrl field if non-nil, zero value otherwise. + +### GetRedirectUrlOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetRedirectUrlOk() (*InternalWebControllersMerchantApiv1InvoiceRedirectURL, bool)` + +GetRedirectUrlOk returns a tuple with the RedirectUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRedirectUrl + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetRedirectUrl(v InternalWebControllersMerchantApiv1InvoiceRedirectURL)` + +SetRedirectUrl sets RedirectUrl field to given value. + +### HasRedirectUrl + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasRedirectUrl() bool` + +HasRedirectUrl returns a boolean if a field has been set. + +### GetTimeBegin + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetTimeBegin() string` + +GetTimeBegin returns the TimeBegin field if non-nil, zero value otherwise. + +### GetTimeBeginOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetTimeBeginOk() (*string, bool)` + +GetTimeBeginOk returns a tuple with the TimeBegin field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeBegin + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetTimeBegin(v string)` + +SetTimeBegin sets TimeBegin field to given value. + +### HasTimeBegin + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasTimeBegin() bool` + +HasTimeBegin returns a boolean if a field has been set. + +### GetTimeEnd + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetTimeEnd() string` + +GetTimeEnd returns the TimeEnd field if non-nil, zero value otherwise. + +### GetTimeEndOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetTimeEndOk() (*string, bool)` + +GetTimeEndOk returns a tuple with the TimeEnd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeEnd + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetTimeEnd(v string)` + +SetTimeEnd sets TimeEnd field to given value. + +### HasTimeEnd + +`func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasTimeEnd() bool` + +HasTimeEnd returns a boolean if a field has been set. + + +[[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/InternalWebControllersMerchantApiv1InvoiceItem.md b/docs/invoice/InternalWebControllersMerchantApiv1InvoiceItem.md new file mode 100644 index 0000000..9c90ad8 --- /dev/null +++ b/docs/invoice/InternalWebControllersMerchantApiv1InvoiceItem.md @@ -0,0 +1,160 @@ +# InternalWebControllersMerchantApiv1InvoiceItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SKU** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] +**Notes** | Pointer to **string** | | [optional] +**Price** | Pointer to **float32** | | [optional] +**Quantity** | Pointer to **int32** | | [optional] + +## Methods + +### NewInternalWebControllersMerchantApiv1InvoiceItem + +`func NewInternalWebControllersMerchantApiv1InvoiceItem() *InternalWebControllersMerchantApiv1InvoiceItem` + +NewInternalWebControllersMerchantApiv1InvoiceItem instantiates a new InternalWebControllersMerchantApiv1InvoiceItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalWebControllersMerchantApiv1InvoiceItemWithDefaults + +`func NewInternalWebControllersMerchantApiv1InvoiceItemWithDefaults() *InternalWebControllersMerchantApiv1InvoiceItem` + +NewInternalWebControllersMerchantApiv1InvoiceItemWithDefaults instantiates a new InternalWebControllersMerchantApiv1InvoiceItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSKU + +`func (o *InternalWebControllersMerchantApiv1InvoiceItem) GetSKU() string` + +GetSKU returns the SKU field if non-nil, zero value otherwise. + +### GetSKUOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceItem) GetSKUOk() (*string, bool)` + +GetSKUOk returns a tuple with the SKU field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSKU + +`func (o *InternalWebControllersMerchantApiv1InvoiceItem) SetSKU(v string)` + +SetSKU sets SKU field to given value. + +### HasSKU + +`func (o *InternalWebControllersMerchantApiv1InvoiceItem) HasSKU() bool` + +HasSKU returns a boolean if a field has been set. + +### GetName + +`func (o *InternalWebControllersMerchantApiv1InvoiceItem) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceItem) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *InternalWebControllersMerchantApiv1InvoiceItem) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *InternalWebControllersMerchantApiv1InvoiceItem) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetNotes + +`func (o *InternalWebControllersMerchantApiv1InvoiceItem) GetNotes() string` + +GetNotes returns the Notes field if non-nil, zero value otherwise. + +### GetNotesOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceItem) GetNotesOk() (*string, bool)` + +GetNotesOk returns a tuple with the Notes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotes + +`func (o *InternalWebControllersMerchantApiv1InvoiceItem) SetNotes(v string)` + +SetNotes sets Notes field to given value. + +### HasNotes + +`func (o *InternalWebControllersMerchantApiv1InvoiceItem) HasNotes() bool` + +HasNotes returns a boolean if a field has been set. + +### GetPrice + +`func (o *InternalWebControllersMerchantApiv1InvoiceItem) GetPrice() float32` + +GetPrice returns the Price field if non-nil, zero value otherwise. + +### GetPriceOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceItem) GetPriceOk() (*float32, bool)` + +GetPriceOk returns a tuple with the Price field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrice + +`func (o *InternalWebControllersMerchantApiv1InvoiceItem) SetPrice(v float32)` + +SetPrice sets Price field to given value. + +### HasPrice + +`func (o *InternalWebControllersMerchantApiv1InvoiceItem) HasPrice() bool` + +HasPrice returns a boolean if a field has been set. + +### GetQuantity + +`func (o *InternalWebControllersMerchantApiv1InvoiceItem) GetQuantity() int32` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceItem) GetQuantityOk() (*int32, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *InternalWebControllersMerchantApiv1InvoiceItem) SetQuantity(v int32)` + +SetQuantity sets Quantity field to given value. + +### HasQuantity + +`func (o *InternalWebControllersMerchantApiv1InvoiceItem) HasQuantity() bool` + +HasQuantity returns a boolean if a field has been set. + + +[[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/InternalWebControllersMerchantApiv1InvoicePaymentMethod.md b/docs/invoice/InternalWebControllersMerchantApiv1InvoicePaymentMethod.md new file mode 100644 index 0000000..2f62daf --- /dev/null +++ b/docs/invoice/InternalWebControllersMerchantApiv1InvoicePaymentMethod.md @@ -0,0 +1,108 @@ +# InternalWebControllersMerchantApiv1InvoicePaymentMethod + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | Pointer to **string** | | [optional] +**Status** | Pointer to **string** | | [optional] +**Type** | Pointer to **string** | | [optional] + +## Methods + +### NewInternalWebControllersMerchantApiv1InvoicePaymentMethod + +`func NewInternalWebControllersMerchantApiv1InvoicePaymentMethod() *InternalWebControllersMerchantApiv1InvoicePaymentMethod` + +NewInternalWebControllersMerchantApiv1InvoicePaymentMethod instantiates a new InternalWebControllersMerchantApiv1InvoicePaymentMethod object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalWebControllersMerchantApiv1InvoicePaymentMethodWithDefaults + +`func NewInternalWebControllersMerchantApiv1InvoicePaymentMethodWithDefaults() *InternalWebControllersMerchantApiv1InvoicePaymentMethod` + +NewInternalWebControllersMerchantApiv1InvoicePaymentMethodWithDefaults instantiates a new InternalWebControllersMerchantApiv1InvoicePaymentMethod object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) GetCode() string` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) GetCodeOk() (*string, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) SetCode(v string)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetStatus + +`func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetType + +`func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) HasType() bool` + +HasType returns a boolean if a field has been set. + + +[[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/InternalWebControllersMerchantApiv1InvoiceRedirectURL.md b/docs/invoice/InternalWebControllersMerchantApiv1InvoiceRedirectURL.md new file mode 100644 index 0000000..290307b --- /dev/null +++ b/docs/invoice/InternalWebControllersMerchantApiv1InvoiceRedirectURL.md @@ -0,0 +1,82 @@ +# InternalWebControllersMerchantApiv1InvoiceRedirectURL + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cancel** | Pointer to **string** | | [optional] +**Success** | Pointer to **string** | | [optional] + +## Methods + +### NewInternalWebControllersMerchantApiv1InvoiceRedirectURL + +`func NewInternalWebControllersMerchantApiv1InvoiceRedirectURL() *InternalWebControllersMerchantApiv1InvoiceRedirectURL` + +NewInternalWebControllersMerchantApiv1InvoiceRedirectURL instantiates a new InternalWebControllersMerchantApiv1InvoiceRedirectURL object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalWebControllersMerchantApiv1InvoiceRedirectURLWithDefaults + +`func NewInternalWebControllersMerchantApiv1InvoiceRedirectURLWithDefaults() *InternalWebControllersMerchantApiv1InvoiceRedirectURL` + +NewInternalWebControllersMerchantApiv1InvoiceRedirectURLWithDefaults instantiates a new InternalWebControllersMerchantApiv1InvoiceRedirectURL object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCancel + +`func (o *InternalWebControllersMerchantApiv1InvoiceRedirectURL) GetCancel() string` + +GetCancel returns the Cancel field if non-nil, zero value otherwise. + +### GetCancelOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceRedirectURL) GetCancelOk() (*string, bool)` + +GetCancelOk returns a tuple with the Cancel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCancel + +`func (o *InternalWebControllersMerchantApiv1InvoiceRedirectURL) SetCancel(v string)` + +SetCancel sets Cancel field to given value. + +### HasCancel + +`func (o *InternalWebControllersMerchantApiv1InvoiceRedirectURL) HasCancel() bool` + +HasCancel returns a boolean if a field has been set. + +### GetSuccess + +`func (o *InternalWebControllersMerchantApiv1InvoiceRedirectURL) GetSuccess() string` + +GetSuccess returns the Success field if non-nil, zero value otherwise. + +### GetSuccessOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceRedirectURL) GetSuccessOk() (*string, bool)` + +GetSuccessOk returns a tuple with the Success field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSuccess + +`func (o *InternalWebControllersMerchantApiv1InvoiceRedirectURL) SetSuccess(v string)` + +SetSuccess sets Success field to given value. + +### HasSuccess + +`func (o *InternalWebControllersMerchantApiv1InvoiceRedirectURL) HasSuccess() bool` + +HasSuccess returns a boolean if a field has been set. + + +[[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/InternalWebControllersMerchantApiv1InvoiceStandardMeta.md b/docs/invoice/InternalWebControllersMerchantApiv1InvoiceStandardMeta.md new file mode 100644 index 0000000..0c3b902 --- /dev/null +++ b/docs/invoice/InternalWebControllersMerchantApiv1InvoiceStandardMeta.md @@ -0,0 +1,82 @@ +# InternalWebControllersMerchantApiv1InvoiceStandardMeta + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ProcessingTime** | Pointer to **string** | | [optional] +**VersionApi** | Pointer to **string** | | [optional] + +## Methods + +### NewInternalWebControllersMerchantApiv1InvoiceStandardMeta + +`func NewInternalWebControllersMerchantApiv1InvoiceStandardMeta() *InternalWebControllersMerchantApiv1InvoiceStandardMeta` + +NewInternalWebControllersMerchantApiv1InvoiceStandardMeta instantiates a new InternalWebControllersMerchantApiv1InvoiceStandardMeta object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalWebControllersMerchantApiv1InvoiceStandardMetaWithDefaults + +`func NewInternalWebControllersMerchantApiv1InvoiceStandardMetaWithDefaults() *InternalWebControllersMerchantApiv1InvoiceStandardMeta` + +NewInternalWebControllersMerchantApiv1InvoiceStandardMetaWithDefaults instantiates a new InternalWebControllersMerchantApiv1InvoiceStandardMeta object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetProcessingTime + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardMeta) GetProcessingTime() string` + +GetProcessingTime returns the ProcessingTime field if non-nil, zero value otherwise. + +### GetProcessingTimeOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardMeta) GetProcessingTimeOk() (*string, bool)` + +GetProcessingTimeOk returns a tuple with the ProcessingTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProcessingTime + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardMeta) SetProcessingTime(v string)` + +SetProcessingTime sets ProcessingTime field to given value. + +### HasProcessingTime + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardMeta) HasProcessingTime() bool` + +HasProcessingTime returns a boolean if a field has been set. + +### GetVersionApi + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardMeta) GetVersionApi() string` + +GetVersionApi returns the VersionApi field if non-nil, zero value otherwise. + +### GetVersionApiOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardMeta) GetVersionApiOk() (*string, bool)` + +GetVersionApiOk returns a tuple with the VersionApi field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersionApi + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardMeta) SetVersionApi(v string)` + +SetVersionApi sets VersionApi field to given value. + +### HasVersionApi + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardMeta) HasVersionApi() bool` + +HasVersionApi returns a boolean if a field has been set. + + +[[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/InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination.md b/docs/invoice/InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination.md new file mode 100644 index 0000000..b09b1dd --- /dev/null +++ b/docs/invoice/InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination.md @@ -0,0 +1,108 @@ +# InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Pagination** | Pointer to [**GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader**](GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader.md) | | [optional] +**ProcessingTime** | Pointer to **string** | | [optional] +**VersionApi** | Pointer to **string** | | [optional] + +## Methods + +### NewInternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination + +`func NewInternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination() *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination` + +NewInternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination instantiates a new InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalWebControllersMerchantApiv1InvoiceStandardMetaWithPaginationWithDefaults + +`func NewInternalWebControllersMerchantApiv1InvoiceStandardMetaWithPaginationWithDefaults() *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination` + +NewInternalWebControllersMerchantApiv1InvoiceStandardMetaWithPaginationWithDefaults instantiates a new InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPagination + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) GetPagination() GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader` + +GetPagination returns the Pagination field if non-nil, zero value otherwise. + +### GetPaginationOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) GetPaginationOk() (*GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader, bool)` + +GetPaginationOk returns a tuple with the Pagination field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPagination + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) SetPagination(v GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader)` + +SetPagination sets Pagination field to given value. + +### HasPagination + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) HasPagination() bool` + +HasPagination returns a boolean if a field has been set. + +### GetProcessingTime + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) GetProcessingTime() string` + +GetProcessingTime returns the ProcessingTime field if non-nil, zero value otherwise. + +### GetProcessingTimeOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) GetProcessingTimeOk() (*string, bool)` + +GetProcessingTimeOk returns a tuple with the ProcessingTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProcessingTime + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) SetProcessingTime(v string)` + +SetProcessingTime sets ProcessingTime field to given value. + +### HasProcessingTime + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) HasProcessingTime() bool` + +HasProcessingTime returns a boolean if a field has been set. + +### GetVersionApi + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) GetVersionApi() string` + +GetVersionApi returns the VersionApi field if non-nil, zero value otherwise. + +### GetVersionApiOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) GetVersionApiOk() (*string, bool)` + +GetVersionApiOk returns a tuple with the VersionApi field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersionApi + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) SetVersionApi(v string)` + +SetVersionApi sets VersionApi field to given value. + +### HasVersionApi + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) HasVersionApi() bool` + +HasVersionApi returns a boolean if a field has been set. + + +[[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/InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse.md b/docs/invoice/InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse.md new file mode 100644 index 0000000..408faa7 --- /dev/null +++ b/docs/invoice/InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse.md @@ -0,0 +1,160 @@ +# InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | Pointer to **int32** | | [optional] +**Data** | Pointer to [**[]InternalWebControllersMerchantApiv1InvoicePaymentMethod**](InternalWebControllersMerchantApiv1InvoicePaymentMethod.md) | | [optional] +**Message** | Pointer to **string** | | [optional] +**Meta** | Pointer to [**InternalWebControllersMerchantApiv1InvoiceStandardMeta**](InternalWebControllersMerchantApiv1InvoiceStandardMeta.md) | | [optional] +**Status** | Pointer to **string** | | [optional] + +## Methods + +### NewInternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse + +`func NewInternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse() *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse` + +NewInternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse instantiates a new InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponseWithDefaults + +`func NewInternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponseWithDefaults() *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse` + +NewInternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponseWithDefaults instantiates a new InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) GetCode() int32` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) GetCodeOk() (*int32, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) SetCode(v int32)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetData + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) GetData() []InternalWebControllersMerchantApiv1InvoicePaymentMethod` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) GetDataOk() (*[]InternalWebControllersMerchantApiv1InvoicePaymentMethod, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) SetData(v []InternalWebControllersMerchantApiv1InvoicePaymentMethod)` + +SetData sets Data field to given value. + +### HasData + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) HasData() bool` + +HasData returns a boolean if a field has been set. + +### GetMessage + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + +### GetMeta + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) GetMeta() InternalWebControllersMerchantApiv1InvoiceStandardMeta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) GetMetaOk() (*InternalWebControllersMerchantApiv1InvoiceStandardMeta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) SetMeta(v InternalWebControllersMerchantApiv1InvoiceStandardMeta)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) HasMeta() bool` + +HasMeta returns a boolean if a field has been set. + +### GetStatus + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + + +[[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/InternalWebControllersMerchantApiv1InvoiceStandardResponse.md b/docs/invoice/InternalWebControllersMerchantApiv1InvoiceStandardResponse.md new file mode 100644 index 0000000..efdca0c --- /dev/null +++ b/docs/invoice/InternalWebControllersMerchantApiv1InvoiceStandardResponse.md @@ -0,0 +1,160 @@ +# InternalWebControllersMerchantApiv1InvoiceStandardResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | Pointer to **int32** | | [optional] +**Data** | Pointer to [**InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse**](InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse.md) | | [optional] +**Message** | Pointer to **string** | | [optional] +**Meta** | Pointer to [**InternalWebControllersMerchantApiv1InvoiceStandardMeta**](InternalWebControllersMerchantApiv1InvoiceStandardMeta.md) | | [optional] +**Status** | Pointer to **string** | | [optional] + +## Methods + +### NewInternalWebControllersMerchantApiv1InvoiceStandardResponse + +`func NewInternalWebControllersMerchantApiv1InvoiceStandardResponse() *InternalWebControllersMerchantApiv1InvoiceStandardResponse` + +NewInternalWebControllersMerchantApiv1InvoiceStandardResponse instantiates a new InternalWebControllersMerchantApiv1InvoiceStandardResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalWebControllersMerchantApiv1InvoiceStandardResponseWithDefaults + +`func NewInternalWebControllersMerchantApiv1InvoiceStandardResponseWithDefaults() *InternalWebControllersMerchantApiv1InvoiceStandardResponse` + +NewInternalWebControllersMerchantApiv1InvoiceStandardResponseWithDefaults instantiates a new InternalWebControllersMerchantApiv1InvoiceStandardResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) GetCode() int32` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) GetCodeOk() (*int32, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) SetCode(v int32)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetData + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) GetData() InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) GetDataOk() (*InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) SetData(v InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse)` + +SetData sets Data field to given value. + +### HasData + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) HasData() bool` + +HasData returns a boolean if a field has been set. + +### GetMessage + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + +### GetMeta + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) GetMeta() InternalWebControllersMerchantApiv1InvoiceStandardMeta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) GetMetaOk() (*InternalWebControllersMerchantApiv1InvoiceStandardMeta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) SetMeta(v InternalWebControllersMerchantApiv1InvoiceStandardMeta)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) HasMeta() bool` + +HasMeta returns a boolean if a field has been set. + +### GetStatus + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + + +[[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/InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination.md b/docs/invoice/InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination.md new file mode 100644 index 0000000..f12709e --- /dev/null +++ b/docs/invoice/InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination.md @@ -0,0 +1,160 @@ +# InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | Pointer to **int32** | | [optional] +**Data** | Pointer to [**[]InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse**](InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse.md) | | [optional] +**Message** | Pointer to **string** | | [optional] +**Meta** | Pointer to [**InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination**](InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination.md) | | [optional] +**Status** | Pointer to **string** | | [optional] + +## Methods + +### NewInternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination + +`func NewInternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination() *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination` + +NewInternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination instantiates a new InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalWebControllersMerchantApiv1InvoiceStandardResponseWithPaginationWithDefaults + +`func NewInternalWebControllersMerchantApiv1InvoiceStandardResponseWithPaginationWithDefaults() *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination` + +NewInternalWebControllersMerchantApiv1InvoiceStandardResponseWithPaginationWithDefaults instantiates a new InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) GetCode() int32` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) GetCodeOk() (*int32, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) SetCode(v int32)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetData + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) GetData() []InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) GetDataOk() (*[]InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) SetData(v []InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse)` + +SetData sets Data field to given value. + +### HasData + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) HasData() bool` + +HasData returns a boolean if a field has been set. + +### GetMessage + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + +### GetMeta + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) GetMeta() InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) GetMetaOk() (*InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) SetMeta(v InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) HasMeta() bool` + +HasMeta returns a boolean if a field has been set. + +### GetStatus + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + + +[[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/PublicInvoiceAPI.md b/docs/invoice/PublicInvoiceAPI.md new file mode 100644 index 0000000..3376c80 --- /dev/null +++ b/docs/invoice/PublicInvoiceAPI.md @@ -0,0 +1,503 @@ +# \PublicInvoiceAPI + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateInvoice**](PublicInvoiceAPI.md#CreateInvoice) | **Post** /merchant/v1/invoice | Create invoice for a payment. +[**DownloadInvoice**](PublicInvoiceAPI.md#DownloadInvoice) | **Get** /merchant/v1/invoice/download/csv | Download CSV file. +[**ExpireInvoice**](PublicInvoiceAPI.md#ExpireInvoice) | **Post** /merchant/v1/invoice/{invoice_id}/expire | Expire invoice by invoice ID. +[**GetInvoiceById**](PublicInvoiceAPI.md#GetInvoiceById) | **Get** /merchant/v1/invoice/{invoice_id} | Fetch invoice data by ID. +[**GetInvoices**](PublicInvoiceAPI.md#GetInvoices) | **Get** /merchant/v1/invoice | List all created invoice data +[**GetPaymentMethodById**](PublicInvoiceAPI.md#GetPaymentMethodById) | **Get** /merchant/v1/invoice/{invoice_id}/payment-method | Fetch payment method by invoice ID. +[**UpdateInvoiceById**](PublicInvoiceAPI.md#UpdateInvoiceById) | **Put** /merchant/v1/invoice/{invoice_id}/update | Update pending invoice + + + +## CreateInvoice + +> InternalWebControllersMerchantApiv1InvoiceStandardResponse CreateInvoice(ctx).Request(request).Execute() + +Create invoice for a payment. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/automotechnologies/doitpay" +) + +func main() { + request := *openapiclient.NewInternalWebControllersMerchantApiv1InvoiceInvoiceRequest() // InternalWebControllersMerchantApiv1InvoiceInvoiceRequest | Request payload to create invoice + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicInvoiceAPI.CreateInvoice(context.Background()).Request(request).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicInvoiceAPI.CreateInvoice``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateInvoice`: InternalWebControllersMerchantApiv1InvoiceStandardResponse + fmt.Fprintf(os.Stdout, "Response from `PublicInvoiceAPI.CreateInvoice`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateInvoiceRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request** | [**InternalWebControllersMerchantApiv1InvoiceInvoiceRequest**](InternalWebControllersMerchantApiv1InvoiceInvoiceRequest.md) | Request payload to create invoice | + +### Return type + +[**InternalWebControllersMerchantApiv1InvoiceStandardResponse**](InternalWebControllersMerchantApiv1InvoiceStandardResponse.md) + +### Authorization + +[BasicAuth](../README.md#BasicAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DownloadInvoice + +> string DownloadInvoice(ctx).Page(page).Limit(limit).Statuses(statuses).Execute() + +Download CSV file. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/automotechnologies/doitpay" +) + +func main() { + page := int32(56) // int32 | Page number (optional) (default to 1) + limit := int32(56) // int32 | Page limit (optional) (default to 10) + statuses := "statuses_example" // string | Comma-separated list of statuses to filter by. Example: ?statuses=ACTIVE,PENDING (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicInvoiceAPI.DownloadInvoice(context.Background()).Page(page).Limit(limit).Statuses(statuses).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicInvoiceAPI.DownloadInvoice``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DownloadInvoice`: string + fmt.Fprintf(os.Stdout, "Response from `PublicInvoiceAPI.DownloadInvoice`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiDownloadInvoiceRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int32** | Page number | [default to 1] + **limit** | **int32** | Page limit | [default to 10] + **statuses** | **string** | Comma-separated list of statuses to filter by. Example: ?statuses=ACTIVE,PENDING | + +### Return type + +**string** + +### Authorization + +[BasicAuth](../README.md#BasicAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ExpireInvoice + +> InternalWebControllersMerchantApiv1InvoiceStandardResponse ExpireInvoice(ctx, invoiceId).Execute() + +Expire invoice by invoice ID. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/automotechnologies/doitpay" +) + +func main() { + invoiceId := "invoiceId_example" // string | Invoice ID to fetch payment method + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicInvoiceAPI.ExpireInvoice(context.Background(), invoiceId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicInvoiceAPI.ExpireInvoice``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ExpireInvoice`: InternalWebControllersMerchantApiv1InvoiceStandardResponse + fmt.Fprintf(os.Stdout, "Response from `PublicInvoiceAPI.ExpireInvoice`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**invoiceId** | **string** | Invoice ID to fetch payment method | + +### Other Parameters + +Other parameters are passed through a pointer to a apiExpireInvoiceRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**InternalWebControllersMerchantApiv1InvoiceStandardResponse**](InternalWebControllersMerchantApiv1InvoiceStandardResponse.md) + +### Authorization + +[BasicAuth](../README.md#BasicAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetInvoiceById + +> InternalWebControllersMerchantApiv1InvoiceStandardResponse GetInvoiceById(ctx, invoiceId).Execute() + +Fetch invoice data by ID. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/automotechnologies/doitpay" +) + +func main() { + invoiceId := "invoiceId_example" // string | Invoice ID to fetch data + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicInvoiceAPI.GetInvoiceById(context.Background(), invoiceId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicInvoiceAPI.GetInvoiceById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetInvoiceById`: InternalWebControllersMerchantApiv1InvoiceStandardResponse + fmt.Fprintf(os.Stdout, "Response from `PublicInvoiceAPI.GetInvoiceById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**invoiceId** | **string** | Invoice ID to fetch data | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetInvoiceByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**InternalWebControllersMerchantApiv1InvoiceStandardResponse**](InternalWebControllersMerchantApiv1InvoiceStandardResponse.md) + +### Authorization + +[BasicAuth](../README.md#BasicAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetInvoices + +> InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination GetInvoices(ctx).Page(page).Limit(limit).Statuses(statuses).Execute() + +List all created invoice data + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/automotechnologies/doitpay" +) + +func main() { + page := int32(56) // int32 | Page number (optional) (default to 1) + limit := int32(56) // int32 | Page limit (optional) (default to 10) + statuses := "statuses_example" // string | Comma-separated list of statuses to filter by. Example: ?statuses=ACTIVE,PENDING (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicInvoiceAPI.GetInvoices(context.Background()).Page(page).Limit(limit).Statuses(statuses).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicInvoiceAPI.GetInvoices``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetInvoices`: InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination + fmt.Fprintf(os.Stdout, "Response from `PublicInvoiceAPI.GetInvoices`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetInvoicesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int32** | Page number | [default to 1] + **limit** | **int32** | Page limit | [default to 10] + **statuses** | **string** | Comma-separated list of statuses to filter by. Example: ?statuses=ACTIVE,PENDING | + +### Return type + +[**InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination**](InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination.md) + +### Authorization + +[BasicAuth](../README.md#BasicAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetPaymentMethodById + +> InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse GetPaymentMethodById(ctx, invoiceId).Execute() + +Fetch payment method by invoice ID. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/automotechnologies/doitpay" +) + +func main() { + invoiceId := "invoiceId_example" // string | Invoice ID to fetch payment method + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicInvoiceAPI.GetPaymentMethodById(context.Background(), invoiceId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicInvoiceAPI.GetPaymentMethodById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPaymentMethodById`: InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse + fmt.Fprintf(os.Stdout, "Response from `PublicInvoiceAPI.GetPaymentMethodById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**invoiceId** | **string** | Invoice ID to fetch payment method | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetPaymentMethodByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse**](InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse.md) + +### Authorization + +[BasicAuth](../README.md#BasicAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateInvoiceById + +> InternalWebControllersMerchantApiv1InvoiceStandardResponse UpdateInvoiceById(ctx, invoiceId).Request(request).Execute() + +Update pending invoice + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/automotechnologies/doitpay" +) + +func main() { + invoiceId := "invoiceId_example" // string | invoice id to update + request := *openapiclient.NewInternalWebControllersMerchantApiv1InvoiceInvoiceRequest() // InternalWebControllersMerchantApiv1InvoiceInvoiceRequest | Invoice Request Body + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicInvoiceAPI.UpdateInvoiceById(context.Background(), invoiceId).Request(request).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicInvoiceAPI.UpdateInvoiceById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateInvoiceById`: InternalWebControllersMerchantApiv1InvoiceStandardResponse + fmt.Fprintf(os.Stdout, "Response from `PublicInvoiceAPI.UpdateInvoiceById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**invoiceId** | **string** | invoice id to update | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateInvoiceByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **request** | [**InternalWebControllersMerchantApiv1InvoiceInvoiceRequest**](InternalWebControllersMerchantApiv1InvoiceInvoiceRequest.md) | Invoice Request Body | + +### Return type + +[**InternalWebControllersMerchantApiv1InvoiceStandardResponse**](InternalWebControllersMerchantApiv1InvoiceStandardResponse.md) + +### Authorization + +[BasicAuth](../README.md#BasicAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/simulate/InternalWebControllersMerchantApiv1SimulateSimulateRequest.md b/docs/simulate/InternalWebControllersMerchantApiv1SimulateSimulateRequest.md new file mode 100644 index 0000000..1f4b2b3 --- /dev/null +++ b/docs/simulate/InternalWebControllersMerchantApiv1SimulateSimulateRequest.md @@ -0,0 +1,82 @@ +# InternalWebControllersMerchantApiv1SimulateSimulateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccountNumber** | Pointer to **string** | | [optional] +**PaymentIdentifier** | Pointer to **string** | | [optional] + +## Methods + +### NewInternalWebControllersMerchantApiv1SimulateSimulateRequest + +`func NewInternalWebControllersMerchantApiv1SimulateSimulateRequest() *InternalWebControllersMerchantApiv1SimulateSimulateRequest` + +NewInternalWebControllersMerchantApiv1SimulateSimulateRequest instantiates a new InternalWebControllersMerchantApiv1SimulateSimulateRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalWebControllersMerchantApiv1SimulateSimulateRequestWithDefaults + +`func NewInternalWebControllersMerchantApiv1SimulateSimulateRequestWithDefaults() *InternalWebControllersMerchantApiv1SimulateSimulateRequest` + +NewInternalWebControllersMerchantApiv1SimulateSimulateRequestWithDefaults instantiates a new InternalWebControllersMerchantApiv1SimulateSimulateRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccountNumber + +`func (o *InternalWebControllersMerchantApiv1SimulateSimulateRequest) GetAccountNumber() string` + +GetAccountNumber returns the AccountNumber field if non-nil, zero value otherwise. + +### GetAccountNumberOk + +`func (o *InternalWebControllersMerchantApiv1SimulateSimulateRequest) GetAccountNumberOk() (*string, bool)` + +GetAccountNumberOk returns a tuple with the AccountNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountNumber + +`func (o *InternalWebControllersMerchantApiv1SimulateSimulateRequest) SetAccountNumber(v string)` + +SetAccountNumber sets AccountNumber field to given value. + +### HasAccountNumber + +`func (o *InternalWebControllersMerchantApiv1SimulateSimulateRequest) HasAccountNumber() bool` + +HasAccountNumber returns a boolean if a field has been set. + +### GetPaymentIdentifier + +`func (o *InternalWebControllersMerchantApiv1SimulateSimulateRequest) GetPaymentIdentifier() string` + +GetPaymentIdentifier returns the PaymentIdentifier field if non-nil, zero value otherwise. + +### GetPaymentIdentifierOk + +`func (o *InternalWebControllersMerchantApiv1SimulateSimulateRequest) GetPaymentIdentifierOk() (*string, bool)` + +GetPaymentIdentifierOk returns a tuple with the PaymentIdentifier field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentIdentifier + +`func (o *InternalWebControllersMerchantApiv1SimulateSimulateRequest) SetPaymentIdentifier(v string)` + +SetPaymentIdentifier sets PaymentIdentifier field to given value. + +### HasPaymentIdentifier + +`func (o *InternalWebControllersMerchantApiv1SimulateSimulateRequest) HasPaymentIdentifier() bool` + +HasPaymentIdentifier returns a boolean if a field has been set. + + +[[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/simulate/PublicSimulateAPI.md b/docs/simulate/PublicSimulateAPI.md new file mode 100644 index 0000000..829c11d --- /dev/null +++ b/docs/simulate/PublicSimulateAPI.md @@ -0,0 +1,73 @@ +# \PublicSimulateAPI + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**SimulatePayment**](PublicSimulateAPI.md#SimulatePayment) | **Post** /merchant/v1/simulate-payment | SimulatePayment is handler for simulate payment system. + + + +## SimulatePayment + +> SimulatePayment(ctx).Request(request).Execute() + +SimulatePayment is handler for simulate payment system. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/automotechnologies/doitpay" +) + +func main() { + request := *openapiclient.NewInternalWebControllersMerchantApiv1SimulateSimulateRequest() // InternalWebControllersMerchantApiv1SimulateSimulateRequest | Request payload to simulate payment + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.PublicSimulateAPI.SimulatePayment(context.Background()).Request(request).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicSimulateAPI.SimulatePayment``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiSimulatePaymentRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request** | [**InternalWebControllersMerchantApiv1SimulateSimulateRequest**](InternalWebControllersMerchantApiv1SimulateSimulateRequest.md) | Request payload to simulate payment | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[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/virtualaccount/InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest.md b/docs/virtualaccount/InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest.md new file mode 100644 index 0000000..2dfd41d --- /dev/null +++ b/docs/virtualaccount/InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest.md @@ -0,0 +1,368 @@ +# InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Amount** | Pointer to **float32** | | [optional] +**AmountMax** | Pointer to **float32** | | [optional] +**AmountMin** | Pointer to **float32** | | [optional] +**BusinessId** | Pointer to **int32** | | [optional] +**Currency** | Pointer to **string** | | [optional] +**Customer** | Pointer to [**InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer**](InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer.md) | | [optional] +**ExpirationDate** | Pointer to **string** | | [optional] +**IsClosed** | Pointer to **bool** | | [optional] +**IsReusable** | Pointer to **bool** | | [optional] +**PaymentMethodCode** | Pointer to **string** | | [optional] +**ReferenceId** | Pointer to **string** | | [optional] +**ReferenceInternalId** | Pointer to **string** | | [optional] +**VirtualAccountSuffix** | Pointer to **string** | | [optional] + +## Methods + +### NewInternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest + +`func NewInternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest() *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest` + +NewInternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest instantiates a new InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequestWithDefaults + +`func NewInternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequestWithDefaults() *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest` + +NewInternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequestWithDefaults instantiates a new InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAmount + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetAmount() float32` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetAmountOk() (*float32, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetAmount(v float32)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### GetAmountMax + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetAmountMax() float32` + +GetAmountMax returns the AmountMax field if non-nil, zero value otherwise. + +### GetAmountMaxOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetAmountMaxOk() (*float32, bool)` + +GetAmountMaxOk returns a tuple with the AmountMax field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmountMax + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetAmountMax(v float32)` + +SetAmountMax sets AmountMax field to given value. + +### HasAmountMax + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasAmountMax() bool` + +HasAmountMax returns a boolean if a field has been set. + +### GetAmountMin + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetAmountMin() float32` + +GetAmountMin returns the AmountMin field if non-nil, zero value otherwise. + +### GetAmountMinOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetAmountMinOk() (*float32, bool)` + +GetAmountMinOk returns a tuple with the AmountMin field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmountMin + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetAmountMin(v float32)` + +SetAmountMin sets AmountMin field to given value. + +### HasAmountMin + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasAmountMin() bool` + +HasAmountMin returns a boolean if a field has been set. + +### GetBusinessId + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetBusinessId() int32` + +GetBusinessId returns the BusinessId field if non-nil, zero value otherwise. + +### GetBusinessIdOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetBusinessIdOk() (*int32, bool)` + +GetBusinessIdOk returns a tuple with the BusinessId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBusinessId + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetBusinessId(v int32)` + +SetBusinessId sets BusinessId field to given value. + +### HasBusinessId + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasBusinessId() bool` + +HasBusinessId returns a boolean if a field has been set. + +### GetCurrency + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + +### HasCurrency + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasCurrency() bool` + +HasCurrency returns a boolean if a field has been set. + +### GetCustomer + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetCustomer() InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer` + +GetCustomer returns the Customer field if non-nil, zero value otherwise. + +### GetCustomerOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetCustomerOk() (*InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer, bool)` + +GetCustomerOk returns a tuple with the Customer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomer + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetCustomer(v InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer)` + +SetCustomer sets Customer field to given value. + +### HasCustomer + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasCustomer() bool` + +HasCustomer returns a boolean if a field has been set. + +### GetExpirationDate + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetExpirationDate() string` + +GetExpirationDate returns the ExpirationDate field if non-nil, zero value otherwise. + +### GetExpirationDateOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetExpirationDateOk() (*string, bool)` + +GetExpirationDateOk returns a tuple with the ExpirationDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpirationDate + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetExpirationDate(v string)` + +SetExpirationDate sets ExpirationDate field to given value. + +### HasExpirationDate + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasExpirationDate() bool` + +HasExpirationDate returns a boolean if a field has been set. + +### GetIsClosed + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetIsClosed() bool` + +GetIsClosed returns the IsClosed field if non-nil, zero value otherwise. + +### GetIsClosedOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetIsClosedOk() (*bool, bool)` + +GetIsClosedOk returns a tuple with the IsClosed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsClosed + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetIsClosed(v bool)` + +SetIsClosed sets IsClosed field to given value. + +### HasIsClosed + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasIsClosed() bool` + +HasIsClosed returns a boolean if a field has been set. + +### GetIsReusable + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetIsReusable() bool` + +GetIsReusable returns the IsReusable field if non-nil, zero value otherwise. + +### GetIsReusableOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetIsReusableOk() (*bool, bool)` + +GetIsReusableOk returns a tuple with the IsReusable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsReusable + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetIsReusable(v bool)` + +SetIsReusable sets IsReusable field to given value. + +### HasIsReusable + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasIsReusable() bool` + +HasIsReusable returns a boolean if a field has been set. + +### GetPaymentMethodCode + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetPaymentMethodCode() string` + +GetPaymentMethodCode returns the PaymentMethodCode field if non-nil, zero value otherwise. + +### GetPaymentMethodCodeOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetPaymentMethodCodeOk() (*string, bool)` + +GetPaymentMethodCodeOk returns a tuple with the PaymentMethodCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentMethodCode + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetPaymentMethodCode(v string)` + +SetPaymentMethodCode sets PaymentMethodCode field to given value. + +### HasPaymentMethodCode + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasPaymentMethodCode() bool` + +HasPaymentMethodCode returns a boolean if a field has been set. + +### GetReferenceId + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetReferenceId() string` + +GetReferenceId returns the ReferenceId field if non-nil, zero value otherwise. + +### GetReferenceIdOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetReferenceIdOk() (*string, bool)` + +GetReferenceIdOk returns a tuple with the ReferenceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceId + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetReferenceId(v string)` + +SetReferenceId sets ReferenceId field to given value. + +### HasReferenceId + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasReferenceId() bool` + +HasReferenceId returns a boolean if a field has been set. + +### GetReferenceInternalId + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetReferenceInternalId() string` + +GetReferenceInternalId returns the ReferenceInternalId field if non-nil, zero value otherwise. + +### GetReferenceInternalIdOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetReferenceInternalIdOk() (*string, bool)` + +GetReferenceInternalIdOk returns a tuple with the ReferenceInternalId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceInternalId + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetReferenceInternalId(v string)` + +SetReferenceInternalId sets ReferenceInternalId field to given value. + +### HasReferenceInternalId + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasReferenceInternalId() bool` + +HasReferenceInternalId returns a boolean if a field has been set. + +### GetVirtualAccountSuffix + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetVirtualAccountSuffix() string` + +GetVirtualAccountSuffix returns the VirtualAccountSuffix field if non-nil, zero value otherwise. + +### GetVirtualAccountSuffixOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetVirtualAccountSuffixOk() (*string, bool)` + +GetVirtualAccountSuffixOk returns a tuple with the VirtualAccountSuffix field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualAccountSuffix + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetVirtualAccountSuffix(v string)` + +SetVirtualAccountSuffix sets VirtualAccountSuffix field to given value. + +### HasVirtualAccountSuffix + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasVirtualAccountSuffix() bool` + +HasVirtualAccountSuffix returns a boolean if a field has been set. + + +[[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/InternalWebControllersMerchantApiv1VirtualaccountStandardMeta.md b/docs/virtualaccount/InternalWebControllersMerchantApiv1VirtualaccountStandardMeta.md new file mode 100644 index 0000000..69d3be9 --- /dev/null +++ b/docs/virtualaccount/InternalWebControllersMerchantApiv1VirtualaccountStandardMeta.md @@ -0,0 +1,82 @@ +# InternalWebControllersMerchantApiv1VirtualaccountStandardMeta + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ProcessingTime** | Pointer to **string** | | [optional] +**VersionApi** | Pointer to **string** | | [optional] + +## Methods + +### NewInternalWebControllersMerchantApiv1VirtualaccountStandardMeta + +`func NewInternalWebControllersMerchantApiv1VirtualaccountStandardMeta() *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta` + +NewInternalWebControllersMerchantApiv1VirtualaccountStandardMeta instantiates a new InternalWebControllersMerchantApiv1VirtualaccountStandardMeta object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithDefaults + +`func NewInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithDefaults() *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta` + +NewInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithDefaults instantiates a new InternalWebControllersMerchantApiv1VirtualaccountStandardMeta object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetProcessingTime + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta) GetProcessingTime() string` + +GetProcessingTime returns the ProcessingTime field if non-nil, zero value otherwise. + +### GetProcessingTimeOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta) GetProcessingTimeOk() (*string, bool)` + +GetProcessingTimeOk returns a tuple with the ProcessingTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProcessingTime + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta) SetProcessingTime(v string)` + +SetProcessingTime sets ProcessingTime field to given value. + +### HasProcessingTime + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta) HasProcessingTime() bool` + +HasProcessingTime returns a boolean if a field has been set. + +### GetVersionApi + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta) GetVersionApi() string` + +GetVersionApi returns the VersionApi field if non-nil, zero value otherwise. + +### GetVersionApiOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta) GetVersionApiOk() (*string, bool)` + +GetVersionApiOk returns a tuple with the VersionApi field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersionApi + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta) SetVersionApi(v string)` + +SetVersionApi sets VersionApi field to given value. + +### HasVersionApi + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta) HasVersionApi() bool` + +HasVersionApi returns a boolean if a field has been set. + + +[[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/InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination.md b/docs/virtualaccount/InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination.md new file mode 100644 index 0000000..e97419d --- /dev/null +++ b/docs/virtualaccount/InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination.md @@ -0,0 +1,108 @@ +# InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Pagination** | Pointer to [**GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader**](GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader.md) | | [optional] +**ProcessingTime** | Pointer to **string** | | [optional] +**VersionApi** | Pointer to **string** | | [optional] + +## Methods + +### NewInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination + +`func NewInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination() *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination` + +NewInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination instantiates a new InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPaginationWithDefaults + +`func NewInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPaginationWithDefaults() *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination` + +NewInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPaginationWithDefaults instantiates a new InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPagination + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) GetPagination() GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader` + +GetPagination returns the Pagination field if non-nil, zero value otherwise. + +### GetPaginationOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) GetPaginationOk() (*GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader, bool)` + +GetPaginationOk returns a tuple with the Pagination field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPagination + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) SetPagination(v GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader)` + +SetPagination sets Pagination field to given value. + +### HasPagination + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) HasPagination() bool` + +HasPagination returns a boolean if a field has been set. + +### GetProcessingTime + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) GetProcessingTime() string` + +GetProcessingTime returns the ProcessingTime field if non-nil, zero value otherwise. + +### GetProcessingTimeOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) GetProcessingTimeOk() (*string, bool)` + +GetProcessingTimeOk returns a tuple with the ProcessingTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProcessingTime + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) SetProcessingTime(v string)` + +SetProcessingTime sets ProcessingTime field to given value. + +### HasProcessingTime + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) HasProcessingTime() bool` + +HasProcessingTime returns a boolean if a field has been set. + +### GetVersionApi + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) GetVersionApi() string` + +GetVersionApi returns the VersionApi field if non-nil, zero value otherwise. + +### GetVersionApiOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) GetVersionApiOk() (*string, bool)` + +GetVersionApiOk returns a tuple with the VersionApi field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersionApi + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) SetVersionApi(v string)` + +SetVersionApi sets VersionApi field to given value. + +### HasVersionApi + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) HasVersionApi() bool` + +HasVersionApi returns a boolean if a field has been set. + + +[[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/InternalWebControllersMerchantApiv1VirtualaccountStandardResponse.md b/docs/virtualaccount/InternalWebControllersMerchantApiv1VirtualaccountStandardResponse.md new file mode 100644 index 0000000..eb12b22 --- /dev/null +++ b/docs/virtualaccount/InternalWebControllersMerchantApiv1VirtualaccountStandardResponse.md @@ -0,0 +1,160 @@ +# InternalWebControllersMerchantApiv1VirtualaccountStandardResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | Pointer to **int32** | | [optional] +**Data** | Pointer to [**InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse**](InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse.md) | | [optional] +**Message** | Pointer to **string** | | [optional] +**Meta** | Pointer to [**InternalWebControllersMerchantApiv1VirtualaccountStandardMeta**](InternalWebControllersMerchantApiv1VirtualaccountStandardMeta.md) | | [optional] +**Status** | Pointer to **string** | | [optional] + +## Methods + +### NewInternalWebControllersMerchantApiv1VirtualaccountStandardResponse + +`func NewInternalWebControllersMerchantApiv1VirtualaccountStandardResponse() *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse` + +NewInternalWebControllersMerchantApiv1VirtualaccountStandardResponse instantiates a new InternalWebControllersMerchantApiv1VirtualaccountStandardResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithDefaults + +`func NewInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithDefaults() *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse` + +NewInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithDefaults instantiates a new InternalWebControllersMerchantApiv1VirtualaccountStandardResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) GetCode() int32` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) GetCodeOk() (*int32, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) SetCode(v int32)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetData + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) GetData() InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) GetDataOk() (*InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) SetData(v InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse)` + +SetData sets Data field to given value. + +### HasData + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) HasData() bool` + +HasData returns a boolean if a field has been set. + +### GetMessage + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + +### GetMeta + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) GetMeta() InternalWebControllersMerchantApiv1VirtualaccountStandardMeta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) GetMetaOk() (*InternalWebControllersMerchantApiv1VirtualaccountStandardMeta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) SetMeta(v InternalWebControllersMerchantApiv1VirtualaccountStandardMeta)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) HasMeta() bool` + +HasMeta returns a boolean if a field has been set. + +### GetStatus + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + + +[[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/InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination.md b/docs/virtualaccount/InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination.md new file mode 100644 index 0000000..871b5e1 --- /dev/null +++ b/docs/virtualaccount/InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination.md @@ -0,0 +1,160 @@ +# InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | Pointer to **int32** | | [optional] +**Data** | Pointer to [**[]InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse**](InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse.md) | | [optional] +**Message** | Pointer to **string** | | [optional] +**Meta** | Pointer to [**InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination**](InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination.md) | | [optional] +**Status** | Pointer to **string** | | [optional] + +## Methods + +### NewInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination + +`func NewInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination() *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination` + +NewInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination instantiates a new InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPaginationWithDefaults + +`func NewInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPaginationWithDefaults() *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination` + +NewInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPaginationWithDefaults instantiates a new InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) GetCode() int32` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) GetCodeOk() (*int32, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) SetCode(v int32)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetData + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) GetData() []InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) GetDataOk() (*[]InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) SetData(v []InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse)` + +SetData sets Data field to given value. + +### HasData + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) HasData() bool` + +HasData returns a boolean if a field has been set. + +### GetMessage + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + +### GetMeta + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) GetMeta() InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) GetMetaOk() (*InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) SetMeta(v InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) HasMeta() bool` + +HasMeta returns a boolean if a field has been set. + +### GetStatus + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + + +[[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/InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer.md b/docs/virtualaccount/InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer.md new file mode 100644 index 0000000..705ec57 --- /dev/null +++ b/docs/virtualaccount/InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer.md @@ -0,0 +1,108 @@ +# InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] +**Phone** | Pointer to **string** | | [optional] + +## Methods + +### NewInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer + +`func NewInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer() *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer` + +NewInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer instantiates a new InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomerWithDefaults + +`func NewInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomerWithDefaults() *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer` + +NewInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomerWithDefaults instantiates a new InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEmail + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) GetEmail() string` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) GetEmailOk() (*string, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmail + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) SetEmail(v string)` + +SetEmail sets Email field to given value. + +### HasEmail + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) HasEmail() bool` + +HasEmail returns a boolean if a field has been set. + +### GetName + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetPhone + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) GetPhone() string` + +GetPhone returns the Phone field if non-nil, zero value otherwise. + +### GetPhoneOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) GetPhoneOk() (*string, bool)` + +GetPhoneOk returns a tuple with the Phone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPhone + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) SetPhone(v string)` + +SetPhone sets Phone field to given value. + +### HasPhone + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) HasPhone() bool` + +HasPhone returns a boolean if a field has been set. + + +[[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/InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse.md b/docs/virtualaccount/InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse.md new file mode 100644 index 0000000..6f15ddf --- /dev/null +++ b/docs/virtualaccount/InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse.md @@ -0,0 +1,420 @@ +# InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Amount** | Pointer to **float32** | | [optional] +**AmountMax** | Pointer to **float32** | | [optional] +**AmountMin** | Pointer to **float32** | | [optional] +**Customer** | Pointer to [**InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer**](InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer.md) | | [optional] +**ExpirationDate** | Pointer to **string** | | [optional] +**IsClosed** | Pointer to **bool** | | [optional] +**IsReusable** | Pointer to **bool** | | [optional] +**PaymentMethodBank** | Pointer to **string** | | [optional] +**PaymentMethodCode** | Pointer to **string** | | [optional] +**ReferenceId** | Pointer to **string** | | [optional] +**ReferenceInternalId** | Pointer to **string** | | [optional] +**Status** | Pointer to **string** | | [optional] +**VirtualAccountLinkId** | Pointer to **string** | | [optional] +**VirtualAccountNumber** | Pointer to **string** | | [optional] +**VirtualAccountSuffix** | Pointer to **string** | | [optional] + +## Methods + +### NewInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse + +`func NewInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse() *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse` + +NewInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse instantiates a new InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponseWithDefaults + +`func NewInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponseWithDefaults() *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse` + +NewInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponseWithDefaults instantiates a new InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAmount + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetAmount() float32` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetAmountOk() (*float32, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetAmount(v float32)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### GetAmountMax + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetAmountMax() float32` + +GetAmountMax returns the AmountMax field if non-nil, zero value otherwise. + +### GetAmountMaxOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetAmountMaxOk() (*float32, bool)` + +GetAmountMaxOk returns a tuple with the AmountMax field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmountMax + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetAmountMax(v float32)` + +SetAmountMax sets AmountMax field to given value. + +### HasAmountMax + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasAmountMax() bool` + +HasAmountMax returns a boolean if a field has been set. + +### GetAmountMin + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetAmountMin() float32` + +GetAmountMin returns the AmountMin field if non-nil, zero value otherwise. + +### GetAmountMinOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetAmountMinOk() (*float32, bool)` + +GetAmountMinOk returns a tuple with the AmountMin field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmountMin + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetAmountMin(v float32)` + +SetAmountMin sets AmountMin field to given value. + +### HasAmountMin + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasAmountMin() bool` + +HasAmountMin returns a boolean if a field has been set. + +### GetCustomer + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetCustomer() InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer` + +GetCustomer returns the Customer field if non-nil, zero value otherwise. + +### GetCustomerOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetCustomerOk() (*InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer, bool)` + +GetCustomerOk returns a tuple with the Customer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomer + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetCustomer(v InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer)` + +SetCustomer sets Customer field to given value. + +### HasCustomer + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasCustomer() bool` + +HasCustomer returns a boolean if a field has been set. + +### GetExpirationDate + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetExpirationDate() string` + +GetExpirationDate returns the ExpirationDate field if non-nil, zero value otherwise. + +### GetExpirationDateOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetExpirationDateOk() (*string, bool)` + +GetExpirationDateOk returns a tuple with the ExpirationDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpirationDate + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetExpirationDate(v string)` + +SetExpirationDate sets ExpirationDate field to given value. + +### HasExpirationDate + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasExpirationDate() bool` + +HasExpirationDate returns a boolean if a field has been set. + +### GetIsClosed + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetIsClosed() bool` + +GetIsClosed returns the IsClosed field if non-nil, zero value otherwise. + +### GetIsClosedOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetIsClosedOk() (*bool, bool)` + +GetIsClosedOk returns a tuple with the IsClosed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsClosed + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetIsClosed(v bool)` + +SetIsClosed sets IsClosed field to given value. + +### HasIsClosed + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasIsClosed() bool` + +HasIsClosed returns a boolean if a field has been set. + +### GetIsReusable + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetIsReusable() bool` + +GetIsReusable returns the IsReusable field if non-nil, zero value otherwise. + +### GetIsReusableOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetIsReusableOk() (*bool, bool)` + +GetIsReusableOk returns a tuple with the IsReusable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsReusable + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetIsReusable(v bool)` + +SetIsReusable sets IsReusable field to given value. + +### HasIsReusable + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasIsReusable() bool` + +HasIsReusable returns a boolean if a field has been set. + +### GetPaymentMethodBank + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetPaymentMethodBank() string` + +GetPaymentMethodBank returns the PaymentMethodBank field if non-nil, zero value otherwise. + +### GetPaymentMethodBankOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetPaymentMethodBankOk() (*string, bool)` + +GetPaymentMethodBankOk returns a tuple with the PaymentMethodBank field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentMethodBank + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetPaymentMethodBank(v string)` + +SetPaymentMethodBank sets PaymentMethodBank field to given value. + +### HasPaymentMethodBank + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasPaymentMethodBank() bool` + +HasPaymentMethodBank returns a boolean if a field has been set. + +### GetPaymentMethodCode + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetPaymentMethodCode() string` + +GetPaymentMethodCode returns the PaymentMethodCode field if non-nil, zero value otherwise. + +### GetPaymentMethodCodeOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetPaymentMethodCodeOk() (*string, bool)` + +GetPaymentMethodCodeOk returns a tuple with the PaymentMethodCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentMethodCode + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetPaymentMethodCode(v string)` + +SetPaymentMethodCode sets PaymentMethodCode field to given value. + +### HasPaymentMethodCode + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasPaymentMethodCode() bool` + +HasPaymentMethodCode returns a boolean if a field has been set. + +### GetReferenceId + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetReferenceId() string` + +GetReferenceId returns the ReferenceId field if non-nil, zero value otherwise. + +### GetReferenceIdOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetReferenceIdOk() (*string, bool)` + +GetReferenceIdOk returns a tuple with the ReferenceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceId + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetReferenceId(v string)` + +SetReferenceId sets ReferenceId field to given value. + +### HasReferenceId + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasReferenceId() bool` + +HasReferenceId returns a boolean if a field has been set. + +### GetReferenceInternalId + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetReferenceInternalId() string` + +GetReferenceInternalId returns the ReferenceInternalId field if non-nil, zero value otherwise. + +### GetReferenceInternalIdOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetReferenceInternalIdOk() (*string, bool)` + +GetReferenceInternalIdOk returns a tuple with the ReferenceInternalId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceInternalId + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetReferenceInternalId(v string)` + +SetReferenceInternalId sets ReferenceInternalId field to given value. + +### HasReferenceInternalId + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasReferenceInternalId() bool` + +HasReferenceInternalId returns a boolean if a field has been set. + +### GetStatus + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetVirtualAccountLinkId + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetVirtualAccountLinkId() string` + +GetVirtualAccountLinkId returns the VirtualAccountLinkId field if non-nil, zero value otherwise. + +### GetVirtualAccountLinkIdOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetVirtualAccountLinkIdOk() (*string, bool)` + +GetVirtualAccountLinkIdOk returns a tuple with the VirtualAccountLinkId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualAccountLinkId + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetVirtualAccountLinkId(v string)` + +SetVirtualAccountLinkId sets VirtualAccountLinkId field to given value. + +### HasVirtualAccountLinkId + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasVirtualAccountLinkId() bool` + +HasVirtualAccountLinkId returns a boolean if a field has been set. + +### GetVirtualAccountNumber + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetVirtualAccountNumber() string` + +GetVirtualAccountNumber returns the VirtualAccountNumber field if non-nil, zero value otherwise. + +### GetVirtualAccountNumberOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetVirtualAccountNumberOk() (*string, bool)` + +GetVirtualAccountNumberOk returns a tuple with the VirtualAccountNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualAccountNumber + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetVirtualAccountNumber(v string)` + +SetVirtualAccountNumber sets VirtualAccountNumber field to given value. + +### HasVirtualAccountNumber + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasVirtualAccountNumber() bool` + +HasVirtualAccountNumber returns a boolean if a field has been set. + +### GetVirtualAccountSuffix + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetVirtualAccountSuffix() string` + +GetVirtualAccountSuffix returns the VirtualAccountSuffix field if non-nil, zero value otherwise. + +### GetVirtualAccountSuffixOk + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetVirtualAccountSuffixOk() (*string, bool)` + +GetVirtualAccountSuffixOk returns a tuple with the VirtualAccountSuffix field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualAccountSuffix + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetVirtualAccountSuffix(v string)` + +SetVirtualAccountSuffix sets VirtualAccountSuffix field to given value. + +### HasVirtualAccountSuffix + +`func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasVirtualAccountSuffix() bool` + +HasVirtualAccountSuffix returns a boolean if a field has been set. + + +[[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/PublicVirtualAccountAPI.md b/docs/virtualaccount/PublicVirtualAccountAPI.md new file mode 100644 index 0000000..ce81e95 --- /dev/null +++ b/docs/virtualaccount/PublicVirtualAccountAPI.md @@ -0,0 +1,288 @@ +# \PublicVirtualAccountAPI + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateVirtualAccount**](PublicVirtualAccountAPI.md#CreateVirtualAccount) | **Post** /merchant/v1/virtual-account | Create virtual account data. +[**GetVirtualAccountById**](PublicVirtualAccountAPI.md#GetVirtualAccountById) | **Get** /merchant/v1/virtual-account/{virtualAccountId} | Fetch virtual account data by ID. +[**GetVirtualAccountByNumber**](PublicVirtualAccountAPI.md#GetVirtualAccountByNumber) | **Get** /merchant/v1/virtual-account/number/{virtualAccountNumber} | Fetch virtual account data by virtual account number. +[**GetVirtualAccounts**](PublicVirtualAccountAPI.md#GetVirtualAccounts) | **Get** /merchant/v1/virtual-account | List all created virtual account data. + + + +## CreateVirtualAccount + +> InternalWebControllersMerchantApiv1VirtualaccountStandardResponse CreateVirtualAccount(ctx).Request(request).Execute() + +Create virtual account data. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/automotechnologies/doitpay" +) + +func main() { + request := *openapiclient.NewInternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest() // InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest | Request payload to create virtual account + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicVirtualAccountAPI.CreateVirtualAccount(context.Background()).Request(request).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicVirtualAccountAPI.CreateVirtualAccount``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateVirtualAccount`: InternalWebControllersMerchantApiv1VirtualaccountStandardResponse + fmt.Fprintf(os.Stdout, "Response from `PublicVirtualAccountAPI.CreateVirtualAccount`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateVirtualAccountRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **request** | [**InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest**](InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest.md) | Request payload to create virtual account | + +### Return type + +[**InternalWebControllersMerchantApiv1VirtualaccountStandardResponse**](InternalWebControllersMerchantApiv1VirtualaccountStandardResponse.md) + +### Authorization + +[BasicAuth](../README.md#BasicAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetVirtualAccountById + +> InternalWebControllersMerchantApiv1VirtualaccountStandardResponse GetVirtualAccountById(ctx, virtualAccountId).Execute() + +Fetch virtual account data by ID. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/automotechnologies/doitpay" +) + +func main() { + virtualAccountId := int32(56) // int32 | Virtual Account ID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicVirtualAccountAPI.GetVirtualAccountById(context.Background(), virtualAccountId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicVirtualAccountAPI.GetVirtualAccountById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetVirtualAccountById`: InternalWebControllersMerchantApiv1VirtualaccountStandardResponse + fmt.Fprintf(os.Stdout, "Response from `PublicVirtualAccountAPI.GetVirtualAccountById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**virtualAccountId** | **int32** | Virtual Account ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetVirtualAccountByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**InternalWebControllersMerchantApiv1VirtualaccountStandardResponse**](InternalWebControllersMerchantApiv1VirtualaccountStandardResponse.md) + +### Authorization + +[BasicAuth](../README.md#BasicAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetVirtualAccountByNumber + +> InternalWebControllersMerchantApiv1VirtualaccountStandardResponse GetVirtualAccountByNumber(ctx, virtualAccountNumber).Execute() + +Fetch virtual account data by virtual account number. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/automotechnologies/doitpay" +) + +func main() { + virtualAccountNumber := "virtualAccountNumber_example" // string | Virtual Account Number + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicVirtualAccountAPI.GetVirtualAccountByNumber(context.Background(), virtualAccountNumber).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicVirtualAccountAPI.GetVirtualAccountByNumber``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetVirtualAccountByNumber`: InternalWebControllersMerchantApiv1VirtualaccountStandardResponse + fmt.Fprintf(os.Stdout, "Response from `PublicVirtualAccountAPI.GetVirtualAccountByNumber`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**virtualAccountNumber** | **string** | Virtual Account Number | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetVirtualAccountByNumberRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**InternalWebControllersMerchantApiv1VirtualaccountStandardResponse**](InternalWebControllersMerchantApiv1VirtualaccountStandardResponse.md) + +### Authorization + +[BasicAuth](../README.md#BasicAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetVirtualAccounts + +> InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination GetVirtualAccounts(ctx).Page(page).Limit(limit).Statuses(statuses).Execute() + +List all created virtual account data. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/automotechnologies/doitpay" +) + +func main() { + page := int32(56) // int32 | Page number (optional) (default to 1) + limit := int32(56) // int32 | Page limit (optional) (default to 10) + statuses := "statuses_example" // string | Comma-separated list of statuses to filter by. Example: ?statuses=ACTIVE,PENDING (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PublicVirtualAccountAPI.GetVirtualAccounts(context.Background()).Page(page).Limit(limit).Statuses(statuses).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PublicVirtualAccountAPI.GetVirtualAccounts``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetVirtualAccounts`: InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination + fmt.Fprintf(os.Stdout, "Response from `PublicVirtualAccountAPI.GetVirtualAccounts`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetVirtualAccountsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int32** | Page number | [default to 1] + **limit** | **int32** | Page limit | [default to 10] + **statuses** | **string** | Comma-separated list of statuses to filter by. Example: ?statuses=ACTIVE,PENDING | + +### Return type + +[**InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination**](InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination.md) + +### Authorization + +[BasicAuth](../README.md#BasicAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/doitpay.go b/doitpay.go new file mode 100644 index 0000000..e2c4a3d --- /dev/null +++ b/doitpay.go @@ -0,0 +1,2 @@ +// Package doitpay provides the binding for Doitpay APIs. +package doitpay diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..2391243 --- /dev/null +++ b/go.mod @@ -0,0 +1,18 @@ +module github.com/automotechnologies/doitpay-go + +go 1.18 + +require ( + github.com/stretchr/testify v1.4.0 + golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558 +) + +require ( + github.com/davecgh/go-spew v1.1.0 // indirect + github.com/golang/protobuf v1.4.2 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + golang.org/x/net v0.0.0-20200822124328-c89045814202 // indirect + google.golang.org/appengine v1.6.6 // indirect + google.golang.org/protobuf v1.25.0 // indirect + gopkg.in/yaml.v2 v2.2.2 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..0d63dca --- /dev/null +++ b/go.sum @@ -0,0 +1,369 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558 h1:D7nTwh4J0i+5mW4Zjzn5omvlr6YBcWywE6KOcatyNxY= +golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/invoice/api_invoice.go b/invoice/api_invoice.go new file mode 100644 index 0000000..f99f75a --- /dev/null +++ b/invoice/api_invoice.go @@ -0,0 +1,872 @@ +package invoice + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strconv" + "strings" + + "github.com/automotechnologies/doitpay-go/common" + "github.com/automotechnologies/doitpay-go/utils" +) + +type PublicInvoiceAPI interface { + + /* + CreateInvoice Create invoice for a payment. + + Create and return invoice data. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateInvoiceRequest + */ + CreateInvoice(ctx context.Context) ApiCreateInvoiceRequest + + // CreateInvoiceExecute executes the request + // @return InternalWebControllersMerchantApiv1InvoiceStandardResponse + CreateInvoiceExecute(r ApiCreateInvoiceRequest) (*InternalWebControllersMerchantApiv1InvoiceStandardResponse, *http.Response, error) + + /* + DownloadInvoice Download CSV file. + + Download a CSV file of invoices. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDownloadInvoiceRequest + */ + DownloadInvoice(ctx context.Context) ApiDownloadInvoiceRequest + + // DownloadInvoiceExecute executes the request + // @return string + DownloadInvoiceExecute(r ApiDownloadInvoiceRequest) (string, *http.Response, error) + + /* + ExpireInvoice Expire invoice by invoice ID. + + Expire invoice by invoice ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param invoiceId Invoice ID to fetch payment method + @return ApiExpireInvoiceRequest + */ + ExpireInvoice(ctx context.Context, invoiceId string) ApiExpireInvoiceRequest + + // ExpireInvoiceExecute executes the request + // @return InternalWebControllersMerchantApiv1InvoiceStandardResponse + ExpireInvoiceExecute(r ApiExpireInvoiceRequest) (*InternalWebControllersMerchantApiv1InvoiceStandardResponse, *http.Response, error) + + /* + GetInvoiceById Fetch invoice data by ID. + + Fetch invoice data by ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param invoiceId Invoice ID to fetch data + @return ApiGetInvoiceByIdRequest + */ + GetInvoiceById(ctx context.Context, invoiceId string) ApiGetInvoiceByIdRequest + + // GetInvoiceByIdExecute executes the request + // @return InternalWebControllersMerchantApiv1InvoiceStandardResponse + GetInvoiceByIdExecute(r ApiGetInvoiceByIdRequest) (*InternalWebControllersMerchantApiv1InvoiceStandardResponse, *http.Response, error) + + /* + GetInvoices List all created invoice data + + List all created invoice data. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetInvoicesRequest + */ + GetInvoices(ctx context.Context) ApiGetInvoicesRequest + + // GetInvoicesExecute executes the request + // @return InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination + GetInvoicesExecute(r ApiGetInvoicesRequest) (*InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination, *http.Response, error) + + /* + GetPaymentMethodById Fetch payment method by invoice ID. + + Fetch payment method by invoice ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param invoiceId Invoice ID to fetch payment method + @return ApiGetPaymentMethodByIdRequest + */ + GetPaymentMethodById(ctx context.Context, invoiceId string) ApiGetPaymentMethodByIdRequest + + // GetPaymentMethodByIdExecute executes the request + // @return InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse + GetPaymentMethodByIdExecute(r ApiGetPaymentMethodByIdRequest) (*InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse, *http.Response, error) + + /* + UpdateInvoiceById Update pending invoice + + Update pending invoice + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param invoiceId invoice id to update + @return ApiUpdateInvoiceByIdRequest + */ + UpdateInvoiceById(ctx context.Context, invoiceId string) ApiUpdateInvoiceByIdRequest + + // UpdateInvoiceByIdExecute executes the request + // @return InternalWebControllersMerchantApiv1InvoiceStandardResponse + UpdateInvoiceByIdExecute(r ApiUpdateInvoiceByIdRequest) (*InternalWebControllersMerchantApiv1InvoiceStandardResponse, *http.Response, error) +} + +type InvoiceApiService struct { + client common.IClient +} + +// NewInvoiceApi Create a new InvoiceApi service +func NewInvoiceApi(client common.IClient) PublicInvoiceAPI { + return &InvoiceApiService{ + client: client, + } +} + +type ApiCreateInvoiceRequest struct { + ctx context.Context + ApiService PublicInvoiceAPI + request *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest +} + +// Request payload to create invoice +func (r ApiCreateInvoiceRequest) Request(request InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) ApiCreateInvoiceRequest { + r.request = &request + return r +} + +func (r ApiCreateInvoiceRequest) Execute() (*InternalWebControllersMerchantApiv1InvoiceStandardResponse, *http.Response, error) { + return r.ApiService.CreateInvoiceExecute(r) +} + +/* +CreateInvoice Create invoice for a payment. + +Create and return invoice data. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateInvoiceRequest +*/ +func (a *InvoiceApiService) CreateInvoice(ctx context.Context) ApiCreateInvoiceRequest { + return ApiCreateInvoiceRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return InternalWebControllersMerchantApiv1InvoiceStandardResponse +func (a *InvoiceApiService) CreateInvoiceExecute(r ApiCreateInvoiceRequest) (*InternalWebControllersMerchantApiv1InvoiceStandardResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *InternalWebControllersMerchantApiv1InvoiceStandardResponse + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "InvoiceApiService.CreateInvoice") + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: InvoiceApiService.CreateInvoiceExecute") + } + + localVarPath := localBasePath + "/merchant/v1/invoice" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.request == nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "request is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.request + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: InvoiceApiService.CreateInvoiceExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDownloadInvoiceRequest struct { + ctx context.Context + ApiService PublicInvoiceAPI + page *int32 + limit *int32 + statuses *string +} + +// Page number +func (r ApiDownloadInvoiceRequest) Page(page int32) ApiDownloadInvoiceRequest { + r.page = &page + return r +} + +// Page limit +func (r ApiDownloadInvoiceRequest) Limit(limit int32) ApiDownloadInvoiceRequest { + r.limit = &limit + return r +} + +// Comma-separated list of statuses to filter by. Example: ?statuses=ACTIVE,PENDING +func (r ApiDownloadInvoiceRequest) Statuses(statuses string) ApiDownloadInvoiceRequest { + r.statuses = &statuses + return r +} + +func (r ApiDownloadInvoiceRequest) Execute() (string, *http.Response, error) { + return r.ApiService.DownloadInvoiceExecute(r) +} + +/* +DownloadInvoice Download CSV file. + +Download a CSV file of invoices. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDownloadInvoiceRequest +*/ +func (a *InvoiceApiService) DownloadInvoice(ctx context.Context) ApiDownloadInvoiceRequest { + return ApiDownloadInvoiceRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return string +func (a *InvoiceApiService) DownloadInvoiceExecute(r ApiDownloadInvoiceRequest) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue string + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "InvoiceApiService.DownloadInvoice") + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: InvoiceApiService.DownloadInvoiceExecute") + } + + localVarPath := localBasePath + "/merchant/v1/invoice/download/csv" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.page != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } else { + var defaultValue int32 = 1 + r.page = &defaultValue + } + if r.limit != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } else { + var defaultValue int32 = 10 + r.limit = &defaultValue + } + if r.statuses != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "statuses", r.statuses, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: InvoiceApiService.DownloadInvoiceExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiExpireInvoiceRequest struct { + ctx context.Context + ApiService PublicInvoiceAPI + invoiceId string +} + +func (r ApiExpireInvoiceRequest) Execute() (*InternalWebControllersMerchantApiv1InvoiceStandardResponse, *http.Response, error) { + return r.ApiService.ExpireInvoiceExecute(r) +} + +/* +ExpireInvoice Expire invoice by invoice ID. + +Expire invoice by invoice ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param invoiceId Invoice ID to fetch payment method + @return ApiExpireInvoiceRequest +*/ +func (a *InvoiceApiService) ExpireInvoice(ctx context.Context, invoiceId string) ApiExpireInvoiceRequest { + return ApiExpireInvoiceRequest{ + ApiService: a, + ctx: ctx, + invoiceId: invoiceId, + } +} + +// Execute executes the request +// +// @return InternalWebControllersMerchantApiv1InvoiceStandardResponse +func (a *InvoiceApiService) ExpireInvoiceExecute(r ApiExpireInvoiceRequest) (*InternalWebControllersMerchantApiv1InvoiceStandardResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *InternalWebControllersMerchantApiv1InvoiceStandardResponse + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "InvoiceApiService.ExpireInvoice") + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: InvoiceApiService.ExpireInvoiceExecute") + } + + localVarPath := localBasePath + "/merchant/v1/invoice/{invoice_id}/expire" + localVarPath = strings.Replace(localVarPath, "{"+"invoice_id"+"}", url.PathEscape(utils.ParameterValueToString(r.invoiceId, "invoiceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: InvoiceApiService.ExpireInvoiceExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetInvoiceByIdRequest struct { + ctx context.Context + ApiService PublicInvoiceAPI + invoiceId string +} + +func (r ApiGetInvoiceByIdRequest) Execute() (*InternalWebControllersMerchantApiv1InvoiceStandardResponse, *http.Response, error) { + return r.ApiService.GetInvoiceByIdExecute(r) +} + +/* +GetInvoiceById Fetch invoice data by ID. + +Fetch invoice data by ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param invoiceId Invoice ID to fetch data + @return ApiGetInvoiceByIdRequest +*/ +func (a *InvoiceApiService) GetInvoiceById(ctx context.Context, invoiceId string) ApiGetInvoiceByIdRequest { + return ApiGetInvoiceByIdRequest{ + ApiService: a, + ctx: ctx, + invoiceId: invoiceId, + } +} + +// Execute executes the request +// +// @return InternalWebControllersMerchantApiv1InvoiceStandardResponse +func (a *InvoiceApiService) GetInvoiceByIdExecute(r ApiGetInvoiceByIdRequest) (*InternalWebControllersMerchantApiv1InvoiceStandardResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *InternalWebControllersMerchantApiv1InvoiceStandardResponse + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "InvoiceApiService.GetInvoiceById") + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: InvoiceApiService.GetInvoiceByIdExecute") + } + + localVarPath := localBasePath + "/merchant/v1/invoice/{invoice_id}" + localVarPath = strings.Replace(localVarPath, "{"+"invoice_id"+"}", url.PathEscape(utils.ParameterValueToString(r.invoiceId, "invoiceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: InvoiceApiService.GetInvoiceByIdExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetInvoicesRequest struct { + ctx context.Context + ApiService PublicInvoiceAPI + page *int32 + limit *int32 + statuses *string +} + +// Page number +func (r ApiGetInvoicesRequest) Page(page int32) ApiGetInvoicesRequest { + r.page = &page + return r +} + +// Page limit +func (r ApiGetInvoicesRequest) Limit(limit int32) ApiGetInvoicesRequest { + r.limit = &limit + return r +} + +// Comma-separated list of statuses to filter by. Example: ?statuses=ACTIVE,PENDING +func (r ApiGetInvoicesRequest) Statuses(statuses string) ApiGetInvoicesRequest { + r.statuses = &statuses + return r +} + +func (r ApiGetInvoicesRequest) Execute() (*InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination, *http.Response, error) { + return r.ApiService.GetInvoicesExecute(r) +} + +/* +GetInvoices List all created invoice data + +List all created invoice data. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetInvoicesRequest +*/ +func (a *InvoiceApiService) GetInvoices(ctx context.Context) ApiGetInvoicesRequest { + return ApiGetInvoicesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination +func (a *InvoiceApiService) GetInvoicesExecute(r ApiGetInvoicesRequest) (*InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "InvoiceApiService.GetInvoices") + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: InvoiceApiService.GetInvoicesExecute") + } + + localVarPath := localBasePath + "/merchant/v1/invoice" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.page != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } else { + var defaultValue int32 = 1 + r.page = &defaultValue + } + if r.limit != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } else { + var defaultValue int32 = 10 + r.limit = &defaultValue + } + if r.statuses != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "statuses", r.statuses, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: InvoiceApiService.CreateInvoiceExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetPaymentMethodByIdRequest struct { + ctx context.Context + ApiService PublicInvoiceAPI + invoiceId string +} + +func (r ApiGetPaymentMethodByIdRequest) Execute() (*InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse, *http.Response, error) { + return r.ApiService.GetPaymentMethodByIdExecute(r) +} + +/* +GetPaymentMethodById Fetch payment method by invoice ID. + +Fetch payment method by invoice ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param invoiceId Invoice ID to fetch payment method + @return ApiGetPaymentMethodByIdRequest +*/ +func (a *InvoiceApiService) GetPaymentMethodById(ctx context.Context, invoiceId string) ApiGetPaymentMethodByIdRequest { + return ApiGetPaymentMethodByIdRequest{ + ApiService: a, + ctx: ctx, + invoiceId: invoiceId, + } +} + +// Execute executes the request +// +// @return InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse +func (a *InvoiceApiService) GetPaymentMethodByIdExecute(r ApiGetPaymentMethodByIdRequest) (*InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "InvoiceApiService.GetPaymentMethodById") + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: InvoiceApiService.GetPaymentMethodByIdExecute") + } + + localVarPath := localBasePath + "/merchant/v1/invoice/{invoice_id}/payment-method" + localVarPath = strings.Replace(localVarPath, "{"+"invoice_id"+"}", url.PathEscape(utils.ParameterValueToString(r.invoiceId, "invoiceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: InvoiceApiService.GetPaymentMethodByIdExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdateInvoiceByIdRequest struct { + ctx context.Context + ApiService PublicInvoiceAPI + invoiceId string + request *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest +} + +// Invoice Request Body +func (r ApiUpdateInvoiceByIdRequest) Request(request InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) ApiUpdateInvoiceByIdRequest { + r.request = &request + return r +} + +func (r ApiUpdateInvoiceByIdRequest) Execute() (*InternalWebControllersMerchantApiv1InvoiceStandardResponse, *http.Response, error) { + return r.ApiService.UpdateInvoiceByIdExecute(r) +} + +/* +UpdateInvoiceById Update pending invoice + +Update pending invoice + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param invoiceId invoice id to update + @return ApiUpdateInvoiceByIdRequest +*/ +func (a *InvoiceApiService) UpdateInvoiceById(ctx context.Context, invoiceId string) ApiUpdateInvoiceByIdRequest { + return ApiUpdateInvoiceByIdRequest{ + ApiService: a, + ctx: ctx, + invoiceId: invoiceId, + } +} + +// Execute executes the request +// +// @return InternalWebControllersMerchantApiv1InvoiceStandardResponse +func (a *InvoiceApiService) UpdateInvoiceByIdExecute(r ApiUpdateInvoiceByIdRequest) (*InternalWebControllersMerchantApiv1InvoiceStandardResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *InternalWebControllersMerchantApiv1InvoiceStandardResponse + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "InvoiceApiService.UpdateInvoiceById") + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: InvoiceApiService.UpdateInvoiceByIdExecute") + } + + localVarPath := localBasePath + "/merchant/v1/invoice/{invoice_id}/update" + localVarPath = strings.Replace(localVarPath, "{"+"invoice_id"+"}", url.PathEscape(utils.ParameterValueToString(r.invoiceId, "invoiceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.request == nil { + return localVarReturnValue, nil, utils.ReportError("request is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.request + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: InvoiceApiService.UpdateInvoiceByIdExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/invoice/model_invoice_customer.go b/invoice/model_invoice_customer.go new file mode 100644 index 0000000..383331e --- /dev/null +++ b/invoice/model_invoice_customer.go @@ -0,0 +1,413 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package invoice + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the InternalWebControllersMerchantApiv1InvoiceCustomer type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &InternalWebControllersMerchantApiv1InvoiceCustomer{} + +// InternalWebControllersMerchantApiv1InvoiceCustomer struct for InternalWebControllersMerchantApiv1InvoiceCustomer +type InternalWebControllersMerchantApiv1InvoiceCustomer struct { + Addresses *string `json:"addresses,omitempty"` + City *string `json:"city,omitempty"` + Country *string `json:"country,omitempty"` + CustomerRefId *string `json:"customer_ref_id,omitempty"` + Email *string `json:"email,omitempty"` + Name *string `json:"name,omitempty"` + Notes *string `json:"notes,omitempty"` + Phone *string `json:"phone,omitempty"` + PostalCode *int32 `json:"postal_code,omitempty"` +} + +// NewInternalWebControllersMerchantApiv1InvoiceCustomer instantiates a new InternalWebControllersMerchantApiv1InvoiceCustomer object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalWebControllersMerchantApiv1InvoiceCustomer() *InternalWebControllersMerchantApiv1InvoiceCustomer { + this := InternalWebControllersMerchantApiv1InvoiceCustomer{} + return &this +} + +// NewInternalWebControllersMerchantApiv1InvoiceCustomerWithDefaults instantiates a new InternalWebControllersMerchantApiv1InvoiceCustomer object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalWebControllersMerchantApiv1InvoiceCustomerWithDefaults() *InternalWebControllersMerchantApiv1InvoiceCustomer { + this := InternalWebControllersMerchantApiv1InvoiceCustomer{} + return &this +} + +// GetAddresses returns the Addresses field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetAddresses() string { + if o == nil || utils.IsNil(o.Addresses) { + var ret string + return ret + } + return *o.Addresses +} + +// GetAddressesOk returns a tuple with the Addresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetAddressesOk() (*string, bool) { + if o == nil || utils.IsNil(o.Addresses) { + return nil, false + } + return o.Addresses, true +} + +// HasAddresses returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) HasAddresses() bool { + if o != nil && !utils.IsNil(o.Addresses) { + return true + } + + return false +} + +// SetAddresses gets a reference to the given string and assigns it to the Addresses field. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) SetAddresses(v string) { + o.Addresses = &v +} + +// GetCity returns the City field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetCity() string { + if o == nil || utils.IsNil(o.City) { + var ret string + return ret + } + return *o.City +} + +// GetCityOk returns a tuple with the City field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetCityOk() (*string, bool) { + if o == nil || utils.IsNil(o.City) { + return nil, false + } + return o.City, true +} + +// HasCity returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) HasCity() bool { + if o != nil && !utils.IsNil(o.City) { + return true + } + + return false +} + +// SetCity gets a reference to the given string and assigns it to the City field. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) SetCity(v string) { + o.City = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetCountry() string { + if o == nil || utils.IsNil(o.Country) { + var ret string + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetCountryOk() (*string, bool) { + if o == nil || utils.IsNil(o.Country) { + return nil, false + } + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) HasCountry() bool { + if o != nil && !utils.IsNil(o.Country) { + return true + } + + return false +} + +// SetCountry gets a reference to the given string and assigns it to the Country field. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) SetCountry(v string) { + o.Country = &v +} + +// GetCustomerRefId returns the CustomerRefId field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetCustomerRefId() string { + if o == nil || utils.IsNil(o.CustomerRefId) { + var ret string + return ret + } + return *o.CustomerRefId +} + +// GetCustomerRefIdOk returns a tuple with the CustomerRefId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetCustomerRefIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.CustomerRefId) { + return nil, false + } + return o.CustomerRefId, true +} + +// HasCustomerRefId returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) HasCustomerRefId() bool { + if o != nil && !utils.IsNil(o.CustomerRefId) { + return true + } + + return false +} + +// SetCustomerRefId gets a reference to the given string and assigns it to the CustomerRefId field. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) SetCustomerRefId(v string) { + o.CustomerRefId = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetEmail() string { + if o == nil || utils.IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetEmailOk() (*string, bool) { + if o == nil || utils.IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) HasEmail() bool { + if o != nil && !utils.IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) SetEmail(v string) { + o.Email = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetName() string { + if o == nil || utils.IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetNameOk() (*string, bool) { + if o == nil || utils.IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) HasName() bool { + if o != nil && !utils.IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) SetName(v string) { + o.Name = &v +} + +// GetNotes returns the Notes field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetNotes() string { + if o == nil || utils.IsNil(o.Notes) { + var ret string + return ret + } + return *o.Notes +} + +// GetNotesOk returns a tuple with the Notes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetNotesOk() (*string, bool) { + if o == nil || utils.IsNil(o.Notes) { + return nil, false + } + return o.Notes, true +} + +// HasNotes returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) HasNotes() bool { + if o != nil && !utils.IsNil(o.Notes) { + return true + } + + return false +} + +// SetNotes gets a reference to the given string and assigns it to the Notes field. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) SetNotes(v string) { + o.Notes = &v +} + +// GetPhone returns the Phone field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetPhone() string { + if o == nil || utils.IsNil(o.Phone) { + var ret string + return ret + } + return *o.Phone +} + +// GetPhoneOk returns a tuple with the Phone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetPhoneOk() (*string, bool) { + if o == nil || utils.IsNil(o.Phone) { + return nil, false + } + return o.Phone, true +} + +// HasPhone returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) HasPhone() bool { + if o != nil && !utils.IsNil(o.Phone) { + return true + } + + return false +} + +// SetPhone gets a reference to the given string and assigns it to the Phone field. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) SetPhone(v string) { + o.Phone = &v +} + +// GetPostalCode returns the PostalCode field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetPostalCode() int32 { + if o == nil || utils.IsNil(o.PostalCode) { + var ret int32 + return ret + } + return *o.PostalCode +} + +// GetPostalCodeOk returns a tuple with the PostalCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) GetPostalCodeOk() (*int32, bool) { + if o == nil || utils.IsNil(o.PostalCode) { + return nil, false + } + return o.PostalCode, true +} + +// HasPostalCode returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) HasPostalCode() bool { + if o != nil && !utils.IsNil(o.PostalCode) { + return true + } + + return false +} + +// SetPostalCode gets a reference to the given int32 and assigns it to the PostalCode field. +func (o *InternalWebControllersMerchantApiv1InvoiceCustomer) SetPostalCode(v int32) { + o.PostalCode = &v +} + +func (o InternalWebControllersMerchantApiv1InvoiceCustomer) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalWebControllersMerchantApiv1InvoiceCustomer) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Addresses) { + toSerialize["addresses"] = o.Addresses + } + if !utils.IsNil(o.City) { + toSerialize["city"] = o.City + } + if !utils.IsNil(o.Country) { + toSerialize["country"] = o.Country + } + if !utils.IsNil(o.CustomerRefId) { + toSerialize["customer_ref_id"] = o.CustomerRefId + } + if !utils.IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if !utils.IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !utils.IsNil(o.Notes) { + toSerialize["notes"] = o.Notes + } + if !utils.IsNil(o.Phone) { + toSerialize["phone"] = o.Phone + } + if !utils.IsNil(o.PostalCode) { + toSerialize["postal_code"] = o.PostalCode + } + return toSerialize, nil +} + +type NullableInternalWebControllersMerchantApiv1InvoiceCustomer struct { + value *InternalWebControllersMerchantApiv1InvoiceCustomer + isSet bool +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceCustomer) Get() *InternalWebControllersMerchantApiv1InvoiceCustomer { + return v.value +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceCustomer) Set(val *InternalWebControllersMerchantApiv1InvoiceCustomer) { + v.value = val + v.isSet = true +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceCustomer) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceCustomer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalWebControllersMerchantApiv1InvoiceCustomer(val *InternalWebControllersMerchantApiv1InvoiceCustomer) *NullableInternalWebControllersMerchantApiv1InvoiceCustomer { + return &NullableInternalWebControllersMerchantApiv1InvoiceCustomer{value: val, isSet: true} +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceCustomer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceCustomer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_invoice_detail_response.go b/invoice/model_invoice_detail_response.go new file mode 100644 index 0000000..bb8c38e --- /dev/null +++ b/invoice/model_invoice_detail_response.go @@ -0,0 +1,665 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package invoice + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse{} + +// InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse struct for InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse +type InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse struct { + Amount *float32 `json:"amount,omitempty"` + AmountCurrency *string `json:"amount_currency,omitempty"` + Country *string `json:"country,omitempty"` + Customer *InternalWebControllersMerchantApiv1InvoiceCustomer `json:"customer,omitempty"` + CustomerNotification []string `json:"customer_notification,omitempty"` + ExternalId *string `json:"external_id,omitempty"` + InvoiceLinkId *string `json:"invoice_link_id,omitempty"` + Items []InternalWebControllersMerchantApiv1InvoiceItem `json:"items,omitempty"` + MerchantLogo *string `json:"merchant_logo,omitempty"` + MerchantName *string `json:"merchant_name,omitempty"` + Notes *string `json:"notes,omitempty"` + PaymentMethods []InternalWebControllersMerchantApiv1InvoicePaymentMethod `json:"payment_methods,omitempty"` + RedirectUrl *InternalWebControllersMerchantApiv1InvoiceRedirectURL `json:"redirect_url,omitempty"` + Status *string `json:"status,omitempty"` + TimeBegin *string `json:"time_begin,omitempty"` + TimeEnd *string `json:"time_end,omitempty"` +} + +// NewInternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse instantiates a new InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse() *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse { + this := InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse{} + return &this +} + +// NewInternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponseWithDefaults instantiates a new InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponseWithDefaults() *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse { + this := InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetAmount() float32 { + if o == nil || utils.IsNil(o.Amount) { + var ret float32 + return ret + } + return *o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetAmountOk() (*float32, bool) { + if o == nil || utils.IsNil(o.Amount) { + return nil, false + } + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasAmount() bool { + if o != nil && !utils.IsNil(o.Amount) { + return true + } + + return false +} + +// SetAmount gets a reference to the given float32 and assigns it to the Amount field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetAmount(v float32) { + o.Amount = &v +} + +// GetAmountCurrency returns the AmountCurrency field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetAmountCurrency() string { + if o == nil || utils.IsNil(o.AmountCurrency) { + var ret string + return ret + } + return *o.AmountCurrency +} + +// GetAmountCurrencyOk returns a tuple with the AmountCurrency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetAmountCurrencyOk() (*string, bool) { + if o == nil || utils.IsNil(o.AmountCurrency) { + return nil, false + } + return o.AmountCurrency, true +} + +// HasAmountCurrency returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasAmountCurrency() bool { + if o != nil && !utils.IsNil(o.AmountCurrency) { + return true + } + + return false +} + +// SetAmountCurrency gets a reference to the given string and assigns it to the AmountCurrency field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetAmountCurrency(v string) { + o.AmountCurrency = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetCountry() string { + if o == nil || utils.IsNil(o.Country) { + var ret string + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetCountryOk() (*string, bool) { + if o == nil || utils.IsNil(o.Country) { + return nil, false + } + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasCountry() bool { + if o != nil && !utils.IsNil(o.Country) { + return true + } + + return false +} + +// SetCountry gets a reference to the given string and assigns it to the Country field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetCountry(v string) { + o.Country = &v +} + +// GetCustomer returns the Customer field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetCustomer() InternalWebControllersMerchantApiv1InvoiceCustomer { + if o == nil || utils.IsNil(o.Customer) { + var ret InternalWebControllersMerchantApiv1InvoiceCustomer + return ret + } + return *o.Customer +} + +// GetCustomerOk returns a tuple with the Customer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetCustomerOk() (*InternalWebControllersMerchantApiv1InvoiceCustomer, bool) { + if o == nil || utils.IsNil(o.Customer) { + return nil, false + } + return o.Customer, true +} + +// HasCustomer returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasCustomer() bool { + if o != nil && !utils.IsNil(o.Customer) { + return true + } + + return false +} + +// SetCustomer gets a reference to the given InternalWebControllersMerchantApiv1InvoiceCustomer and assigns it to the Customer field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetCustomer(v InternalWebControllersMerchantApiv1InvoiceCustomer) { + o.Customer = &v +} + +// GetCustomerNotification returns the CustomerNotification field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetCustomerNotification() []string { + if o == nil || utils.IsNil(o.CustomerNotification) { + var ret []string + return ret + } + return o.CustomerNotification +} + +// GetCustomerNotificationOk returns a tuple with the CustomerNotification field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetCustomerNotificationOk() ([]string, bool) { + if o == nil || utils.IsNil(o.CustomerNotification) { + return nil, false + } + return o.CustomerNotification, true +} + +// HasCustomerNotification returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasCustomerNotification() bool { + if o != nil && !utils.IsNil(o.CustomerNotification) { + return true + } + + return false +} + +// SetCustomerNotification gets a reference to the given []string and assigns it to the CustomerNotification field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetCustomerNotification(v []string) { + o.CustomerNotification = v +} + +// GetExternalId returns the ExternalId field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetExternalId() string { + if o == nil || utils.IsNil(o.ExternalId) { + var ret string + return ret + } + return *o.ExternalId +} + +// GetExternalIdOk returns a tuple with the ExternalId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetExternalIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.ExternalId) { + return nil, false + } + return o.ExternalId, true +} + +// HasExternalId returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasExternalId() bool { + if o != nil && !utils.IsNil(o.ExternalId) { + return true + } + + return false +} + +// SetExternalId gets a reference to the given string and assigns it to the ExternalId field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetExternalId(v string) { + o.ExternalId = &v +} + +// GetInvoiceLinkId returns the InvoiceLinkId field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetInvoiceLinkId() string { + if o == nil || utils.IsNil(o.InvoiceLinkId) { + var ret string + return ret + } + return *o.InvoiceLinkId +} + +// GetInvoiceLinkIdOk returns a tuple with the InvoiceLinkId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetInvoiceLinkIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.InvoiceLinkId) { + return nil, false + } + return o.InvoiceLinkId, true +} + +// HasInvoiceLinkId returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasInvoiceLinkId() bool { + if o != nil && !utils.IsNil(o.InvoiceLinkId) { + return true + } + + return false +} + +// SetInvoiceLinkId gets a reference to the given string and assigns it to the InvoiceLinkId field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetInvoiceLinkId(v string) { + o.InvoiceLinkId = &v +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetItems() []InternalWebControllersMerchantApiv1InvoiceItem { + if o == nil || utils.IsNil(o.Items) { + var ret []InternalWebControllersMerchantApiv1InvoiceItem + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetItemsOk() ([]InternalWebControllersMerchantApiv1InvoiceItem, bool) { + if o == nil || utils.IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasItems() bool { + if o != nil && !utils.IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []InternalWebControllersMerchantApiv1InvoiceItem and assigns it to the Items field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetItems(v []InternalWebControllersMerchantApiv1InvoiceItem) { + o.Items = v +} + +// GetMerchantLogo returns the MerchantLogo field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetMerchantLogo() string { + if o == nil || utils.IsNil(o.MerchantLogo) { + var ret string + return ret + } + return *o.MerchantLogo +} + +// GetMerchantLogoOk returns a tuple with the MerchantLogo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetMerchantLogoOk() (*string, bool) { + if o == nil || utils.IsNil(o.MerchantLogo) { + return nil, false + } + return o.MerchantLogo, true +} + +// HasMerchantLogo returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasMerchantLogo() bool { + if o != nil && !utils.IsNil(o.MerchantLogo) { + return true + } + + return false +} + +// SetMerchantLogo gets a reference to the given string and assigns it to the MerchantLogo field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetMerchantLogo(v string) { + o.MerchantLogo = &v +} + +// GetMerchantName returns the MerchantName field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetMerchantName() string { + if o == nil || utils.IsNil(o.MerchantName) { + var ret string + return ret + } + return *o.MerchantName +} + +// GetMerchantNameOk returns a tuple with the MerchantName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetMerchantNameOk() (*string, bool) { + if o == nil || utils.IsNil(o.MerchantName) { + return nil, false + } + return o.MerchantName, true +} + +// HasMerchantName returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasMerchantName() bool { + if o != nil && !utils.IsNil(o.MerchantName) { + return true + } + + return false +} + +// SetMerchantName gets a reference to the given string and assigns it to the MerchantName field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetMerchantName(v string) { + o.MerchantName = &v +} + +// GetNotes returns the Notes field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetNotes() string { + if o == nil || utils.IsNil(o.Notes) { + var ret string + return ret + } + return *o.Notes +} + +// GetNotesOk returns a tuple with the Notes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetNotesOk() (*string, bool) { + if o == nil || utils.IsNil(o.Notes) { + return nil, false + } + return o.Notes, true +} + +// HasNotes returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasNotes() bool { + if o != nil && !utils.IsNil(o.Notes) { + return true + } + + return false +} + +// SetNotes gets a reference to the given string and assigns it to the Notes field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetNotes(v string) { + o.Notes = &v +} + +// GetPaymentMethods returns the PaymentMethods field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetPaymentMethods() []InternalWebControllersMerchantApiv1InvoicePaymentMethod { + if o == nil || utils.IsNil(o.PaymentMethods) { + var ret []InternalWebControllersMerchantApiv1InvoicePaymentMethod + return ret + } + return o.PaymentMethods +} + +// GetPaymentMethodsOk returns a tuple with the PaymentMethods field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetPaymentMethodsOk() ([]InternalWebControllersMerchantApiv1InvoicePaymentMethod, bool) { + if o == nil || utils.IsNil(o.PaymentMethods) { + return nil, false + } + return o.PaymentMethods, true +} + +// HasPaymentMethods returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasPaymentMethods() bool { + if o != nil && !utils.IsNil(o.PaymentMethods) { + return true + } + + return false +} + +// SetPaymentMethods gets a reference to the given []InternalWebControllersMerchantApiv1InvoicePaymentMethod and assigns it to the PaymentMethods field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetPaymentMethods(v []InternalWebControllersMerchantApiv1InvoicePaymentMethod) { + o.PaymentMethods = v +} + +// GetRedirectUrl returns the RedirectUrl field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetRedirectUrl() InternalWebControllersMerchantApiv1InvoiceRedirectURL { + if o == nil || utils.IsNil(o.RedirectUrl) { + var ret InternalWebControllersMerchantApiv1InvoiceRedirectURL + return ret + } + return *o.RedirectUrl +} + +// GetRedirectUrlOk returns a tuple with the RedirectUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetRedirectUrlOk() (*InternalWebControllersMerchantApiv1InvoiceRedirectURL, bool) { + if o == nil || utils.IsNil(o.RedirectUrl) { + return nil, false + } + return o.RedirectUrl, true +} + +// HasRedirectUrl returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasRedirectUrl() bool { + if o != nil && !utils.IsNil(o.RedirectUrl) { + return true + } + + return false +} + +// SetRedirectUrl gets a reference to the given InternalWebControllersMerchantApiv1InvoiceRedirectURL and assigns it to the RedirectUrl field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetRedirectUrl(v InternalWebControllersMerchantApiv1InvoiceRedirectURL) { + o.RedirectUrl = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetStatus() string { + if o == nil || utils.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetStatusOk() (*string, bool) { + if o == nil || utils.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasStatus() bool { + if o != nil && !utils.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetStatus(v string) { + o.Status = &v +} + +// GetTimeBegin returns the TimeBegin field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetTimeBegin() string { + if o == nil || utils.IsNil(o.TimeBegin) { + var ret string + return ret + } + return *o.TimeBegin +} + +// GetTimeBeginOk returns a tuple with the TimeBegin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetTimeBeginOk() (*string, bool) { + if o == nil || utils.IsNil(o.TimeBegin) { + return nil, false + } + return o.TimeBegin, true +} + +// HasTimeBegin returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasTimeBegin() bool { + if o != nil && !utils.IsNil(o.TimeBegin) { + return true + } + + return false +} + +// SetTimeBegin gets a reference to the given string and assigns it to the TimeBegin field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetTimeBegin(v string) { + o.TimeBegin = &v +} + +// GetTimeEnd returns the TimeEnd field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetTimeEnd() string { + if o == nil || utils.IsNil(o.TimeEnd) { + var ret string + return ret + } + return *o.TimeEnd +} + +// GetTimeEndOk returns a tuple with the TimeEnd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) GetTimeEndOk() (*string, bool) { + if o == nil || utils.IsNil(o.TimeEnd) { + return nil, false + } + return o.TimeEnd, true +} + +// HasTimeEnd returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) HasTimeEnd() bool { + if o != nil && !utils.IsNil(o.TimeEnd) { + return true + } + + return false +} + +// SetTimeEnd gets a reference to the given string and assigns it to the TimeEnd field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) SetTimeEnd(v string) { + o.TimeEnd = &v +} + +func (o InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } + if !utils.IsNil(o.AmountCurrency) { + toSerialize["amount_currency"] = o.AmountCurrency + } + if !utils.IsNil(o.Country) { + toSerialize["country"] = o.Country + } + if !utils.IsNil(o.Customer) { + toSerialize["customer"] = o.Customer + } + if !utils.IsNil(o.CustomerNotification) { + toSerialize["customer_notification"] = o.CustomerNotification + } + if !utils.IsNil(o.ExternalId) { + toSerialize["external_id"] = o.ExternalId + } + if !utils.IsNil(o.InvoiceLinkId) { + toSerialize["invoice_link_id"] = o.InvoiceLinkId + } + if !utils.IsNil(o.Items) { + toSerialize["items"] = o.Items + } + if !utils.IsNil(o.MerchantLogo) { + toSerialize["merchant_logo"] = o.MerchantLogo + } + if !utils.IsNil(o.MerchantName) { + toSerialize["merchant_name"] = o.MerchantName + } + if !utils.IsNil(o.Notes) { + toSerialize["notes"] = o.Notes + } + if !utils.IsNil(o.PaymentMethods) { + toSerialize["payment_methods"] = o.PaymentMethods + } + if !utils.IsNil(o.RedirectUrl) { + toSerialize["redirect_url"] = o.RedirectUrl + } + if !utils.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !utils.IsNil(o.TimeBegin) { + toSerialize["time_begin"] = o.TimeBegin + } + if !utils.IsNil(o.TimeEnd) { + toSerialize["time_end"] = o.TimeEnd + } + return toSerialize, nil +} + +type NullableInternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse struct { + value *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse + isSet bool +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) Get() *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse { + return v.value +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) Set(val *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) { + v.value = val + v.isSet = true +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse(val *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) *NullableInternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse { + return &NullableInternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse{value: val, isSet: true} +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_invoice_item.go b/invoice/model_invoice_item.go new file mode 100644 index 0000000..4551384 --- /dev/null +++ b/invoice/model_invoice_item.go @@ -0,0 +1,269 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package invoice + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the InternalWebControllersMerchantApiv1InvoiceItem type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &InternalWebControllersMerchantApiv1InvoiceItem{} + +// InternalWebControllersMerchantApiv1InvoiceItem struct for InternalWebControllersMerchantApiv1InvoiceItem +type InternalWebControllersMerchantApiv1InvoiceItem struct { + SKU *string `json:"SKU,omitempty"` + Name *string `json:"name,omitempty"` + Notes *string `json:"notes,omitempty"` + Price *float32 `json:"price,omitempty"` + Quantity *int32 `json:"quantity,omitempty"` +} + +// NewInternalWebControllersMerchantApiv1InvoiceItem instantiates a new InternalWebControllersMerchantApiv1InvoiceItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalWebControllersMerchantApiv1InvoiceItem() *InternalWebControllersMerchantApiv1InvoiceItem { + this := InternalWebControllersMerchantApiv1InvoiceItem{} + return &this +} + +// NewInternalWebControllersMerchantApiv1InvoiceItemWithDefaults instantiates a new InternalWebControllersMerchantApiv1InvoiceItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalWebControllersMerchantApiv1InvoiceItemWithDefaults() *InternalWebControllersMerchantApiv1InvoiceItem { + this := InternalWebControllersMerchantApiv1InvoiceItem{} + return &this +} + +// GetSKU returns the SKU field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceItem) GetSKU() string { + if o == nil || utils.IsNil(o.SKU) { + var ret string + return ret + } + return *o.SKU +} + +// GetSKUOk returns a tuple with the SKU field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceItem) GetSKUOk() (*string, bool) { + if o == nil || utils.IsNil(o.SKU) { + return nil, false + } + return o.SKU, true +} + +// HasSKU returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceItem) HasSKU() bool { + if o != nil && !utils.IsNil(o.SKU) { + return true + } + + return false +} + +// SetSKU gets a reference to the given string and assigns it to the SKU field. +func (o *InternalWebControllersMerchantApiv1InvoiceItem) SetSKU(v string) { + o.SKU = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceItem) GetName() string { + if o == nil || utils.IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceItem) GetNameOk() (*string, bool) { + if o == nil || utils.IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceItem) HasName() bool { + if o != nil && !utils.IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *InternalWebControllersMerchantApiv1InvoiceItem) SetName(v string) { + o.Name = &v +} + +// GetNotes returns the Notes field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceItem) GetNotes() string { + if o == nil || utils.IsNil(o.Notes) { + var ret string + return ret + } + return *o.Notes +} + +// GetNotesOk returns a tuple with the Notes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceItem) GetNotesOk() (*string, bool) { + if o == nil || utils.IsNil(o.Notes) { + return nil, false + } + return o.Notes, true +} + +// HasNotes returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceItem) HasNotes() bool { + if o != nil && !utils.IsNil(o.Notes) { + return true + } + + return false +} + +// SetNotes gets a reference to the given string and assigns it to the Notes field. +func (o *InternalWebControllersMerchantApiv1InvoiceItem) SetNotes(v string) { + o.Notes = &v +} + +// GetPrice returns the Price field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceItem) GetPrice() float32 { + if o == nil || utils.IsNil(o.Price) { + var ret float32 + return ret + } + return *o.Price +} + +// GetPriceOk returns a tuple with the Price field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceItem) GetPriceOk() (*float32, bool) { + if o == nil || utils.IsNil(o.Price) { + return nil, false + } + return o.Price, true +} + +// HasPrice returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceItem) HasPrice() bool { + if o != nil && !utils.IsNil(o.Price) { + return true + } + + return false +} + +// SetPrice gets a reference to the given float32 and assigns it to the Price field. +func (o *InternalWebControllersMerchantApiv1InvoiceItem) SetPrice(v float32) { + o.Price = &v +} + +// GetQuantity returns the Quantity field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceItem) GetQuantity() int32 { + if o == nil || utils.IsNil(o.Quantity) { + var ret int32 + return ret + } + return *o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceItem) GetQuantityOk() (*int32, bool) { + if o == nil || utils.IsNil(o.Quantity) { + return nil, false + } + return o.Quantity, true +} + +// HasQuantity returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceItem) HasQuantity() bool { + if o != nil && !utils.IsNil(o.Quantity) { + return true + } + + return false +} + +// SetQuantity gets a reference to the given int32 and assigns it to the Quantity field. +func (o *InternalWebControllersMerchantApiv1InvoiceItem) SetQuantity(v int32) { + o.Quantity = &v +} + +func (o InternalWebControllersMerchantApiv1InvoiceItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalWebControllersMerchantApiv1InvoiceItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.SKU) { + toSerialize["SKU"] = o.SKU + } + if !utils.IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !utils.IsNil(o.Notes) { + toSerialize["notes"] = o.Notes + } + if !utils.IsNil(o.Price) { + toSerialize["price"] = o.Price + } + if !utils.IsNil(o.Quantity) { + toSerialize["quantity"] = o.Quantity + } + return toSerialize, nil +} + +type NullableInternalWebControllersMerchantApiv1InvoiceItem struct { + value *InternalWebControllersMerchantApiv1InvoiceItem + isSet bool +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceItem) Get() *InternalWebControllersMerchantApiv1InvoiceItem { + return v.value +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceItem) Set(val *InternalWebControllersMerchantApiv1InvoiceItem) { + v.value = val + v.isSet = true +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceItem) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalWebControllersMerchantApiv1InvoiceItem(val *InternalWebControllersMerchantApiv1InvoiceItem) *NullableInternalWebControllersMerchantApiv1InvoiceItem { + return &NullableInternalWebControllersMerchantApiv1InvoiceItem{value: val, isSet: true} +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_invoice_payment_method.go b/invoice/model_invoice_payment_method.go new file mode 100644 index 0000000..84c674c --- /dev/null +++ b/invoice/model_invoice_payment_method.go @@ -0,0 +1,197 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package invoice + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the InternalWebControllersMerchantApiv1InvoicePaymentMethod type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &InternalWebControllersMerchantApiv1InvoicePaymentMethod{} + +// InternalWebControllersMerchantApiv1InvoicePaymentMethod struct for InternalWebControllersMerchantApiv1InvoicePaymentMethod +type InternalWebControllersMerchantApiv1InvoicePaymentMethod struct { + Code *string `json:"code,omitempty"` + Status *string `json:"status,omitempty"` + Type *string `json:"type,omitempty"` +} + +// NewInternalWebControllersMerchantApiv1InvoicePaymentMethod instantiates a new InternalWebControllersMerchantApiv1InvoicePaymentMethod object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalWebControllersMerchantApiv1InvoicePaymentMethod() *InternalWebControllersMerchantApiv1InvoicePaymentMethod { + this := InternalWebControllersMerchantApiv1InvoicePaymentMethod{} + return &this +} + +// NewInternalWebControllersMerchantApiv1InvoicePaymentMethodWithDefaults instantiates a new InternalWebControllersMerchantApiv1InvoicePaymentMethod object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalWebControllersMerchantApiv1InvoicePaymentMethodWithDefaults() *InternalWebControllersMerchantApiv1InvoicePaymentMethod { + this := InternalWebControllersMerchantApiv1InvoicePaymentMethod{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) GetCode() string { + if o == nil || utils.IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) GetCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) HasCode() bool { + if o != nil && !utils.IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) SetCode(v string) { + o.Code = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) GetStatus() string { + if o == nil || utils.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) GetStatusOk() (*string, bool) { + if o == nil || utils.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) HasStatus() bool { + if o != nil && !utils.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) SetStatus(v string) { + o.Status = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) GetType() string { + if o == nil || utils.IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) GetTypeOk() (*string, bool) { + if o == nil || utils.IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) HasType() bool { + if o != nil && !utils.IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *InternalWebControllersMerchantApiv1InvoicePaymentMethod) SetType(v string) { + o.Type = &v +} + +func (o InternalWebControllersMerchantApiv1InvoicePaymentMethod) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalWebControllersMerchantApiv1InvoicePaymentMethod) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !utils.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !utils.IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableInternalWebControllersMerchantApiv1InvoicePaymentMethod struct { + value *InternalWebControllersMerchantApiv1InvoicePaymentMethod + isSet bool +} + +func (v NullableInternalWebControllersMerchantApiv1InvoicePaymentMethod) Get() *InternalWebControllersMerchantApiv1InvoicePaymentMethod { + return v.value +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoicePaymentMethod) Set(val *InternalWebControllersMerchantApiv1InvoicePaymentMethod) { + v.value = val + v.isSet = true +} + +func (v NullableInternalWebControllersMerchantApiv1InvoicePaymentMethod) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoicePaymentMethod) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalWebControllersMerchantApiv1InvoicePaymentMethod(val *InternalWebControllersMerchantApiv1InvoicePaymentMethod) *NullableInternalWebControllersMerchantApiv1InvoicePaymentMethod { + return &NullableInternalWebControllersMerchantApiv1InvoicePaymentMethod{value: val, isSet: true} +} + +func (v NullableInternalWebControllersMerchantApiv1InvoicePaymentMethod) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoicePaymentMethod) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_invoice_redirect_url.go b/invoice/model_invoice_redirect_url.go new file mode 100644 index 0000000..3e15392 --- /dev/null +++ b/invoice/model_invoice_redirect_url.go @@ -0,0 +1,161 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package invoice + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the InternalWebControllersMerchantApiv1InvoiceRedirectURL type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &InternalWebControllersMerchantApiv1InvoiceRedirectURL{} + +// InternalWebControllersMerchantApiv1InvoiceRedirectURL struct for InternalWebControllersMerchantApiv1InvoiceRedirectURL +type InternalWebControllersMerchantApiv1InvoiceRedirectURL struct { + Cancel *string `json:"cancel,omitempty"` + Success *string `json:"success,omitempty"` +} + +// NewInternalWebControllersMerchantApiv1InvoiceRedirectURL instantiates a new InternalWebControllersMerchantApiv1InvoiceRedirectURL object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalWebControllersMerchantApiv1InvoiceRedirectURL() *InternalWebControllersMerchantApiv1InvoiceRedirectURL { + this := InternalWebControllersMerchantApiv1InvoiceRedirectURL{} + return &this +} + +// NewInternalWebControllersMerchantApiv1InvoiceRedirectURLWithDefaults instantiates a new InternalWebControllersMerchantApiv1InvoiceRedirectURL object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalWebControllersMerchantApiv1InvoiceRedirectURLWithDefaults() *InternalWebControllersMerchantApiv1InvoiceRedirectURL { + this := InternalWebControllersMerchantApiv1InvoiceRedirectURL{} + return &this +} + +// GetCancel returns the Cancel field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceRedirectURL) GetCancel() string { + if o == nil || utils.IsNil(o.Cancel) { + var ret string + return ret + } + return *o.Cancel +} + +// GetCancelOk returns a tuple with the Cancel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceRedirectURL) GetCancelOk() (*string, bool) { + if o == nil || utils.IsNil(o.Cancel) { + return nil, false + } + return o.Cancel, true +} + +// HasCancel returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceRedirectURL) HasCancel() bool { + if o != nil && !utils.IsNil(o.Cancel) { + return true + } + + return false +} + +// SetCancel gets a reference to the given string and assigns it to the Cancel field. +func (o *InternalWebControllersMerchantApiv1InvoiceRedirectURL) SetCancel(v string) { + o.Cancel = &v +} + +// GetSuccess returns the Success field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceRedirectURL) GetSuccess() string { + if o == nil || utils.IsNil(o.Success) { + var ret string + return ret + } + return *o.Success +} + +// GetSuccessOk returns a tuple with the Success field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceRedirectURL) GetSuccessOk() (*string, bool) { + if o == nil || utils.IsNil(o.Success) { + return nil, false + } + return o.Success, true +} + +// HasSuccess returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceRedirectURL) HasSuccess() bool { + if o != nil && !utils.IsNil(o.Success) { + return true + } + + return false +} + +// SetSuccess gets a reference to the given string and assigns it to the Success field. +func (o *InternalWebControllersMerchantApiv1InvoiceRedirectURL) SetSuccess(v string) { + o.Success = &v +} + +func (o InternalWebControllersMerchantApiv1InvoiceRedirectURL) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalWebControllersMerchantApiv1InvoiceRedirectURL) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Cancel) { + toSerialize["cancel"] = o.Cancel + } + if !utils.IsNil(o.Success) { + toSerialize["success"] = o.Success + } + return toSerialize, nil +} + +type NullableInternalWebControllersMerchantApiv1InvoiceRedirectURL struct { + value *InternalWebControllersMerchantApiv1InvoiceRedirectURL + isSet bool +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceRedirectURL) Get() *InternalWebControllersMerchantApiv1InvoiceRedirectURL { + return v.value +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceRedirectURL) Set(val *InternalWebControllersMerchantApiv1InvoiceRedirectURL) { + v.value = val + v.isSet = true +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceRedirectURL) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceRedirectURL) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalWebControllersMerchantApiv1InvoiceRedirectURL(val *InternalWebControllersMerchantApiv1InvoiceRedirectURL) *NullableInternalWebControllersMerchantApiv1InvoiceRedirectURL { + return &NullableInternalWebControllersMerchantApiv1InvoiceRedirectURL{value: val, isSet: true} +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceRedirectURL) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceRedirectURL) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_invoice_request.go b/invoice/model_invoice_request.go new file mode 100644 index 0000000..6f39811 --- /dev/null +++ b/invoice/model_invoice_request.go @@ -0,0 +1,521 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package invoice + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the InternalWebControllersMerchantApiv1InvoiceInvoiceRequest type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &InternalWebControllersMerchantApiv1InvoiceInvoiceRequest{} + +// InternalWebControllersMerchantApiv1InvoiceInvoiceRequest Invoice Request +type InternalWebControllersMerchantApiv1InvoiceInvoiceRequest struct { + Amount *float32 `json:"amount,omitempty"` + AmountCurrency *string `json:"amount_currency,omitempty"` + Country *string `json:"country,omitempty"` + Customer *InternalWebControllersMerchantApiv1InvoiceCustomer `json:"customer,omitempty"` + CustomerNotification []string `json:"customer_notification,omitempty"` + ExternalId *string `json:"external_id,omitempty"` + Items []InternalWebControllersMerchantApiv1InvoiceItem `json:"items,omitempty"` + Notes *string `json:"notes,omitempty"` + PaymentMethods []InternalWebControllersMerchantApiv1InvoicePaymentMethod `json:"payment_methods,omitempty"` + RedirectUrl *InternalWebControllersMerchantApiv1InvoiceRedirectURL `json:"redirect_url,omitempty"` + TimeBegin *string `json:"time_begin,omitempty"` + TimeEnd *string `json:"time_end,omitempty"` +} + +// NewInternalWebControllersMerchantApiv1InvoiceInvoiceRequest instantiates a new InternalWebControllersMerchantApiv1InvoiceInvoiceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalWebControllersMerchantApiv1InvoiceInvoiceRequest() *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest { + this := InternalWebControllersMerchantApiv1InvoiceInvoiceRequest{} + return &this +} + +// NewInternalWebControllersMerchantApiv1InvoiceInvoiceRequestWithDefaults instantiates a new InternalWebControllersMerchantApiv1InvoiceInvoiceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalWebControllersMerchantApiv1InvoiceInvoiceRequestWithDefaults() *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest { + this := InternalWebControllersMerchantApiv1InvoiceInvoiceRequest{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetAmount() float32 { + if o == nil || utils.IsNil(o.Amount) { + var ret float32 + return ret + } + return *o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetAmountOk() (*float32, bool) { + if o == nil || utils.IsNil(o.Amount) { + return nil, false + } + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasAmount() bool { + if o != nil && !utils.IsNil(o.Amount) { + return true + } + + return false +} + +// SetAmount gets a reference to the given float32 and assigns it to the Amount field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetAmount(v float32) { + o.Amount = &v +} + +// GetAmountCurrency returns the AmountCurrency field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetAmountCurrency() string { + if o == nil || utils.IsNil(o.AmountCurrency) { + var ret string + return ret + } + return *o.AmountCurrency +} + +// GetAmountCurrencyOk returns a tuple with the AmountCurrency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetAmountCurrencyOk() (*string, bool) { + if o == nil || utils.IsNil(o.AmountCurrency) { + return nil, false + } + return o.AmountCurrency, true +} + +// HasAmountCurrency returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasAmountCurrency() bool { + if o != nil && !utils.IsNil(o.AmountCurrency) { + return true + } + + return false +} + +// SetAmountCurrency gets a reference to the given string and assigns it to the AmountCurrency field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetAmountCurrency(v string) { + o.AmountCurrency = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetCountry() string { + if o == nil || utils.IsNil(o.Country) { + var ret string + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetCountryOk() (*string, bool) { + if o == nil || utils.IsNil(o.Country) { + return nil, false + } + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasCountry() bool { + if o != nil && !utils.IsNil(o.Country) { + return true + } + + return false +} + +// SetCountry gets a reference to the given string and assigns it to the Country field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetCountry(v string) { + o.Country = &v +} + +// GetCustomer returns the Customer field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetCustomer() InternalWebControllersMerchantApiv1InvoiceCustomer { + if o == nil || utils.IsNil(o.Customer) { + var ret InternalWebControllersMerchantApiv1InvoiceCustomer + return ret + } + return *o.Customer +} + +// GetCustomerOk returns a tuple with the Customer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetCustomerOk() (*InternalWebControllersMerchantApiv1InvoiceCustomer, bool) { + if o == nil || utils.IsNil(o.Customer) { + return nil, false + } + return o.Customer, true +} + +// HasCustomer returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasCustomer() bool { + if o != nil && !utils.IsNil(o.Customer) { + return true + } + + return false +} + +// SetCustomer gets a reference to the given InternalWebControllersMerchantApiv1InvoiceCustomer and assigns it to the Customer field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetCustomer(v InternalWebControllersMerchantApiv1InvoiceCustomer) { + o.Customer = &v +} + +// GetCustomerNotification returns the CustomerNotification field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetCustomerNotification() []string { + if o == nil || utils.IsNil(o.CustomerNotification) { + var ret []string + return ret + } + return o.CustomerNotification +} + +// GetCustomerNotificationOk returns a tuple with the CustomerNotification field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetCustomerNotificationOk() ([]string, bool) { + if o == nil || utils.IsNil(o.CustomerNotification) { + return nil, false + } + return o.CustomerNotification, true +} + +// HasCustomerNotification returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasCustomerNotification() bool { + if o != nil && !utils.IsNil(o.CustomerNotification) { + return true + } + + return false +} + +// SetCustomerNotification gets a reference to the given []string and assigns it to the CustomerNotification field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetCustomerNotification(v []string) { + o.CustomerNotification = v +} + +// GetExternalId returns the ExternalId field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetExternalId() string { + if o == nil || utils.IsNil(o.ExternalId) { + var ret string + return ret + } + return *o.ExternalId +} + +// GetExternalIdOk returns a tuple with the ExternalId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetExternalIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.ExternalId) { + return nil, false + } + return o.ExternalId, true +} + +// HasExternalId returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasExternalId() bool { + if o != nil && !utils.IsNil(o.ExternalId) { + return true + } + + return false +} + +// SetExternalId gets a reference to the given string and assigns it to the ExternalId field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetExternalId(v string) { + o.ExternalId = &v +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetItems() []InternalWebControllersMerchantApiv1InvoiceItem { + if o == nil || utils.IsNil(o.Items) { + var ret []InternalWebControllersMerchantApiv1InvoiceItem + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetItemsOk() ([]InternalWebControllersMerchantApiv1InvoiceItem, bool) { + if o == nil || utils.IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasItems() bool { + if o != nil && !utils.IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []InternalWebControllersMerchantApiv1InvoiceItem and assigns it to the Items field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetItems(v []InternalWebControllersMerchantApiv1InvoiceItem) { + o.Items = v +} + +// GetNotes returns the Notes field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetNotes() string { + if o == nil || utils.IsNil(o.Notes) { + var ret string + return ret + } + return *o.Notes +} + +// GetNotesOk returns a tuple with the Notes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetNotesOk() (*string, bool) { + if o == nil || utils.IsNil(o.Notes) { + return nil, false + } + return o.Notes, true +} + +// HasNotes returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasNotes() bool { + if o != nil && !utils.IsNil(o.Notes) { + return true + } + + return false +} + +// SetNotes gets a reference to the given string and assigns it to the Notes field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetNotes(v string) { + o.Notes = &v +} + +// GetPaymentMethods returns the PaymentMethods field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetPaymentMethods() []InternalWebControllersMerchantApiv1InvoicePaymentMethod { + if o == nil || utils.IsNil(o.PaymentMethods) { + var ret []InternalWebControllersMerchantApiv1InvoicePaymentMethod + return ret + } + return o.PaymentMethods +} + +// GetPaymentMethodsOk returns a tuple with the PaymentMethods field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetPaymentMethodsOk() ([]InternalWebControllersMerchantApiv1InvoicePaymentMethod, bool) { + if o == nil || utils.IsNil(o.PaymentMethods) { + return nil, false + } + return o.PaymentMethods, true +} + +// HasPaymentMethods returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasPaymentMethods() bool { + if o != nil && !utils.IsNil(o.PaymentMethods) { + return true + } + + return false +} + +// SetPaymentMethods gets a reference to the given []InternalWebControllersMerchantApiv1InvoicePaymentMethod and assigns it to the PaymentMethods field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetPaymentMethods(v []InternalWebControllersMerchantApiv1InvoicePaymentMethod) { + o.PaymentMethods = v +} + +// GetRedirectUrl returns the RedirectUrl field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetRedirectUrl() InternalWebControllersMerchantApiv1InvoiceRedirectURL { + if o == nil || utils.IsNil(o.RedirectUrl) { + var ret InternalWebControllersMerchantApiv1InvoiceRedirectURL + return ret + } + return *o.RedirectUrl +} + +// GetRedirectUrlOk returns a tuple with the RedirectUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetRedirectUrlOk() (*InternalWebControllersMerchantApiv1InvoiceRedirectURL, bool) { + if o == nil || utils.IsNil(o.RedirectUrl) { + return nil, false + } + return o.RedirectUrl, true +} + +// HasRedirectUrl returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasRedirectUrl() bool { + if o != nil && !utils.IsNil(o.RedirectUrl) { + return true + } + + return false +} + +// SetRedirectUrl gets a reference to the given InternalWebControllersMerchantApiv1InvoiceRedirectURL and assigns it to the RedirectUrl field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetRedirectUrl(v InternalWebControllersMerchantApiv1InvoiceRedirectURL) { + o.RedirectUrl = &v +} + +// GetTimeBegin returns the TimeBegin field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetTimeBegin() string { + if o == nil || utils.IsNil(o.TimeBegin) { + var ret string + return ret + } + return *o.TimeBegin +} + +// GetTimeBeginOk returns a tuple with the TimeBegin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetTimeBeginOk() (*string, bool) { + if o == nil || utils.IsNil(o.TimeBegin) { + return nil, false + } + return o.TimeBegin, true +} + +// HasTimeBegin returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasTimeBegin() bool { + if o != nil && !utils.IsNil(o.TimeBegin) { + return true + } + + return false +} + +// SetTimeBegin gets a reference to the given string and assigns it to the TimeBegin field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetTimeBegin(v string) { + o.TimeBegin = &v +} + +// GetTimeEnd returns the TimeEnd field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetTimeEnd() string { + if o == nil || utils.IsNil(o.TimeEnd) { + var ret string + return ret + } + return *o.TimeEnd +} + +// GetTimeEndOk returns a tuple with the TimeEnd field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) GetTimeEndOk() (*string, bool) { + if o == nil || utils.IsNil(o.TimeEnd) { + return nil, false + } + return o.TimeEnd, true +} + +// HasTimeEnd returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) HasTimeEnd() bool { + if o != nil && !utils.IsNil(o.TimeEnd) { + return true + } + + return false +} + +// SetTimeEnd gets a reference to the given string and assigns it to the TimeEnd field. +func (o *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) SetTimeEnd(v string) { + o.TimeEnd = &v +} + +func (o InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } + if !utils.IsNil(o.AmountCurrency) { + toSerialize["amount_currency"] = o.AmountCurrency + } + if !utils.IsNil(o.Country) { + toSerialize["country"] = o.Country + } + if !utils.IsNil(o.Customer) { + toSerialize["customer"] = o.Customer + } + if !utils.IsNil(o.CustomerNotification) { + toSerialize["customer_notification"] = o.CustomerNotification + } + if !utils.IsNil(o.ExternalId) { + toSerialize["external_id"] = o.ExternalId + } + if !utils.IsNil(o.Items) { + toSerialize["items"] = o.Items + } + if !utils.IsNil(o.Notes) { + toSerialize["notes"] = o.Notes + } + if !utils.IsNil(o.PaymentMethods) { + toSerialize["payment_methods"] = o.PaymentMethods + } + if !utils.IsNil(o.RedirectUrl) { + toSerialize["redirect_url"] = o.RedirectUrl + } + if !utils.IsNil(o.TimeBegin) { + toSerialize["time_begin"] = o.TimeBegin + } + if !utils.IsNil(o.TimeEnd) { + toSerialize["time_end"] = o.TimeEnd + } + return toSerialize, nil +} + +type NullableInternalWebControllersMerchantApiv1InvoiceInvoiceRequest struct { + value *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest + isSet bool +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceInvoiceRequest) Get() *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest { + return v.value +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceInvoiceRequest) Set(val *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceInvoiceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceInvoiceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalWebControllersMerchantApiv1InvoiceInvoiceRequest(val *InternalWebControllersMerchantApiv1InvoiceInvoiceRequest) *NullableInternalWebControllersMerchantApiv1InvoiceInvoiceRequest { + return &NullableInternalWebControllersMerchantApiv1InvoiceInvoiceRequest{value: val, isSet: true} +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceInvoiceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceInvoiceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_invoice_standard_meta.go b/invoice/model_invoice_standard_meta.go new file mode 100644 index 0000000..52fa6d7 --- /dev/null +++ b/invoice/model_invoice_standard_meta.go @@ -0,0 +1,161 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package invoice + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the InternalWebControllersMerchantApiv1InvoiceStandardMeta type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &InternalWebControllersMerchantApiv1InvoiceStandardMeta{} + +// InternalWebControllersMerchantApiv1InvoiceStandardMeta struct for InternalWebControllersMerchantApiv1InvoiceStandardMeta +type InternalWebControllersMerchantApiv1InvoiceStandardMeta struct { + ProcessingTime *string `json:"processing_time,omitempty"` + VersionApi *string `json:"version_api,omitempty"` +} + +// NewInternalWebControllersMerchantApiv1InvoiceStandardMeta instantiates a new InternalWebControllersMerchantApiv1InvoiceStandardMeta object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalWebControllersMerchantApiv1InvoiceStandardMeta() *InternalWebControllersMerchantApiv1InvoiceStandardMeta { + this := InternalWebControllersMerchantApiv1InvoiceStandardMeta{} + return &this +} + +// NewInternalWebControllersMerchantApiv1InvoiceStandardMetaWithDefaults instantiates a new InternalWebControllersMerchantApiv1InvoiceStandardMeta object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalWebControllersMerchantApiv1InvoiceStandardMetaWithDefaults() *InternalWebControllersMerchantApiv1InvoiceStandardMeta { + this := InternalWebControllersMerchantApiv1InvoiceStandardMeta{} + return &this +} + +// GetProcessingTime returns the ProcessingTime field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardMeta) GetProcessingTime() string { + if o == nil || utils.IsNil(o.ProcessingTime) { + var ret string + return ret + } + return *o.ProcessingTime +} + +// GetProcessingTimeOk returns a tuple with the ProcessingTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardMeta) GetProcessingTimeOk() (*string, bool) { + if o == nil || utils.IsNil(o.ProcessingTime) { + return nil, false + } + return o.ProcessingTime, true +} + +// HasProcessingTime returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardMeta) HasProcessingTime() bool { + if o != nil && !utils.IsNil(o.ProcessingTime) { + return true + } + + return false +} + +// SetProcessingTime gets a reference to the given string and assigns it to the ProcessingTime field. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardMeta) SetProcessingTime(v string) { + o.ProcessingTime = &v +} + +// GetVersionApi returns the VersionApi field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardMeta) GetVersionApi() string { + if o == nil || utils.IsNil(o.VersionApi) { + var ret string + return ret + } + return *o.VersionApi +} + +// GetVersionApiOk returns a tuple with the VersionApi field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardMeta) GetVersionApiOk() (*string, bool) { + if o == nil || utils.IsNil(o.VersionApi) { + return nil, false + } + return o.VersionApi, true +} + +// HasVersionApi returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardMeta) HasVersionApi() bool { + if o != nil && !utils.IsNil(o.VersionApi) { + return true + } + + return false +} + +// SetVersionApi gets a reference to the given string and assigns it to the VersionApi field. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardMeta) SetVersionApi(v string) { + o.VersionApi = &v +} + +func (o InternalWebControllersMerchantApiv1InvoiceStandardMeta) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalWebControllersMerchantApiv1InvoiceStandardMeta) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ProcessingTime) { + toSerialize["processing_time"] = o.ProcessingTime + } + if !utils.IsNil(o.VersionApi) { + toSerialize["version_api"] = o.VersionApi + } + return toSerialize, nil +} + +type NullableInternalWebControllersMerchantApiv1InvoiceStandardMeta struct { + value *InternalWebControllersMerchantApiv1InvoiceStandardMeta + isSet bool +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceStandardMeta) Get() *InternalWebControllersMerchantApiv1InvoiceStandardMeta { + return v.value +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceStandardMeta) Set(val *InternalWebControllersMerchantApiv1InvoiceStandardMeta) { + v.value = val + v.isSet = true +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceStandardMeta) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceStandardMeta) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalWebControllersMerchantApiv1InvoiceStandardMeta(val *InternalWebControllersMerchantApiv1InvoiceStandardMeta) *NullableInternalWebControllersMerchantApiv1InvoiceStandardMeta { + return &NullableInternalWebControllersMerchantApiv1InvoiceStandardMeta{value: val, isSet: true} +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceStandardMeta) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceStandardMeta) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_invoice_standard_meta_with_pagination.go b/invoice/model_invoice_standard_meta_with_pagination.go new file mode 100644 index 0000000..9ab7831 --- /dev/null +++ b/invoice/model_invoice_standard_meta_with_pagination.go @@ -0,0 +1,197 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package invoice + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination{} + +// InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination struct for InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination +type InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination struct { + Pagination *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader `json:"pagination,omitempty"` + ProcessingTime *string `json:"processing_time,omitempty"` + VersionApi *string `json:"version_api,omitempty"` +} + +// NewInternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination instantiates a new InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination() *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination { + this := InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination{} + return &this +} + +// NewInternalWebControllersMerchantApiv1InvoiceStandardMetaWithPaginationWithDefaults instantiates a new InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalWebControllersMerchantApiv1InvoiceStandardMetaWithPaginationWithDefaults() *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination { + this := InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination{} + return &this +} + +// GetPagination returns the Pagination field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) GetPagination() GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader { + if o == nil || utils.IsNil(o.Pagination) { + var ret GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader + return ret + } + return *o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) GetPaginationOk() (*GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader, bool) { + if o == nil || utils.IsNil(o.Pagination) { + return nil, false + } + return o.Pagination, true +} + +// HasPagination returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) HasPagination() bool { + if o != nil && !utils.IsNil(o.Pagination) { + return true + } + + return false +} + +// SetPagination gets a reference to the given GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader and assigns it to the Pagination field. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) SetPagination(v GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) { + o.Pagination = &v +} + +// GetProcessingTime returns the ProcessingTime field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) GetProcessingTime() string { + if o == nil || utils.IsNil(o.ProcessingTime) { + var ret string + return ret + } + return *o.ProcessingTime +} + +// GetProcessingTimeOk returns a tuple with the ProcessingTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) GetProcessingTimeOk() (*string, bool) { + if o == nil || utils.IsNil(o.ProcessingTime) { + return nil, false + } + return o.ProcessingTime, true +} + +// HasProcessingTime returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) HasProcessingTime() bool { + if o != nil && !utils.IsNil(o.ProcessingTime) { + return true + } + + return false +} + +// SetProcessingTime gets a reference to the given string and assigns it to the ProcessingTime field. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) SetProcessingTime(v string) { + o.ProcessingTime = &v +} + +// GetVersionApi returns the VersionApi field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) GetVersionApi() string { + if o == nil || utils.IsNil(o.VersionApi) { + var ret string + return ret + } + return *o.VersionApi +} + +// GetVersionApiOk returns a tuple with the VersionApi field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) GetVersionApiOk() (*string, bool) { + if o == nil || utils.IsNil(o.VersionApi) { + return nil, false + } + return o.VersionApi, true +} + +// HasVersionApi returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) HasVersionApi() bool { + if o != nil && !utils.IsNil(o.VersionApi) { + return true + } + + return false +} + +// SetVersionApi gets a reference to the given string and assigns it to the VersionApi field. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) SetVersionApi(v string) { + o.VersionApi = &v +} + +func (o InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Pagination) { + toSerialize["pagination"] = o.Pagination + } + if !utils.IsNil(o.ProcessingTime) { + toSerialize["processing_time"] = o.ProcessingTime + } + if !utils.IsNil(o.VersionApi) { + toSerialize["version_api"] = o.VersionApi + } + return toSerialize, nil +} + +type NullableInternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination struct { + value *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination + isSet bool +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) Get() *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination { + return v.value +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) Set(val *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) { + v.value = val + v.isSet = true +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination(val *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) *NullableInternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination { + return &NullableInternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination{value: val, isSet: true} +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_invoice_standard_payment_method_response.go b/invoice/model_invoice_standard_payment_method_response.go new file mode 100644 index 0000000..d7ca575 --- /dev/null +++ b/invoice/model_invoice_standard_payment_method_response.go @@ -0,0 +1,269 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package invoice + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse{} + +// InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse struct for InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse +type InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse struct { + Code *int32 `json:"code,omitempty"` + Data []InternalWebControllersMerchantApiv1InvoicePaymentMethod `json:"data,omitempty"` + Message *string `json:"message,omitempty"` + Meta *InternalWebControllersMerchantApiv1InvoiceStandardMeta `json:"meta,omitempty"` + Status *string `json:"status,omitempty"` +} + +// NewInternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse instantiates a new InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse() *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse { + this := InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse{} + return &this +} + +// NewInternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponseWithDefaults instantiates a new InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponseWithDefaults() *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse { + this := InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) GetCode() int32 { + if o == nil || utils.IsNil(o.Code) { + var ret int32 + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) GetCodeOk() (*int32, bool) { + if o == nil || utils.IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) HasCode() bool { + if o != nil && !utils.IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given int32 and assigns it to the Code field. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) SetCode(v int32) { + o.Code = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) GetData() []InternalWebControllersMerchantApiv1InvoicePaymentMethod { + if o == nil || utils.IsNil(o.Data) { + var ret []InternalWebControllersMerchantApiv1InvoicePaymentMethod + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) GetDataOk() ([]InternalWebControllersMerchantApiv1InvoicePaymentMethod, bool) { + if o == nil || utils.IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) HasData() bool { + if o != nil && !utils.IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given []InternalWebControllersMerchantApiv1InvoicePaymentMethod and assigns it to the Data field. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) SetData(v []InternalWebControllersMerchantApiv1InvoicePaymentMethod) { + o.Data = v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) GetMessage() string { + if o == nil || utils.IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) GetMessageOk() (*string, bool) { + if o == nil || utils.IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) HasMessage() bool { + if o != nil && !utils.IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) SetMessage(v string) { + o.Message = &v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) GetMeta() InternalWebControllersMerchantApiv1InvoiceStandardMeta { + if o == nil || utils.IsNil(o.Meta) { + var ret InternalWebControllersMerchantApiv1InvoiceStandardMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) GetMetaOk() (*InternalWebControllersMerchantApiv1InvoiceStandardMeta, bool) { + if o == nil || utils.IsNil(o.Meta) { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) HasMeta() bool { + if o != nil && !utils.IsNil(o.Meta) { + return true + } + + return false +} + +// SetMeta gets a reference to the given InternalWebControllersMerchantApiv1InvoiceStandardMeta and assigns it to the Meta field. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) SetMeta(v InternalWebControllersMerchantApiv1InvoiceStandardMeta) { + o.Meta = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) GetStatus() string { + if o == nil || utils.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) GetStatusOk() (*string, bool) { + if o == nil || utils.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) HasStatus() bool { + if o != nil && !utils.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) SetStatus(v string) { + o.Status = &v +} + +func (o InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !utils.IsNil(o.Data) { + toSerialize["data"] = o.Data + } + if !utils.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + if !utils.IsNil(o.Meta) { + toSerialize["meta"] = o.Meta + } + if !utils.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil +} + +type NullableInternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse struct { + value *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse + isSet bool +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) Get() *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse { + return v.value +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) Set(val *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) { + v.value = val + v.isSet = true +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse(val *InternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) *NullableInternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse { + return &NullableInternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse{value: val, isSet: true} +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceStandardPaymentMethodResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_invoice_standard_response.go b/invoice/model_invoice_standard_response.go new file mode 100644 index 0000000..afa6248 --- /dev/null +++ b/invoice/model_invoice_standard_response.go @@ -0,0 +1,269 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package invoice + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the InternalWebControllersMerchantApiv1InvoiceStandardResponse type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &InternalWebControllersMerchantApiv1InvoiceStandardResponse{} + +// InternalWebControllersMerchantApiv1InvoiceStandardResponse struct for InternalWebControllersMerchantApiv1InvoiceStandardResponse +type InternalWebControllersMerchantApiv1InvoiceStandardResponse struct { + Code *int32 `json:"code,omitempty"` + Data *InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse `json:"data,omitempty"` + Message *string `json:"message,omitempty"` + Meta *InternalWebControllersMerchantApiv1InvoiceStandardMeta `json:"meta,omitempty"` + Status *string `json:"status,omitempty"` +} + +// NewInternalWebControllersMerchantApiv1InvoiceStandardResponse instantiates a new InternalWebControllersMerchantApiv1InvoiceStandardResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalWebControllersMerchantApiv1InvoiceStandardResponse() *InternalWebControllersMerchantApiv1InvoiceStandardResponse { + this := InternalWebControllersMerchantApiv1InvoiceStandardResponse{} + return &this +} + +// NewInternalWebControllersMerchantApiv1InvoiceStandardResponseWithDefaults instantiates a new InternalWebControllersMerchantApiv1InvoiceStandardResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalWebControllersMerchantApiv1InvoiceStandardResponseWithDefaults() *InternalWebControllersMerchantApiv1InvoiceStandardResponse { + this := InternalWebControllersMerchantApiv1InvoiceStandardResponse{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) GetCode() int32 { + if o == nil || utils.IsNil(o.Code) { + var ret int32 + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) GetCodeOk() (*int32, bool) { + if o == nil || utils.IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) HasCode() bool { + if o != nil && !utils.IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given int32 and assigns it to the Code field. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) SetCode(v int32) { + o.Code = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) GetData() InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse { + if o == nil || utils.IsNil(o.Data) { + var ret InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) GetDataOk() (*InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse, bool) { + if o == nil || utils.IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) HasData() bool { + if o != nil && !utils.IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse and assigns it to the Data field. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) SetData(v InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) { + o.Data = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) GetMessage() string { + if o == nil || utils.IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) GetMessageOk() (*string, bool) { + if o == nil || utils.IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) HasMessage() bool { + if o != nil && !utils.IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) SetMessage(v string) { + o.Message = &v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) GetMeta() InternalWebControllersMerchantApiv1InvoiceStandardMeta { + if o == nil || utils.IsNil(o.Meta) { + var ret InternalWebControllersMerchantApiv1InvoiceStandardMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) GetMetaOk() (*InternalWebControllersMerchantApiv1InvoiceStandardMeta, bool) { + if o == nil || utils.IsNil(o.Meta) { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) HasMeta() bool { + if o != nil && !utils.IsNil(o.Meta) { + return true + } + + return false +} + +// SetMeta gets a reference to the given InternalWebControllersMerchantApiv1InvoiceStandardMeta and assigns it to the Meta field. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) SetMeta(v InternalWebControllersMerchantApiv1InvoiceStandardMeta) { + o.Meta = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) GetStatus() string { + if o == nil || utils.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) GetStatusOk() (*string, bool) { + if o == nil || utils.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) HasStatus() bool { + if o != nil && !utils.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponse) SetStatus(v string) { + o.Status = &v +} + +func (o InternalWebControllersMerchantApiv1InvoiceStandardResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalWebControllersMerchantApiv1InvoiceStandardResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !utils.IsNil(o.Data) { + toSerialize["data"] = o.Data + } + if !utils.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + if !utils.IsNil(o.Meta) { + toSerialize["meta"] = o.Meta + } + if !utils.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil +} + +type NullableInternalWebControllersMerchantApiv1InvoiceStandardResponse struct { + value *InternalWebControllersMerchantApiv1InvoiceStandardResponse + isSet bool +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceStandardResponse) Get() *InternalWebControllersMerchantApiv1InvoiceStandardResponse { + return v.value +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceStandardResponse) Set(val *InternalWebControllersMerchantApiv1InvoiceStandardResponse) { + v.value = val + v.isSet = true +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceStandardResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceStandardResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalWebControllersMerchantApiv1InvoiceStandardResponse(val *InternalWebControllersMerchantApiv1InvoiceStandardResponse) *NullableInternalWebControllersMerchantApiv1InvoiceStandardResponse { + return &NullableInternalWebControllersMerchantApiv1InvoiceStandardResponse{value: val, isSet: true} +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceStandardResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceStandardResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_invoice_standard_response_with_pagination.go b/invoice/model_invoice_standard_response_with_pagination.go new file mode 100644 index 0000000..915f521 --- /dev/null +++ b/invoice/model_invoice_standard_response_with_pagination.go @@ -0,0 +1,269 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package invoice + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination{} + +// InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination struct for InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination +type InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination struct { + Code *int32 `json:"code,omitempty"` + Data []InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse `json:"data,omitempty"` + Message *string `json:"message,omitempty"` + Meta *InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination `json:"meta,omitempty"` + Status *string `json:"status,omitempty"` +} + +// NewInternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination instantiates a new InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination() *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination { + this := InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination{} + return &this +} + +// NewInternalWebControllersMerchantApiv1InvoiceStandardResponseWithPaginationWithDefaults instantiates a new InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalWebControllersMerchantApiv1InvoiceStandardResponseWithPaginationWithDefaults() *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination { + this := InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) GetCode() int32 { + if o == nil || utils.IsNil(o.Code) { + var ret int32 + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) GetCodeOk() (*int32, bool) { + if o == nil || utils.IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) HasCode() bool { + if o != nil && !utils.IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given int32 and assigns it to the Code field. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) SetCode(v int32) { + o.Code = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) GetData() []InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse { + if o == nil || utils.IsNil(o.Data) { + var ret []InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) GetDataOk() ([]InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse, bool) { + if o == nil || utils.IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) HasData() bool { + if o != nil && !utils.IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given []InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse and assigns it to the Data field. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) SetData(v []InternalWebControllersMerchantApiv1InvoiceInvoiceDetailResponse) { + o.Data = v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) GetMessage() string { + if o == nil || utils.IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) GetMessageOk() (*string, bool) { + if o == nil || utils.IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) HasMessage() bool { + if o != nil && !utils.IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) SetMessage(v string) { + o.Message = &v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) GetMeta() InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination { + if o == nil || utils.IsNil(o.Meta) { + var ret InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) GetMetaOk() (*InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination, bool) { + if o == nil || utils.IsNil(o.Meta) { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) HasMeta() bool { + if o != nil && !utils.IsNil(o.Meta) { + return true + } + + return false +} + +// SetMeta gets a reference to the given InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination and assigns it to the Meta field. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) SetMeta(v InternalWebControllersMerchantApiv1InvoiceStandardMetaWithPagination) { + o.Meta = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) GetStatus() string { + if o == nil || utils.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) GetStatusOk() (*string, bool) { + if o == nil || utils.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) HasStatus() bool { + if o != nil && !utils.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) SetStatus(v string) { + o.Status = &v +} + +func (o InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !utils.IsNil(o.Data) { + toSerialize["data"] = o.Data + } + if !utils.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + if !utils.IsNil(o.Meta) { + toSerialize["meta"] = o.Meta + } + if !utils.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil +} + +type NullableInternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination struct { + value *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination + isSet bool +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) Get() *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination { + return v.value +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) Set(val *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) { + v.value = val + v.isSet = true +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination(val *InternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) *NullableInternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination { + return &NullableInternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination{value: val, isSet: true} +} + +func (v NullableInternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalWebControllersMerchantApiv1InvoiceStandardResponseWithPagination) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_invoice_status.go b/invoice/model_invoice_status.go new file mode 100644 index 0000000..6962b1e --- /dev/null +++ b/invoice/model_invoice_status.go @@ -0,0 +1,116 @@ +package invoice + +import ( + "encoding/json" + + "fmt" +) + +// InvoiceStatus Representing the status of an invoice. +type InvoiceStatus string + +// List of InvoiceStatus +const ( + INVOICE_STATUS_PENDING InvoiceStatus = "PENDING" + INVOICE_STATUS_PAID InvoiceStatus = "PAID" + INVOICE_STATUS_CANCELED InvoiceStatus = "CANCELLED" + INVOICE_STATUS_REFUNDED InvoiceStatus = "REFUNDED" + INVOICE_STATUS_PARTIAL_SETTLED InvoiceStatus = "PARTIAL_SETTLED" + INVOICE_STATUS_EXPIRED InvoiceStatus = "EXPIRED" + INVOICE_STATUS_UNKNOWN InvoiceStatus = "UNKNOWN" +) + +// All allowed values of InvoiceStatus enum +var AllowedInvoiceStatusEnumValues = []InvoiceStatus{ + "PENDING", + "PAID", + "CANCELLED", + "REFUNDED", + "PARTIAL_SETTLED", + "EXPIRED", + "UNKNOWN", +} + +func (v *InvoiceStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InvoiceStatus(value) + for _, existing := range AllowedInvoiceStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = INVOICE_STATUS_UNKNOWN + return nil +} + +// NewInvoiceStatusFromValue returns a pointer to a valid InvoiceStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInvoiceStatusFromValue(v string) (*InvoiceStatus, error) { + ev := InvoiceStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InvoiceStatus: valid values are %v", v, AllowedInvoiceStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InvoiceStatus) IsValid() bool { + for _, existing := range AllowedInvoiceStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v InvoiceStatus) String() string { + return string(v) +} + +// Ptr returns reference to InvoiceStatus value +func (v InvoiceStatus) Ptr() *InvoiceStatus { + return &v +} + +type NullableInvoiceStatus struct { + value *InvoiceStatus + isSet bool +} + +func (v NullableInvoiceStatus) Get() *InvoiceStatus { + return v.value +} + +func (v *NullableInvoiceStatus) Set(val *InvoiceStatus) { + v.value = val + v.isSet = true +} + +func (v NullableInvoiceStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableInvoiceStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvoiceStatus(val *InvoiceStatus) *NullableInvoiceStatus { + return &NullableInvoiceStatus{value: val, isSet: true} +} + +func (v NullableInvoiceStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvoiceStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/invoice/model_render_app_pagination_header.go b/invoice/model_render_app_pagination_header.go new file mode 100644 index 0000000..43fb144 --- /dev/null +++ b/invoice/model_render_app_pagination_header.go @@ -0,0 +1,233 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package invoice + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader{} + +// GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader struct for GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader +type GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader struct { + CurrentPage *int32 `json:"current_page,omitempty"` + PerPage *int32 `json:"per_page,omitempty"` + TotalData *int32 `json:"total_data,omitempty"` + TotalPages *int32 `json:"total_pages,omitempty"` +} + +// NewGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader instantiates a new GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader() *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader { + this := GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader{} + return &this +} + +// NewGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeaderWithDefaults instantiates a new GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeaderWithDefaults() *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader { + this := GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader{} + return &this +} + +// GetCurrentPage returns the CurrentPage field value if set, zero value otherwise. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) GetCurrentPage() int32 { + if o == nil || utils.IsNil(o.CurrentPage) { + var ret int32 + return ret + } + return *o.CurrentPage +} + +// GetCurrentPageOk returns a tuple with the CurrentPage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) GetCurrentPageOk() (*int32, bool) { + if o == nil || utils.IsNil(o.CurrentPage) { + return nil, false + } + return o.CurrentPage, true +} + +// HasCurrentPage returns a boolean if a field has been set. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) HasCurrentPage() bool { + if o != nil && !utils.IsNil(o.CurrentPage) { + return true + } + + return false +} + +// SetCurrentPage gets a reference to the given int32 and assigns it to the CurrentPage field. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) SetCurrentPage(v int32) { + o.CurrentPage = &v +} + +// GetPerPage returns the PerPage field value if set, zero value otherwise. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) GetPerPage() int32 { + if o == nil || utils.IsNil(o.PerPage) { + var ret int32 + return ret + } + return *o.PerPage +} + +// GetPerPageOk returns a tuple with the PerPage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) GetPerPageOk() (*int32, bool) { + if o == nil || utils.IsNil(o.PerPage) { + return nil, false + } + return o.PerPage, true +} + +// HasPerPage returns a boolean if a field has been set. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) HasPerPage() bool { + if o != nil && !utils.IsNil(o.PerPage) { + return true + } + + return false +} + +// SetPerPage gets a reference to the given int32 and assigns it to the PerPage field. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) SetPerPage(v int32) { + o.PerPage = &v +} + +// GetTotalData returns the TotalData field value if set, zero value otherwise. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) GetTotalData() int32 { + if o == nil || utils.IsNil(o.TotalData) { + var ret int32 + return ret + } + return *o.TotalData +} + +// GetTotalDataOk returns a tuple with the TotalData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) GetTotalDataOk() (*int32, bool) { + if o == nil || utils.IsNil(o.TotalData) { + return nil, false + } + return o.TotalData, true +} + +// HasTotalData returns a boolean if a field has been set. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) HasTotalData() bool { + if o != nil && !utils.IsNil(o.TotalData) { + return true + } + + return false +} + +// SetTotalData gets a reference to the given int32 and assigns it to the TotalData field. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) SetTotalData(v int32) { + o.TotalData = &v +} + +// GetTotalPages returns the TotalPages field value if set, zero value otherwise. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) GetTotalPages() int32 { + if o == nil || utils.IsNil(o.TotalPages) { + var ret int32 + return ret + } + return *o.TotalPages +} + +// GetTotalPagesOk returns a tuple with the TotalPages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) GetTotalPagesOk() (*int32, bool) { + if o == nil || utils.IsNil(o.TotalPages) { + return nil, false + } + return o.TotalPages, true +} + +// HasTotalPages returns a boolean if a field has been set. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) HasTotalPages() bool { + if o != nil && !utils.IsNil(o.TotalPages) { + return true + } + + return false +} + +// SetTotalPages gets a reference to the given int32 and assigns it to the TotalPages field. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) SetTotalPages(v int32) { + o.TotalPages = &v +} + +func (o GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.CurrentPage) { + toSerialize["current_page"] = o.CurrentPage + } + if !utils.IsNil(o.PerPage) { + toSerialize["per_page"] = o.PerPage + } + if !utils.IsNil(o.TotalData) { + toSerialize["total_data"] = o.TotalData + } + if !utils.IsNil(o.TotalPages) { + toSerialize["total_pages"] = o.TotalPages + } + return toSerialize, nil +} + +type NullableGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader struct { + value *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader + isSet bool +} + +func (v NullableGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) Get() *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader { + return v.value +} + +func (v *NullableGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) Set(val *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) { + v.value = val + v.isSet = true +} + +func (v NullableGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) IsSet() bool { + return v.isSet +} + +func (v *NullableGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader(val *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) *NullableGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader { + return &NullableGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader{value: val, isSet: true} +} + +func (v NullableGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/response.go b/response.go new file mode 100644 index 0000000..a486991 --- /dev/null +++ b/response.go @@ -0,0 +1,46 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package doitpay + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/simulate/api_simulate.go b/simulate/api_simulate.go new file mode 100644 index 0000000..67c58b8 --- /dev/null +++ b/simulate/api_simulate.go @@ -0,0 +1,132 @@ +package simulate + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strconv" + + "github.com/automotechnologies/doitpay-go/common" + "github.com/automotechnologies/doitpay-go/utils" +) + +type PublicSimulateAPI interface { + + /* + SimulatePayment SimulatePayment is handler for simulate payment system. + + Return status code 200 if the payment is completed. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSimulatePaymentRequest + */ + SimulatePayment(ctx context.Context) ApiSimulatePaymentRequest + + // SimulatePaymentExecute executes the request + SimulatePaymentExecute(r ApiSimulatePaymentRequest) (*http.Response, error) +} + +type SimulateApiService struct { + client common.IClient +} + +// NewSimulateApi Create a new SimulateApi service +func NewSimulateApi(client common.IClient) PublicSimulateAPI { + return &SimulateApiService{ + client: client, + } +} + +type ApiSimulatePaymentRequest struct { + ctx context.Context + ApiService PublicSimulateAPI + request *InternalWebControllersMerchantApiv1SimulateSimulateRequest +} + +// Request payload to simulate payment +func (r ApiSimulatePaymentRequest) Request(request InternalWebControllersMerchantApiv1SimulateSimulateRequest) ApiSimulatePaymentRequest { + r.request = &request + return r +} + +func (r ApiSimulatePaymentRequest) Execute() (*http.Response, error) { + return r.ApiService.SimulatePaymentExecute(r) +} + +/* +SimulatePayment SimulatePayment is handler for simulate payment system. + +Return status code 200 if the payment is completed. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSimulatePaymentRequest +*/ +func (a *SimulateApiService) SimulatePayment(ctx context.Context) ApiSimulatePaymentRequest { + return ApiSimulatePaymentRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *SimulateApiService) SimulatePaymentExecute(r ApiSimulatePaymentRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []common.FormFile + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "SimulateApiService.SimulatePayment") + if err != nil { + return nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: SimulateApiService.SimulatePaymentExecute") + } + + localVarPath := localBasePath + "/merchant/v1/simulate-payment" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.request == nil { + return nil, utils.ReportError("request is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.request + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: SimulateApiService.SimulatePaymentExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarHTTPResponse, doitpaySdkError + } + + return localVarHTTPResponse, nil +} diff --git a/simulate/model_simulate_request.go b/simulate/model_simulate_request.go new file mode 100644 index 0000000..84fd193 --- /dev/null +++ b/simulate/model_simulate_request.go @@ -0,0 +1,161 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package simulate + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the InternalWebControllersMerchantApiv1SimulateSimulateRequest type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &InternalWebControllersMerchantApiv1SimulateSimulateRequest{} + +// InternalWebControllersMerchantApiv1SimulateSimulateRequest struct for InternalWebControllersMerchantApiv1SimulateSimulateRequest +type InternalWebControllersMerchantApiv1SimulateSimulateRequest struct { + AccountNumber *string `json:"account_number,omitempty"` + PaymentIdentifier *string `json:"payment_identifier,omitempty"` +} + +// NewInternalWebControllersMerchantApiv1SimulateSimulateRequest instantiates a new InternalWebControllersMerchantApiv1SimulateSimulateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalWebControllersMerchantApiv1SimulateSimulateRequest() *InternalWebControllersMerchantApiv1SimulateSimulateRequest { + this := InternalWebControllersMerchantApiv1SimulateSimulateRequest{} + return &this +} + +// NewInternalWebControllersMerchantApiv1SimulateSimulateRequestWithDefaults instantiates a new InternalWebControllersMerchantApiv1SimulateSimulateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalWebControllersMerchantApiv1SimulateSimulateRequestWithDefaults() *InternalWebControllersMerchantApiv1SimulateSimulateRequest { + this := InternalWebControllersMerchantApiv1SimulateSimulateRequest{} + return &this +} + +// GetAccountNumber returns the AccountNumber field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1SimulateSimulateRequest) GetAccountNumber() string { + if o == nil || utils.IsNil(o.AccountNumber) { + var ret string + return ret + } + return *o.AccountNumber +} + +// GetAccountNumberOk returns a tuple with the AccountNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1SimulateSimulateRequest) GetAccountNumberOk() (*string, bool) { + if o == nil || utils.IsNil(o.AccountNumber) { + return nil, false + } + return o.AccountNumber, true +} + +// HasAccountNumber returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1SimulateSimulateRequest) HasAccountNumber() bool { + if o != nil && !utils.IsNil(o.AccountNumber) { + return true + } + + return false +} + +// SetAccountNumber gets a reference to the given string and assigns it to the AccountNumber field. +func (o *InternalWebControllersMerchantApiv1SimulateSimulateRequest) SetAccountNumber(v string) { + o.AccountNumber = &v +} + +// GetPaymentIdentifier returns the PaymentIdentifier field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1SimulateSimulateRequest) GetPaymentIdentifier() string { + if o == nil || utils.IsNil(o.PaymentIdentifier) { + var ret string + return ret + } + return *o.PaymentIdentifier +} + +// GetPaymentIdentifierOk returns a tuple with the PaymentIdentifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1SimulateSimulateRequest) GetPaymentIdentifierOk() (*string, bool) { + if o == nil || utils.IsNil(o.PaymentIdentifier) { + return nil, false + } + return o.PaymentIdentifier, true +} + +// HasPaymentIdentifier returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1SimulateSimulateRequest) HasPaymentIdentifier() bool { + if o != nil && !utils.IsNil(o.PaymentIdentifier) { + return true + } + + return false +} + +// SetPaymentIdentifier gets a reference to the given string and assigns it to the PaymentIdentifier field. +func (o *InternalWebControllersMerchantApiv1SimulateSimulateRequest) SetPaymentIdentifier(v string) { + o.PaymentIdentifier = &v +} + +func (o InternalWebControllersMerchantApiv1SimulateSimulateRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalWebControllersMerchantApiv1SimulateSimulateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.AccountNumber) { + toSerialize["account_number"] = o.AccountNumber + } + if !utils.IsNil(o.PaymentIdentifier) { + toSerialize["payment_identifier"] = o.PaymentIdentifier + } + return toSerialize, nil +} + +type NullableInternalWebControllersMerchantApiv1SimulateSimulateRequest struct { + value *InternalWebControllersMerchantApiv1SimulateSimulateRequest + isSet bool +} + +func (v NullableInternalWebControllersMerchantApiv1SimulateSimulateRequest) Get() *InternalWebControllersMerchantApiv1SimulateSimulateRequest { + return v.value +} + +func (v *NullableInternalWebControllersMerchantApiv1SimulateSimulateRequest) Set(val *InternalWebControllersMerchantApiv1SimulateSimulateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableInternalWebControllersMerchantApiv1SimulateSimulateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalWebControllersMerchantApiv1SimulateSimulateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalWebControllersMerchantApiv1SimulateSimulateRequest(val *InternalWebControllersMerchantApiv1SimulateSimulateRequest) *NullableInternalWebControllersMerchantApiv1SimulateSimulateRequest { + return &NullableInternalWebControllersMerchantApiv1SimulateSimulateRequest{value: val, isSet: true} +} + +func (v NullableInternalWebControllersMerchantApiv1SimulateSimulateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalWebControllersMerchantApiv1SimulateSimulateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/test/api_balance_test.go b/test/api_balance_test.go new file mode 100644 index 0000000..d5b3954 --- /dev/null +++ b/test/api_balance_test.go @@ -0,0 +1,41 @@ +/* +Doitpay API + +Testing PublicBalanceAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package doitpay + +import ( + "context" + "os" + "testing" + + "github.com/automotechnologies/doitpay-go" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_doitpay_BalanceApiService(t *testing.T) { + + apiKey := os.Getenv("DTP_APIKEY") + if apiKey == "" { + t.Skip("DTP_APIKEY not set") + } + + apiClient := doitpay.NewClient(apiKey) + + t.Run("Test BalanceApiService GetBalance", func(t *testing.T) { + + resp, httpRes, err := apiClient.BalanceAPI.GetBalance(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_invoice_test.go b/test/api_invoice_test.go new file mode 100644 index 0000000..97229b7 --- /dev/null +++ b/test/api_invoice_test.go @@ -0,0 +1,109 @@ +/* +Doitpay API + +Testing PublicInvoiceAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package doitpay + +import ( + "context" + "os" + "testing" + + "github.com/automotechnologies/doitpay-go" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_doitpay_InvoiceApiService(t *testing.T) { + + apiKey := os.Getenv("DTP_APIKEY") + if apiKey == "" { + t.Skip("DTP_APIKEY not set") + } + + apiClient := doitpay.NewClient(apiKey) + + t.Run("Test InvoiceApiService CreateInvoice", func(t *testing.T) { + + resp, httpRes, err := apiClient.InvoiceAPI.CreateInvoice(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test InvoiceApiService DownloadInvoice", func(t *testing.T) { + + resp, httpRes, err := apiClient.InvoiceAPI.DownloadInvoice(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test InvoiceApiService ExpireInvoice", func(t *testing.T) { + + var invoiceId string + + resp, httpRes, err := apiClient.InvoiceAPI.ExpireInvoice(context.Background(), invoiceId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test InvoiceApiService GetInvoiceById", func(t *testing.T) { + + var invoiceId string + + resp, httpRes, err := apiClient.InvoiceAPI.GetInvoiceById(context.Background(), invoiceId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test InvoiceApiService GetInvoices", func(t *testing.T) { + + resp, httpRes, err := apiClient.InvoiceAPI.GetInvoices(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test InvoiceApiService GetPaymentMethodById", func(t *testing.T) { + + var invoiceId string + + resp, httpRes, err := apiClient.InvoiceAPI.GetPaymentMethodById(context.Background(), invoiceId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test InvoiceApiService UpdateInvoiceById", func(t *testing.T) { + + var invoiceId string + + resp, httpRes, err := apiClient.InvoiceAPI.UpdateInvoiceById(context.Background(), invoiceId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_simulate_test.go b/test/api_simulate_test.go new file mode 100644 index 0000000..95f13f7 --- /dev/null +++ b/test/api_simulate_test.go @@ -0,0 +1,40 @@ +/* +Doitpay API + +Testing PublicSimulateAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package doitpay + +import ( + "context" + "os" + "testing" + + "github.com/automotechnologies/doitpay-go" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_doitpay_PublicSimulateAPIService(t *testing.T) { + + apiKey := os.Getenv("DTP_APIKEY") + if apiKey == "" { + t.Skip("DTP_APIKEY not set") + } + + apiClient := doitpay.NewClient(apiKey) + + t.Run("Test SimulateApiService SimulatePayment", func(t *testing.T) { + + httpRes, err := apiClient.SimulateAPI.SimulatePayment(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/test/api_virtual_account_test.go b/test/api_virtual_account_test.go new file mode 100644 index 0000000..7143066 --- /dev/null +++ b/test/api_virtual_account_test.go @@ -0,0 +1,75 @@ +/* +Doitpay API + +Testing PublicVirtualAccountAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package doitpay + +import ( + "context" + "os" + "testing" + + "github.com/automotechnologies/doitpay-go" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_doitpay_VirtualAccountApiService(t *testing.T) { + + apiKey := os.Getenv("DTP_APIKEY") + if apiKey == "" { + t.Skip("DTP_APIKEY not set") + } + + apiClient := doitpay.NewClient(apiKey) + + t.Run("Test VirtualAccountApiService CreateVirtualAccount", func(t *testing.T) { + + resp, httpRes, err := apiClient.VirtualAccountAPI.CreateVirtualAccount(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test VirtualAccountApiService GetVirtualAccountById", func(t *testing.T) { + + var virtualAccountId int32 + + resp, httpRes, err := apiClient.VirtualAccountAPI.GetVirtualAccountById(context.Background(), virtualAccountId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test VirtualAccountApiService GetVirtualAccountByNumber", func(t *testing.T) { + + var virtualAccountNumber string + + resp, httpRes, err := apiClient.VirtualAccountAPI.GetVirtualAccountByNumber(context.Background(), virtualAccountNumber).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test VirtualAccountApiService GetVirtualAccounts", func(t *testing.T) { + + resp, httpRes, err := apiClient.VirtualAccountAPI.GetVirtualAccounts(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/utils/helpers.go b/utils/helpers.go new file mode 100644 index 0000000..fb4d51b --- /dev/null +++ b/utils/helpers.go @@ -0,0 +1,205 @@ +package utils + +import ( + "bytes" + "encoding/json" + "fmt" + "net/url" + "reflect" + "strconv" + "strings" + "time" +) + +func Atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// SelectHeaderContentType select a content type from the available list. +func SelectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if Contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// SelectHeaderAccept join all accept types and return +func SelectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if Contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// Contains is a case insensitive match, finding needle in a haystack +func Contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func TypeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func ParameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// ParameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func ParameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + ParameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + ParameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + ParameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, arrayValue.Interface(), collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + ParameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + ParameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + case map[string]string: + valuesMap[keyPrefix] = value + } +} + +// helper for converting interface{} parameters to json strings +func ParameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// Prevent trying to import "fmt" +func ReportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// FormatErrorMessage using title and detail when model implements rfc7807 +func FormatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} + +// A wrapper for strict JSON decoding +func NewStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} diff --git a/utils/utils.go b/utils/utils.go new file mode 100644 index 0000000..2fc037a --- /dev/null +++ b/utils/utils.go @@ -0,0 +1,346 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package utils + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/virtualaccount/api_virtual_account.go b/virtualaccount/api_virtual_account.go new file mode 100644 index 0000000..0a8b114 --- /dev/null +++ b/virtualaccount/api_virtual_account.go @@ -0,0 +1,502 @@ +package virtualaccount + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strconv" + "strings" + + "github.com/automotechnologies/doitpay-go/common" + "github.com/automotechnologies/doitpay-go/utils" +) + +type PublicVirtualAccountAPI interface { + + /* + CreateVirtualAccount Create virtual account data. + + Create and return virtual account data. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateVirtualAccountRequest + */ + CreateVirtualAccount(ctx context.Context) ApiCreateVirtualAccountRequest + + // CreateVirtualAccountExecute executes the request + // @return InternalWebControllersMerchantApiv1VirtualaccountStandardResponse + CreateVirtualAccountExecute(r ApiCreateVirtualAccountRequest) (*InternalWebControllersMerchantApiv1VirtualaccountStandardResponse, *http.Response, error) + + /* + GetVirtualAccountById Fetch virtual account data by ID. + + Fetch virtual account data by ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param virtualAccountId Virtual Account ID + @return ApiGetVirtualAccountByIdRequest + */ + GetVirtualAccountById(ctx context.Context, virtualAccountId int32) ApiGetVirtualAccountByIdRequest + + // GetVirtualAccountByIdExecute executes the request + // @return InternalWebControllersMerchantApiv1VirtualaccountStandardResponse + GetVirtualAccountByIdExecute(r ApiGetVirtualAccountByIdRequest) (*InternalWebControllersMerchantApiv1VirtualaccountStandardResponse, *http.Response, error) + + /* + GetVirtualAccountByNumber Fetch virtual account data by virtual account number. + + Fetch virtual account data by virtual account number. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param virtualAccountNumber Virtual Account Number + @return ApiGetVirtualAccountByNumberRequest + */ + GetVirtualAccountByNumber(ctx context.Context, virtualAccountNumber string) ApiGetVirtualAccountByNumberRequest + + // GetVirtualAccountByNumberExecute executes the request + // @return InternalWebControllersMerchantApiv1VirtualaccountStandardResponse + GetVirtualAccountByNumberExecute(r ApiGetVirtualAccountByNumberRequest) (*InternalWebControllersMerchantApiv1VirtualaccountStandardResponse, *http.Response, error) + + /* + GetVirtualAccounts List all created virtual account data. + + List all created virtual account data. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetVirtualAccountsRequest + */ + GetVirtualAccounts(ctx context.Context) ApiGetVirtualAccountsRequest + + // GetVirtualAccountsExecute executes the request + // @return InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination + GetVirtualAccountsExecute(r ApiGetVirtualAccountsRequest) (*InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination, *http.Response, error) +} + +type VirtualAccountApiService struct { + client common.IClient +} + +// NewVirtualAccountApi Create a new VirtualAccountApi service +func NewVirtualAccountApi(client common.IClient) PublicVirtualAccountAPI { + return &VirtualAccountApiService{ + client: client, + } +} + +type ApiCreateVirtualAccountRequest struct { + ctx context.Context + ApiService PublicVirtualAccountAPI + request *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest +} + +// Request payload to create virtual account +func (r ApiCreateVirtualAccountRequest) Request(request InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) ApiCreateVirtualAccountRequest { + r.request = &request + return r +} + +func (r ApiCreateVirtualAccountRequest) Execute() (*InternalWebControllersMerchantApiv1VirtualaccountStandardResponse, *http.Response, error) { + return r.ApiService.CreateVirtualAccountExecute(r) +} + +/* +CreateVirtualAccount Create virtual account data. + +Create and return virtual account data. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateVirtualAccountRequest +*/ +func (a *VirtualAccountApiService) CreateVirtualAccount(ctx context.Context) ApiCreateVirtualAccountRequest { + return ApiCreateVirtualAccountRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return InternalWebControllersMerchantApiv1VirtualaccountStandardResponse +func (a *VirtualAccountApiService) CreateVirtualAccountExecute(r ApiCreateVirtualAccountRequest) (*InternalWebControllersMerchantApiv1VirtualaccountStandardResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "VirtualAccountApiService.CreateVirtualAccount") + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: VirtualAccountApiService.CreateVirtualAccountExecute") + } + + localVarPath := localBasePath + "/merchant/v1/virtual-account" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.request == nil { + return localVarReturnValue, nil, utils.ReportError("request is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.request + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: VirtualAccountApiService.CreateVirtualAccountExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetVirtualAccountByIdRequest struct { + ctx context.Context + ApiService PublicVirtualAccountAPI + virtualAccountId int32 +} + +func (r ApiGetVirtualAccountByIdRequest) Execute() (*InternalWebControllersMerchantApiv1VirtualaccountStandardResponse, *http.Response, error) { + return r.ApiService.GetVirtualAccountByIdExecute(r) +} + +/* +GetVirtualAccountById Fetch virtual account data by ID. + +Fetch virtual account data by ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param virtualAccountId Virtual Account ID + @return ApiGetVirtualAccountByIdRequest +*/ +func (a *VirtualAccountApiService) GetVirtualAccountById(ctx context.Context, virtualAccountId int32) ApiGetVirtualAccountByIdRequest { + return ApiGetVirtualAccountByIdRequest{ + ApiService: a, + ctx: ctx, + virtualAccountId: virtualAccountId, + } +} + +// Execute executes the request +// +// @return InternalWebControllersMerchantApiv1VirtualaccountStandardResponse +func (a *VirtualAccountApiService) GetVirtualAccountByIdExecute(r ApiGetVirtualAccountByIdRequest) (*InternalWebControllersMerchantApiv1VirtualaccountStandardResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "VirtualAccountApiService.GetVirtualAccountById") + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: VirtualAccountApiService.GetVirtualAccountByIdExecute") + } + + localVarPath := localBasePath + "/merchant/v1/virtual-account/{virtualAccountId}" + localVarPath = strings.Replace(localVarPath, "{"+"virtualAccountId"+"}", url.PathEscape(utils.ParameterValueToString(r.virtualAccountId, "virtualAccountId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: VirtualAccountApiService.GetVirtualAccountByIdExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetVirtualAccountByNumberRequest struct { + ctx context.Context + ApiService PublicVirtualAccountAPI + virtualAccountNumber string +} + +func (r ApiGetVirtualAccountByNumberRequest) Execute() (*InternalWebControllersMerchantApiv1VirtualaccountStandardResponse, *http.Response, error) { + return r.ApiService.GetVirtualAccountByNumberExecute(r) +} + +/* +GetVirtualAccountByNumber Fetch virtual account data by virtual account number. + +Fetch virtual account data by virtual account number. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param virtualAccountNumber Virtual Account Number + @return ApiGetVirtualAccountByNumberRequest +*/ +func (a *VirtualAccountApiService) GetVirtualAccountByNumber(ctx context.Context, virtualAccountNumber string) ApiGetVirtualAccountByNumberRequest { + return ApiGetVirtualAccountByNumberRequest{ + ApiService: a, + ctx: ctx, + virtualAccountNumber: virtualAccountNumber, + } +} + +// Execute executes the request +// +// @return InternalWebControllersMerchantApiv1VirtualaccountStandardResponse +func (a *VirtualAccountApiService) GetVirtualAccountByNumberExecute(r ApiGetVirtualAccountByNumberRequest) (*InternalWebControllersMerchantApiv1VirtualaccountStandardResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "VirtualAccountApiService.GetVirtualAccountByNumber") + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: VirtualAccountApiService.GetVirtualAccountByNumberExecute") + } + + localVarPath := localBasePath + "/merchant/v1/virtual-account/number/{virtualAccountNumber}" + localVarPath = strings.Replace(localVarPath, "{"+"virtualAccountNumber"+"}", url.PathEscape(utils.ParameterValueToString(r.virtualAccountNumber, "virtualAccountNumber")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: VirtualAccountApiService.GetVirtualAccountByNumberExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetVirtualAccountsRequest struct { + ctx context.Context + ApiService PublicVirtualAccountAPI + page *int32 + limit *int32 + statuses *string +} + +// Page number +func (r ApiGetVirtualAccountsRequest) Page(page int32) ApiGetVirtualAccountsRequest { + r.page = &page + return r +} + +// Page limit +func (r ApiGetVirtualAccountsRequest) Limit(limit int32) ApiGetVirtualAccountsRequest { + r.limit = &limit + return r +} + +// Comma-separated list of statuses to filter by. Example: ?statuses=ACTIVE,PENDING +func (r ApiGetVirtualAccountsRequest) Statuses(statuses string) ApiGetVirtualAccountsRequest { + r.statuses = &statuses + return r +} + +func (r ApiGetVirtualAccountsRequest) Execute() (*InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination, *http.Response, error) { + return r.ApiService.GetVirtualAccountsExecute(r) +} + +/* +GetVirtualAccounts List all created virtual account data. + +List all created virtual account data. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetVirtualAccountsRequest +*/ +func (a *VirtualAccountApiService) GetVirtualAccounts(ctx context.Context) ApiGetVirtualAccountsRequest { + return ApiGetVirtualAccountsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination +func (a *VirtualAccountApiService) GetVirtualAccountsExecute(r ApiGetVirtualAccountsRequest) (*InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []common.FormFile + localVarReturnValue *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination + ) + + localBasePath, err := a.client.GetConfig().ServerURLWithContext(r.ctx, "VirtualAccountApiService.GetVirtualAccounts") + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: VirtualAccountApiService.GetVirtualAccountsExecute") + } + + localVarPath := localBasePath + "/merchant/v1/virtual-account" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.page != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } else { + var defaultValue int32 = 1 + r.page = &defaultValue + } + if r.limit != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "") + } else { + var defaultValue int32 = 10 + r.limit = &defaultValue + } + if r.statuses != nil { + utils.ParameterAddToHeaderOrQuery(localVarQueryParams, "statuses", r.statuses, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := utils.SelectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := utils.SelectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.PrepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, common.NewDoitpaySdkError(nil, "", "Error creating HTTP request: VirtualAccountApiService.GetVirtualAccountsExecute") + } + + localVarHTTPResponse, err := a.client.CallAPI(req) + + localVarBody, _ := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + + if err != nil || localVarHTTPResponse.StatusCode < 200 || localVarHTTPResponse.StatusCode >= 300 { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + err = a.client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + doitpaySdkError := common.NewDoitpaySdkError(&localVarBody, strconv.Itoa(localVarHTTPResponse.StatusCode), localVarHTTPResponse.Status) + + return localVarReturnValue, localVarHTTPResponse, doitpaySdkError + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/virtualaccount/model_render_app_pagination_header.go b/virtualaccount/model_render_app_pagination_header.go new file mode 100644 index 0000000..28fdd44 --- /dev/null +++ b/virtualaccount/model_render_app_pagination_header.go @@ -0,0 +1,233 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package virtualaccount + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader{} + +// GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader struct for GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader +type GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader struct { + CurrentPage *int32 `json:"current_page,omitempty"` + PerPage *int32 `json:"per_page,omitempty"` + TotalData *int32 `json:"total_data,omitempty"` + TotalPages *int32 `json:"total_pages,omitempty"` +} + +// NewGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader instantiates a new GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader() *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader { + this := GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader{} + return &this +} + +// NewGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeaderWithDefaults instantiates a new GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeaderWithDefaults() *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader { + this := GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader{} + return &this +} + +// GetCurrentPage returns the CurrentPage field value if set, zero value otherwise. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) GetCurrentPage() int32 { + if o == nil || utils.IsNil(o.CurrentPage) { + var ret int32 + return ret + } + return *o.CurrentPage +} + +// GetCurrentPageOk returns a tuple with the CurrentPage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) GetCurrentPageOk() (*int32, bool) { + if o == nil || utils.IsNil(o.CurrentPage) { + return nil, false + } + return o.CurrentPage, true +} + +// HasCurrentPage returns a boolean if a field has been set. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) HasCurrentPage() bool { + if o != nil && !utils.IsNil(o.CurrentPage) { + return true + } + + return false +} + +// SetCurrentPage gets a reference to the given int32 and assigns it to the CurrentPage field. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) SetCurrentPage(v int32) { + o.CurrentPage = &v +} + +// GetPerPage returns the PerPage field value if set, zero value otherwise. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) GetPerPage() int32 { + if o == nil || utils.IsNil(o.PerPage) { + var ret int32 + return ret + } + return *o.PerPage +} + +// GetPerPageOk returns a tuple with the PerPage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) GetPerPageOk() (*int32, bool) { + if o == nil || utils.IsNil(o.PerPage) { + return nil, false + } + return o.PerPage, true +} + +// HasPerPage returns a boolean if a field has been set. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) HasPerPage() bool { + if o != nil && !utils.IsNil(o.PerPage) { + return true + } + + return false +} + +// SetPerPage gets a reference to the given int32 and assigns it to the PerPage field. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) SetPerPage(v int32) { + o.PerPage = &v +} + +// GetTotalData returns the TotalData field value if set, zero value otherwise. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) GetTotalData() int32 { + if o == nil || utils.IsNil(o.TotalData) { + var ret int32 + return ret + } + return *o.TotalData +} + +// GetTotalDataOk returns a tuple with the TotalData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) GetTotalDataOk() (*int32, bool) { + if o == nil || utils.IsNil(o.TotalData) { + return nil, false + } + return o.TotalData, true +} + +// HasTotalData returns a boolean if a field has been set. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) HasTotalData() bool { + if o != nil && !utils.IsNil(o.TotalData) { + return true + } + + return false +} + +// SetTotalData gets a reference to the given int32 and assigns it to the TotalData field. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) SetTotalData(v int32) { + o.TotalData = &v +} + +// GetTotalPages returns the TotalPages field value if set, zero value otherwise. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) GetTotalPages() int32 { + if o == nil || utils.IsNil(o.TotalPages) { + var ret int32 + return ret + } + return *o.TotalPages +} + +// GetTotalPagesOk returns a tuple with the TotalPages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) GetTotalPagesOk() (*int32, bool) { + if o == nil || utils.IsNil(o.TotalPages) { + return nil, false + } + return o.TotalPages, true +} + +// HasTotalPages returns a boolean if a field has been set. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) HasTotalPages() bool { + if o != nil && !utils.IsNil(o.TotalPages) { + return true + } + + return false +} + +// SetTotalPages gets a reference to the given int32 and assigns it to the TotalPages field. +func (o *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) SetTotalPages(v int32) { + o.TotalPages = &v +} + +func (o GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.CurrentPage) { + toSerialize["current_page"] = o.CurrentPage + } + if !utils.IsNil(o.PerPage) { + toSerialize["per_page"] = o.PerPage + } + if !utils.IsNil(o.TotalData) { + toSerialize["total_data"] = o.TotalData + } + if !utils.IsNil(o.TotalPages) { + toSerialize["total_pages"] = o.TotalPages + } + return toSerialize, nil +} + +type NullableGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader struct { + value *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader + isSet bool +} + +func (v NullableGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) Get() *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader { + return v.value +} + +func (v *NullableGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) Set(val *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) { + v.value = val + v.isSet = true +} + +func (v NullableGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) IsSet() bool { + return v.isSet +} + +func (v *NullableGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader(val *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) *NullableGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader { + return &NullableGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader{value: val, isSet: true} +} + +func (v NullableGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/virtualaccount/model_virtualaccount_create_virtual_account_request.go b/virtualaccount/model_virtualaccount_create_virtual_account_request.go new file mode 100644 index 0000000..64b6e57 --- /dev/null +++ b/virtualaccount/model_virtualaccount_create_virtual_account_request.go @@ -0,0 +1,557 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package virtualaccount + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest{} + +// InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest struct for InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest +type InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest struct { + Amount *float32 `json:"amount,omitempty"` + AmountMax *float32 `json:"amount_max,omitempty"` + AmountMin *float32 `json:"amount_min,omitempty"` + BusinessId *int32 `json:"business_id,omitempty"` + Currency *string `json:"currency,omitempty"` + Customer *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer `json:"customer,omitempty"` + ExpirationDate *string `json:"expiration_date,omitempty"` + IsClosed *bool `json:"is_closed,omitempty"` + IsReusable *bool `json:"is_reusable,omitempty"` + PaymentMethodCode *string `json:"payment_method_code,omitempty"` + ReferenceId *string `json:"reference_id,omitempty"` + ReferenceInternalId *string `json:"reference_internal_id,omitempty"` + VirtualAccountSuffix *string `json:"virtual_account_suffix,omitempty"` +} + +// NewInternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest instantiates a new InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest() *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest { + this := InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest{} + return &this +} + +// NewInternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequestWithDefaults instantiates a new InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequestWithDefaults() *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest { + this := InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetAmount() float32 { + if o == nil || utils.IsNil(o.Amount) { + var ret float32 + return ret + } + return *o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetAmountOk() (*float32, bool) { + if o == nil || utils.IsNil(o.Amount) { + return nil, false + } + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasAmount() bool { + if o != nil && !utils.IsNil(o.Amount) { + return true + } + + return false +} + +// SetAmount gets a reference to the given float32 and assigns it to the Amount field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetAmount(v float32) { + o.Amount = &v +} + +// GetAmountMax returns the AmountMax field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetAmountMax() float32 { + if o == nil || utils.IsNil(o.AmountMax) { + var ret float32 + return ret + } + return *o.AmountMax +} + +// GetAmountMaxOk returns a tuple with the AmountMax field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetAmountMaxOk() (*float32, bool) { + if o == nil || utils.IsNil(o.AmountMax) { + return nil, false + } + return o.AmountMax, true +} + +// HasAmountMax returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasAmountMax() bool { + if o != nil && !utils.IsNil(o.AmountMax) { + return true + } + + return false +} + +// SetAmountMax gets a reference to the given float32 and assigns it to the AmountMax field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetAmountMax(v float32) { + o.AmountMax = &v +} + +// GetAmountMin returns the AmountMin field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetAmountMin() float32 { + if o == nil || utils.IsNil(o.AmountMin) { + var ret float32 + return ret + } + return *o.AmountMin +} + +// GetAmountMinOk returns a tuple with the AmountMin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetAmountMinOk() (*float32, bool) { + if o == nil || utils.IsNil(o.AmountMin) { + return nil, false + } + return o.AmountMin, true +} + +// HasAmountMin returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasAmountMin() bool { + if o != nil && !utils.IsNil(o.AmountMin) { + return true + } + + return false +} + +// SetAmountMin gets a reference to the given float32 and assigns it to the AmountMin field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetAmountMin(v float32) { + o.AmountMin = &v +} + +// GetBusinessId returns the BusinessId field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetBusinessId() int32 { + if o == nil || utils.IsNil(o.BusinessId) { + var ret int32 + return ret + } + return *o.BusinessId +} + +// GetBusinessIdOk returns a tuple with the BusinessId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetBusinessIdOk() (*int32, bool) { + if o == nil || utils.IsNil(o.BusinessId) { + return nil, false + } + return o.BusinessId, true +} + +// HasBusinessId returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasBusinessId() bool { + if o != nil && !utils.IsNil(o.BusinessId) { + return true + } + + return false +} + +// SetBusinessId gets a reference to the given int32 and assigns it to the BusinessId field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetBusinessId(v int32) { + o.BusinessId = &v +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetCurrency() string { + if o == nil || utils.IsNil(o.Currency) { + var ret string + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetCurrencyOk() (*string, bool) { + if o == nil || utils.IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasCurrency() bool { + if o != nil && !utils.IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given string and assigns it to the Currency field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetCurrency(v string) { + o.Currency = &v +} + +// GetCustomer returns the Customer field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetCustomer() InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer { + if o == nil || utils.IsNil(o.Customer) { + var ret InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer + return ret + } + return *o.Customer +} + +// GetCustomerOk returns a tuple with the Customer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetCustomerOk() (*InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer, bool) { + if o == nil || utils.IsNil(o.Customer) { + return nil, false + } + return o.Customer, true +} + +// HasCustomer returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasCustomer() bool { + if o != nil && !utils.IsNil(o.Customer) { + return true + } + + return false +} + +// SetCustomer gets a reference to the given InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer and assigns it to the Customer field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetCustomer(v InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) { + o.Customer = &v +} + +// GetExpirationDate returns the ExpirationDate field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetExpirationDate() string { + if o == nil || utils.IsNil(o.ExpirationDate) { + var ret string + return ret + } + return *o.ExpirationDate +} + +// GetExpirationDateOk returns a tuple with the ExpirationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetExpirationDateOk() (*string, bool) { + if o == nil || utils.IsNil(o.ExpirationDate) { + return nil, false + } + return o.ExpirationDate, true +} + +// HasExpirationDate returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasExpirationDate() bool { + if o != nil && !utils.IsNil(o.ExpirationDate) { + return true + } + + return false +} + +// SetExpirationDate gets a reference to the given string and assigns it to the ExpirationDate field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetExpirationDate(v string) { + o.ExpirationDate = &v +} + +// GetIsClosed returns the IsClosed field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetIsClosed() bool { + if o == nil || utils.IsNil(o.IsClosed) { + var ret bool + return ret + } + return *o.IsClosed +} + +// GetIsClosedOk returns a tuple with the IsClosed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetIsClosedOk() (*bool, bool) { + if o == nil || utils.IsNil(o.IsClosed) { + return nil, false + } + return o.IsClosed, true +} + +// HasIsClosed returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasIsClosed() bool { + if o != nil && !utils.IsNil(o.IsClosed) { + return true + } + + return false +} + +// SetIsClosed gets a reference to the given bool and assigns it to the IsClosed field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetIsClosed(v bool) { + o.IsClosed = &v +} + +// GetIsReusable returns the IsReusable field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetIsReusable() bool { + if o == nil || utils.IsNil(o.IsReusable) { + var ret bool + return ret + } + return *o.IsReusable +} + +// GetIsReusableOk returns a tuple with the IsReusable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetIsReusableOk() (*bool, bool) { + if o == nil || utils.IsNil(o.IsReusable) { + return nil, false + } + return o.IsReusable, true +} + +// HasIsReusable returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasIsReusable() bool { + if o != nil && !utils.IsNil(o.IsReusable) { + return true + } + + return false +} + +// SetIsReusable gets a reference to the given bool and assigns it to the IsReusable field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetIsReusable(v bool) { + o.IsReusable = &v +} + +// GetPaymentMethodCode returns the PaymentMethodCode field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetPaymentMethodCode() string { + if o == nil || utils.IsNil(o.PaymentMethodCode) { + var ret string + return ret + } + return *o.PaymentMethodCode +} + +// GetPaymentMethodCodeOk returns a tuple with the PaymentMethodCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetPaymentMethodCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.PaymentMethodCode) { + return nil, false + } + return o.PaymentMethodCode, true +} + +// HasPaymentMethodCode returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasPaymentMethodCode() bool { + if o != nil && !utils.IsNil(o.PaymentMethodCode) { + return true + } + + return false +} + +// SetPaymentMethodCode gets a reference to the given string and assigns it to the PaymentMethodCode field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetPaymentMethodCode(v string) { + o.PaymentMethodCode = &v +} + +// GetReferenceId returns the ReferenceId field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetReferenceId() string { + if o == nil || utils.IsNil(o.ReferenceId) { + var ret string + return ret + } + return *o.ReferenceId +} + +// GetReferenceIdOk returns a tuple with the ReferenceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetReferenceIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.ReferenceId) { + return nil, false + } + return o.ReferenceId, true +} + +// HasReferenceId returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasReferenceId() bool { + if o != nil && !utils.IsNil(o.ReferenceId) { + return true + } + + return false +} + +// SetReferenceId gets a reference to the given string and assigns it to the ReferenceId field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetReferenceId(v string) { + o.ReferenceId = &v +} + +// GetReferenceInternalId returns the ReferenceInternalId field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetReferenceInternalId() string { + if o == nil || utils.IsNil(o.ReferenceInternalId) { + var ret string + return ret + } + return *o.ReferenceInternalId +} + +// GetReferenceInternalIdOk returns a tuple with the ReferenceInternalId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetReferenceInternalIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.ReferenceInternalId) { + return nil, false + } + return o.ReferenceInternalId, true +} + +// HasReferenceInternalId returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasReferenceInternalId() bool { + if o != nil && !utils.IsNil(o.ReferenceInternalId) { + return true + } + + return false +} + +// SetReferenceInternalId gets a reference to the given string and assigns it to the ReferenceInternalId field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetReferenceInternalId(v string) { + o.ReferenceInternalId = &v +} + +// GetVirtualAccountSuffix returns the VirtualAccountSuffix field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetVirtualAccountSuffix() string { + if o == nil || utils.IsNil(o.VirtualAccountSuffix) { + var ret string + return ret + } + return *o.VirtualAccountSuffix +} + +// GetVirtualAccountSuffixOk returns a tuple with the VirtualAccountSuffix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) GetVirtualAccountSuffixOk() (*string, bool) { + if o == nil || utils.IsNil(o.VirtualAccountSuffix) { + return nil, false + } + return o.VirtualAccountSuffix, true +} + +// HasVirtualAccountSuffix returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) HasVirtualAccountSuffix() bool { + if o != nil && !utils.IsNil(o.VirtualAccountSuffix) { + return true + } + + return false +} + +// SetVirtualAccountSuffix gets a reference to the given string and assigns it to the VirtualAccountSuffix field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) SetVirtualAccountSuffix(v string) { + o.VirtualAccountSuffix = &v +} + +func (o InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } + if !utils.IsNil(o.AmountMax) { + toSerialize["amount_max"] = o.AmountMax + } + if !utils.IsNil(o.AmountMin) { + toSerialize["amount_min"] = o.AmountMin + } + if !utils.IsNil(o.BusinessId) { + toSerialize["business_id"] = o.BusinessId + } + if !utils.IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + if !utils.IsNil(o.Customer) { + toSerialize["customer"] = o.Customer + } + if !utils.IsNil(o.ExpirationDate) { + toSerialize["expiration_date"] = o.ExpirationDate + } + if !utils.IsNil(o.IsClosed) { + toSerialize["is_closed"] = o.IsClosed + } + if !utils.IsNil(o.IsReusable) { + toSerialize["is_reusable"] = o.IsReusable + } + if !utils.IsNil(o.PaymentMethodCode) { + toSerialize["payment_method_code"] = o.PaymentMethodCode + } + if !utils.IsNil(o.ReferenceId) { + toSerialize["reference_id"] = o.ReferenceId + } + if !utils.IsNil(o.ReferenceInternalId) { + toSerialize["reference_internal_id"] = o.ReferenceInternalId + } + if !utils.IsNil(o.VirtualAccountSuffix) { + toSerialize["virtual_account_suffix"] = o.VirtualAccountSuffix + } + return toSerialize, nil +} + +type NullableInternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest struct { + value *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest + isSet bool +} + +func (v NullableInternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) Get() *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest { + return v.value +} + +func (v *NullableInternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) Set(val *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) { + v.value = val + v.isSet = true +} + +func (v NullableInternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest(val *InternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) *NullableInternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest { + return &NullableInternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest{value: val, isSet: true} +} + +func (v NullableInternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalWebControllersMerchantApiv1VirtualaccountCreateVirtualAccountRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/virtualaccount/model_virtualaccount_standard_meta.go b/virtualaccount/model_virtualaccount_standard_meta.go new file mode 100644 index 0000000..5f7b201 --- /dev/null +++ b/virtualaccount/model_virtualaccount_standard_meta.go @@ -0,0 +1,161 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package virtualaccount + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the InternalWebControllersMerchantApiv1VirtualaccountStandardMeta type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &InternalWebControllersMerchantApiv1VirtualaccountStandardMeta{} + +// InternalWebControllersMerchantApiv1VirtualaccountStandardMeta struct for InternalWebControllersMerchantApiv1VirtualaccountStandardMeta +type InternalWebControllersMerchantApiv1VirtualaccountStandardMeta struct { + ProcessingTime *string `json:"processing_time,omitempty"` + VersionApi *string `json:"version_api,omitempty"` +} + +// NewInternalWebControllersMerchantApiv1VirtualaccountStandardMeta instantiates a new InternalWebControllersMerchantApiv1VirtualaccountStandardMeta object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalWebControllersMerchantApiv1VirtualaccountStandardMeta() *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta { + this := InternalWebControllersMerchantApiv1VirtualaccountStandardMeta{} + return &this +} + +// NewInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithDefaults instantiates a new InternalWebControllersMerchantApiv1VirtualaccountStandardMeta object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithDefaults() *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta { + this := InternalWebControllersMerchantApiv1VirtualaccountStandardMeta{} + return &this +} + +// GetProcessingTime returns the ProcessingTime field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta) GetProcessingTime() string { + if o == nil || utils.IsNil(o.ProcessingTime) { + var ret string + return ret + } + return *o.ProcessingTime +} + +// GetProcessingTimeOk returns a tuple with the ProcessingTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta) GetProcessingTimeOk() (*string, bool) { + if o == nil || utils.IsNil(o.ProcessingTime) { + return nil, false + } + return o.ProcessingTime, true +} + +// HasProcessingTime returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta) HasProcessingTime() bool { + if o != nil && !utils.IsNil(o.ProcessingTime) { + return true + } + + return false +} + +// SetProcessingTime gets a reference to the given string and assigns it to the ProcessingTime field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta) SetProcessingTime(v string) { + o.ProcessingTime = &v +} + +// GetVersionApi returns the VersionApi field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta) GetVersionApi() string { + if o == nil || utils.IsNil(o.VersionApi) { + var ret string + return ret + } + return *o.VersionApi +} + +// GetVersionApiOk returns a tuple with the VersionApi field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta) GetVersionApiOk() (*string, bool) { + if o == nil || utils.IsNil(o.VersionApi) { + return nil, false + } + return o.VersionApi, true +} + +// HasVersionApi returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta) HasVersionApi() bool { + if o != nil && !utils.IsNil(o.VersionApi) { + return true + } + + return false +} + +// SetVersionApi gets a reference to the given string and assigns it to the VersionApi field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta) SetVersionApi(v string) { + o.VersionApi = &v +} + +func (o InternalWebControllersMerchantApiv1VirtualaccountStandardMeta) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalWebControllersMerchantApiv1VirtualaccountStandardMeta) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ProcessingTime) { + toSerialize["processing_time"] = o.ProcessingTime + } + if !utils.IsNil(o.VersionApi) { + toSerialize["version_api"] = o.VersionApi + } + return toSerialize, nil +} + +type NullableInternalWebControllersMerchantApiv1VirtualaccountStandardMeta struct { + value *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta + isSet bool +} + +func (v NullableInternalWebControllersMerchantApiv1VirtualaccountStandardMeta) Get() *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta { + return v.value +} + +func (v *NullableInternalWebControllersMerchantApiv1VirtualaccountStandardMeta) Set(val *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta) { + v.value = val + v.isSet = true +} + +func (v NullableInternalWebControllersMerchantApiv1VirtualaccountStandardMeta) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalWebControllersMerchantApiv1VirtualaccountStandardMeta) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalWebControllersMerchantApiv1VirtualaccountStandardMeta(val *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta) *NullableInternalWebControllersMerchantApiv1VirtualaccountStandardMeta { + return &NullableInternalWebControllersMerchantApiv1VirtualaccountStandardMeta{value: val, isSet: true} +} + +func (v NullableInternalWebControllersMerchantApiv1VirtualaccountStandardMeta) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalWebControllersMerchantApiv1VirtualaccountStandardMeta) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/virtualaccount/model_virtualaccount_standard_meta_with_pagination.go b/virtualaccount/model_virtualaccount_standard_meta_with_pagination.go new file mode 100644 index 0000000..07992b1 --- /dev/null +++ b/virtualaccount/model_virtualaccount_standard_meta_with_pagination.go @@ -0,0 +1,197 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package virtualaccount + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination{} + +// InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination struct for InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination +type InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination struct { + Pagination *GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader `json:"pagination,omitempty"` + ProcessingTime *string `json:"processing_time,omitempty"` + VersionApi *string `json:"version_api,omitempty"` +} + +// NewInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination instantiates a new InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination() *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination { + this := InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination{} + return &this +} + +// NewInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPaginationWithDefaults instantiates a new InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPaginationWithDefaults() *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination { + this := InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination{} + return &this +} + +// GetPagination returns the Pagination field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) GetPagination() GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader { + if o == nil || utils.IsNil(o.Pagination) { + var ret GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader + return ret + } + return *o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) GetPaginationOk() (*GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader, bool) { + if o == nil || utils.IsNil(o.Pagination) { + return nil, false + } + return o.Pagination, true +} + +// HasPagination returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) HasPagination() bool { + if o != nil && !utils.IsNil(o.Pagination) { + return true + } + + return false +} + +// SetPagination gets a reference to the given GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader and assigns it to the Pagination field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) SetPagination(v GithubComAutomotechnologiesDoitpayInternalWebRenderAppPaginationHeader) { + o.Pagination = &v +} + +// GetProcessingTime returns the ProcessingTime field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) GetProcessingTime() string { + if o == nil || utils.IsNil(o.ProcessingTime) { + var ret string + return ret + } + return *o.ProcessingTime +} + +// GetProcessingTimeOk returns a tuple with the ProcessingTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) GetProcessingTimeOk() (*string, bool) { + if o == nil || utils.IsNil(o.ProcessingTime) { + return nil, false + } + return o.ProcessingTime, true +} + +// HasProcessingTime returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) HasProcessingTime() bool { + if o != nil && !utils.IsNil(o.ProcessingTime) { + return true + } + + return false +} + +// SetProcessingTime gets a reference to the given string and assigns it to the ProcessingTime field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) SetProcessingTime(v string) { + o.ProcessingTime = &v +} + +// GetVersionApi returns the VersionApi field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) GetVersionApi() string { + if o == nil || utils.IsNil(o.VersionApi) { + var ret string + return ret + } + return *o.VersionApi +} + +// GetVersionApiOk returns a tuple with the VersionApi field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) GetVersionApiOk() (*string, bool) { + if o == nil || utils.IsNil(o.VersionApi) { + return nil, false + } + return o.VersionApi, true +} + +// HasVersionApi returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) HasVersionApi() bool { + if o != nil && !utils.IsNil(o.VersionApi) { + return true + } + + return false +} + +// SetVersionApi gets a reference to the given string and assigns it to the VersionApi field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) SetVersionApi(v string) { + o.VersionApi = &v +} + +func (o InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Pagination) { + toSerialize["pagination"] = o.Pagination + } + if !utils.IsNil(o.ProcessingTime) { + toSerialize["processing_time"] = o.ProcessingTime + } + if !utils.IsNil(o.VersionApi) { + toSerialize["version_api"] = o.VersionApi + } + return toSerialize, nil +} + +type NullableInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination struct { + value *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination + isSet bool +} + +func (v NullableInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) Get() *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination { + return v.value +} + +func (v *NullableInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) Set(val *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) { + v.value = val + v.isSet = true +} + +func (v NullableInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination(val *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) *NullableInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination { + return &NullableInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination{value: val, isSet: true} +} + +func (v NullableInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/virtualaccount/model_virtualaccount_standard_response.go b/virtualaccount/model_virtualaccount_standard_response.go new file mode 100644 index 0000000..af4c319 --- /dev/null +++ b/virtualaccount/model_virtualaccount_standard_response.go @@ -0,0 +1,269 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package virtualaccount + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the InternalWebControllersMerchantApiv1VirtualaccountStandardResponse type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &InternalWebControllersMerchantApiv1VirtualaccountStandardResponse{} + +// InternalWebControllersMerchantApiv1VirtualaccountStandardResponse struct for InternalWebControllersMerchantApiv1VirtualaccountStandardResponse +type InternalWebControllersMerchantApiv1VirtualaccountStandardResponse struct { + Code *int32 `json:"code,omitempty"` + Data *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse `json:"data,omitempty"` + Message *string `json:"message,omitempty"` + Meta *InternalWebControllersMerchantApiv1VirtualaccountStandardMeta `json:"meta,omitempty"` + Status *string `json:"status,omitempty"` +} + +// NewInternalWebControllersMerchantApiv1VirtualaccountStandardResponse instantiates a new InternalWebControllersMerchantApiv1VirtualaccountStandardResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalWebControllersMerchantApiv1VirtualaccountStandardResponse() *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse { + this := InternalWebControllersMerchantApiv1VirtualaccountStandardResponse{} + return &this +} + +// NewInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithDefaults instantiates a new InternalWebControllersMerchantApiv1VirtualaccountStandardResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithDefaults() *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse { + this := InternalWebControllersMerchantApiv1VirtualaccountStandardResponse{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) GetCode() int32 { + if o == nil || utils.IsNil(o.Code) { + var ret int32 + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) GetCodeOk() (*int32, bool) { + if o == nil || utils.IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) HasCode() bool { + if o != nil && !utils.IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given int32 and assigns it to the Code field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) SetCode(v int32) { + o.Code = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) GetData() InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse { + if o == nil || utils.IsNil(o.Data) { + var ret InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) GetDataOk() (*InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse, bool) { + if o == nil || utils.IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) HasData() bool { + if o != nil && !utils.IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse and assigns it to the Data field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) SetData(v InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) { + o.Data = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) GetMessage() string { + if o == nil || utils.IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) GetMessageOk() (*string, bool) { + if o == nil || utils.IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) HasMessage() bool { + if o != nil && !utils.IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) SetMessage(v string) { + o.Message = &v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) GetMeta() InternalWebControllersMerchantApiv1VirtualaccountStandardMeta { + if o == nil || utils.IsNil(o.Meta) { + var ret InternalWebControllersMerchantApiv1VirtualaccountStandardMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) GetMetaOk() (*InternalWebControllersMerchantApiv1VirtualaccountStandardMeta, bool) { + if o == nil || utils.IsNil(o.Meta) { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) HasMeta() bool { + if o != nil && !utils.IsNil(o.Meta) { + return true + } + + return false +} + +// SetMeta gets a reference to the given InternalWebControllersMerchantApiv1VirtualaccountStandardMeta and assigns it to the Meta field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) SetMeta(v InternalWebControllersMerchantApiv1VirtualaccountStandardMeta) { + o.Meta = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) GetStatus() string { + if o == nil || utils.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) GetStatusOk() (*string, bool) { + if o == nil || utils.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) HasStatus() bool { + if o != nil && !utils.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) SetStatus(v string) { + o.Status = &v +} + +func (o InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !utils.IsNil(o.Data) { + toSerialize["data"] = o.Data + } + if !utils.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + if !utils.IsNil(o.Meta) { + toSerialize["meta"] = o.Meta + } + if !utils.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil +} + +type NullableInternalWebControllersMerchantApiv1VirtualaccountStandardResponse struct { + value *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse + isSet bool +} + +func (v NullableInternalWebControllersMerchantApiv1VirtualaccountStandardResponse) Get() *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse { + return v.value +} + +func (v *NullableInternalWebControllersMerchantApiv1VirtualaccountStandardResponse) Set(val *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) { + v.value = val + v.isSet = true +} + +func (v NullableInternalWebControllersMerchantApiv1VirtualaccountStandardResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalWebControllersMerchantApiv1VirtualaccountStandardResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalWebControllersMerchantApiv1VirtualaccountStandardResponse(val *InternalWebControllersMerchantApiv1VirtualaccountStandardResponse) *NullableInternalWebControllersMerchantApiv1VirtualaccountStandardResponse { + return &NullableInternalWebControllersMerchantApiv1VirtualaccountStandardResponse{value: val, isSet: true} +} + +func (v NullableInternalWebControllersMerchantApiv1VirtualaccountStandardResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalWebControllersMerchantApiv1VirtualaccountStandardResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/virtualaccount/model_virtualaccount_standard_response_with_pagination.go b/virtualaccount/model_virtualaccount_standard_response_with_pagination.go new file mode 100644 index 0000000..21e5b13 --- /dev/null +++ b/virtualaccount/model_virtualaccount_standard_response_with_pagination.go @@ -0,0 +1,269 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package virtualaccount + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination{} + +// InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination struct for InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination +type InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination struct { + Code *int32 `json:"code,omitempty"` + Data []InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse `json:"data,omitempty"` + Message *string `json:"message,omitempty"` + Meta *InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination `json:"meta,omitempty"` + Status *string `json:"status,omitempty"` +} + +// NewInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination instantiates a new InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination() *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination { + this := InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination{} + return &this +} + +// NewInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPaginationWithDefaults instantiates a new InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPaginationWithDefaults() *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination { + this := InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) GetCode() int32 { + if o == nil || utils.IsNil(o.Code) { + var ret int32 + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) GetCodeOk() (*int32, bool) { + if o == nil || utils.IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) HasCode() bool { + if o != nil && !utils.IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given int32 and assigns it to the Code field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) SetCode(v int32) { + o.Code = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) GetData() []InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse { + if o == nil || utils.IsNil(o.Data) { + var ret []InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) GetDataOk() ([]InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse, bool) { + if o == nil || utils.IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) HasData() bool { + if o != nil && !utils.IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given []InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse and assigns it to the Data field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) SetData(v []InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) { + o.Data = v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) GetMessage() string { + if o == nil || utils.IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) GetMessageOk() (*string, bool) { + if o == nil || utils.IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) HasMessage() bool { + if o != nil && !utils.IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) SetMessage(v string) { + o.Message = &v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) GetMeta() InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination { + if o == nil || utils.IsNil(o.Meta) { + var ret InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) GetMetaOk() (*InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination, bool) { + if o == nil || utils.IsNil(o.Meta) { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) HasMeta() bool { + if o != nil && !utils.IsNil(o.Meta) { + return true + } + + return false +} + +// SetMeta gets a reference to the given InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination and assigns it to the Meta field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) SetMeta(v InternalWebControllersMerchantApiv1VirtualaccountStandardMetaWithPagination) { + o.Meta = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) GetStatus() string { + if o == nil || utils.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) GetStatusOk() (*string, bool) { + if o == nil || utils.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) HasStatus() bool { + if o != nil && !utils.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) SetStatus(v string) { + o.Status = &v +} + +func (o InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !utils.IsNil(o.Data) { + toSerialize["data"] = o.Data + } + if !utils.IsNil(o.Message) { + toSerialize["message"] = o.Message + } + if !utils.IsNil(o.Meta) { + toSerialize["meta"] = o.Meta + } + if !utils.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil +} + +type NullableInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination struct { + value *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination + isSet bool +} + +func (v NullableInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) Get() *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination { + return v.value +} + +func (v *NullableInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) Set(val *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) { + v.value = val + v.isSet = true +} + +func (v NullableInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination(val *InternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) *NullableInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination { + return &NullableInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination{value: val, isSet: true} +} + +func (v NullableInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalWebControllersMerchantApiv1VirtualaccountStandardResponseWithPagination) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/virtualaccount/model_virtualaccount_status.go b/virtualaccount/model_virtualaccount_status.go new file mode 100644 index 0000000..b8d8dfb --- /dev/null +++ b/virtualaccount/model_virtualaccount_status.go @@ -0,0 +1,114 @@ +package virtualaccount + +import ( + "encoding/json" + + "fmt" +) + +// VirtualAccountStatus Representing the status of a virtual account. +type VirtualAccountStatus string + +// List of VirtualAccountStatus +const ( + VIRTUAL_ACCOUNT_STATUS_UNKNOWN VirtualAccountStatus = "UNKNOWN" + VIRTUAL_ACCOUNT_STATUS_INACTIVE VirtualAccountStatus = "INACTIVE" + VIRTUAL_ACCOUNT_STATUS_PENDING VirtualAccountStatus = "PENDING" + VIRTUAL_ACCOUNT_STATUS_ACTIVE VirtualAccountStatus = "ACTIVE" + VIRTUAL_ACCOUNT_STATUS_PAID VirtualAccountStatus = "PAID" + VIRTUAL_ACCOUNT_STATUS_EXPIRED VirtualAccountStatus = "EXPIRED" +) + +// All allowed values of VirtualAccountStatus enum +var AllowedVirtualAccountStatusEnumValues = []VirtualAccountStatus{ + "UNKNOWN", + "INACTIVE", + "PENDING", + "ACTIVE", + "PAID", + "EXPIRED", +} + +func (v *VirtualAccountStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := VirtualAccountStatus(value) + for _, existing := range AllowedVirtualAccountStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + *v = VIRTUAL_ACCOUNT_STATUS_UNKNOWN + return nil +} + +// NewVirtualAccountStatusFromValue returns a pointer to a valid VirtualAccountStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewVirtualAccountStatusFromValue(v string) (*VirtualAccountStatus, error) { + ev := VirtualAccountStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for VirtualAccountStatus: valid values are %v", v, AllowedVirtualAccountStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v VirtualAccountStatus) IsValid() bool { + for _, existing := range AllowedVirtualAccountStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +func (v VirtualAccountStatus) String() string { + return string(v) +} + +// Ptr returns reference to VirtualAccountStatus value +func (v VirtualAccountStatus) Ptr() *VirtualAccountStatus { + return &v +} + +type NullableVirtualAccountStatus struct { + value *VirtualAccountStatus + isSet bool +} + +func (v NullableVirtualAccountStatus) Get() *VirtualAccountStatus { + return v.value +} + +func (v *NullableVirtualAccountStatus) Set(val *VirtualAccountStatus) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualAccountStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualAccountStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualAccountStatus(val *VirtualAccountStatus) *NullableVirtualAccountStatus { + return &NullableVirtualAccountStatus{value: val, isSet: true} +} + +func (v NullableVirtualAccountStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualAccountStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/virtualaccount/model_virtualaccount_virtual_account_customer.go b/virtualaccount/model_virtualaccount_virtual_account_customer.go new file mode 100644 index 0000000..2f2b87b --- /dev/null +++ b/virtualaccount/model_virtualaccount_virtual_account_customer.go @@ -0,0 +1,197 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package virtualaccount + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer{} + +// InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer struct for InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer +type InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer struct { + Email *string `json:"email,omitempty"` + Name *string `json:"name,omitempty"` + Phone *string `json:"phone,omitempty"` +} + +// NewInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer instantiates a new InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer() *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer { + this := InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer{} + return &this +} + +// NewInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomerWithDefaults instantiates a new InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomerWithDefaults() *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer { + this := InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer{} + return &this +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) GetEmail() string { + if o == nil || utils.IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) GetEmailOk() (*string, bool) { + if o == nil || utils.IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) HasEmail() bool { + if o != nil && !utils.IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) SetEmail(v string) { + o.Email = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) GetName() string { + if o == nil || utils.IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) GetNameOk() (*string, bool) { + if o == nil || utils.IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) HasName() bool { + if o != nil && !utils.IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) SetName(v string) { + o.Name = &v +} + +// GetPhone returns the Phone field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) GetPhone() string { + if o == nil || utils.IsNil(o.Phone) { + var ret string + return ret + } + return *o.Phone +} + +// GetPhoneOk returns a tuple with the Phone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) GetPhoneOk() (*string, bool) { + if o == nil || utils.IsNil(o.Phone) { + return nil, false + } + return o.Phone, true +} + +// HasPhone returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) HasPhone() bool { + if o != nil && !utils.IsNil(o.Phone) { + return true + } + + return false +} + +// SetPhone gets a reference to the given string and assigns it to the Phone field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) SetPhone(v string) { + o.Phone = &v +} + +func (o InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if !utils.IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !utils.IsNil(o.Phone) { + toSerialize["phone"] = o.Phone + } + return toSerialize, nil +} + +type NullableInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer struct { + value *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer + isSet bool +} + +func (v NullableInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) Get() *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer { + return v.value +} + +func (v *NullableInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) Set(val *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) { + v.value = val + v.isSet = true +} + +func (v NullableInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer(val *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) *NullableInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer { + return &NullableInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer{value: val, isSet: true} +} + +func (v NullableInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/virtualaccount/model_virtualaccount_virtual_account_response.go b/virtualaccount/model_virtualaccount_virtual_account_response.go new file mode 100644 index 0000000..78ecb3f --- /dev/null +++ b/virtualaccount/model_virtualaccount_virtual_account_response.go @@ -0,0 +1,629 @@ +/* +Doitpay API + +This is the payment gateway API server for Doitpay. + +API version: 1.0 +Contact: support@doitpay.co.id +*/ + +package virtualaccount + +import ( + "encoding/json" + + "github.com/automotechnologies/doitpay-go/utils" +) + +// checks if the InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse type satisfies the utils.MappedNullable interface at compile time +var _ utils.MappedNullable = &InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse{} + +// InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse struct for InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse +type InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse struct { + Amount *float32 `json:"amount,omitempty"` + AmountMax *float32 `json:"amount_max,omitempty"` + AmountMin *float32 `json:"amount_min,omitempty"` + Customer *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer `json:"customer,omitempty"` + ExpirationDate *string `json:"expiration_date,omitempty"` + IsClosed *bool `json:"is_closed,omitempty"` + IsReusable *bool `json:"is_reusable,omitempty"` + PaymentMethodBank *string `json:"payment_method_bank,omitempty"` + PaymentMethodCode *string `json:"payment_method_code,omitempty"` + ReferenceId *string `json:"reference_id,omitempty"` + ReferenceInternalId *string `json:"reference_internal_id,omitempty"` + Status *string `json:"status,omitempty"` + VirtualAccountLinkId *string `json:"virtual_account_link_id,omitempty"` + VirtualAccountNumber *string `json:"virtual_account_number,omitempty"` + VirtualAccountSuffix *string `json:"virtual_account_suffix,omitempty"` +} + +// NewInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse instantiates a new InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse() *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse { + this := InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse{} + return &this +} + +// NewInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponseWithDefaults instantiates a new InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponseWithDefaults() *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse { + this := InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetAmount() float32 { + if o == nil || utils.IsNil(o.Amount) { + var ret float32 + return ret + } + return *o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetAmountOk() (*float32, bool) { + if o == nil || utils.IsNil(o.Amount) { + return nil, false + } + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasAmount() bool { + if o != nil && !utils.IsNil(o.Amount) { + return true + } + + return false +} + +// SetAmount gets a reference to the given float32 and assigns it to the Amount field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetAmount(v float32) { + o.Amount = &v +} + +// GetAmountMax returns the AmountMax field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetAmountMax() float32 { + if o == nil || utils.IsNil(o.AmountMax) { + var ret float32 + return ret + } + return *o.AmountMax +} + +// GetAmountMaxOk returns a tuple with the AmountMax field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetAmountMaxOk() (*float32, bool) { + if o == nil || utils.IsNil(o.AmountMax) { + return nil, false + } + return o.AmountMax, true +} + +// HasAmountMax returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasAmountMax() bool { + if o != nil && !utils.IsNil(o.AmountMax) { + return true + } + + return false +} + +// SetAmountMax gets a reference to the given float32 and assigns it to the AmountMax field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetAmountMax(v float32) { + o.AmountMax = &v +} + +// GetAmountMin returns the AmountMin field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetAmountMin() float32 { + if o == nil || utils.IsNil(o.AmountMin) { + var ret float32 + return ret + } + return *o.AmountMin +} + +// GetAmountMinOk returns a tuple with the AmountMin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetAmountMinOk() (*float32, bool) { + if o == nil || utils.IsNil(o.AmountMin) { + return nil, false + } + return o.AmountMin, true +} + +// HasAmountMin returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasAmountMin() bool { + if o != nil && !utils.IsNil(o.AmountMin) { + return true + } + + return false +} + +// SetAmountMin gets a reference to the given float32 and assigns it to the AmountMin field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetAmountMin(v float32) { + o.AmountMin = &v +} + +// GetCustomer returns the Customer field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetCustomer() InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer { + if o == nil || utils.IsNil(o.Customer) { + var ret InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer + return ret + } + return *o.Customer +} + +// GetCustomerOk returns a tuple with the Customer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetCustomerOk() (*InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer, bool) { + if o == nil || utils.IsNil(o.Customer) { + return nil, false + } + return o.Customer, true +} + +// HasCustomer returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasCustomer() bool { + if o != nil && !utils.IsNil(o.Customer) { + return true + } + + return false +} + +// SetCustomer gets a reference to the given InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer and assigns it to the Customer field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetCustomer(v InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountCustomer) { + o.Customer = &v +} + +// GetExpirationDate returns the ExpirationDate field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetExpirationDate() string { + if o == nil || utils.IsNil(o.ExpirationDate) { + var ret string + return ret + } + return *o.ExpirationDate +} + +// GetExpirationDateOk returns a tuple with the ExpirationDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetExpirationDateOk() (*string, bool) { + if o == nil || utils.IsNil(o.ExpirationDate) { + return nil, false + } + return o.ExpirationDate, true +} + +// HasExpirationDate returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasExpirationDate() bool { + if o != nil && !utils.IsNil(o.ExpirationDate) { + return true + } + + return false +} + +// SetExpirationDate gets a reference to the given string and assigns it to the ExpirationDate field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetExpirationDate(v string) { + o.ExpirationDate = &v +} + +// GetIsClosed returns the IsClosed field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetIsClosed() bool { + if o == nil || utils.IsNil(o.IsClosed) { + var ret bool + return ret + } + return *o.IsClosed +} + +// GetIsClosedOk returns a tuple with the IsClosed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetIsClosedOk() (*bool, bool) { + if o == nil || utils.IsNil(o.IsClosed) { + return nil, false + } + return o.IsClosed, true +} + +// HasIsClosed returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasIsClosed() bool { + if o != nil && !utils.IsNil(o.IsClosed) { + return true + } + + return false +} + +// SetIsClosed gets a reference to the given bool and assigns it to the IsClosed field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetIsClosed(v bool) { + o.IsClosed = &v +} + +// GetIsReusable returns the IsReusable field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetIsReusable() bool { + if o == nil || utils.IsNil(o.IsReusable) { + var ret bool + return ret + } + return *o.IsReusable +} + +// GetIsReusableOk returns a tuple with the IsReusable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetIsReusableOk() (*bool, bool) { + if o == nil || utils.IsNil(o.IsReusable) { + return nil, false + } + return o.IsReusable, true +} + +// HasIsReusable returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasIsReusable() bool { + if o != nil && !utils.IsNil(o.IsReusable) { + return true + } + + return false +} + +// SetIsReusable gets a reference to the given bool and assigns it to the IsReusable field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetIsReusable(v bool) { + o.IsReusable = &v +} + +// GetPaymentMethodBank returns the PaymentMethodBank field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetPaymentMethodBank() string { + if o == nil || utils.IsNil(o.PaymentMethodBank) { + var ret string + return ret + } + return *o.PaymentMethodBank +} + +// GetPaymentMethodBankOk returns a tuple with the PaymentMethodBank field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetPaymentMethodBankOk() (*string, bool) { + if o == nil || utils.IsNil(o.PaymentMethodBank) { + return nil, false + } + return o.PaymentMethodBank, true +} + +// HasPaymentMethodBank returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasPaymentMethodBank() bool { + if o != nil && !utils.IsNil(o.PaymentMethodBank) { + return true + } + + return false +} + +// SetPaymentMethodBank gets a reference to the given string and assigns it to the PaymentMethodBank field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetPaymentMethodBank(v string) { + o.PaymentMethodBank = &v +} + +// GetPaymentMethodCode returns the PaymentMethodCode field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetPaymentMethodCode() string { + if o == nil || utils.IsNil(o.PaymentMethodCode) { + var ret string + return ret + } + return *o.PaymentMethodCode +} + +// GetPaymentMethodCodeOk returns a tuple with the PaymentMethodCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetPaymentMethodCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.PaymentMethodCode) { + return nil, false + } + return o.PaymentMethodCode, true +} + +// HasPaymentMethodCode returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasPaymentMethodCode() bool { + if o != nil && !utils.IsNil(o.PaymentMethodCode) { + return true + } + + return false +} + +// SetPaymentMethodCode gets a reference to the given string and assigns it to the PaymentMethodCode field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetPaymentMethodCode(v string) { + o.PaymentMethodCode = &v +} + +// GetReferenceId returns the ReferenceId field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetReferenceId() string { + if o == nil || utils.IsNil(o.ReferenceId) { + var ret string + return ret + } + return *o.ReferenceId +} + +// GetReferenceIdOk returns a tuple with the ReferenceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetReferenceIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.ReferenceId) { + return nil, false + } + return o.ReferenceId, true +} + +// HasReferenceId returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasReferenceId() bool { + if o != nil && !utils.IsNil(o.ReferenceId) { + return true + } + + return false +} + +// SetReferenceId gets a reference to the given string and assigns it to the ReferenceId field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetReferenceId(v string) { + o.ReferenceId = &v +} + +// GetReferenceInternalId returns the ReferenceInternalId field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetReferenceInternalId() string { + if o == nil || utils.IsNil(o.ReferenceInternalId) { + var ret string + return ret + } + return *o.ReferenceInternalId +} + +// GetReferenceInternalIdOk returns a tuple with the ReferenceInternalId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetReferenceInternalIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.ReferenceInternalId) { + return nil, false + } + return o.ReferenceInternalId, true +} + +// HasReferenceInternalId returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasReferenceInternalId() bool { + if o != nil && !utils.IsNil(o.ReferenceInternalId) { + return true + } + + return false +} + +// SetReferenceInternalId gets a reference to the given string and assigns it to the ReferenceInternalId field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetReferenceInternalId(v string) { + o.ReferenceInternalId = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetStatus() string { + if o == nil || utils.IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetStatusOk() (*string, bool) { + if o == nil || utils.IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasStatus() bool { + if o != nil && !utils.IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetStatus(v string) { + o.Status = &v +} + +// GetVirtualAccountLinkId returns the VirtualAccountLinkId field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetVirtualAccountLinkId() string { + if o == nil || utils.IsNil(o.VirtualAccountLinkId) { + var ret string + return ret + } + return *o.VirtualAccountLinkId +} + +// GetVirtualAccountLinkIdOk returns a tuple with the VirtualAccountLinkId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetVirtualAccountLinkIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.VirtualAccountLinkId) { + return nil, false + } + return o.VirtualAccountLinkId, true +} + +// HasVirtualAccountLinkId returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasVirtualAccountLinkId() bool { + if o != nil && !utils.IsNil(o.VirtualAccountLinkId) { + return true + } + + return false +} + +// SetVirtualAccountLinkId gets a reference to the given string and assigns it to the VirtualAccountLinkId field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetVirtualAccountLinkId(v string) { + o.VirtualAccountLinkId = &v +} + +// GetVirtualAccountNumber returns the VirtualAccountNumber field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetVirtualAccountNumber() string { + if o == nil || utils.IsNil(o.VirtualAccountNumber) { + var ret string + return ret + } + return *o.VirtualAccountNumber +} + +// GetVirtualAccountNumberOk returns a tuple with the VirtualAccountNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetVirtualAccountNumberOk() (*string, bool) { + if o == nil || utils.IsNil(o.VirtualAccountNumber) { + return nil, false + } + return o.VirtualAccountNumber, true +} + +// HasVirtualAccountNumber returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasVirtualAccountNumber() bool { + if o != nil && !utils.IsNil(o.VirtualAccountNumber) { + return true + } + + return false +} + +// SetVirtualAccountNumber gets a reference to the given string and assigns it to the VirtualAccountNumber field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetVirtualAccountNumber(v string) { + o.VirtualAccountNumber = &v +} + +// GetVirtualAccountSuffix returns the VirtualAccountSuffix field value if set, zero value otherwise. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetVirtualAccountSuffix() string { + if o == nil || utils.IsNil(o.VirtualAccountSuffix) { + var ret string + return ret + } + return *o.VirtualAccountSuffix +} + +// GetVirtualAccountSuffixOk returns a tuple with the VirtualAccountSuffix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) GetVirtualAccountSuffixOk() (*string, bool) { + if o == nil || utils.IsNil(o.VirtualAccountSuffix) { + return nil, false + } + return o.VirtualAccountSuffix, true +} + +// HasVirtualAccountSuffix returns a boolean if a field has been set. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) HasVirtualAccountSuffix() bool { + if o != nil && !utils.IsNil(o.VirtualAccountSuffix) { + return true + } + + return false +} + +// SetVirtualAccountSuffix gets a reference to the given string and assigns it to the VirtualAccountSuffix field. +func (o *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) SetVirtualAccountSuffix(v string) { + o.VirtualAccountSuffix = &v +} + +func (o InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } + if !utils.IsNil(o.AmountMax) { + toSerialize["amount_max"] = o.AmountMax + } + if !utils.IsNil(o.AmountMin) { + toSerialize["amount_min"] = o.AmountMin + } + if !utils.IsNil(o.Customer) { + toSerialize["customer"] = o.Customer + } + if !utils.IsNil(o.ExpirationDate) { + toSerialize["expiration_date"] = o.ExpirationDate + } + if !utils.IsNil(o.IsClosed) { + toSerialize["is_closed"] = o.IsClosed + } + if !utils.IsNil(o.IsReusable) { + toSerialize["is_reusable"] = o.IsReusable + } + if !utils.IsNil(o.PaymentMethodBank) { + toSerialize["payment_method_bank"] = o.PaymentMethodBank + } + if !utils.IsNil(o.PaymentMethodCode) { + toSerialize["payment_method_code"] = o.PaymentMethodCode + } + if !utils.IsNil(o.ReferenceId) { + toSerialize["reference_id"] = o.ReferenceId + } + if !utils.IsNil(o.ReferenceInternalId) { + toSerialize["reference_internal_id"] = o.ReferenceInternalId + } + if !utils.IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !utils.IsNil(o.VirtualAccountLinkId) { + toSerialize["virtual_account_link_id"] = o.VirtualAccountLinkId + } + if !utils.IsNil(o.VirtualAccountNumber) { + toSerialize["virtual_account_number"] = o.VirtualAccountNumber + } + if !utils.IsNil(o.VirtualAccountSuffix) { + toSerialize["virtual_account_suffix"] = o.VirtualAccountSuffix + } + return toSerialize, nil +} + +type NullableInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse struct { + value *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse + isSet bool +} + +func (v NullableInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) Get() *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse { + return v.value +} + +func (v *NullableInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) Set(val *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) { + v.value = val + v.isSet = true +} + +func (v NullableInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse(val *InternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) *NullableInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse { + return &NullableInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse{value: val, isSet: true} +} + +func (v NullableInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalWebControllersMerchantApiv1VirtualaccountVirtualAccountResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} From 5f9670f619bd4d7a2a40d0ac501ba0b9f97d6606 Mon Sep 17 00:00:00 2001 From: Kervin Christianata Date: Tue, 24 Oct 2023 10:36:58 +0700 Subject: [PATCH 2/2] Doitpay Go SDK --- .github/workflows/go.yml | 28 ++++++++++++++++++++++++++++ configuration.go | 4 ++-- go.mod | 2 +- 3 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..4927f09 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,28 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: Go + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.21' + + - name: Build + run: go build -v ./... + + - name: Test + run: go test -v ./... diff --git a/configuration.go b/configuration.go index 71230de..660debd 100644 --- a/configuration.go +++ b/configuration.go @@ -89,8 +89,8 @@ func NewConfiguration() *Configuration { Debug: false, Servers: ServerConfigurations{ { - URL: "http://localhost:8000", - Description: "No description provided", + URL: "https://api.doitpay.co", + Description: "Doitpay API Server", }, }, OperationServers: map[string]ServerConfigurations{}, diff --git a/go.mod b/go.mod index 2391243..6870244 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/automotechnologies/doitpay-go -go 1.18 +go 1.21.1 require ( github.com/stretchr/testify v1.4.0