## This is a onli-cloud-api repository managed by Buf
The onli-cloud-tray is a proxy service for developers to onli services mentioned below.

### 1. Transfer-agent:
Transfer-agent is an onli-cloud service that is used to transfer packages between lockers. It has the following methods:
1. [onliCloudApi.ChangeOwner](https://onli.support/raw/proto/onli-cloud/buf/#ChangeOwner):
	Transfer agent manages the evolution of ownership of a genome(s) workflow, initiated by the service endpoint, which receives a pkg from a locker, unpacks the genomes, evolves the owners of the genomes, packs evolved genomes, and places the pkg in the requested locker.

### 2. Treasury:
Treasury is an onli-cloud service that stores, prints, and issues minted genomes. It has the following methods:
1. [onliCloudApi.Issue](https://onli.support/raw/proto/onli-cloud/buf/#Issue): Used to issue genomes to a specific user. You can select the destination vault type of the user too. Options: cloud, desktop, mobile
2. [onliCloudApi.DefineGenomeStream](https://onli.support/raw/proto/onli-cloud/buf/#DefineGenomeStream): DefineGenomeStream is a bi-directional streaming method that moves genomes from reserve (not issuable) to inventory (issuable) and assigns a face value.
3. [onliCloudApi.Blacklist](https://onli.support/raw/proto/onli-cloud/buf/#Blacklist): Blacklist marks a genome as blacklisted and also informs the oracle.
4.  [onliCloudApi.List](https://onli.support/raw/proto/onli-cloud/buf/#List): List returns a paginated list of genomes in a specific vault type. Vault types: reserve, inventory, issued, blacklisted

### 3. Security-Tray:
Security-tray is the authentication, authorization and accounting server for the onli one network. It has the following methods:
1. [onliCloudApi.AuthLog](https://onli.support/raw/proto/onli-cloud/buf/#AuthLog): Get security-tray Auth Logs using auth_log_id and app_symbol
2. [onliCloudApi.AskToMove](https://onli.support/raw/proto/onli-cloud/buf/#AskToMove): AskToMove workflow is used to Ask an end-user to move their genomes to their locker which can then be used to `onliCloudApi.ChangeOwner` to transfer to another user. This request is initiated by appliance developer and a notification is sent to the end-user. The end-user can either accept or reject the request. 
3. [onliCloudApi.AskToMoveStream](https://onli.support/raw/proto/onli-cloud/buf/#AskToMoveStream): AskToMoveStream is a bi-directional streaming version of AskToMove workflow
4. [onliCloudApi.GetAskToMoveRecord](https://onli.support/raw/proto/onli-cloud/buf/#GetAskToMoveRecord): Get AskToMoveRecord using ask_to_move_id
5. [onliCloudApi.ReturnAskToMove](https://onli.support/raw/proto/onli-cloud/buf/#ReturnAskToMove): ReturnAskToMove is used to cancel the ask_to_move transaction and return the packages from user's locker back to user's vault
6. [onliCloudApi.AskToAdd](https://onli.support/raw/proto/onli-cloud/buf/#AskToAdd): AskToAdd is used to add settlement time to the AskToMoveRecord
7. [onliCloudApi.AuthenticateOwner](https://onli.support/raw/proto/onli-cloud/buf/#AuthenticateOwner): AuthenticateOwner is a workflow used to request asset_balance of an end-user. This request is initiated by appliance-developer and sent to the end-user using notification. 
8. [onliCloudApi.AuthorizeBehavior](https://onli.support/raw/proto/onli-cloud/buf/#AuthorizeBehavior): AuthorizeBehavior is just like AuthenticateOwner except that it doesn't returns asset balance and it support only BASIC type of authentication
9. [onliCloudApi.AskAssetBalance](https://onli.support/raw/proto/onli-cloud/buf/#AskAssetBalance): AskAssetBalance is called by app-dev to request the owner for vault-balance. Security-tray will inform the owner about the request through RMQ on owner queue

### 4. Oracle:
The oracle is database that keeps a record of the state of each genome across the system. The oracle is used as evidence of the source of truth for the state of binders across the network. It has the following methods:
1. [onliCloudApi.RevealGenomes](https://onli.support/raw/proto/onli-cloud/buf/#RevealGenomes): RevealGenomes returns oracle helix records for the specified owner_id

### 5. Bill-Breaker:
Bill Breaker is an onli-cloud service that makes change and reduces change for denomination and series genus types. It has the following methods:
1. [onliCloudApi.DrawerBalance](https://onli.support/raw/proto/onli-cloud/buf/#DrawerBalance): DrawerBalance returns bill-breaker balance in the drawer



## How to use this API?
1. To use this API, you need appliance developer `master_user` credentials from onli. The credentials include `user_id` and `app_key`. These credentials need to be passed as Metadata headers in each request. 
2. Once you have the credentials, you can test this buf repo using API platforms like postman, insomnia etc. Or you can use it in your app in any language. You can get the supported SDK from here: [Buf SDKs](https://buf.build/onlicorp/onli-cloud/sdks)

