|
| 1 | + |
| 2 | +# Getting Started with gumlet-rest-apis |
| 3 | + |
| 4 | +## Install the Package |
| 5 | + |
| 6 | +The package is compatible with Python versions `3.7+`. |
| 7 | +Install the package from PyPi using the following pip command: |
| 8 | + |
| 9 | +```bash |
| 10 | +pip install gumlet-python-sdk==1.0.0 |
| 11 | +``` |
| 12 | + |
| 13 | +You can also view the package at: |
| 14 | +https://pypi.python.org/pypi/gumlet-python-sdk/1.0.0 |
| 15 | + |
| 16 | +## Test the SDK |
| 17 | + |
| 18 | +You can test the generated SDK and the server with test cases. `unittest` is used as the testing framework and `pytest` is used as the test runner. You can run the tests as follows: |
| 19 | + |
| 20 | +Navigate to the root directory of the SDK and run the following commands |
| 21 | + |
| 22 | +``` |
| 23 | +pip install -r test-requirements.txt |
| 24 | +pytest |
| 25 | +``` |
| 26 | + |
| 27 | +## Initialize the API Client |
| 28 | + |
| 29 | +**_Note:_** Documentation for the client can be found [here.](https://www.github.com/akbansa/gumlet-python-sdk/tree/1.0.0/doc/client.md) |
| 30 | + |
| 31 | +The following parameters are configurable for the API Client: |
| 32 | + |
| 33 | +| Parameter | Type | Description | |
| 34 | +| --- | --- | --- | |
| 35 | +| http_client_instance | `HttpClient` | The Http Client passed from the sdk user for making requests | |
| 36 | +| override_http_client_configuration | `bool` | The value which determines to override properties of the passed Http Client from the sdk user | |
| 37 | +| http_call_back | `HttpCallBack` | The callback value that is invoked before and after an HTTP call is made to an endpoint | |
| 38 | +| timeout | `float` | The value to use for connection timeout. <br> **Default: 60** | |
| 39 | +| max_retries | `int` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** | |
| 40 | +| backoff_factor | `float` | A backoff factor to apply between attempts after the second try. <br> **Default: 2** | |
| 41 | +| retry_statuses | `Array of int` | The http statuses on which retry is to be done. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** | |
| 42 | +| retry_methods | `Array of string` | The http methods on which retry is to be done. <br> **Default: ['GET', 'PUT']** | |
| 43 | +| custom_header_authentication_credentials | [`CustomHeaderAuthenticationCredentials`](https://www.github.com/akbansa/gumlet-python-sdk/tree/1.0.0/doc/auth/custom-header-signature.md) | The credential object for Custom Header Signature | |
| 44 | + |
| 45 | +The API client can be initialized as follows: |
| 46 | + |
| 47 | +```python |
| 48 | +client = GumletrestapisClient( |
| 49 | + custom_header_authentication_credentials=CustomHeaderAuthenticationCredentials( |
| 50 | + authorization='Authorization' |
| 51 | + ), |
| 52 | + environment=Environment.PRODUCTION |
| 53 | +) |
| 54 | +``` |
| 55 | + |
| 56 | +## Authorization |
| 57 | + |
| 58 | +This API uses the following authentication schemes. |
| 59 | + |
| 60 | +* [`sec0 (Custom Header Signature)`](https://www.github.com/akbansa/gumlet-python-sdk/tree/1.0.0/doc/auth/custom-header-signature.md) |
| 61 | + |
| 62 | +## List of APIs |
| 63 | + |
| 64 | +* [API Endpoints](https://www.github.com/akbansa/gumlet-python-sdk/tree/1.0.0/doc/controllers/api-endpoints.md) |
| 65 | + |
| 66 | +## SDK Infrastructure |
| 67 | + |
| 68 | +### HTTP |
| 69 | + |
| 70 | +* [HttpResponse](https://www.github.com/akbansa/gumlet-python-sdk/tree/1.0.0/doc/http-response.md) |
| 71 | +* [HttpRequest](https://www.github.com/akbansa/gumlet-python-sdk/tree/1.0.0/doc/http-request.md) |
| 72 | + |
| 73 | +### Utilities |
| 74 | + |
| 75 | +* [ApiHelper](https://www.github.com/akbansa/gumlet-python-sdk/tree/1.0.0/doc/api-helper.md) |
| 76 | +* [HttpDateTime](https://www.github.com/akbansa/gumlet-python-sdk/tree/1.0.0/doc/http-date-time.md) |
| 77 | +* [RFC3339DateTime](https://www.github.com/akbansa/gumlet-python-sdk/tree/1.0.0/doc/rfc3339-date-time.md) |
| 78 | +* [UnixDateTime](https://www.github.com/akbansa/gumlet-python-sdk/tree/1.0.0/doc/unix-date-time.md) |
| 79 | + |
0 commit comments