-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,48 @@ | ||
# Explanations | ||
|
||
The Google Wallet API is not self explanatory. | ||
Here we try to give an overview how it works and how the different parts are connected. | ||
## Google Wallet API | ||
|
||
The [Google Wallet](https://developers.google.com/wallet/) API is not self explanatory. | ||
|
||
The Python API client follows the models and data-structure defined by Google. | ||
|
||
- Overall Google defines Wallet Classes which are templates for Wallet Objects, while latter are the actual passes, referencing it's Wallet Class. | ||
- There are different types of Wallet Classes and Wallet Objects, while each type is always a pair of Wallet Class and Wallet Object, i.e. `RetailClass` and `RetailObject`. | ||
Those are the top-level models. | ||
Additional, there are supporting top-level objects like `Issuer`, `Permissions`, and more. | ||
- Each Wallet Class or Wallet Object has a set of fields which are defined by Google and can not be changed. | ||
- Each fields type is either a simple value or another data-type with its own fields. | ||
|
||
In this client package all data-structure defined by Google are represented by Pydantic models. | ||
The models are defined in the `edutap.wallet_google.models` module and are documented in the [Reference](reference.md). | ||
|
||
All top-level models are registered in the `edutap.wallet_google.registry` module. | ||
In further code, the models are referenced by their registered name, which is the name of the class (in CamelCase). | ||
|
||
The API functions are defined in the `edutap.wallet_google.api` module. | ||
They follow a CRUD API, while there is no delete at Google Wallet, but a disable. | ||
Additional a message can be sent to a Wallet Class or Wallet Object. | ||
Also, a download link can be created. | ||
All are documented in the [Reference](reference.md) section. | ||
|
||
Most API function do take a name of a model as first parameter. | ||
The name is the registered name. | ||
Depending on the registered name used, a function might not be able to execute. | ||
This is checked by the API function based on the registry record of the model, where the capabilities are stored. | ||
The constraints are coming from the Google API and are mirrored here. | ||
|
||
|
||
## Contributing | ||
|
||
The sources are in a Git version control system with its main branches at [GitHub](https://github.com/edutap-eu/edutap.wallet_google). | ||
|
||
We'd be happy to see many issues, forks, and pull-requests to make this package even better. | ||
|
||
Please report any issues at our [issue tracker](https://github.com/edutap-eu/edutap.wallet_google/issues). | ||
|
||
|
||
## License | ||
|
||
The code is under [European Union Public Licence v1.2](https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12) (EUPL). | ||
The EUPL is an [OpenSource Initiative (OSI) approved Free and OpenSource license](https://opensource.org/license/eupl-1-2/). | ||
|