cybrid_api_bank_ruby 0.71.72 → 0.72.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +5 -13
- data/cybrid_api_bank_ruby.gemspec +1 -1
- data/lib/cybrid_api_bank_ruby/api/accounts_bank_api.rb +1 -1
- data/lib/cybrid_api_bank_ruby/api/assets_bank_api.rb +1 -1
- data/lib/cybrid_api_bank_ruby/api/banks_bank_api.rb +1 -1
- data/lib/cybrid_api_bank_ruby/api/customers_bank_api.rb +1 -1
- data/lib/cybrid_api_bank_ruby/api/deposit_addresses_bank_api.rb +1 -1
- data/lib/cybrid_api_bank_ruby/api/external_bank_accounts_bank_api.rb +1 -1
- data/lib/cybrid_api_bank_ruby/api/external_wallets_bank_api.rb +1 -1
- data/lib/cybrid_api_bank_ruby/api/identity_verifications_bank_api.rb +1 -1
- data/lib/cybrid_api_bank_ruby/api/prices_bank_api.rb +1 -1
- data/lib/cybrid_api_bank_ruby/api/quotes_bank_api.rb +1 -1
- data/lib/cybrid_api_bank_ruby/api/rewards_bank_api.rb +1 -1
- data/lib/cybrid_api_bank_ruby/api/symbols_bank_api.rb +1 -1
- data/lib/cybrid_api_bank_ruby/api/trades_bank_api.rb +1 -1
- data/lib/cybrid_api_bank_ruby/api/transfers_bank_api.rb +1 -1
- data/lib/cybrid_api_bank_ruby/api/verification_keys_bank_api.rb +1 -1
- data/lib/cybrid_api_bank_ruby/api/workflows_bank_api.rb +1 -1
- data/lib/cybrid_api_bank_ruby/api_client.rb +1 -1
- data/lib/cybrid_api_bank_ruby/api_error.rb +1 -1
- data/lib/cybrid_api_bank_ruby/configuration.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/account_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/account_list_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/asset_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/asset_list_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/bank_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/bank_list_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/customer_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/customer_list_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/deposit_address_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/deposit_address_list_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/error_response_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/external_bank_account_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/external_bank_account_list_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/external_wallet_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/external_wallet_list_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/identity_verification_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/identity_verification_list_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/identity_verification_with_details_all_of_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/identity_verification_with_details_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/patch_bank_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/patch_external_bank_account_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/post_account_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/post_bank_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/post_customer_address_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/post_customer_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/post_customer_name_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/post_deposit_address_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/post_external_bank_account_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/post_external_wallet_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/post_identification_number_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/post_identity_verification_address_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/post_identity_verification_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/post_identity_verification_name_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/post_one_time_address_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/post_quote_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/post_reward_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/post_trade_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/post_transfer_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/post_verification_key_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/post_workflow_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/quote_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/quote_list_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/reward_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/reward_list_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/symbol_price_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/trade_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/trade_list_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/transfer_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/transfer_list_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/verification_key_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/verification_key_list_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/workflow_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/workflow_with_details_all_of_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/workflow_with_details_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/models/workflows_list_bank_model.rb +1 -1
- data/lib/cybrid_api_bank_ruby/version.rb +2 -2
- data/lib/cybrid_api_bank_ruby.rb +1 -7
- data/spec/api/accounts_bank_api_spec.rb +1 -1
- data/spec/api/assets_bank_api_spec.rb +1 -1
- data/spec/api/banks_bank_api_spec.rb +1 -1
- data/spec/api/customers_bank_api_spec.rb +1 -1
- data/spec/api/deposit_addresses_bank_api_spec.rb +1 -1
- data/spec/api/external_bank_accounts_bank_api_spec.rb +1 -1
- data/spec/api/external_wallets_bank_api_spec.rb +1 -1
- data/spec/api/identity_verifications_bank_api_spec.rb +1 -1
- data/spec/api/prices_bank_api_spec.rb +1 -1
- data/spec/api/quotes_bank_api_spec.rb +1 -1
- data/spec/api/rewards_bank_api_spec.rb +1 -1
- data/spec/api/symbols_bank_api_spec.rb +1 -1
- data/spec/api/trades_bank_api_spec.rb +1 -1
- data/spec/api/transfers_bank_api_spec.rb +1 -1
- data/spec/api/verification_keys_bank_api_spec.rb +1 -1
- data/spec/api/workflows_bank_api_spec.rb +1 -1
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/account_bank_model_spec.rb +1 -1
- data/spec/models/account_list_bank_model_spec.rb +1 -1
- data/spec/models/asset_bank_model_spec.rb +1 -1
- data/spec/models/asset_list_bank_model_spec.rb +1 -1
- data/spec/models/bank_bank_model_spec.rb +1 -1
- data/spec/models/bank_list_bank_model_spec.rb +1 -1
- data/spec/models/customer_bank_model_spec.rb +1 -1
- data/spec/models/customer_list_bank_model_spec.rb +1 -1
- data/spec/models/deposit_address_bank_model_spec.rb +1 -1
- data/spec/models/deposit_address_list_bank_model_spec.rb +1 -1
- data/spec/models/error_response_bank_model_spec.rb +1 -1
- data/spec/models/external_bank_account_bank_model_spec.rb +1 -1
- data/spec/models/external_bank_account_list_bank_model_spec.rb +1 -1
- data/spec/models/external_wallet_bank_model_spec.rb +1 -1
- data/spec/models/external_wallet_list_bank_model_spec.rb +1 -1
- data/spec/models/identity_verification_bank_model_spec.rb +1 -1
- data/spec/models/identity_verification_list_bank_model_spec.rb +1 -1
- data/spec/models/identity_verification_with_details_all_of_bank_model_spec.rb +1 -1
- data/spec/models/identity_verification_with_details_bank_model_spec.rb +1 -1
- data/spec/models/patch_bank_bank_model_spec.rb +1 -1
- data/spec/models/patch_external_bank_account_bank_model_spec.rb +1 -1
- data/spec/models/post_account_bank_model_spec.rb +1 -1
- data/spec/models/post_bank_bank_model_spec.rb +1 -1
- data/spec/models/post_customer_address_bank_model_spec.rb +1 -1
- data/spec/models/post_customer_bank_model_spec.rb +1 -1
- data/spec/models/post_customer_name_bank_model_spec.rb +1 -1
- data/spec/models/post_deposit_address_bank_model_spec.rb +1 -1
- data/spec/models/post_external_bank_account_bank_model_spec.rb +1 -1
- data/spec/models/post_external_wallet_bank_model_spec.rb +1 -1
- data/spec/models/post_identification_number_bank_model_spec.rb +1 -1
- data/spec/models/post_identity_verification_address_bank_model_spec.rb +1 -1
- data/spec/models/post_identity_verification_bank_model_spec.rb +1 -1
- data/spec/models/post_identity_verification_name_bank_model_spec.rb +1 -1
- data/spec/models/post_one_time_address_bank_model_spec.rb +1 -1
- data/spec/models/post_quote_bank_model_spec.rb +1 -1
- data/spec/models/post_reward_bank_model_spec.rb +1 -1
- data/spec/models/post_trade_bank_model_spec.rb +1 -1
- data/spec/models/post_transfer_bank_model_spec.rb +1 -1
- data/spec/models/post_verification_key_bank_model_spec.rb +1 -1
- data/spec/models/post_workflow_bank_model_spec.rb +1 -1
- data/spec/models/quote_bank_model_spec.rb +1 -1
- data/spec/models/quote_list_bank_model_spec.rb +1 -1
- data/spec/models/reward_bank_model_spec.rb +1 -1
- data/spec/models/reward_list_bank_model_spec.rb +1 -1
- data/spec/models/symbol_price_bank_model_spec.rb +1 -1
- data/spec/models/trade_bank_model_spec.rb +1 -1
- data/spec/models/trade_list_bank_model_spec.rb +1 -1
- data/spec/models/transfer_bank_model_spec.rb +1 -1
- data/spec/models/transfer_list_bank_model_spec.rb +1 -1
- data/spec/models/verification_key_bank_model_spec.rb +1 -1
- data/spec/models/verification_key_list_bank_model_spec.rb +1 -1
- data/spec/models/workflow_bank_model_spec.rb +1 -1
- data/spec/models/workflow_with_details_all_of_bank_model_spec.rb +1 -1
- data/spec/models/workflow_with_details_bank_model_spec.rb +1 -1
- data/spec/models/workflows_list_bank_model_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-11.1.3/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/ffi-1.15.5/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.1.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.0.7/gem_make.out +5 -5
- metadata +1 -25
- data/docs/AttestationDetailsBankModel.md +0 -20
- data/docs/IdentityRecordBankModel.md +0 -28
- data/docs/IdentityRecordListBankModel.md +0 -24
- data/docs/IdentityRecordsBankApi.md +0 -232
- data/docs/PostIdentityRecordAttestationDetailsBankModel.md +0 -18
- data/docs/PostIdentityRecordBankModel.md +0 -22
- data/lib/cybrid_api_bank_ruby/api/identity_records_bank_api.rb +0 -231
- data/lib/cybrid_api_bank_ruby/models/attestation_details_bank_model.rb +0 -277
- data/lib/cybrid_api_bank_ruby/models/identity_record_bank_model.rb +0 -352
- data/lib/cybrid_api_bank_ruby/models/identity_record_list_bank_model.rb +0 -328
- data/lib/cybrid_api_bank_ruby/models/post_identity_record_attestation_details_bank_model.rb +0 -244
- data/lib/cybrid_api_bank_ruby/models/post_identity_record_bank_model.rb +0 -316
- data/spec/api/identity_records_bank_api_spec.rb +0 -73
- data/spec/models/attestation_details_bank_model_spec.rb +0 -48
- data/spec/models/identity_record_bank_model_spec.rb +0 -68
- data/spec/models/identity_record_list_bank_model_spec.rb +0 -52
- data/spec/models/post_identity_record_attestation_details_bank_model_spec.rb +0 -34
- data/spec/models/post_identity_record_bank_model_spec.rb +0 -50
@@ -1,231 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Cybrid Bank API
|
3
|
-
|
4
|
-
## Cybrid API documentation Welcome to Cybrid, an all-in-one crypto platform that enables you to easily **build** and **launch** white-label crypto products or services. In these documents, you'll find details on how our REST API operates and generally how our platform functions. If you're looking for our UI SDK Widgets for Web or Mobile (iOS/Android), generated API clients, or demo applications, head over to our [Github repo](https://github.com/Cybrid-app). 💡 We recommend bookmarking the [Cybrid LinkTree](https://linktr.ee/cybridtechnologies) which contains many helpful links to platform resources. ## Getting Started This is Cybrid's public interactive API documentation, which allows you to fully test our APIs. If you'd like to use a different tool to exercise our APIs, you can download the [Open API 3.0 yaml](https://bank.sandbox.cybrid.app/api/schema/v1/swagger.yaml) for import. If you're new to our APIs and the Cybrid Platform, follow the below guides to get set up and familiar with the platform: 1. [Understanding the Platform](https://kb.cybrid.xyz/understanding-the-platform) 2. [Getting Started in the Cybrid Sandbox](https://kb.cybrid.xyz/getting-started-guide) 3. [Getting Ready for Trading](https://kb.cybrid.xyz/getting-ready-for-trading) 4. [Running the Web Demo App](https://kb.cybrid.xyz/locally-running-the-web-demo-app) (or, alternatively, [Testing with Hosted Web Demo App](https://kb.cybrid.xyz/testing-with-hosted-web-demo-app)) In [Getting Started in the Cybrid Sandbox](https://www.cybrid.xyz/guides/getting-started), we walk you through how to use the [Cybrid Sandbox](https://id.sandbox.cybrid.app/) to create a test bank and generate API keys. In [Getting Ready for Trading](https://www.cybrid.xyz/guides/getting-ready-for-trading), we walk through creating customers, customer identities, accounts, as well as executing quotes and trades. If you've already run through the first two guides, you can follow the [Running the Web Demo App](https://www.cybrid.xyz/guides/running-the-cybrid-web-demo-crypto-app) guide to test our web SDK with your sandbox `bank` and `customer`. ## Working with the Cybrid Platform There are three primary ways you can interact with the Cybrid platform: 1. Directly via our RESTful API (this documentation) 2. Using our API clients available in a variety of languages ([Angular](https://github.com/Cybrid-app/cybrid-api-bank-angular), [Java](https://github.com/Cybrid-app/cybrid-api-bank-java), [Kotlin](https://github.com/Cybrid-app/cybrid-api-bank-kotlin), [Python](https://github.com/Cybrid-app/cybrid-api-bank-python), [Ruby](https://github.com/Cybrid-app/cybrid-api-bank-ruby), [Swift](https://github.com/Cybrid-app/cybrid-api-bank-swift) or [Typescript](https://github.com/Cybrid-app/cybrid-api-bank-typescript)) 3. Integrating a platform specific SDK ([Web](https://github.com/Cybrid-app/cybrid-sdk-web), [Android](https://github.com/Cybrid-app/cybrid-sdk-android), [iOS](https://github.com/Cybrid-app/cybrid-sdk-ios)) Our complete set of APIs allows you to manage resources across three distinct areas: your `Organization`, your `Banks` and your `Identities`. For most of your testing and interaction you'll be using the `Bank` API, which is where the majority of APIs reside. *The complete set of APIs can be found on the following pages:* | API | Description | |------------------------------------------------------------------|-------------------------------------------------------------| | [Organization API](https://organization.sandbox.cybrid.app/api/schema/swagger-ui) | APIs to manage organizations | | [Bank API](https://bank.sandbox.cybrid.app/api/schema/swagger-ui) | APIs to manage banks (and all downstream customer activity) | | [Identities API](https://id.sandbox.cybrid.app/api/schema/swagger-ui) | APIs to manage organization and bank identities | For questions please contact [Support](mailto:support@cybrid.xyz) at any time for assistance, or contact the [Product Team](mailto:product@cybrid.xyz) for product suggestions. ## Authenticating with the API The Cybrid Platform uses OAuth 2.0 Bearer Tokens to authenticate requests to the platform. Credentials to create `Organization` and `Bank` tokens can be generated via the [Cybrid Sandbox](https://id.sandbox.cybrid.app). Access tokens can be generated for a `Customer` as well via the [Cybrid IdP](https://id.sandbox.cybrid.app) as well. An `Organization` access token applies broadly to the whole Organization and all of its `Banks`, whereas, a `Bank` access token is specific to an individual Bank. `Customer` tokens, similarly, are scoped to a specific customer in a bank. Both `Organization` and `Bank` tokens can be created using the OAuth Client Credential Grant flow. Each Organization and Bank has its own unique `Client ID` and `Secret` that allows for machine-to-machine authentication. A `Bank` can then generate `Customer` access tokens via API using our [Identities API](https://id.sandbox.cybrid.app/api/schema/swagger-ui). <font color=\"orange\">**⚠️ Never share your Client ID or Secret publicly or in your source code repository.**</font> Your `Client ID` and `Secret` can be exchanged for a time-limited `Bearer Token` by interacting with the Cybrid Identity Provider or through interacting with the **Authorize** button in this document. The following curl command can be used to quickly generate a `Bearer Token` for use in testing the API or demo applications. ``` # Example request when using Bank credentials curl -X POST https://id.sandbox.cybrid.app/oauth/token -d '{ \"grant_type\": \"client_credentials\", \"client_id\": \"<Your Client ID>\", \"client_secret\": \"<Your Secret>\", \"scope\": \"banks:read banks:write accounts:read accounts:execute customers:read customers:write customers:execute prices:read quotes:execute quotes:read trades:execute trades:read transfers:execute transfers:read rewards:execute rewards:read external_bank_accounts:read external_bank_accounts:write external_bank_accounts:execute external_wallets:read external_wallets:execute workflows:read workflows:execute deposit_addresses:read deposit_addresses:execute\" }' -H \"Content-Type: application/json\" # When using Organization credentials set `scope` to 'organizations:read organizations:write banks:read banks:write banks:execute customers:read accounts:read prices:read quotes:execute quotes:read trades:execute trades:read transfers:read transfers:execute external_bank_accounts:read external_wallets:read workflows:read deposit_addresses:read' ``` <font color=\"orange\">**⚠️ Note: The above curl will create a bearer token with full scope access. Delete scopes if you'd like to restrict access.**</font> ## Authentication Scopes The Cybrid platform supports the use of scopes to control the level of access a token is limited to. Scopes do not grant access to resources; instead, they provide limits, in support of the least privilege principal. The following scopes are available on the platform and can be requested when generating either an Organization, Bank or Customer token. Generally speaking, the _Read_ scope is required to read and list resources, the _Write_ scope is required to update a resource and the _Execute_ scope is required to create a resource. | Resource | Read scope (Token Type) | Write scope (Token Type) | Execute scope (Token Type) | |-----------------------|------------------------------------------------------------|-----------------------------------------------|--------------------------------------------------| | Account | accounts:read (Organization, Bank, Customer) | | accounts:execute (Bank, Customer) | | Bank | banks:read (Organization, Bank) | banks:write (Organization, Bank) | banks:execute (Organization) | | Customer | customers:read (Organization, Bank, Customer) | customers:write (Bank, Customer) | customers:execute (Bank) | | Deposit Address | deposit_addresses:read (Organization, Bank, Customer) | deposit_addresses:write (Bank, Customer) | deposit_addresses:execute (Bank, Customer) | | External Bank Account | external_bank_accounts:read (Organization, Bank, Customer) | external_bank_accounts:write (Bank, Customer) | external_bank_accounts:execute (Bank, Customer) | | External Wallet | external_wallet:read (Organization, Bank, Customer) | | external_wallet:execute (Bank, Customer) | | Organization | organizations:read (Organization) | organizations:write (Organization) | | | Price | prices:read (Bank, Customer) | | | | Quote | quotes:read (Organization, Bank, Customer) | | quotes:execute (Organization, Bank, Customer) | | Reward | rewards:read (Bank, Customer) | | rewards:execute (Bank) | | Trade | trades:read (Organization, Bank, Customer) | | trades:execute (Organization, Bank, Customer) | | Transfer | transfers:read (Organization, Bank, Customer) | | transfers:execute (Organization, Bank, Customer) | | Workflow | workflows:read (Organization, Bank, Customer) | | workflows:execute (Bank, Customer) | ## Available Endpoints The available APIs for the [Identity](https://id.sandbox.cybrid.app/api/schema/swagger-ui), [Organization](https://organization.sandbox.cybrid.app/api/schema/swagger-ui) and [Bank](https://bank.sandbox.cybrid.app/api/schema/swagger-ui) API services are listed below: | API Service | Model | API Endpoint Path | Description | |--------------|----------------------|--------------------------------|---------------------------------------------------------------------------------------------------| | Identity | Bank | /api/bank_applications | Create and list banks | | Identity | CustomerToken | /api/customer_tokens | Create customer JWT access tokens | | Identity | Organization | /api/organization_applications | Create and list organizations | | Organization | Organization | /api/organizations | APIs to retrieve and update organization name | | Bank | Account | /api/accounts | Create and list accounts, which hold a specific asset for a customers | | Bank | Asset | /api/assets | Get a list of assets supported by the platform (ex: BTC, ETH) | | Bank | Bank | /api/banks | Create, update and list banks, the parent to customers, accounts, etc | | Bank | BankVerificationKey | /api/bank_verification_keys | Create, list and retrive verification keys, used for signing identities | | Bank | Customer | /api/customers | Create and list customers | | Bank | DepositAddress | /api/deposit_addresses | Create, get and list deposit addresses | | Bank | ExternalBankAccount | /api/external_bank_accounts | Create, get and list external bank accounts, which connect customer bank accounts to the platform | | Bank | ExternalWallet | /api/external_wallets | Create, get, list and delete external wallets, which connect customer wallets to the platform | | Bank | IdentityVerification | /api/identity_verifications | Create and list identity verifications, which are performed on customers for KYC | | Bank | Price | /api/prices | Get the current prices for assets on the platform | | Bank | Quote | /api/quotes | Create and list quotes, which are required to execute trades | | Bank | Reward | /api/rewards | Create a new reward (automates quote/trade for simplicity) | | Bank | Symbol | /api/symbols | Get a list of symbols supported for trade (ex: BTC-USD) | | Bank | Trade | /api/trades | Create and list trades, which buy or sell cryptocurrency | | Bank | Transfer | /api/transfers | Create, get and list transfers (e.g., funding, book) | | Bank | Workflow | /api/workflows | Create, get and list workflows | ## Understanding Object Models & Endpoints **Organizations** An `Organization` is meant to represent the organization partnering with Cybrid to use our platform. An `Organization` typically does not directly interact with `customers`. Instead, an Organization has one or more `banks`, which encompass the financial service offerings of the platform. **Banks** A `Bank` is owned by an `Organization` and can be thought of as an environment or container for `customers` and product offerings. Banks are created in either `Sandbox` or `Production` mode, where `Sandbox` is the environment that you would test, prototype and build in prior to moving to `Production`. An `Organization` can have multiple `banks`, in either `Sandbox` or `Production` environments. A `Sandbox Bank` will be backed by stubbed data and process flows. For instance, funding source transfer processes as well as trades will be simulated rather than performed, however asset prices are representative of real-world values. You have an unlimited amount of simulated fiat currency for testing purposes. **Customers** `Customers` represent your banking users on the platform. At present, we offer support for `Individuals` as Customers. `Customers` must be verified (i.e., KYC'd) in our system before they can play any part on the platform, which means they must have an associated and a passing `Identity Verification`. See the Identity Verifications section for more details on how a customer can be verified. `Customers` must also have an `Account` to be able to transact, in the desired asset class. See the Accounts APIs for more details on setting up accounts for the customer.
|
5
|
-
|
6
|
-
The version of the OpenAPI document: v0.71.72
|
7
|
-
Contact: support@cybrid.app
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 6.0.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'cgi'
|
14
|
-
|
15
|
-
module CybridApiBank
|
16
|
-
class IdentityRecordsBankApi
|
17
|
-
attr_accessor :api_client
|
18
|
-
|
19
|
-
def initialize(api_client = ApiClient.default)
|
20
|
-
@api_client = api_client
|
21
|
-
end
|
22
|
-
# Create Identity Record
|
23
|
-
# Creates an identity record. ## Identity Records Identity Records verify an individual for inclusion on the platform. This know-your-customer (KYC) process is a requirement for individuals to be able to transact. At present, we offer support for Attestation Identity Records. Once an Identity Record has been submitted, it will be reviewed by our system and transit through a lifecycle before ultimately being `verified` or `failed`. If an Identity Record is ends up `failed`, contextual information as to the reason may be provided on the resource and additional attempts can be made. ## Attestation Identity Records An Attestation Identity Record is a confirmation of fact that the Organization has completed their own KYC process and can vouch for its correctness. Prior to uploading `verified` attestation identity records, an Organization must register their signing public key with their Bank through the create Verification Key API. To create an attestation identity record, a signed JWT is required as proof that the Customer's identity has been verified by the Organization. When creating the JWT, the Organization must use the RS512 signing algorithm. The JWT must contain the following headers: - **alg**: The RS512 algorithm value, e.g., 'RS512'. - **kid**: Set to the guid of the verification key that has been registered for the Bank The JWT must contain the following claims: - **iss**: Set to http://api.cybrid.app/banks/{bank_guid} - **aud**: Set to http://api.cybrid.app - **sub**: Set to http://api.cybrid.app/customers/{customer_guid} - **iat**: Set to the time at which the JWT was issued - **exp**: Set to the time after which the JWT expires - **jti**: Set to a unique identifier for the JWT Example code (python) for generating an Attestation Identity Record JWT token: ```python # Assumes an RSA private key has been generated (`private_key`), a Verification Key has been created and a `verification_key_guid` is available. # # `customer_guid` should be set to the guid assigned to a Customer that has been created. # `bank_guid` should be set to the guid of your bank # import uuid from datetime import datetime, timezone, timedelta from jwcrypto import jwt, jwk from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives.serialization import load_pem_private_key algorithm = 'RS512' issued_at = datetime.now(timezone.utc) expired_at = issued_at + timedelta(days=365) with open(\"verification_key.pem\", 'rb') as pem_in: pem_lines = pem_in.read() private_key = load_pem_private_key(pem_lines, None) ### DISCLAIMER:- Since NO ENCRYPTION is used in the key storage/formatting. Please DO NOT use this code in production environment. signing_key = jwk.JWK.from_pem( private_key.private_bytes( encoding=serialization.Encoding.PEM, format=serialization.PrivateFormat.PKCS8, encryption_algorithm=serialization.NoEncryption() ) ) signing_key.update({\"kid\": verification_key_guid}) attestation_jwt = jwt.JWT( header={ \"alg\": algorithm, \"kid\": verification_key_guid }, claims={ \"iss\": f\"http://api.cybrid.app/banks/{bank_guid}\", \"aud\": \"http://api.cybrid.app\", \"sub\": f\"http://api.cybrid.app/customers/{customer_guid}\", \"iat\": int(issued_at.timestamp()), \"exp\": int(expired_at.timestamp()), \"jti\": str(uuid.uuid4()) }, key=signing_key, algs=[algorithm] ) attestation_jwt.make_signed_token(signing_key) token = attestation_jwt.serialize(compact=True) print(\"Token is : \", token) ``` ## Default Attestation Signing Key The Cybrid Sandbox environment comes provisioned with a default signing key that can be used to perform identity record attestation. The default identity signing key provides a convenient starting point for testing Sandbox flows that require identity attestation, such as executing trades. The signing key can be loaded directly into a client application by passing its PEM encoded value as an environment variable. ``` -----BEGIN PRIVATE KEY----- MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDZ75nSfJy/eeuj 4f7EK7i+n4FUDE8BsD/acCdk9Pn56suuDc3SFcMoyjBIoDLZkbRsVfmBEcPDNJOp GNqzoaXa7qe7Yw0qpK9MbNbAYxiyAfxwVHM+ZpwP6M/r3LmsCRFXgNdCjfOzok7u V59hDjfHMMQm/M9ztGVhaJpgozY/7DKk+R6qY/DEBs63eXwfcHE0u0NbS8Y9Qp+6 7cB2f1iuy++5Uut1vx4qdgZ4UFMkwIdTWl/e6LDcdXhk3///T5WOnDlI+S4rhGUO xsAOfOa+T9uqYBr2hbQR9emTEYmwF1lgZ7VU4S9sSjAMKpB/TVlVVOsNhdNSGg6f 6hu7fuadAgMBAAECggEBAMUJL1VyfHVRUY5VoPTTYrBVnaPTjQrFwrVHeRZ5thgS BBxVNqSeMFgMlSLUU6UJasoX4QCkgw1V17qmUfTeTQlnhBaTMzA+vI6oSHCgJ4+o 5AbbE2Zzdt2ba4Cfiu7TM+6c+gGePZtHP32Vku84340jtfRZ1WWSz6YF4K1GYqHe y7I4POotHu2WcSTXYKs2zTu5KAO7gvx7yITVytaiUGUHk9FNyZPDIh0u7e9CAEti BangdYTfvbXAIx9lrg3XQ4gtFXTd0aY/3R9K3SE+s5iWh/SabjV4U7x+MuHZS5kv 8rcLCPQ5kUgiF4bQMy7QznUuNso65SbRJKHaU8UAuIECgYEA7+bNdz/uiN/JxUJY 3xwjD+CG4vXOyEmCioBjllYBeXQyB/VrsdzVrdF2JiECnStPRH6/6nd7/wUcLORv NyrQqnCa5/O8Kv9Z3t4TmxYf+ECIgx+gazehQHptUkr8QWtxceorUC9pu4cUJ8z3 nQLCggHYQ3g7xj73LLZ+5QQBC8kCgYEA6I91Dgs+HZWDMMcGbKV2cMkXK8BTOgZZ 6B6i6flO4tf9U2CPBZsjYLBN5EEuxxy9Yl7rlV7CxAhnnjdIKk2jQbzTPI0qmJfp 397rvdR8bur1OkALj2Tb39fz8z1Qy7AcN8siqXuortZZ5OI9XRWgnG/3B4gUFOnW 4Mr0dhfaxjUCgYEAmVcricehjneMnrtz1thDSQi47yUzES57dE/wV82Nj7ZHrHKg bcW8ByhVnrWG2DMwrZVe0l2hMjZv9fnlZJvHWMo1GYHfipRBO4UzfvO7Z5DIMRfs D9w1A+O9MNahOqeUkb2eBdjoemcy6OXId+Gltje7phSaEHN6xme34GaYzJECgYBP eRbLYdQsT/exJ5JudmzvRgkBDoxie+EljbKmumfW5XDQmWLGy6lfVWCI7C2MJaoi f8WKGgP88dJXIxUqP7XWtSyKuMMhumhV9Nwi1wZe8TQ0X8aTjigFassXCJEfymMa PfTubi/K771wlk/aC5YDX8/PZxVVwEOKNlEsOiKtMQKBgQDqRv5AUHhabqcMfbs7 DTeo/fS/eXJv8MN+CUU2RSrNUKjEdHT2R5KP550TyXr1JXLKpEEZu8wvvaQDV4Dw p0Eij6bKsh03X38NR+C5SxonXPosdvoiXR8uUgya2f/aJYV+aWZ9euFgYZAXf/0Q MnWdKylfZlV50XP2KFn07wPs7w== -----END PRIVATE KEY----- ``` A corresponding public verification key can be retrieved from the Cybrid Banks API using the `/api/bank_verification_keys` endpoint. Performing a `get` request to this endpoint returns the available Verification Key records, the first of which is the provisioned default. The endpoint can be hit directly or by using the Cybrid Banks API client: ```python ... api_client = cybrid_api_bank.ApiClient(configuration) api_instance = verification_keys_bank_api.VerificationKeysBankApi(api_client) verification_keys = api_instance.list_verification_keys() verification_key = verification_keys.objects[0] ``` Once available to the application, the signing key and Verification Key record can be used in conjunction to create the attestation JWT. The Verification Key's GUID is passed as the JWT's `kid` while the signing key is used to sign the JWT. ## Attestation State | State | Description | |-------|-------------| | storing | The Platform is storing the attestation in our private store | | pending | The Platform is verifying the attestation's JWT | | verified | The Platform has verified the attestation and the customer is able to transact | | failed | The Platform was not able to verify the attestation and the customer is not able to transact | Required scope: **customers:write**
|
24
|
-
# @param post_identity_record_bank_model [PostIdentityRecordBankModel]
|
25
|
-
# @param [Hash] opts the optional parameters
|
26
|
-
# @return [IdentityRecordBankModel]
|
27
|
-
def create_identity_record(post_identity_record_bank_model, opts = {})
|
28
|
-
data, _status_code, _headers = create_identity_record_with_http_info(post_identity_record_bank_model, opts)
|
29
|
-
data
|
30
|
-
end
|
31
|
-
|
32
|
-
# Create Identity Record
|
33
|
-
# Creates an identity record. ## Identity Records Identity Records verify an individual for inclusion on the platform. This know-your-customer (KYC) process is a requirement for individuals to be able to transact. At present, we offer support for Attestation Identity Records. Once an Identity Record has been submitted, it will be reviewed by our system and transit through a lifecycle before ultimately being `verified` or `failed`. If an Identity Record is ends up `failed`, contextual information as to the reason may be provided on the resource and additional attempts can be made. ## Attestation Identity Records An Attestation Identity Record is a confirmation of fact that the Organization has completed their own KYC process and can vouch for its correctness. Prior to uploading `verified` attestation identity records, an Organization must register their signing public key with their Bank through the create Verification Key API. To create an attestation identity record, a signed JWT is required as proof that the Customer's identity has been verified by the Organization. When creating the JWT, the Organization must use the RS512 signing algorithm. The JWT must contain the following headers: - **alg**: The RS512 algorithm value, e.g., 'RS512'. - **kid**: Set to the guid of the verification key that has been registered for the Bank The JWT must contain the following claims: - **iss**: Set to http://api.cybrid.app/banks/{bank_guid} - **aud**: Set to http://api.cybrid.app - **sub**: Set to http://api.cybrid.app/customers/{customer_guid} - **iat**: Set to the time at which the JWT was issued - **exp**: Set to the time after which the JWT expires - **jti**: Set to a unique identifier for the JWT Example code (python) for generating an Attestation Identity Record JWT token: ```python # Assumes an RSA private key has been generated (`private_key`), a Verification Key has been created and a `verification_key_guid` is available. # # `customer_guid` should be set to the guid assigned to a Customer that has been created. # `bank_guid` should be set to the guid of your bank # import uuid from datetime import datetime, timezone, timedelta from jwcrypto import jwt, jwk from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives.serialization import load_pem_private_key algorithm = 'RS512' issued_at = datetime.now(timezone.utc) expired_at = issued_at + timedelta(days=365) with open(\"verification_key.pem\", 'rb') as pem_in: pem_lines = pem_in.read() private_key = load_pem_private_key(pem_lines, None) ### DISCLAIMER:- Since NO ENCRYPTION is used in the key storage/formatting. Please DO NOT use this code in production environment. signing_key = jwk.JWK.from_pem( private_key.private_bytes( encoding=serialization.Encoding.PEM, format=serialization.PrivateFormat.PKCS8, encryption_algorithm=serialization.NoEncryption() ) ) signing_key.update({\"kid\": verification_key_guid}) attestation_jwt = jwt.JWT( header={ \"alg\": algorithm, \"kid\": verification_key_guid }, claims={ \"iss\": f\"http://api.cybrid.app/banks/{bank_guid}\", \"aud\": \"http://api.cybrid.app\", \"sub\": f\"http://api.cybrid.app/customers/{customer_guid}\", \"iat\": int(issued_at.timestamp()), \"exp\": int(expired_at.timestamp()), \"jti\": str(uuid.uuid4()) }, key=signing_key, algs=[algorithm] ) attestation_jwt.make_signed_token(signing_key) token = attestation_jwt.serialize(compact=True) print(\"Token is : \", token) ``` ## Default Attestation Signing Key The Cybrid Sandbox environment comes provisioned with a default signing key that can be used to perform identity record attestation. The default identity signing key provides a convenient starting point for testing Sandbox flows that require identity attestation, such as executing trades. The signing key can be loaded directly into a client application by passing its PEM encoded value as an environment variable. ``` -----BEGIN PRIVATE KEY----- MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDZ75nSfJy/eeuj 4f7EK7i+n4FUDE8BsD/acCdk9Pn56suuDc3SFcMoyjBIoDLZkbRsVfmBEcPDNJOp GNqzoaXa7qe7Yw0qpK9MbNbAYxiyAfxwVHM+ZpwP6M/r3LmsCRFXgNdCjfOzok7u V59hDjfHMMQm/M9ztGVhaJpgozY/7DKk+R6qY/DEBs63eXwfcHE0u0NbS8Y9Qp+6 7cB2f1iuy++5Uut1vx4qdgZ4UFMkwIdTWl/e6LDcdXhk3///T5WOnDlI+S4rhGUO xsAOfOa+T9uqYBr2hbQR9emTEYmwF1lgZ7VU4S9sSjAMKpB/TVlVVOsNhdNSGg6f 6hu7fuadAgMBAAECggEBAMUJL1VyfHVRUY5VoPTTYrBVnaPTjQrFwrVHeRZ5thgS BBxVNqSeMFgMlSLUU6UJasoX4QCkgw1V17qmUfTeTQlnhBaTMzA+vI6oSHCgJ4+o 5AbbE2Zzdt2ba4Cfiu7TM+6c+gGePZtHP32Vku84340jtfRZ1WWSz6YF4K1GYqHe y7I4POotHu2WcSTXYKs2zTu5KAO7gvx7yITVytaiUGUHk9FNyZPDIh0u7e9CAEti BangdYTfvbXAIx9lrg3XQ4gtFXTd0aY/3R9K3SE+s5iWh/SabjV4U7x+MuHZS5kv 8rcLCPQ5kUgiF4bQMy7QznUuNso65SbRJKHaU8UAuIECgYEA7+bNdz/uiN/JxUJY 3xwjD+CG4vXOyEmCioBjllYBeXQyB/VrsdzVrdF2JiECnStPRH6/6nd7/wUcLORv NyrQqnCa5/O8Kv9Z3t4TmxYf+ECIgx+gazehQHptUkr8QWtxceorUC9pu4cUJ8z3 nQLCggHYQ3g7xj73LLZ+5QQBC8kCgYEA6I91Dgs+HZWDMMcGbKV2cMkXK8BTOgZZ 6B6i6flO4tf9U2CPBZsjYLBN5EEuxxy9Yl7rlV7CxAhnnjdIKk2jQbzTPI0qmJfp 397rvdR8bur1OkALj2Tb39fz8z1Qy7AcN8siqXuortZZ5OI9XRWgnG/3B4gUFOnW 4Mr0dhfaxjUCgYEAmVcricehjneMnrtz1thDSQi47yUzES57dE/wV82Nj7ZHrHKg bcW8ByhVnrWG2DMwrZVe0l2hMjZv9fnlZJvHWMo1GYHfipRBO4UzfvO7Z5DIMRfs D9w1A+O9MNahOqeUkb2eBdjoemcy6OXId+Gltje7phSaEHN6xme34GaYzJECgYBP eRbLYdQsT/exJ5JudmzvRgkBDoxie+EljbKmumfW5XDQmWLGy6lfVWCI7C2MJaoi f8WKGgP88dJXIxUqP7XWtSyKuMMhumhV9Nwi1wZe8TQ0X8aTjigFassXCJEfymMa PfTubi/K771wlk/aC5YDX8/PZxVVwEOKNlEsOiKtMQKBgQDqRv5AUHhabqcMfbs7 DTeo/fS/eXJv8MN+CUU2RSrNUKjEdHT2R5KP550TyXr1JXLKpEEZu8wvvaQDV4Dw p0Eij6bKsh03X38NR+C5SxonXPosdvoiXR8uUgya2f/aJYV+aWZ9euFgYZAXf/0Q MnWdKylfZlV50XP2KFn07wPs7w== -----END PRIVATE KEY----- ``` A corresponding public verification key can be retrieved from the Cybrid Banks API using the `/api/bank_verification_keys` endpoint. Performing a `get` request to this endpoint returns the available Verification Key records, the first of which is the provisioned default. The endpoint can be hit directly or by using the Cybrid Banks API client: ```python ... api_client = cybrid_api_bank.ApiClient(configuration) api_instance = verification_keys_bank_api.VerificationKeysBankApi(api_client) verification_keys = api_instance.list_verification_keys() verification_key = verification_keys.objects[0] ``` Once available to the application, the signing key and Verification Key record can be used in conjunction to create the attestation JWT. The Verification Key's GUID is passed as the JWT's `kid` while the signing key is used to sign the JWT. ## Attestation State | State | Description | |-------|-------------| | storing | The Platform is storing the attestation in our private store | | pending | The Platform is verifying the attestation's JWT | | verified | The Platform has verified the attestation and the customer is able to transact | | failed | The Platform was not able to verify the attestation and the customer is not able to transact | Required scope: **customers:write**
|
34
|
-
# @param post_identity_record_bank_model [PostIdentityRecordBankModel]
|
35
|
-
# @param [Hash] opts the optional parameters
|
36
|
-
# @return [Array<(IdentityRecordBankModel, Integer, Hash)>] IdentityRecordBankModel data, response status code and response headers
|
37
|
-
def create_identity_record_with_http_info(post_identity_record_bank_model, opts = {})
|
38
|
-
if @api_client.config.debugging
|
39
|
-
@api_client.config.logger.debug 'Calling API: IdentityRecordsBankApi.create_identity_record ...'
|
40
|
-
end
|
41
|
-
# verify the required parameter 'post_identity_record_bank_model' is set
|
42
|
-
if @api_client.config.client_side_validation && post_identity_record_bank_model.nil?
|
43
|
-
fail ArgumentError, "Missing the required parameter 'post_identity_record_bank_model' when calling IdentityRecordsBankApi.create_identity_record"
|
44
|
-
end
|
45
|
-
# resource path
|
46
|
-
local_var_path = '/api/identity_records'
|
47
|
-
|
48
|
-
# query parameters
|
49
|
-
query_params = opts[:query_params] || {}
|
50
|
-
|
51
|
-
# header parameters
|
52
|
-
header_params = opts[:header_params] || {}
|
53
|
-
# HTTP header 'Accept' (if needed)
|
54
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
55
|
-
# HTTP header 'Content-Type'
|
56
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
57
|
-
if !content_type.nil?
|
58
|
-
header_params['Content-Type'] = content_type
|
59
|
-
end
|
60
|
-
|
61
|
-
# form parameters
|
62
|
-
form_params = opts[:form_params] || {}
|
63
|
-
|
64
|
-
# http body (model)
|
65
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(post_identity_record_bank_model)
|
66
|
-
|
67
|
-
# return_type
|
68
|
-
return_type = opts[:debug_return_type] || 'IdentityRecordBankModel'
|
69
|
-
|
70
|
-
# auth_names
|
71
|
-
auth_names = opts[:debug_auth_names] || ['BearerAuth', 'oauth2']
|
72
|
-
|
73
|
-
new_options = opts.merge(
|
74
|
-
:operation => :"IdentityRecordsBankApi.create_identity_record",
|
75
|
-
:header_params => header_params,
|
76
|
-
:query_params => query_params,
|
77
|
-
:form_params => form_params,
|
78
|
-
:body => post_body,
|
79
|
-
:auth_names => auth_names,
|
80
|
-
:return_type => return_type
|
81
|
-
)
|
82
|
-
|
83
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
84
|
-
if @api_client.config.debugging
|
85
|
-
@api_client.config.logger.debug "API called: IdentityRecordsBankApi#create_identity_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
86
|
-
end
|
87
|
-
return data, status_code, headers
|
88
|
-
end
|
89
|
-
|
90
|
-
# Get Identity Record
|
91
|
-
# Retrieves an identity record. Required scope: **customers:read**
|
92
|
-
# @param identity_record_guid [String] Identifier for the identity record.
|
93
|
-
# @param [Hash] opts the optional parameters
|
94
|
-
# @return [IdentityRecordBankModel]
|
95
|
-
def get_identity_record(identity_record_guid, opts = {})
|
96
|
-
data, _status_code, _headers = get_identity_record_with_http_info(identity_record_guid, opts)
|
97
|
-
data
|
98
|
-
end
|
99
|
-
|
100
|
-
# Get Identity Record
|
101
|
-
# Retrieves an identity record. Required scope: **customers:read**
|
102
|
-
# @param identity_record_guid [String] Identifier for the identity record.
|
103
|
-
# @param [Hash] opts the optional parameters
|
104
|
-
# @return [Array<(IdentityRecordBankModel, Integer, Hash)>] IdentityRecordBankModel data, response status code and response headers
|
105
|
-
def get_identity_record_with_http_info(identity_record_guid, opts = {})
|
106
|
-
if @api_client.config.debugging
|
107
|
-
@api_client.config.logger.debug 'Calling API: IdentityRecordsBankApi.get_identity_record ...'
|
108
|
-
end
|
109
|
-
# verify the required parameter 'identity_record_guid' is set
|
110
|
-
if @api_client.config.client_side_validation && identity_record_guid.nil?
|
111
|
-
fail ArgumentError, "Missing the required parameter 'identity_record_guid' when calling IdentityRecordsBankApi.get_identity_record"
|
112
|
-
end
|
113
|
-
# resource path
|
114
|
-
local_var_path = '/api/identity_records/{identity_record_guid}'.sub('{' + 'identity_record_guid' + '}', CGI.escape(identity_record_guid.to_s))
|
115
|
-
|
116
|
-
# query parameters
|
117
|
-
query_params = opts[:query_params] || {}
|
118
|
-
|
119
|
-
# header parameters
|
120
|
-
header_params = opts[:header_params] || {}
|
121
|
-
# HTTP header 'Accept' (if needed)
|
122
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
123
|
-
|
124
|
-
# form parameters
|
125
|
-
form_params = opts[:form_params] || {}
|
126
|
-
|
127
|
-
# http body (model)
|
128
|
-
post_body = opts[:debug_body]
|
129
|
-
|
130
|
-
# return_type
|
131
|
-
return_type = opts[:debug_return_type] || 'IdentityRecordBankModel'
|
132
|
-
|
133
|
-
# auth_names
|
134
|
-
auth_names = opts[:debug_auth_names] || ['BearerAuth', 'oauth2']
|
135
|
-
|
136
|
-
new_options = opts.merge(
|
137
|
-
:operation => :"IdentityRecordsBankApi.get_identity_record",
|
138
|
-
:header_params => header_params,
|
139
|
-
:query_params => query_params,
|
140
|
-
:form_params => form_params,
|
141
|
-
:body => post_body,
|
142
|
-
:auth_names => auth_names,
|
143
|
-
:return_type => return_type
|
144
|
-
)
|
145
|
-
|
146
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
147
|
-
if @api_client.config.debugging
|
148
|
-
@api_client.config.logger.debug "API called: IdentityRecordsBankApi#get_identity_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
149
|
-
end
|
150
|
-
return data, status_code, headers
|
151
|
-
end
|
152
|
-
|
153
|
-
# List Identity Records
|
154
|
-
# Retrieves a listing of identity records for a bank. Required scope: **customers:read**
|
155
|
-
# @param [Hash] opts the optional parameters
|
156
|
-
# @option opts [String] :customer_guid Comma separated customer identifier to list identity records for.
|
157
|
-
# @option opts [Integer] :page
|
158
|
-
# @option opts [Integer] :per_page
|
159
|
-
# @return [IdentityRecordListBankModel]
|
160
|
-
def list_identity_records(opts = {})
|
161
|
-
data, _status_code, _headers = list_identity_records_with_http_info(opts)
|
162
|
-
data
|
163
|
-
end
|
164
|
-
|
165
|
-
# List Identity Records
|
166
|
-
# Retrieves a listing of identity records for a bank. Required scope: **customers:read**
|
167
|
-
# @param [Hash] opts the optional parameters
|
168
|
-
# @option opts [String] :customer_guid Comma separated customer identifier to list identity records for.
|
169
|
-
# @option opts [Integer] :page
|
170
|
-
# @option opts [Integer] :per_page
|
171
|
-
# @return [Array<(IdentityRecordListBankModel, Integer, Hash)>] IdentityRecordListBankModel data, response status code and response headers
|
172
|
-
def list_identity_records_with_http_info(opts = {})
|
173
|
-
if @api_client.config.debugging
|
174
|
-
@api_client.config.logger.debug 'Calling API: IdentityRecordsBankApi.list_identity_records ...'
|
175
|
-
end
|
176
|
-
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
|
177
|
-
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling IdentityRecordsBankApi.list_identity_records, must be greater than or equal to 0.'
|
178
|
-
end
|
179
|
-
|
180
|
-
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
|
181
|
-
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling IdentityRecordsBankApi.list_identity_records, must be smaller than or equal to 100.'
|
182
|
-
end
|
183
|
-
|
184
|
-
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
|
185
|
-
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling IdentityRecordsBankApi.list_identity_records, must be greater than or equal to 1.'
|
186
|
-
end
|
187
|
-
|
188
|
-
# resource path
|
189
|
-
local_var_path = '/api/identity_records'
|
190
|
-
|
191
|
-
# query parameters
|
192
|
-
query_params = opts[:query_params] || {}
|
193
|
-
query_params[:'customer_guid'] = opts[:'customer_guid'] if !opts[:'customer_guid'].nil?
|
194
|
-
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
195
|
-
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
196
|
-
|
197
|
-
# header parameters
|
198
|
-
header_params = opts[:header_params] || {}
|
199
|
-
# HTTP header 'Accept' (if needed)
|
200
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
201
|
-
|
202
|
-
# form parameters
|
203
|
-
form_params = opts[:form_params] || {}
|
204
|
-
|
205
|
-
# http body (model)
|
206
|
-
post_body = opts[:debug_body]
|
207
|
-
|
208
|
-
# return_type
|
209
|
-
return_type = opts[:debug_return_type] || 'IdentityRecordListBankModel'
|
210
|
-
|
211
|
-
# auth_names
|
212
|
-
auth_names = opts[:debug_auth_names] || ['BearerAuth', 'oauth2']
|
213
|
-
|
214
|
-
new_options = opts.merge(
|
215
|
-
:operation => :"IdentityRecordsBankApi.list_identity_records",
|
216
|
-
:header_params => header_params,
|
217
|
-
:query_params => query_params,
|
218
|
-
:form_params => form_params,
|
219
|
-
:body => post_body,
|
220
|
-
:auth_names => auth_names,
|
221
|
-
:return_type => return_type
|
222
|
-
)
|
223
|
-
|
224
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
225
|
-
if @api_client.config.debugging
|
226
|
-
@api_client.config.logger.debug "API called: IdentityRecordsBankApi#list_identity_records\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
227
|
-
end
|
228
|
-
return data, status_code, headers
|
229
|
-
end
|
230
|
-
end
|
231
|
-
end
|
@@ -1,277 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Cybrid Bank API
|
3
|
-
|
4
|
-
## Cybrid API documentation Welcome to Cybrid, an all-in-one crypto platform that enables you to easily **build** and **launch** white-label crypto products or services. In these documents, you'll find details on how our REST API operates and generally how our platform functions. If you're looking for our UI SDK Widgets for Web or Mobile (iOS/Android), generated API clients, or demo applications, head over to our [Github repo](https://github.com/Cybrid-app). 💡 We recommend bookmarking the [Cybrid LinkTree](https://linktr.ee/cybridtechnologies) which contains many helpful links to platform resources. ## Getting Started This is Cybrid's public interactive API documentation, which allows you to fully test our APIs. If you'd like to use a different tool to exercise our APIs, you can download the [Open API 3.0 yaml](https://bank.sandbox.cybrid.app/api/schema/v1/swagger.yaml) for import. If you're new to our APIs and the Cybrid Platform, follow the below guides to get set up and familiar with the platform: 1. [Understanding the Platform](https://kb.cybrid.xyz/understanding-the-platform) 2. [Getting Started in the Cybrid Sandbox](https://kb.cybrid.xyz/getting-started-guide) 3. [Getting Ready for Trading](https://kb.cybrid.xyz/getting-ready-for-trading) 4. [Running the Web Demo App](https://kb.cybrid.xyz/locally-running-the-web-demo-app) (or, alternatively, [Testing with Hosted Web Demo App](https://kb.cybrid.xyz/testing-with-hosted-web-demo-app)) In [Getting Started in the Cybrid Sandbox](https://www.cybrid.xyz/guides/getting-started), we walk you through how to use the [Cybrid Sandbox](https://id.sandbox.cybrid.app/) to create a test bank and generate API keys. In [Getting Ready for Trading](https://www.cybrid.xyz/guides/getting-ready-for-trading), we walk through creating customers, customer identities, accounts, as well as executing quotes and trades. If you've already run through the first two guides, you can follow the [Running the Web Demo App](https://www.cybrid.xyz/guides/running-the-cybrid-web-demo-crypto-app) guide to test our web SDK with your sandbox `bank` and `customer`. ## Working with the Cybrid Platform There are three primary ways you can interact with the Cybrid platform: 1. Directly via our RESTful API (this documentation) 2. Using our API clients available in a variety of languages ([Angular](https://github.com/Cybrid-app/cybrid-api-bank-angular), [Java](https://github.com/Cybrid-app/cybrid-api-bank-java), [Kotlin](https://github.com/Cybrid-app/cybrid-api-bank-kotlin), [Python](https://github.com/Cybrid-app/cybrid-api-bank-python), [Ruby](https://github.com/Cybrid-app/cybrid-api-bank-ruby), [Swift](https://github.com/Cybrid-app/cybrid-api-bank-swift) or [Typescript](https://github.com/Cybrid-app/cybrid-api-bank-typescript)) 3. Integrating a platform specific SDK ([Web](https://github.com/Cybrid-app/cybrid-sdk-web), [Android](https://github.com/Cybrid-app/cybrid-sdk-android), [iOS](https://github.com/Cybrid-app/cybrid-sdk-ios)) Our complete set of APIs allows you to manage resources across three distinct areas: your `Organization`, your `Banks` and your `Identities`. For most of your testing and interaction you'll be using the `Bank` API, which is where the majority of APIs reside. *The complete set of APIs can be found on the following pages:* | API | Description | |------------------------------------------------------------------|-------------------------------------------------------------| | [Organization API](https://organization.sandbox.cybrid.app/api/schema/swagger-ui) | APIs to manage organizations | | [Bank API](https://bank.sandbox.cybrid.app/api/schema/swagger-ui) | APIs to manage banks (and all downstream customer activity) | | [Identities API](https://id.sandbox.cybrid.app/api/schema/swagger-ui) | APIs to manage organization and bank identities | For questions please contact [Support](mailto:support@cybrid.xyz) at any time for assistance, or contact the [Product Team](mailto:product@cybrid.xyz) for product suggestions. ## Authenticating with the API The Cybrid Platform uses OAuth 2.0 Bearer Tokens to authenticate requests to the platform. Credentials to create `Organization` and `Bank` tokens can be generated via the [Cybrid Sandbox](https://id.sandbox.cybrid.app). Access tokens can be generated for a `Customer` as well via the [Cybrid IdP](https://id.sandbox.cybrid.app) as well. An `Organization` access token applies broadly to the whole Organization and all of its `Banks`, whereas, a `Bank` access token is specific to an individual Bank. `Customer` tokens, similarly, are scoped to a specific customer in a bank. Both `Organization` and `Bank` tokens can be created using the OAuth Client Credential Grant flow. Each Organization and Bank has its own unique `Client ID` and `Secret` that allows for machine-to-machine authentication. A `Bank` can then generate `Customer` access tokens via API using our [Identities API](https://id.sandbox.cybrid.app/api/schema/swagger-ui). <font color=\"orange\">**⚠️ Never share your Client ID or Secret publicly or in your source code repository.**</font> Your `Client ID` and `Secret` can be exchanged for a time-limited `Bearer Token` by interacting with the Cybrid Identity Provider or through interacting with the **Authorize** button in this document. The following curl command can be used to quickly generate a `Bearer Token` for use in testing the API or demo applications. ``` # Example request when using Bank credentials curl -X POST https://id.sandbox.cybrid.app/oauth/token -d '{ \"grant_type\": \"client_credentials\", \"client_id\": \"<Your Client ID>\", \"client_secret\": \"<Your Secret>\", \"scope\": \"banks:read banks:write accounts:read accounts:execute customers:read customers:write customers:execute prices:read quotes:execute quotes:read trades:execute trades:read transfers:execute transfers:read rewards:execute rewards:read external_bank_accounts:read external_bank_accounts:write external_bank_accounts:execute external_wallets:read external_wallets:execute workflows:read workflows:execute deposit_addresses:read deposit_addresses:execute\" }' -H \"Content-Type: application/json\" # When using Organization credentials set `scope` to 'organizations:read organizations:write banks:read banks:write banks:execute customers:read accounts:read prices:read quotes:execute quotes:read trades:execute trades:read transfers:read transfers:execute external_bank_accounts:read external_wallets:read workflows:read deposit_addresses:read' ``` <font color=\"orange\">**⚠️ Note: The above curl will create a bearer token with full scope access. Delete scopes if you'd like to restrict access.**</font> ## Authentication Scopes The Cybrid platform supports the use of scopes to control the level of access a token is limited to. Scopes do not grant access to resources; instead, they provide limits, in support of the least privilege principal. The following scopes are available on the platform and can be requested when generating either an Organization, Bank or Customer token. Generally speaking, the _Read_ scope is required to read and list resources, the _Write_ scope is required to update a resource and the _Execute_ scope is required to create a resource. | Resource | Read scope (Token Type) | Write scope (Token Type) | Execute scope (Token Type) | |-----------------------|------------------------------------------------------------|-----------------------------------------------|--------------------------------------------------| | Account | accounts:read (Organization, Bank, Customer) | | accounts:execute (Bank, Customer) | | Bank | banks:read (Organization, Bank) | banks:write (Organization, Bank) | banks:execute (Organization) | | Customer | customers:read (Organization, Bank, Customer) | customers:write (Bank, Customer) | customers:execute (Bank) | | Deposit Address | deposit_addresses:read (Organization, Bank, Customer) | deposit_addresses:write (Bank, Customer) | deposit_addresses:execute (Bank, Customer) | | External Bank Account | external_bank_accounts:read (Organization, Bank, Customer) | external_bank_accounts:write (Bank, Customer) | external_bank_accounts:execute (Bank, Customer) | | External Wallet | external_wallet:read (Organization, Bank, Customer) | | external_wallet:execute (Bank, Customer) | | Organization | organizations:read (Organization) | organizations:write (Organization) | | | Price | prices:read (Bank, Customer) | | | | Quote | quotes:read (Organization, Bank, Customer) | | quotes:execute (Organization, Bank, Customer) | | Reward | rewards:read (Bank, Customer) | | rewards:execute (Bank) | | Trade | trades:read (Organization, Bank, Customer) | | trades:execute (Organization, Bank, Customer) | | Transfer | transfers:read (Organization, Bank, Customer) | | transfers:execute (Organization, Bank, Customer) | | Workflow | workflows:read (Organization, Bank, Customer) | | workflows:execute (Bank, Customer) | ## Available Endpoints The available APIs for the [Identity](https://id.sandbox.cybrid.app/api/schema/swagger-ui), [Organization](https://organization.sandbox.cybrid.app/api/schema/swagger-ui) and [Bank](https://bank.sandbox.cybrid.app/api/schema/swagger-ui) API services are listed below: | API Service | Model | API Endpoint Path | Description | |--------------|----------------------|--------------------------------|---------------------------------------------------------------------------------------------------| | Identity | Bank | /api/bank_applications | Create and list banks | | Identity | CustomerToken | /api/customer_tokens | Create customer JWT access tokens | | Identity | Organization | /api/organization_applications | Create and list organizations | | Organization | Organization | /api/organizations | APIs to retrieve and update organization name | | Bank | Account | /api/accounts | Create and list accounts, which hold a specific asset for a customers | | Bank | Asset | /api/assets | Get a list of assets supported by the platform (ex: BTC, ETH) | | Bank | Bank | /api/banks | Create, update and list banks, the parent to customers, accounts, etc | | Bank | BankVerificationKey | /api/bank_verification_keys | Create, list and retrive verification keys, used for signing identities | | Bank | Customer | /api/customers | Create and list customers | | Bank | DepositAddress | /api/deposit_addresses | Create, get and list deposit addresses | | Bank | ExternalBankAccount | /api/external_bank_accounts | Create, get and list external bank accounts, which connect customer bank accounts to the platform | | Bank | ExternalWallet | /api/external_wallets | Create, get, list and delete external wallets, which connect customer wallets to the platform | | Bank | IdentityVerification | /api/identity_verifications | Create and list identity verifications, which are performed on customers for KYC | | Bank | Price | /api/prices | Get the current prices for assets on the platform | | Bank | Quote | /api/quotes | Create and list quotes, which are required to execute trades | | Bank | Reward | /api/rewards | Create a new reward (automates quote/trade for simplicity) | | Bank | Symbol | /api/symbols | Get a list of symbols supported for trade (ex: BTC-USD) | | Bank | Trade | /api/trades | Create and list trades, which buy or sell cryptocurrency | | Bank | Transfer | /api/transfers | Create, get and list transfers (e.g., funding, book) | | Bank | Workflow | /api/workflows | Create, get and list workflows | ## Understanding Object Models & Endpoints **Organizations** An `Organization` is meant to represent the organization partnering with Cybrid to use our platform. An `Organization` typically does not directly interact with `customers`. Instead, an Organization has one or more `banks`, which encompass the financial service offerings of the platform. **Banks** A `Bank` is owned by an `Organization` and can be thought of as an environment or container for `customers` and product offerings. Banks are created in either `Sandbox` or `Production` mode, where `Sandbox` is the environment that you would test, prototype and build in prior to moving to `Production`. An `Organization` can have multiple `banks`, in either `Sandbox` or `Production` environments. A `Sandbox Bank` will be backed by stubbed data and process flows. For instance, funding source transfer processes as well as trades will be simulated rather than performed, however asset prices are representative of real-world values. You have an unlimited amount of simulated fiat currency for testing purposes. **Customers** `Customers` represent your banking users on the platform. At present, we offer support for `Individuals` as Customers. `Customers` must be verified (i.e., KYC'd) in our system before they can play any part on the platform, which means they must have an associated and a passing `Identity Verification`. See the Identity Verifications section for more details on how a customer can be verified. `Customers` must also have an `Account` to be able to transact, in the desired asset class. See the Accounts APIs for more details on setting up accounts for the customer.
|
5
|
-
|
6
|
-
The version of the OpenAPI document: v0.71.72
|
7
|
-
Contact: support@cybrid.app
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 6.0.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
require 'time'
|
15
|
-
|
16
|
-
module CybridApiBank
|
17
|
-
class AttestationDetailsBankModel
|
18
|
-
# The state of an identity record attestation
|
19
|
-
attr_accessor :state
|
20
|
-
|
21
|
-
# The failure code of an identity record attestation (if any)
|
22
|
-
attr_accessor :failure_code
|
23
|
-
|
24
|
-
class EnumAttributeValidator
|
25
|
-
attr_reader :datatype
|
26
|
-
attr_reader :allowable_values
|
27
|
-
|
28
|
-
def initialize(datatype, allowable_values)
|
29
|
-
@allowable_values = allowable_values.map do |value|
|
30
|
-
case datatype.to_s
|
31
|
-
when /Integer/i
|
32
|
-
value.to_i
|
33
|
-
when /Float/i
|
34
|
-
value.to_f
|
35
|
-
else
|
36
|
-
value
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
def valid?(value)
|
42
|
-
!value || allowable_values.include?(value)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
47
|
-
def self.attribute_map
|
48
|
-
{
|
49
|
-
:'state' => :'state',
|
50
|
-
:'failure_code' => :'failure_code'
|
51
|
-
}
|
52
|
-
end
|
53
|
-
|
54
|
-
# Returns all the JSON keys this model knows about
|
55
|
-
def self.acceptable_attributes
|
56
|
-
attribute_map.values
|
57
|
-
end
|
58
|
-
|
59
|
-
# Attribute type mapping.
|
60
|
-
def self.openapi_types
|
61
|
-
{
|
62
|
-
:'state' => :'String',
|
63
|
-
:'failure_code' => :'String'
|
64
|
-
}
|
65
|
-
end
|
66
|
-
|
67
|
-
# List of attributes with nullable: true
|
68
|
-
def self.openapi_nullable
|
69
|
-
Set.new([
|
70
|
-
:'failure_code'
|
71
|
-
])
|
72
|
-
end
|
73
|
-
|
74
|
-
# Initializes the object
|
75
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
76
|
-
def initialize(attributes = {})
|
77
|
-
if (!attributes.is_a?(Hash))
|
78
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `CybridApiBank::AttestationDetailsBankModel` initialize method"
|
79
|
-
end
|
80
|
-
|
81
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
82
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
83
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
84
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `CybridApiBank::AttestationDetailsBankModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
85
|
-
end
|
86
|
-
h[k.to_sym] = v
|
87
|
-
}
|
88
|
-
|
89
|
-
if attributes.key?(:'state')
|
90
|
-
self.state = attributes[:'state']
|
91
|
-
end
|
92
|
-
|
93
|
-
if attributes.key?(:'failure_code')
|
94
|
-
self.failure_code = attributes[:'failure_code']
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
99
|
-
# @return Array for valid properties with the reasons
|
100
|
-
def list_invalid_properties
|
101
|
-
invalid_properties = Array.new
|
102
|
-
invalid_properties
|
103
|
-
end
|
104
|
-
|
105
|
-
# Check to see if the all the properties in the model are valid
|
106
|
-
# @return true if the model is valid
|
107
|
-
def valid?
|
108
|
-
state_validator = EnumAttributeValidator.new('String', ["storing", "expired", "verified", "failed"])
|
109
|
-
return false unless state_validator.valid?(@state)
|
110
|
-
failure_code_validator = EnumAttributeValidator.new('String', ["invalid_key", "invalid_algorithm", "invalid_signature", "invalid_issuer", "invalid_audience", "invalid_subject", "jwt_expired", "missing_jti", "missing_keyid"])
|
111
|
-
return false unless failure_code_validator.valid?(@failure_code)
|
112
|
-
true
|
113
|
-
end
|
114
|
-
|
115
|
-
# Custom attribute writer method checking allowed values (enum).
|
116
|
-
# @param [Object] state Object to be assigned
|
117
|
-
def state=(state)
|
118
|
-
validator = EnumAttributeValidator.new('String', ["storing", "expired", "verified", "failed"])
|
119
|
-
unless validator.valid?(state)
|
120
|
-
fail ArgumentError, "invalid value for \"state\", must be one of #{validator.allowable_values}."
|
121
|
-
end
|
122
|
-
@state = state
|
123
|
-
end
|
124
|
-
|
125
|
-
# Custom attribute writer method checking allowed values (enum).
|
126
|
-
# @param [Object] failure_code Object to be assigned
|
127
|
-
def failure_code=(failure_code)
|
128
|
-
validator = EnumAttributeValidator.new('String', ["invalid_key", "invalid_algorithm", "invalid_signature", "invalid_issuer", "invalid_audience", "invalid_subject", "jwt_expired", "missing_jti", "missing_keyid"])
|
129
|
-
unless validator.valid?(failure_code)
|
130
|
-
fail ArgumentError, "invalid value for \"failure_code\", must be one of #{validator.allowable_values}."
|
131
|
-
end
|
132
|
-
@failure_code = failure_code
|
133
|
-
end
|
134
|
-
|
135
|
-
# Checks equality by comparing each attribute.
|
136
|
-
# @param [Object] Object to be compared
|
137
|
-
def ==(o)
|
138
|
-
return true if self.equal?(o)
|
139
|
-
self.class == o.class &&
|
140
|
-
state == o.state &&
|
141
|
-
failure_code == o.failure_code
|
142
|
-
end
|
143
|
-
|
144
|
-
# @see the `==` method
|
145
|
-
# @param [Object] Object to be compared
|
146
|
-
def eql?(o)
|
147
|
-
self == o
|
148
|
-
end
|
149
|
-
|
150
|
-
# Calculates hash code according to all attributes.
|
151
|
-
# @return [Integer] Hash code
|
152
|
-
def hash
|
153
|
-
[state, failure_code].hash
|
154
|
-
end
|
155
|
-
|
156
|
-
# Builds the object from hash
|
157
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
158
|
-
# @return [Object] Returns the model itself
|
159
|
-
def self.build_from_hash(attributes)
|
160
|
-
new.build_from_hash(attributes)
|
161
|
-
end
|
162
|
-
|
163
|
-
# Builds the object from hash
|
164
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
165
|
-
# @return [Object] Returns the model itself
|
166
|
-
def build_from_hash(attributes)
|
167
|
-
return nil unless attributes.is_a?(Hash)
|
168
|
-
attributes = attributes.transform_keys(&:to_sym)
|
169
|
-
self.class.openapi_types.each_pair do |key, type|
|
170
|
-
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
171
|
-
self.send("#{key}=", nil)
|
172
|
-
elsif type =~ /\AArray<(.*)>/i
|
173
|
-
# check to ensure the input is an array given that the attribute
|
174
|
-
# is documented as an array but the input is not
|
175
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
176
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
177
|
-
end
|
178
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
179
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
180
|
-
end
|
181
|
-
end
|
182
|
-
|
183
|
-
self
|
184
|
-
end
|
185
|
-
|
186
|
-
# Deserializes the data based on type
|
187
|
-
# @param string type Data type
|
188
|
-
# @param string value Value to be deserialized
|
189
|
-
# @return [Object] Deserialized data
|
190
|
-
def _deserialize(type, value)
|
191
|
-
case type.to_sym
|
192
|
-
when :Time
|
193
|
-
Time.parse(value)
|
194
|
-
when :Date
|
195
|
-
Date.parse(value)
|
196
|
-
when :String
|
197
|
-
value.to_s
|
198
|
-
when :Integer
|
199
|
-
value.to_i
|
200
|
-
when :Float
|
201
|
-
value.to_f
|
202
|
-
when :Boolean
|
203
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
204
|
-
true
|
205
|
-
else
|
206
|
-
false
|
207
|
-
end
|
208
|
-
when :Object
|
209
|
-
# generic object (usually a Hash), return directly
|
210
|
-
value
|
211
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
212
|
-
inner_type = Regexp.last_match[:inner_type]
|
213
|
-
value.map { |v| _deserialize(inner_type, v) }
|
214
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
215
|
-
k_type = Regexp.last_match[:k_type]
|
216
|
-
v_type = Regexp.last_match[:v_type]
|
217
|
-
{}.tap do |hash|
|
218
|
-
value.each do |k, v|
|
219
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
220
|
-
end
|
221
|
-
end
|
222
|
-
else # model
|
223
|
-
# models (e.g. Pet) or oneOf
|
224
|
-
klass = CybridApiBank.const_get(type)
|
225
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
226
|
-
end
|
227
|
-
end
|
228
|
-
|
229
|
-
# Returns the string representation of the object
|
230
|
-
# @return [String] String presentation of the object
|
231
|
-
def to_s
|
232
|
-
to_hash.to_s
|
233
|
-
end
|
234
|
-
|
235
|
-
# to_body is an alias to to_hash (backward compatibility)
|
236
|
-
# @return [Hash] Returns the object in the form of hash
|
237
|
-
def to_body
|
238
|
-
to_hash
|
239
|
-
end
|
240
|
-
|
241
|
-
# Returns the object in the form of hash
|
242
|
-
# @return [Hash] Returns the object in the form of hash
|
243
|
-
def to_hash
|
244
|
-
hash = {}
|
245
|
-
self.class.attribute_map.each_pair do |attr, param|
|
246
|
-
value = self.send(attr)
|
247
|
-
if value.nil?
|
248
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
249
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
250
|
-
end
|
251
|
-
|
252
|
-
hash[param] = _to_hash(value)
|
253
|
-
end
|
254
|
-
hash
|
255
|
-
end
|
256
|
-
|
257
|
-
# Outputs non-array value in the form of hash
|
258
|
-
# For object, use to_hash. Otherwise, just return the value
|
259
|
-
# @param [Object] value Any valid value
|
260
|
-
# @return [Hash] Returns the value in the form of hash
|
261
|
-
def _to_hash(value)
|
262
|
-
if value.is_a?(Array)
|
263
|
-
value.compact.map { |v| _to_hash(v) }
|
264
|
-
elsif value.is_a?(Hash)
|
265
|
-
{}.tap do |hash|
|
266
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
267
|
-
end
|
268
|
-
elsif value.respond_to? :to_hash
|
269
|
-
value.to_hash
|
270
|
-
else
|
271
|
-
value
|
272
|
-
end
|
273
|
-
end
|
274
|
-
|
275
|
-
end
|
276
|
-
|
277
|
-
end
|