diff --git a/client-libs/python/.swagger-codegen/VERSION b/client-libs/python/.swagger-codegen/VERSION new file mode 100644 index 000000000..8479333e1 --- /dev/null +++ b/client-libs/python/.swagger-codegen/VERSION @@ -0,0 +1 @@ +3.0.27 \ No newline at end of file diff --git a/client-libs/python/README.md b/client-libs/python/README.md new file mode 100644 index 000000000..343238426 --- /dev/null +++ b/client-libs/python/README.md @@ -0,0 +1,391 @@ +# swagger-client +REST API for any Emblem server + +This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: + +- API version: 2021-07-12 +- Package version: 1.0.0 +- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen + +## Requirements. + +Python 2.7 and 3.4+ + +## Installation & Usage +### pip install + +If the python package is hosted on Github, you can install directly from Github + +```sh +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) + +Then import the package: +```python +import swagger_client +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import swagger_client +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) + +try: + # Returns a list of approvers + api_response = api_instance.approvers_get() + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->approvers_get: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +id = 'id_example' # str | Approver Id + +try: + # deletes a single approver + api_instance.approvers_id_delete(id) +except ApiException as e: + print("Exception when calling DefaultApi->approvers_id_delete: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +id = 'id_example' # str | Approver Id + +try: + # returns a single approver + api_response = api_instance.approvers_id_get(id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->approvers_id_get: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +body = swagger_client.Approver() # Approver | JSON representation of a single approver +id = 'id_example' # str | Approver Id + +try: + # updates a single approver + api_response = api_instance.approvers_id_patch(body, id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->approvers_id_patch: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +body = swagger_client.Approver() # Approver | JSON representation of a single approver + +try: + # Create a new approver + api_instance.approvers_post(body) +except ApiException as e: + print("Exception when calling DefaultApi->approvers_post: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) + +try: + # Returns a list of campaigns + api_response = api_instance.campaigns_get() + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->campaigns_get: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +id = 'id_example' # str | Campaign Id + +try: + # deletes a single campaign + api_instance.campaigns_id_delete(id) +except ApiException as e: + print("Exception when calling DefaultApi->campaigns_id_delete: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +id = 'id_example' # str | Campaign Id + +try: + # lists all donations for the specified campaign + api_response = api_instance.campaigns_id_donations_get(id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->campaigns_id_donations_get: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +id = 'id_example' # str | Campaign Id + +try: + # returns a single campaign + api_response = api_instance.campaigns_id_get(id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->campaigns_id_get: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +body = swagger_client.Campaign() # Campaign | JSON representation of a single campaign +id = 'id_example' # str | Campaign Id + +try: + # updates a single campaign + api_response = api_instance.campaigns_id_patch(body, id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->campaigns_id_patch: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +body = swagger_client.Campaign() # Campaign | JSON representation of a single campaign + +try: + # Create a new campaign + api_instance.campaigns_post(body) +except ApiException as e: + print("Exception when calling DefaultApi->campaigns_post: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) + +try: + # Returns a list of causes + api_response = api_instance.causes_get() + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->causes_get: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +id = 'id_example' # str | Cause Id + +try: + # deletes a single cause + api_instance.causes_id_delete(id) +except ApiException as e: + print("Exception when calling DefaultApi->causes_id_delete: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +id = 'id_example' # str | Cause Id + +try: + # returns a single cause + api_response = api_instance.causes_id_get(id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->causes_id_get: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +body = swagger_client.Cause() # Cause | JSON representation of a single cause +id = 'id_example' # str | Cause Id + +try: + # updates a single cause + api_response = api_instance.causes_id_patch(body, id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->causes_id_patch: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +body = swagger_client.Cause() # Cause | JSON representation of a single cause + +try: + # Create a new cause + api_instance.causes_post(body) +except ApiException as e: + print("Exception when calling DefaultApi->causes_post: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) + +try: + # Returns a list of donations + api_response = api_instance.donations_get() + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->donations_get: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +id = 'id_example' # str | Donation Id + +try: + # deletes a single donation + api_instance.donations_id_delete(id) +except ApiException as e: + print("Exception when calling DefaultApi->donations_id_delete: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +id = 'id_example' # str | Donation Id + +try: + # returns a single donation + api_response = api_instance.donations_id_get(id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->donations_id_get: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +body = swagger_client.Donation() # Donation | JSON representation of a single donation +id = 'id_example' # str | Donation Id + +try: + # updates a single donation + api_response = api_instance.donations_id_patch(body, id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->donations_id_patch: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +body = swagger_client.Donation() # Donation | JSON representation of a single donation + +try: + # Create a new donation + api_instance.donations_post(body) +except ApiException as e: + print("Exception when calling DefaultApi->donations_post: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) + +try: + # Returns a list of donors + api_response = api_instance.donors_get() + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->donors_get: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +id = 'id_example' # str | Donor Id + +try: + # deletes a single donor + api_instance.donors_id_delete(id) +except ApiException as e: + print("Exception when calling DefaultApi->donors_id_delete: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +id = 'id_example' # str | Donor Id + +try: + # lists all donations for the specified donor + api_response = api_instance.donors_id_donations_get(id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->donors_id_donations_get: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +id = 'id_example' # str | Donor Id + +try: + # returns a single donor + api_response = api_instance.donors_id_get(id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->donors_id_get: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +body = swagger_client.Donor() # Donor | JSON representation of a single donor +id = 'id_example' # str | Donor Id + +try: + # updates a single donor + api_response = api_instance.donors_id_patch(body, id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->donors_id_patch: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +body = swagger_client.Donor() # Donor | JSON representation of a single donor + +try: + # Create a new donor + api_instance.donors_post(body) +except ApiException as e: + print("Exception when calling DefaultApi->donors_post: %s\n" % e) +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api-pwrmtjf4hq-uc.a.run.app* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**approvers_get**](docs/DefaultApi.md#approvers_get) | **GET** /approvers | Returns a list of approvers +*DefaultApi* | [**approvers_id_delete**](docs/DefaultApi.md#approvers_id_delete) | **DELETE** /approvers/{id} | deletes a single approver +*DefaultApi* | [**approvers_id_get**](docs/DefaultApi.md#approvers_id_get) | **GET** /approvers/{id} | returns a single approver +*DefaultApi* | [**approvers_id_patch**](docs/DefaultApi.md#approvers_id_patch) | **PATCH** /approvers/{id} | updates a single approver +*DefaultApi* | [**approvers_post**](docs/DefaultApi.md#approvers_post) | **POST** /approvers | Create a new approver +*DefaultApi* | [**campaigns_get**](docs/DefaultApi.md#campaigns_get) | **GET** /campaigns | Returns a list of campaigns +*DefaultApi* | [**campaigns_id_delete**](docs/DefaultApi.md#campaigns_id_delete) | **DELETE** /campaigns/{id} | deletes a single campaign +*DefaultApi* | [**campaigns_id_donations_get**](docs/DefaultApi.md#campaigns_id_donations_get) | **GET** /campaigns/{id}/donations | lists all donations for the specified campaign +*DefaultApi* | [**campaigns_id_get**](docs/DefaultApi.md#campaigns_id_get) | **GET** /campaigns/{id} | returns a single campaign +*DefaultApi* | [**campaigns_id_patch**](docs/DefaultApi.md#campaigns_id_patch) | **PATCH** /campaigns/{id} | updates a single campaign +*DefaultApi* | [**campaigns_post**](docs/DefaultApi.md#campaigns_post) | **POST** /campaigns | Create a new campaign +*DefaultApi* | [**causes_get**](docs/DefaultApi.md#causes_get) | **GET** /causes | Returns a list of causes +*DefaultApi* | [**causes_id_delete**](docs/DefaultApi.md#causes_id_delete) | **DELETE** /causes/{id} | deletes a single cause +*DefaultApi* | [**causes_id_get**](docs/DefaultApi.md#causes_id_get) | **GET** /causes/{id} | returns a single cause +*DefaultApi* | [**causes_id_patch**](docs/DefaultApi.md#causes_id_patch) | **PATCH** /causes/{id} | updates a single cause +*DefaultApi* | [**causes_post**](docs/DefaultApi.md#causes_post) | **POST** /causes | Create a new cause +*DefaultApi* | [**donations_get**](docs/DefaultApi.md#donations_get) | **GET** /donations | Returns a list of donations +*DefaultApi* | [**donations_id_delete**](docs/DefaultApi.md#donations_id_delete) | **DELETE** /donations/{id} | deletes a single donation +*DefaultApi* | [**donations_id_get**](docs/DefaultApi.md#donations_id_get) | **GET** /donations/{id} | returns a single donation +*DefaultApi* | [**donations_id_patch**](docs/DefaultApi.md#donations_id_patch) | **PATCH** /donations/{id} | updates a single donation +*DefaultApi* | [**donations_post**](docs/DefaultApi.md#donations_post) | **POST** /donations | Create a new donation +*DefaultApi* | [**donors_get**](docs/DefaultApi.md#donors_get) | **GET** /donors | Returns a list of donors +*DefaultApi* | [**donors_id_delete**](docs/DefaultApi.md#donors_id_delete) | **DELETE** /donors/{id} | deletes a single donor +*DefaultApi* | [**donors_id_donations_get**](docs/DefaultApi.md#donors_id_donations_get) | **GET** /donors/{id}/donations | lists all donations for the specified donor +*DefaultApi* | [**donors_id_get**](docs/DefaultApi.md#donors_id_get) | **GET** /donors/{id} | returns a single donor +*DefaultApi* | [**donors_id_patch**](docs/DefaultApi.md#donors_id_patch) | **PATCH** /donors/{id} | updates a single donor +*DefaultApi* | [**donors_post**](docs/DefaultApi.md#donors_post) | **POST** /donors | Create a new donor + +## Documentation For Models + + - [Approver](docs/Approver.md) + - [Campaign](docs/Campaign.md) + - [Cause](docs/Cause.md) + - [Donation](docs/Donation.md) + - [Donor](docs/Donor.md) + +## Documentation For Authorization + + All endpoints do not require authorization. + + +## Author + + diff --git a/client-libs/python/docs/Approver.md b/client-libs/python/docs/Approver.md new file mode 100644 index 000000000..d42cdfdad --- /dev/null +++ b/client-libs/python/docs/Approver.md @@ -0,0 +1,15 @@ +# Approver + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | unique, system-assigned identifier | [optional] +**name** | **str** | the display name of this Approver | [optional] +**email** | **str** | the Approver's email address | [optional] +**active** | **bool** | is this approver currently active? | [optional] +**time_created** | **datetime** | system-assigned creation timestamp | [optional] +**updated** | **datetime** | system-assigned update timestamp | [optional] +**self_link** | **str** | full URI of the resource | [optional] + +[[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/client-libs/python/docs/Campaign.md b/client-libs/python/docs/Campaign.md new file mode 100644 index 000000000..9efd7598d --- /dev/null +++ b/client-libs/python/docs/Campaign.md @@ -0,0 +1,19 @@ +# Campaign + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | unique, system-assigned identifier | [optional] +**name** | **str** | the campaign's display name | [optional] +**description** | **str** | the purpose of the campaign | [optional] +**cause** | **str** | the id of the Cause this campaign is for | [optional] +**managers** | **list[str]** | | [optional] +**goal** | **float** | the fundraising goal, in USD | [optional] +**image_url** | **str** | location of image to display for the campaign | [optional] +**active** | **bool** | is this campaign accepting donations at this time? | [optional] +**time_created** | **datetime** | system-assigned creation timestamp | [optional] +**updated** | **datetime** | system-assigned update timestamp | [optional] +**self_link** | **str** | full URI of the resource | [optional] + +[[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/client-libs/python/docs/Cause.md b/client-libs/python/docs/Cause.md new file mode 100644 index 000000000..c74429be8 --- /dev/null +++ b/client-libs/python/docs/Cause.md @@ -0,0 +1,16 @@ +# Cause + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | unique, system-assigned identifier | [optional] +**name** | **str** | the cause's display name | [optional] +**description** | **str** | the purpose of the cause | [optional] +**image_url** | **str** | location of image to display for the cause | [optional] +**active** | **bool** | is this cause accepting donations at this time? | [optional] +**time_created** | **datetime** | system-assigned creation timestamp | [optional] +**updated** | **datetime** | system-assigned update timestamp | [optional] +**self_link** | **str** | full URI of the resource | [optional] + +[[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/client-libs/python/docs/DefaultApi.md b/client-libs/python/docs/DefaultApi.md new file mode 100644 index 000000000..9695289bc --- /dev/null +++ b/client-libs/python/docs/DefaultApi.md @@ -0,0 +1,1256 @@ +# swagger_client.DefaultApi + +All URIs are relative to *https://api-pwrmtjf4hq-uc.a.run.app* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**approvers_get**](DefaultApi.md#approvers_get) | **GET** /approvers | Returns a list of approvers +[**approvers_id_delete**](DefaultApi.md#approvers_id_delete) | **DELETE** /approvers/{id} | deletes a single approver +[**approvers_id_get**](DefaultApi.md#approvers_id_get) | **GET** /approvers/{id} | returns a single approver +[**approvers_id_patch**](DefaultApi.md#approvers_id_patch) | **PATCH** /approvers/{id} | updates a single approver +[**approvers_post**](DefaultApi.md#approvers_post) | **POST** /approvers | Create a new approver +[**campaigns_get**](DefaultApi.md#campaigns_get) | **GET** /campaigns | Returns a list of campaigns +[**campaigns_id_delete**](DefaultApi.md#campaigns_id_delete) | **DELETE** /campaigns/{id} | deletes a single campaign +[**campaigns_id_donations_get**](DefaultApi.md#campaigns_id_donations_get) | **GET** /campaigns/{id}/donations | lists all donations for the specified campaign +[**campaigns_id_get**](DefaultApi.md#campaigns_id_get) | **GET** /campaigns/{id} | returns a single campaign +[**campaigns_id_patch**](DefaultApi.md#campaigns_id_patch) | **PATCH** /campaigns/{id} | updates a single campaign +[**campaigns_post**](DefaultApi.md#campaigns_post) | **POST** /campaigns | Create a new campaign +[**causes_get**](DefaultApi.md#causes_get) | **GET** /causes | Returns a list of causes +[**causes_id_delete**](DefaultApi.md#causes_id_delete) | **DELETE** /causes/{id} | deletes a single cause +[**causes_id_get**](DefaultApi.md#causes_id_get) | **GET** /causes/{id} | returns a single cause +[**causes_id_patch**](DefaultApi.md#causes_id_patch) | **PATCH** /causes/{id} | updates a single cause +[**causes_post**](DefaultApi.md#causes_post) | **POST** /causes | Create a new cause +[**donations_get**](DefaultApi.md#donations_get) | **GET** /donations | Returns a list of donations +[**donations_id_delete**](DefaultApi.md#donations_id_delete) | **DELETE** /donations/{id} | deletes a single donation +[**donations_id_get**](DefaultApi.md#donations_id_get) | **GET** /donations/{id} | returns a single donation +[**donations_id_patch**](DefaultApi.md#donations_id_patch) | **PATCH** /donations/{id} | updates a single donation +[**donations_post**](DefaultApi.md#donations_post) | **POST** /donations | Create a new donation +[**donors_get**](DefaultApi.md#donors_get) | **GET** /donors | Returns a list of donors +[**donors_id_delete**](DefaultApi.md#donors_id_delete) | **DELETE** /donors/{id} | deletes a single donor +[**donors_id_donations_get**](DefaultApi.md#donors_id_donations_get) | **GET** /donors/{id}/donations | lists all donations for the specified donor +[**donors_id_get**](DefaultApi.md#donors_id_get) | **GET** /donors/{id} | returns a single donor +[**donors_id_patch**](DefaultApi.md#donors_id_patch) | **PATCH** /donors/{id} | updates a single donor +[**donors_post**](DefaultApi.md#donors_post) | **POST** /donors | Create a new donor + +# **approvers_get** +> list[Approver] approvers_get() + +Returns a list of approvers + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() + +try: + # Returns a list of approvers + api_response = api_instance.approvers_get() + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->approvers_get: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**list[Approver]**](Approver.md) + +### Authorization + +No authorization required + +### 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) + +# **approvers_id_delete** +> approvers_id_delete(id) + +deletes a single approver + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() +id = 'id_example' # str | Approver Id + +try: + # deletes a single approver + api_instance.approvers_id_delete(id) +except ApiException as e: + print("Exception when calling DefaultApi->approvers_id_delete: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Approver Id | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **approvers_id_get** +> Approver approvers_id_get(id) + +returns a single approver + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() +id = 'id_example' # str | Approver Id + +try: + # returns a single approver + api_response = api_instance.approvers_id_get(id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->approvers_id_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Approver Id | + +### Return type + +[**Approver**](Approver.md) + +### Authorization + +No authorization required + +### 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) + +# **approvers_id_patch** +> Approver approvers_id_patch(body, id) + +updates a single approver + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() +body = swagger_client.Approver() # Approver | JSON representation of a single approver +id = 'id_example' # str | Approver Id + +try: + # updates a single approver + api_response = api_instance.approvers_id_patch(body, id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->approvers_id_patch: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Approver**](Approver.md)| JSON representation of a single approver | + **id** | **str**| Approver Id | + +### Return type + +[**Approver**](Approver.md) + +### Authorization + +No authorization required + +### 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) + +# **approvers_post** +> approvers_post(body) + +Create a new approver + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() +body = swagger_client.Approver() # Approver | JSON representation of a single approver + +try: + # Create a new approver + api_instance.approvers_post(body) +except ApiException as e: + print("Exception when calling DefaultApi->approvers_post: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Approver**](Approver.md)| JSON representation of a single approver | + +### Return type + +void (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) + +# **campaigns_get** +> list[Campaign] campaigns_get() + +Returns a list of campaigns + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() + +try: + # Returns a list of campaigns + api_response = api_instance.campaigns_get() + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->campaigns_get: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**list[Campaign]**](Campaign.md) + +### Authorization + +No authorization required + +### 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) + +# **campaigns_id_delete** +> campaigns_id_delete(id) + +deletes a single campaign + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() +id = 'id_example' # str | Campaign Id + +try: + # deletes a single campaign + api_instance.campaigns_id_delete(id) +except ApiException as e: + print("Exception when calling DefaultApi->campaigns_id_delete: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Campaign Id | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **campaigns_id_donations_get** +> list[Donation] campaigns_id_donations_get(id) + +lists all donations for the specified campaign + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() +id = 'id_example' # str | Campaign Id + +try: + # lists all donations for the specified campaign + api_response = api_instance.campaigns_id_donations_get(id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->campaigns_id_donations_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Campaign Id | + +### Return type + +[**list[Donation]**](Donation.md) + +### Authorization + +No authorization required + +### 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) + +# **campaigns_id_get** +> Campaign campaigns_id_get(id) + +returns a single campaign + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() +id = 'id_example' # str | Campaign Id + +try: + # returns a single campaign + api_response = api_instance.campaigns_id_get(id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->campaigns_id_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Campaign Id | + +### Return type + +[**Campaign**](Campaign.md) + +### Authorization + +No authorization required + +### 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) + +# **campaigns_id_patch** +> Campaign campaigns_id_patch(body, id) + +updates a single campaign + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() +body = swagger_client.Campaign() # Campaign | JSON representation of a single campaign +id = 'id_example' # str | Campaign Id + +try: + # updates a single campaign + api_response = api_instance.campaigns_id_patch(body, id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->campaigns_id_patch: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Campaign**](Campaign.md)| JSON representation of a single campaign | + **id** | **str**| Campaign Id | + +### Return type + +[**Campaign**](Campaign.md) + +### Authorization + +No authorization required + +### 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) + +# **campaigns_post** +> campaigns_post(body) + +Create a new campaign + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() +body = swagger_client.Campaign() # Campaign | JSON representation of a single campaign + +try: + # Create a new campaign + api_instance.campaigns_post(body) +except ApiException as e: + print("Exception when calling DefaultApi->campaigns_post: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Campaign**](Campaign.md)| JSON representation of a single campaign | + +### Return type + +void (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) + +# **causes_get** +> list[Cause] causes_get() + +Returns a list of causes + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() + +try: + # Returns a list of causes + api_response = api_instance.causes_get() + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->causes_get: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**list[Cause]**](Cause.md) + +### Authorization + +No authorization required + +### 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) + +# **causes_id_delete** +> causes_id_delete(id) + +deletes a single cause + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() +id = 'id_example' # str | Cause Id + +try: + # deletes a single cause + api_instance.causes_id_delete(id) +except ApiException as e: + print("Exception when calling DefaultApi->causes_id_delete: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Cause Id | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **causes_id_get** +> Cause causes_id_get(id) + +returns a single cause + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() +id = 'id_example' # str | Cause Id + +try: + # returns a single cause + api_response = api_instance.causes_id_get(id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->causes_id_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Cause Id | + +### Return type + +[**Cause**](Cause.md) + +### Authorization + +No authorization required + +### 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) + +# **causes_id_patch** +> Cause causes_id_patch(body, id) + +updates a single cause + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() +body = swagger_client.Cause() # Cause | JSON representation of a single cause +id = 'id_example' # str | Cause Id + +try: + # updates a single cause + api_response = api_instance.causes_id_patch(body, id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->causes_id_patch: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Cause**](Cause.md)| JSON representation of a single cause | + **id** | **str**| Cause Id | + +### Return type + +[**Cause**](Cause.md) + +### Authorization + +No authorization required + +### 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) + +# **causes_post** +> causes_post(body) + +Create a new cause + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() +body = swagger_client.Cause() # Cause | JSON representation of a single cause + +try: + # Create a new cause + api_instance.causes_post(body) +except ApiException as e: + print("Exception when calling DefaultApi->causes_post: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Cause**](Cause.md)| JSON representation of a single cause | + +### Return type + +void (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) + +# **donations_get** +> list[Donation] donations_get() + +Returns a list of donations + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() + +try: + # Returns a list of donations + api_response = api_instance.donations_get() + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->donations_get: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**list[Donation]**](Donation.md) + +### Authorization + +No authorization required + +### 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) + +# **donations_id_delete** +> donations_id_delete(id) + +deletes a single donation + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() +id = 'id_example' # str | Donation Id + +try: + # deletes a single donation + api_instance.donations_id_delete(id) +except ApiException as e: + print("Exception when calling DefaultApi->donations_id_delete: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Donation Id | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **donations_id_get** +> Donation donations_id_get(id) + +returns a single donation + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() +id = 'id_example' # str | Donation Id + +try: + # returns a single donation + api_response = api_instance.donations_id_get(id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->donations_id_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Donation Id | + +### Return type + +[**Donation**](Donation.md) + +### Authorization + +No authorization required + +### 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) + +# **donations_id_patch** +> Donation donations_id_patch(body, id) + +updates a single donation + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() +body = swagger_client.Donation() # Donation | JSON representation of a single donation +id = 'id_example' # str | Donation Id + +try: + # updates a single donation + api_response = api_instance.donations_id_patch(body, id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->donations_id_patch: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Donation**](Donation.md)| JSON representation of a single donation | + **id** | **str**| Donation Id | + +### Return type + +[**Donation**](Donation.md) + +### Authorization + +No authorization required + +### 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) + +# **donations_post** +> donations_post(body) + +Create a new donation + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() +body = swagger_client.Donation() # Donation | JSON representation of a single donation + +try: + # Create a new donation + api_instance.donations_post(body) +except ApiException as e: + print("Exception when calling DefaultApi->donations_post: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Donation**](Donation.md)| JSON representation of a single donation | + +### Return type + +void (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) + +# **donors_get** +> list[Donor] donors_get() + +Returns a list of donors + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() + +try: + # Returns a list of donors + api_response = api_instance.donors_get() + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->donors_get: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**list[Donor]**](Donor.md) + +### Authorization + +No authorization required + +### 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) + +# **donors_id_delete** +> donors_id_delete(id) + +deletes a single donor + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() +id = 'id_example' # str | Donor Id + +try: + # deletes a single donor + api_instance.donors_id_delete(id) +except ApiException as e: + print("Exception when calling DefaultApi->donors_id_delete: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Donor Id | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **donors_id_donations_get** +> list[Donation] donors_id_donations_get(id) + +lists all donations for the specified donor + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() +id = 'id_example' # str | Donor Id + +try: + # lists all donations for the specified donor + api_response = api_instance.donors_id_donations_get(id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->donors_id_donations_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Donor Id | + +### Return type + +[**list[Donation]**](Donation.md) + +### Authorization + +No authorization required + +### 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) + +# **donors_id_get** +> Donor donors_id_get(id) + +returns a single donor + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() +id = 'id_example' # str | Donor Id + +try: + # returns a single donor + api_response = api_instance.donors_id_get(id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->donors_id_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Donor Id | + +### Return type + +[**Donor**](Donor.md) + +### Authorization + +No authorization required + +### 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) + +# **donors_id_patch** +> Donor donors_id_patch(body, id) + +updates a single donor + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() +body = swagger_client.Donor() # Donor | JSON representation of a single donor +id = 'id_example' # str | Donor Id + +try: + # updates a single donor + api_response = api_instance.donors_id_patch(body, id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->donors_id_patch: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Donor**](Donor.md)| JSON representation of a single donor | + **id** | **str**| Donor Id | + +### Return type + +[**Donor**](Donor.md) + +### Authorization + +No authorization required + +### 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) + +# **donors_post** +> donors_post(body) + +Create a new donor + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() +body = swagger_client.Donor() # Donor | JSON representation of a single donor + +try: + # Create a new donor + api_instance.donors_post(body) +except ApiException as e: + print("Exception when calling DefaultApi->donors_post: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Donor**](Donor.md)| JSON representation of a single donor | + +### Return type + +void (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/client-libs/python/docs/Donation.md b/client-libs/python/docs/Donation.md new file mode 100644 index 000000000..59e90986f --- /dev/null +++ b/client-libs/python/docs/Donation.md @@ -0,0 +1,15 @@ +# Donation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | unique, system-assigned identifier | [optional] +**campaign** | **str** | the id of the campaign this donation is for | [optional] +**donor** | **str** | the id of the donor this donation is from | [optional] +**amount** | **float** | the amount donated, in USD | [optional] +**time_created** | **datetime** | system-assigned creation timestamp | [optional] +**updated** | **datetime** | system-assigned update timestamp | [optional] +**self_link** | **str** | full URI of the resource | [optional] + +[[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/client-libs/python/docs/Donor.md b/client-libs/python/docs/Donor.md new file mode 100644 index 000000000..e954835b8 --- /dev/null +++ b/client-libs/python/docs/Donor.md @@ -0,0 +1,15 @@ +# Donor + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | unique, system-assigned identifier | [optional] +**name** | **str** | the display name of this donor | [optional] +**email** | **str** | the donor's email address | [optional] +**mailing_address** | **str** | the donor's physical address | [optional] +**time_created** | **datetime** | system-assigned creation timestamp | [optional] +**updated** | **datetime** | system-assigned update timestamp | [optional] +**self_link** | **str** | full URI of the resource | [optional] + +[[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/client-libs/python/requirements.txt b/client-libs/python/requirements.txt new file mode 100644 index 000000000..bafdc0753 --- /dev/null +++ b/client-libs/python/requirements.txt @@ -0,0 +1,5 @@ +certifi >= 14.05.14 +six >= 1.10 +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.15.1 diff --git a/client-libs/python/setup.py b/client-libs/python/setup.py new file mode 100644 index 000000000..6d308554b --- /dev/null +++ b/client-libs/python/setup.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Emblem API + + REST API for any Emblem server # noqa: E501 + + OpenAPI spec version: 2021-07-12 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from setuptools import setup, find_packages # noqa: H301 + +NAME = "swagger-client" +VERSION = "1.0.0" +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] + +setup( + name=NAME, + version=VERSION, + description="Emblem API", + author_email="", + url="", + keywords=["Swagger", "Emblem API"], + install_requires=REQUIRES, + packages=find_packages(), + include_package_data=True, + long_description="""\ + REST API for any Emblem server # noqa: E501 + """ +) diff --git a/client-libs/python/swagger_client/__init__.py b/client-libs/python/swagger_client/__init__.py new file mode 100644 index 000000000..58bc6c310 --- /dev/null +++ b/client-libs/python/swagger_client/__init__.py @@ -0,0 +1,27 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Emblem API + + REST API for any Emblem server # noqa: E501 + + OpenAPI spec version: 2021-07-12 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +# import apis into sdk package +from swagger_client.api.default_api import DefaultApi +# import ApiClient +from swagger_client.api_client import ApiClient +from swagger_client.configuration import Configuration +# import models into sdk package +from swagger_client.models.approver import Approver +from swagger_client.models.campaign import Campaign +from swagger_client.models.cause import Cause +from swagger_client.models.donation import Donation +from swagger_client.models.donor import Donor diff --git a/client-libs/python/swagger_client/api/__init__.py b/client-libs/python/swagger_client/api/__init__.py new file mode 100644 index 000000000..447bb1c3c --- /dev/null +++ b/client-libs/python/swagger_client/api/__init__.py @@ -0,0 +1,6 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from swagger_client.api.default_api import DefaultApi diff --git a/client-libs/python/swagger_client/api/default_api.py b/client-libs/python/swagger_client/api/default_api.py new file mode 100644 index 000000000..87a618f27 --- /dev/null +++ b/client-libs/python/swagger_client/api/default_api.py @@ -0,0 +1,2544 @@ +# coding: utf-8 + +""" + Emblem API + + REST API for any Emblem server # noqa: E501 + + OpenAPI spec version: 2021-07-12 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from swagger_client.api_client import ApiClient + + +class DefaultApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def approvers_get(self, **kwargs): # noqa: E501 + """Returns a list of approvers # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.approvers_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[Approver] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.approvers_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.approvers_get_with_http_info(**kwargs) # noqa: E501 + return data + + def approvers_get_with_http_info(self, **kwargs): # noqa: E501 + """Returns a list of approvers # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.approvers_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[Approver] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method approvers_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/approvers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Approver]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def approvers_id_delete(self, id, **kwargs): # noqa: E501 + """deletes a single approver # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.approvers_id_delete(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Approver Id (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.approvers_id_delete_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.approvers_id_delete_with_http_info(id, **kwargs) # noqa: E501 + return data + + def approvers_id_delete_with_http_info(self, id, **kwargs): # noqa: E501 + """deletes a single approver # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.approvers_id_delete_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Approver Id (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method approvers_id_delete" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `approvers_id_delete`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/approvers/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def approvers_id_get(self, id, **kwargs): # noqa: E501 + """returns a single approver # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.approvers_id_get(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Approver Id (required) + :return: Approver + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.approvers_id_get_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.approvers_id_get_with_http_info(id, **kwargs) # noqa: E501 + return data + + def approvers_id_get_with_http_info(self, id, **kwargs): # noqa: E501 + """returns a single approver # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.approvers_id_get_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Approver Id (required) + :return: Approver + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method approvers_id_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `approvers_id_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/approvers/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Approver', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def approvers_id_patch(self, body, id, **kwargs): # noqa: E501 + """updates a single approver # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.approvers_id_patch(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Approver body: JSON representation of a single approver (required) + :param str id: Approver Id (required) + :return: Approver + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.approvers_id_patch_with_http_info(body, id, **kwargs) # noqa: E501 + else: + (data) = self.approvers_id_patch_with_http_info(body, id, **kwargs) # noqa: E501 + return data + + def approvers_id_patch_with_http_info(self, body, id, **kwargs): # noqa: E501 + """updates a single approver # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.approvers_id_patch_with_http_info(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Approver body: JSON representation of a single approver (required) + :param str id: Approver Id (required) + :return: Approver + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method approvers_id_patch" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `approvers_id_patch`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `approvers_id_patch`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/approvers/{id}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Approver', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def approvers_post(self, body, **kwargs): # noqa: E501 + """Create a new approver # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.approvers_post(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Approver body: JSON representation of a single approver (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.approvers_post_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.approvers_post_with_http_info(body, **kwargs) # noqa: E501 + return data + + def approvers_post_with_http_info(self, body, **kwargs): # noqa: E501 + """Create a new approver # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.approvers_post_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Approver body: JSON representation of a single approver (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method approvers_post" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `approvers_post`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/approvers', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def campaigns_get(self, **kwargs): # noqa: E501 + """Returns a list of campaigns # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.campaigns_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[Campaign] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.campaigns_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.campaigns_get_with_http_info(**kwargs) # noqa: E501 + return data + + def campaigns_get_with_http_info(self, **kwargs): # noqa: E501 + """Returns a list of campaigns # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.campaigns_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[Campaign] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method campaigns_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/campaigns', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Campaign]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def campaigns_id_delete(self, id, **kwargs): # noqa: E501 + """deletes a single campaign # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.campaigns_id_delete(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Campaign Id (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.campaigns_id_delete_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.campaigns_id_delete_with_http_info(id, **kwargs) # noqa: E501 + return data + + def campaigns_id_delete_with_http_info(self, id, **kwargs): # noqa: E501 + """deletes a single campaign # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.campaigns_id_delete_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Campaign Id (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method campaigns_id_delete" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `campaigns_id_delete`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/campaigns/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def campaigns_id_donations_get(self, id, **kwargs): # noqa: E501 + """lists all donations for the specified campaign # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.campaigns_id_donations_get(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Campaign Id (required) + :return: list[Donation] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.campaigns_id_donations_get_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.campaigns_id_donations_get_with_http_info(id, **kwargs) # noqa: E501 + return data + + def campaigns_id_donations_get_with_http_info(self, id, **kwargs): # noqa: E501 + """lists all donations for the specified campaign # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.campaigns_id_donations_get_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Campaign Id (required) + :return: list[Donation] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method campaigns_id_donations_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `campaigns_id_donations_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/campaigns/{id}/donations', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Donation]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def campaigns_id_get(self, id, **kwargs): # noqa: E501 + """returns a single campaign # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.campaigns_id_get(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Campaign Id (required) + :return: Campaign + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.campaigns_id_get_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.campaigns_id_get_with_http_info(id, **kwargs) # noqa: E501 + return data + + def campaigns_id_get_with_http_info(self, id, **kwargs): # noqa: E501 + """returns a single campaign # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.campaigns_id_get_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Campaign Id (required) + :return: Campaign + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method campaigns_id_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `campaigns_id_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/campaigns/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Campaign', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def campaigns_id_patch(self, body, id, **kwargs): # noqa: E501 + """updates a single campaign # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.campaigns_id_patch(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Campaign body: JSON representation of a single campaign (required) + :param str id: Campaign Id (required) + :return: Campaign + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.campaigns_id_patch_with_http_info(body, id, **kwargs) # noqa: E501 + else: + (data) = self.campaigns_id_patch_with_http_info(body, id, **kwargs) # noqa: E501 + return data + + def campaigns_id_patch_with_http_info(self, body, id, **kwargs): # noqa: E501 + """updates a single campaign # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.campaigns_id_patch_with_http_info(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Campaign body: JSON representation of a single campaign (required) + :param str id: Campaign Id (required) + :return: Campaign + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method campaigns_id_patch" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `campaigns_id_patch`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `campaigns_id_patch`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/campaigns/{id}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Campaign', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def campaigns_post(self, body, **kwargs): # noqa: E501 + """Create a new campaign # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.campaigns_post(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Campaign body: JSON representation of a single campaign (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.campaigns_post_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.campaigns_post_with_http_info(body, **kwargs) # noqa: E501 + return data + + def campaigns_post_with_http_info(self, body, **kwargs): # noqa: E501 + """Create a new campaign # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.campaigns_post_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Campaign body: JSON representation of a single campaign (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method campaigns_post" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `campaigns_post`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/campaigns', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def causes_get(self, **kwargs): # noqa: E501 + """Returns a list of causes # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.causes_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[Cause] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.causes_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.causes_get_with_http_info(**kwargs) # noqa: E501 + return data + + def causes_get_with_http_info(self, **kwargs): # noqa: E501 + """Returns a list of causes # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.causes_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[Cause] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method causes_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/causes', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Cause]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def causes_id_delete(self, id, **kwargs): # noqa: E501 + """deletes a single cause # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.causes_id_delete(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Cause Id (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.causes_id_delete_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.causes_id_delete_with_http_info(id, **kwargs) # noqa: E501 + return data + + def causes_id_delete_with_http_info(self, id, **kwargs): # noqa: E501 + """deletes a single cause # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.causes_id_delete_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Cause Id (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method causes_id_delete" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `causes_id_delete`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/causes/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def causes_id_get(self, id, **kwargs): # noqa: E501 + """returns a single cause # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.causes_id_get(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Cause Id (required) + :return: Cause + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.causes_id_get_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.causes_id_get_with_http_info(id, **kwargs) # noqa: E501 + return data + + def causes_id_get_with_http_info(self, id, **kwargs): # noqa: E501 + """returns a single cause # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.causes_id_get_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Cause Id (required) + :return: Cause + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method causes_id_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `causes_id_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/causes/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Cause', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def causes_id_patch(self, body, id, **kwargs): # noqa: E501 + """updates a single cause # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.causes_id_patch(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Cause body: JSON representation of a single cause (required) + :param str id: Cause Id (required) + :return: Cause + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.causes_id_patch_with_http_info(body, id, **kwargs) # noqa: E501 + else: + (data) = self.causes_id_patch_with_http_info(body, id, **kwargs) # noqa: E501 + return data + + def causes_id_patch_with_http_info(self, body, id, **kwargs): # noqa: E501 + """updates a single cause # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.causes_id_patch_with_http_info(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Cause body: JSON representation of a single cause (required) + :param str id: Cause Id (required) + :return: Cause + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method causes_id_patch" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `causes_id_patch`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `causes_id_patch`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/causes/{id}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Cause', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def causes_post(self, body, **kwargs): # noqa: E501 + """Create a new cause # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.causes_post(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Cause body: JSON representation of a single cause (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.causes_post_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.causes_post_with_http_info(body, **kwargs) # noqa: E501 + return data + + def causes_post_with_http_info(self, body, **kwargs): # noqa: E501 + """Create a new cause # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.causes_post_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Cause body: JSON representation of a single cause (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method causes_post" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `causes_post`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/causes', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def donations_get(self, **kwargs): # noqa: E501 + """Returns a list of donations # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.donations_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[Donation] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.donations_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.donations_get_with_http_info(**kwargs) # noqa: E501 + return data + + def donations_get_with_http_info(self, **kwargs): # noqa: E501 + """Returns a list of donations # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.donations_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[Donation] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method donations_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/donations', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Donation]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def donations_id_delete(self, id, **kwargs): # noqa: E501 + """deletes a single donation # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.donations_id_delete(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Donation Id (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.donations_id_delete_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.donations_id_delete_with_http_info(id, **kwargs) # noqa: E501 + return data + + def donations_id_delete_with_http_info(self, id, **kwargs): # noqa: E501 + """deletes a single donation # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.donations_id_delete_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Donation Id (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method donations_id_delete" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `donations_id_delete`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/donations/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def donations_id_get(self, id, **kwargs): # noqa: E501 + """returns a single donation # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.donations_id_get(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Donation Id (required) + :return: Donation + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.donations_id_get_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.donations_id_get_with_http_info(id, **kwargs) # noqa: E501 + return data + + def donations_id_get_with_http_info(self, id, **kwargs): # noqa: E501 + """returns a single donation # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.donations_id_get_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Donation Id (required) + :return: Donation + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method donations_id_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `donations_id_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/donations/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Donation', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def donations_id_patch(self, body, id, **kwargs): # noqa: E501 + """updates a single donation # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.donations_id_patch(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Donation body: JSON representation of a single donation (required) + :param str id: Donation Id (required) + :return: Donation + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.donations_id_patch_with_http_info(body, id, **kwargs) # noqa: E501 + else: + (data) = self.donations_id_patch_with_http_info(body, id, **kwargs) # noqa: E501 + return data + + def donations_id_patch_with_http_info(self, body, id, **kwargs): # noqa: E501 + """updates a single donation # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.donations_id_patch_with_http_info(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Donation body: JSON representation of a single donation (required) + :param str id: Donation Id (required) + :return: Donation + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method donations_id_patch" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `donations_id_patch`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `donations_id_patch`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/donations/{id}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Donation', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def donations_post(self, body, **kwargs): # noqa: E501 + """Create a new donation # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.donations_post(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Donation body: JSON representation of a single donation (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.donations_post_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.donations_post_with_http_info(body, **kwargs) # noqa: E501 + return data + + def donations_post_with_http_info(self, body, **kwargs): # noqa: E501 + """Create a new donation # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.donations_post_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Donation body: JSON representation of a single donation (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method donations_post" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `donations_post`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/donations', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def donors_get(self, **kwargs): # noqa: E501 + """Returns a list of donors # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.donors_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[Donor] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.donors_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.donors_get_with_http_info(**kwargs) # noqa: E501 + return data + + def donors_get_with_http_info(self, **kwargs): # noqa: E501 + """Returns a list of donors # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.donors_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[Donor] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method donors_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/donors', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Donor]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def donors_id_delete(self, id, **kwargs): # noqa: E501 + """deletes a single donor # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.donors_id_delete(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Donor Id (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.donors_id_delete_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.donors_id_delete_with_http_info(id, **kwargs) # noqa: E501 + return data + + def donors_id_delete_with_http_info(self, id, **kwargs): # noqa: E501 + """deletes a single donor # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.donors_id_delete_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Donor Id (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method donors_id_delete" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `donors_id_delete`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/donors/{id}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def donors_id_donations_get(self, id, **kwargs): # noqa: E501 + """lists all donations for the specified donor # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.donors_id_donations_get(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Donor Id (required) + :return: list[Donation] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.donors_id_donations_get_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.donors_id_donations_get_with_http_info(id, **kwargs) # noqa: E501 + return data + + def donors_id_donations_get_with_http_info(self, id, **kwargs): # noqa: E501 + """lists all donations for the specified donor # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.donors_id_donations_get_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Donor Id (required) + :return: list[Donation] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method donors_id_donations_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `donors_id_donations_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/donors/{id}/donations', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Donation]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def donors_id_get(self, id, **kwargs): # noqa: E501 + """returns a single donor # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.donors_id_get(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Donor Id (required) + :return: Donor + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.donors_id_get_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.donors_id_get_with_http_info(id, **kwargs) # noqa: E501 + return data + + def donors_id_get_with_http_info(self, id, **kwargs): # noqa: E501 + """returns a single donor # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.donors_id_get_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Donor Id (required) + :return: Donor + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method donors_id_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `donors_id_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/donors/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Donor', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def donors_id_patch(self, body, id, **kwargs): # noqa: E501 + """updates a single donor # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.donors_id_patch(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Donor body: JSON representation of a single donor (required) + :param str id: Donor Id (required) + :return: Donor + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.donors_id_patch_with_http_info(body, id, **kwargs) # noqa: E501 + else: + (data) = self.donors_id_patch_with_http_info(body, id, **kwargs) # noqa: E501 + return data + + def donors_id_patch_with_http_info(self, body, id, **kwargs): # noqa: E501 + """updates a single donor # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.donors_id_patch_with_http_info(body, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Donor body: JSON representation of a single donor (required) + :param str id: Donor Id (required) + :return: Donor + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method donors_id_patch" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `donors_id_patch`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `donors_id_patch`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/donors/{id}', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Donor', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def donors_post(self, body, **kwargs): # noqa: E501 + """Create a new donor # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.donors_post(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Donor body: JSON representation of a single donor (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.donors_post_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.donors_post_with_http_info(body, **kwargs) # noqa: E501 + return data + + def donors_post_with_http_info(self, body, **kwargs): # noqa: E501 + """Create a new donor # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.donors_post_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Donor body: JSON representation of a single donor (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method donors_post" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `donors_post`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/donors', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/client-libs/python/swagger_client/api_client.py b/client-libs/python/swagger_client/api_client.py new file mode 100644 index 000000000..89b6f2095 --- /dev/null +++ b/client-libs/python/swagger_client/api_client.py @@ -0,0 +1,628 @@ +# coding: utf-8 +""" + Emblem API + + REST API for any Emblem server # noqa: E501 + + OpenAPI spec version: 2021-07-12 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" +from __future__ import absolute_import + +import datetime +import json +import mimetypes +from multiprocessing.pool import ThreadPool +import os +import re +import tempfile + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote + +from swagger_client.configuration import Configuration +import swagger_client.models +from swagger_client import rest + + +class ApiClient(object): + """Generic API client for Swagger client library builds. + + Swagger generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the Swagger + templates. + + NOTE: This class is auto generated by the swagger code generator program. + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int if six.PY3 else long, # noqa: F821 + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + + self.pool = ThreadPool() + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'Swagger-Codegen/1.0.0/python' + + def __del__(self): + self.pool.close() + self.pool.join() + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = self.prepare_post_parameters(post_params, files) + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + url = self.configuration.host + resource_path + + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + + self.last_response = response_data + + return_data = response_data + if _preload_content: + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is swagger model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `swagger_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) + for attr, _ in six.iteritems(obj.swagger_types) + if getattr(obj, attr) is not None} + + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == "file": + return self.__deserialize_file(response) + + # fetch data from response object + try: + data = json.loads(response.data) + except ValueError: + data = response.data + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if type(klass) == str: + if klass.startswith('list['): + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('dict('): + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in six.iteritems(data)} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(swagger_client.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datatime(data) + else: + return self.__deserialize_model(data, klass) + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async_req=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout) + else: + thread = self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, _request_timeout)) + return thread + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def prepare_post_parameters(self, post_params=None, files=None): + """Builds form parameters. + + :param post_params: Normal form parameters. + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if post_params: + params = post_params + + if files: + for k, v in six.iteritems(files): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, querys, auth_settings): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if not auth_setting['value']: + continue + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return six.text_type(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return a original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datatime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __hasattr(self, object, name): + return name in object.__class__.__dict__ + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + if not klass.swagger_types and not self.__hasattr(klass, 'get_real_child_model'): + return data + + kwargs = {} + if klass.swagger_types is not None: + for attr, attr_type in six.iteritems(klass.swagger_types): + if (data is not None and + klass.attribute_map[attr] in data and + isinstance(data, (list, dict))): + value = data[klass.attribute_map[attr]] + kwargs[attr] = self.__deserialize(value, attr_type) + + instance = klass(**kwargs) + + if (isinstance(instance, dict) and + klass.swagger_types is not None and + isinstance(data, dict)): + for key, value in data.items(): + if key not in klass.swagger_types: + instance[key] = value + if self.__hasattr(instance, 'get_real_child_model'): + klass_name = instance.get_real_child_model(data) + if klass_name: + instance = self.__deserialize(data, klass_name) + return instance diff --git a/client-libs/python/swagger_client/configuration.py b/client-libs/python/swagger_client/configuration.py new file mode 100644 index 000000000..5c7901acf --- /dev/null +++ b/client-libs/python/swagger_client/configuration.py @@ -0,0 +1,244 @@ +# coding: utf-8 + +""" + Emblem API + + REST API for any Emblem server # noqa: E501 + + OpenAPI spec version: 2021-07-12 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import copy +import logging +import multiprocessing +import sys +import urllib3 + +import six +from six.moves import http_client as httplib + + +class TypeWithDefault(type): + def __init__(cls, name, bases, dct): + super(TypeWithDefault, cls).__init__(name, bases, dct) + cls._default = None + + def __call__(cls): + if cls._default is None: + cls._default = type.__call__(cls) + return copy.copy(cls._default) + + def set_default(cls, default): + cls._default = copy.copy(default) + + +class Configuration(six.with_metaclass(TypeWithDefault, object)): + """NOTE: This class is auto generated by the swagger code generator program. + + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + """ + + def __init__(self): + """Constructor""" + # Default Base url + self.host = "https://api-pwrmtjf4hq-uc.a.run.app" + # Temp file folder for downloading files + self.temp_folder_path = None + + # Authentication Settings + # dict to store API key(s) + self.api_key = {} + # dict to store API prefix (e.g. Bearer) + self.api_key_prefix = {} + # function to refresh API key if expired + self.refresh_api_key_hook = None + # Username for HTTP basic authentication + self.username = "" + # Password for HTTP basic authentication + self.password = "" + # Logging Settings + self.logger = {} + self.logger["package_logger"] = logging.getLogger("swagger_client") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + # Log format + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + # Log stream handler + self.logger_stream_handler = None + # Log file handler + self.logger_file_handler = None + # Debug file location + self.logger_file = None + # Debug switch + self.debug = False + + # SSL/TLS verification + # Set this to false to skip verifying SSL certificate when calling API + # from https server. + self.verify_ssl = True + # Set this to customize the certificate file to verify the peer. + self.ssl_ca_cert = None + # client certificate file + self.cert_file = None + # client key file + self.key_file = None + # Set this to True/False to enable/disable SSL hostname verification. + self.assert_hostname = None + + # urllib3 connection pool's maximum number of connections saved + # per pool. urllib3 uses 1 connection as default value, but this is + # not the best value when you are making a lot of possibly parallel + # requests to the same host, which is often the case here. + # cpu_count * 5 is used as default value to increase performance. + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + + # Proxy URL + self.proxy = None + # Safe chars for path_param + self.safe_chars_for_path_param = '' + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + if self.logger_stream_handler: + logger.removeHandler(self.logger_stream_handler) + else: + # If not set logging file, + # then add stream handler and remove file handler. + self.logger_stream_handler = logging.StreamHandler() + self.logger_stream_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_stream_handler) + if self.logger_file_handler: + logger.removeHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook: + self.refresh_api_key_hook(self) + + key = self.api_key.get(identifier) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + return urllib3.util.make_headers( + basic_auth=self.username + ':' + self.password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + return { + } + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 2021-07-12\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) diff --git a/client-libs/python/swagger_client/models/__init__.py b/client-libs/python/swagger_client/models/__init__.py new file mode 100644 index 000000000..4b762fba6 --- /dev/null +++ b/client-libs/python/swagger_client/models/__init__.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +# flake8: noqa +""" + Emblem API + + REST API for any Emblem server # noqa: E501 + + OpenAPI spec version: 2021-07-12 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +# import models into model package +from swagger_client.models.approver import Approver +from swagger_client.models.campaign import Campaign +from swagger_client.models.cause import Cause +from swagger_client.models.donation import Donation +from swagger_client.models.donor import Donor diff --git a/client-libs/python/swagger_client/models/approver.py b/client-libs/python/swagger_client/models/approver.py new file mode 100644 index 000000000..ea56b66f8 --- /dev/null +++ b/client-libs/python/swagger_client/models/approver.py @@ -0,0 +1,280 @@ +# coding: utf-8 + +""" + Emblem API + + REST API for any Emblem server # noqa: E501 + + OpenAPI spec version: 2021-07-12 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Approver(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'name': 'str', + 'email': 'str', + 'active': 'bool', + 'time_created': 'datetime', + 'updated': 'datetime', + 'self_link': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'email': 'email', + 'active': 'active', + 'time_created': 'timeCreated', + 'updated': 'updated', + 'self_link': 'selfLink' + } + + def __init__(self, id=None, name=None, email=None, active=None, time_created=None, updated=None, self_link=None): # noqa: E501 + """Approver - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self._email = None + self._active = None + self._time_created = None + self._updated = None + self._self_link = None + self.discriminator = None + if id is not None: + self.id = id + if name is not None: + self.name = name + if email is not None: + self.email = email + if active is not None: + self.active = active + if time_created is not None: + self.time_created = time_created + if updated is not None: + self.updated = updated + if self_link is not None: + self.self_link = self_link + + @property + def id(self): + """Gets the id of this Approver. # noqa: E501 + + unique, system-assigned identifier # noqa: E501 + + :return: The id of this Approver. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Approver. + + unique, system-assigned identifier # noqa: E501 + + :param id: The id of this Approver. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this Approver. # noqa: E501 + + the display name of this Approver # noqa: E501 + + :return: The name of this Approver. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Approver. + + the display name of this Approver # noqa: E501 + + :param name: The name of this Approver. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def email(self): + """Gets the email of this Approver. # noqa: E501 + + the Approver's email address # noqa: E501 + + :return: The email of this Approver. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this Approver. + + the Approver's email address # noqa: E501 + + :param email: The email of this Approver. # noqa: E501 + :type: str + """ + + self._email = email + + @property + def active(self): + """Gets the active of this Approver. # noqa: E501 + + is this approver currently active? # noqa: E501 + + :return: The active of this Approver. # noqa: E501 + :rtype: bool + """ + return self._active + + @active.setter + def active(self, active): + """Sets the active of this Approver. + + is this approver currently active? # noqa: E501 + + :param active: The active of this Approver. # noqa: E501 + :type: bool + """ + + self._active = active + + @property + def time_created(self): + """Gets the time_created of this Approver. # noqa: E501 + + system-assigned creation timestamp # noqa: E501 + + :return: The time_created of this Approver. # noqa: E501 + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """Sets the time_created of this Approver. + + system-assigned creation timestamp # noqa: E501 + + :param time_created: The time_created of this Approver. # noqa: E501 + :type: datetime + """ + + self._time_created = time_created + + @property + def updated(self): + """Gets the updated of this Approver. # noqa: E501 + + system-assigned update timestamp # noqa: E501 + + :return: The updated of this Approver. # noqa: E501 + :rtype: datetime + """ + return self._updated + + @updated.setter + def updated(self, updated): + """Sets the updated of this Approver. + + system-assigned update timestamp # noqa: E501 + + :param updated: The updated of this Approver. # noqa: E501 + :type: datetime + """ + + self._updated = updated + + @property + def self_link(self): + """Gets the self_link of this Approver. # noqa: E501 + + full URI of the resource # noqa: E501 + + :return: The self_link of this Approver. # noqa: E501 + :rtype: str + """ + return self._self_link + + @self_link.setter + def self_link(self, self_link): + """Sets the self_link of this Approver. + + full URI of the resource # noqa: E501 + + :param self_link: The self_link of this Approver. # noqa: E501 + :type: str + """ + + self._self_link = self_link + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Approver, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Approver): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/client-libs/python/swagger_client/models/campaign.py b/client-libs/python/swagger_client/models/campaign.py new file mode 100644 index 000000000..0b7df8925 --- /dev/null +++ b/client-libs/python/swagger_client/models/campaign.py @@ -0,0 +1,390 @@ +# coding: utf-8 + +""" + Emblem API + + REST API for any Emblem server # noqa: E501 + + OpenAPI spec version: 2021-07-12 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Campaign(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'name': 'str', + 'description': 'str', + 'cause': 'str', + 'managers': 'list[str]', + 'goal': 'float', + 'image_url': 'str', + 'active': 'bool', + 'time_created': 'datetime', + 'updated': 'datetime', + 'self_link': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'description': 'description', + 'cause': 'cause', + 'managers': 'managers', + 'goal': 'goal', + 'image_url': 'imageUrl', + 'active': 'active', + 'time_created': 'timeCreated', + 'updated': 'updated', + 'self_link': 'selfLink' + } + + def __init__(self, id=None, name=None, description=None, cause=None, managers=None, goal=None, image_url=None, active=None, time_created=None, updated=None, self_link=None): # noqa: E501 + """Campaign - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self._description = None + self._cause = None + self._managers = None + self._goal = None + self._image_url = None + self._active = None + self._time_created = None + self._updated = None + self._self_link = None + self.discriminator = None + if id is not None: + self.id = id + if name is not None: + self.name = name + if description is not None: + self.description = description + if cause is not None: + self.cause = cause + if managers is not None: + self.managers = managers + if goal is not None: + self.goal = goal + if image_url is not None: + self.image_url = image_url + if active is not None: + self.active = active + if time_created is not None: + self.time_created = time_created + if updated is not None: + self.updated = updated + if self_link is not None: + self.self_link = self_link + + @property + def id(self): + """Gets the id of this Campaign. # noqa: E501 + + unique, system-assigned identifier # noqa: E501 + + :return: The id of this Campaign. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Campaign. + + unique, system-assigned identifier # noqa: E501 + + :param id: The id of this Campaign. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this Campaign. # noqa: E501 + + the campaign's display name # noqa: E501 + + :return: The name of this Campaign. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Campaign. + + the campaign's display name # noqa: E501 + + :param name: The name of this Campaign. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def description(self): + """Gets the description of this Campaign. # noqa: E501 + + the purpose of the campaign # noqa: E501 + + :return: The description of this Campaign. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this Campaign. + + the purpose of the campaign # noqa: E501 + + :param description: The description of this Campaign. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def cause(self): + """Gets the cause of this Campaign. # noqa: E501 + + the id of the Cause this campaign is for # noqa: E501 + + :return: The cause of this Campaign. # noqa: E501 + :rtype: str + """ + return self._cause + + @cause.setter + def cause(self, cause): + """Sets the cause of this Campaign. + + the id of the Cause this campaign is for # noqa: E501 + + :param cause: The cause of this Campaign. # noqa: E501 + :type: str + """ + + self._cause = cause + + @property + def managers(self): + """Gets the managers of this Campaign. # noqa: E501 + + + :return: The managers of this Campaign. # noqa: E501 + :rtype: list[str] + """ + return self._managers + + @managers.setter + def managers(self, managers): + """Sets the managers of this Campaign. + + + :param managers: The managers of this Campaign. # noqa: E501 + :type: list[str] + """ + + self._managers = managers + + @property + def goal(self): + """Gets the goal of this Campaign. # noqa: E501 + + the fundraising goal, in USD # noqa: E501 + + :return: The goal of this Campaign. # noqa: E501 + :rtype: float + """ + return self._goal + + @goal.setter + def goal(self, goal): + """Sets the goal of this Campaign. + + the fundraising goal, in USD # noqa: E501 + + :param goal: The goal of this Campaign. # noqa: E501 + :type: float + """ + + self._goal = goal + + @property + def image_url(self): + """Gets the image_url of this Campaign. # noqa: E501 + + location of image to display for the campaign # noqa: E501 + + :return: The image_url of this Campaign. # noqa: E501 + :rtype: str + """ + return self._image_url + + @image_url.setter + def image_url(self, image_url): + """Sets the image_url of this Campaign. + + location of image to display for the campaign # noqa: E501 + + :param image_url: The image_url of this Campaign. # noqa: E501 + :type: str + """ + + self._image_url = image_url + + @property + def active(self): + """Gets the active of this Campaign. # noqa: E501 + + is this campaign accepting donations at this time? # noqa: E501 + + :return: The active of this Campaign. # noqa: E501 + :rtype: bool + """ + return self._active + + @active.setter + def active(self, active): + """Sets the active of this Campaign. + + is this campaign accepting donations at this time? # noqa: E501 + + :param active: The active of this Campaign. # noqa: E501 + :type: bool + """ + + self._active = active + + @property + def time_created(self): + """Gets the time_created of this Campaign. # noqa: E501 + + system-assigned creation timestamp # noqa: E501 + + :return: The time_created of this Campaign. # noqa: E501 + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """Sets the time_created of this Campaign. + + system-assigned creation timestamp # noqa: E501 + + :param time_created: The time_created of this Campaign. # noqa: E501 + :type: datetime + """ + + self._time_created = time_created + + @property + def updated(self): + """Gets the updated of this Campaign. # noqa: E501 + + system-assigned update timestamp # noqa: E501 + + :return: The updated of this Campaign. # noqa: E501 + :rtype: datetime + """ + return self._updated + + @updated.setter + def updated(self, updated): + """Sets the updated of this Campaign. + + system-assigned update timestamp # noqa: E501 + + :param updated: The updated of this Campaign. # noqa: E501 + :type: datetime + """ + + self._updated = updated + + @property + def self_link(self): + """Gets the self_link of this Campaign. # noqa: E501 + + full URI of the resource # noqa: E501 + + :return: The self_link of this Campaign. # noqa: E501 + :rtype: str + """ + return self._self_link + + @self_link.setter + def self_link(self, self_link): + """Sets the self_link of this Campaign. + + full URI of the resource # noqa: E501 + + :param self_link: The self_link of this Campaign. # noqa: E501 + :type: str + """ + + self._self_link = self_link + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Campaign, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Campaign): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/client-libs/python/swagger_client/models/cause.py b/client-libs/python/swagger_client/models/cause.py new file mode 100644 index 000000000..f4b9f9d6c --- /dev/null +++ b/client-libs/python/swagger_client/models/cause.py @@ -0,0 +1,308 @@ +# coding: utf-8 + +""" + Emblem API + + REST API for any Emblem server # noqa: E501 + + OpenAPI spec version: 2021-07-12 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Cause(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'name': 'str', + 'description': 'str', + 'image_url': 'str', + 'active': 'bool', + 'time_created': 'datetime', + 'updated': 'datetime', + 'self_link': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'description': 'description', + 'image_url': 'imageUrl', + 'active': 'active', + 'time_created': 'timeCreated', + 'updated': 'updated', + 'self_link': 'selfLink' + } + + def __init__(self, id=None, name=None, description=None, image_url=None, active=None, time_created=None, updated=None, self_link=None): # noqa: E501 + """Cause - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self._description = None + self._image_url = None + self._active = None + self._time_created = None + self._updated = None + self._self_link = None + self.discriminator = None + if id is not None: + self.id = id + if name is not None: + self.name = name + if description is not None: + self.description = description + if image_url is not None: + self.image_url = image_url + if active is not None: + self.active = active + if time_created is not None: + self.time_created = time_created + if updated is not None: + self.updated = updated + if self_link is not None: + self.self_link = self_link + + @property + def id(self): + """Gets the id of this Cause. # noqa: E501 + + unique, system-assigned identifier # noqa: E501 + + :return: The id of this Cause. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Cause. + + unique, system-assigned identifier # noqa: E501 + + :param id: The id of this Cause. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this Cause. # noqa: E501 + + the cause's display name # noqa: E501 + + :return: The name of this Cause. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Cause. + + the cause's display name # noqa: E501 + + :param name: The name of this Cause. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def description(self): + """Gets the description of this Cause. # noqa: E501 + + the purpose of the cause # noqa: E501 + + :return: The description of this Cause. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this Cause. + + the purpose of the cause # noqa: E501 + + :param description: The description of this Cause. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def image_url(self): + """Gets the image_url of this Cause. # noqa: E501 + + location of image to display for the cause # noqa: E501 + + :return: The image_url of this Cause. # noqa: E501 + :rtype: str + """ + return self._image_url + + @image_url.setter + def image_url(self, image_url): + """Sets the image_url of this Cause. + + location of image to display for the cause # noqa: E501 + + :param image_url: The image_url of this Cause. # noqa: E501 + :type: str + """ + + self._image_url = image_url + + @property + def active(self): + """Gets the active of this Cause. # noqa: E501 + + is this cause accepting donations at this time? # noqa: E501 + + :return: The active of this Cause. # noqa: E501 + :rtype: bool + """ + return self._active + + @active.setter + def active(self, active): + """Sets the active of this Cause. + + is this cause accepting donations at this time? # noqa: E501 + + :param active: The active of this Cause. # noqa: E501 + :type: bool + """ + + self._active = active + + @property + def time_created(self): + """Gets the time_created of this Cause. # noqa: E501 + + system-assigned creation timestamp # noqa: E501 + + :return: The time_created of this Cause. # noqa: E501 + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """Sets the time_created of this Cause. + + system-assigned creation timestamp # noqa: E501 + + :param time_created: The time_created of this Cause. # noqa: E501 + :type: datetime + """ + + self._time_created = time_created + + @property + def updated(self): + """Gets the updated of this Cause. # noqa: E501 + + system-assigned update timestamp # noqa: E501 + + :return: The updated of this Cause. # noqa: E501 + :rtype: datetime + """ + return self._updated + + @updated.setter + def updated(self, updated): + """Sets the updated of this Cause. + + system-assigned update timestamp # noqa: E501 + + :param updated: The updated of this Cause. # noqa: E501 + :type: datetime + """ + + self._updated = updated + + @property + def self_link(self): + """Gets the self_link of this Cause. # noqa: E501 + + full URI of the resource # noqa: E501 + + :return: The self_link of this Cause. # noqa: E501 + :rtype: str + """ + return self._self_link + + @self_link.setter + def self_link(self, self_link): + """Sets the self_link of this Cause. + + full URI of the resource # noqa: E501 + + :param self_link: The self_link of this Cause. # noqa: E501 + :type: str + """ + + self._self_link = self_link + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Cause, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Cause): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/client-libs/python/swagger_client/models/donation.py b/client-libs/python/swagger_client/models/donation.py new file mode 100644 index 000000000..04620e706 --- /dev/null +++ b/client-libs/python/swagger_client/models/donation.py @@ -0,0 +1,280 @@ +# coding: utf-8 + +""" + Emblem API + + REST API for any Emblem server # noqa: E501 + + OpenAPI spec version: 2021-07-12 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Donation(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'campaign': 'str', + 'donor': 'str', + 'amount': 'float', + 'time_created': 'datetime', + 'updated': 'datetime', + 'self_link': 'str' + } + + attribute_map = { + 'id': 'id', + 'campaign': 'campaign', + 'donor': 'donor', + 'amount': 'amount', + 'time_created': 'timeCreated', + 'updated': 'updated', + 'self_link': 'selfLink' + } + + def __init__(self, id=None, campaign=None, donor=None, amount=None, time_created=None, updated=None, self_link=None): # noqa: E501 + """Donation - a model defined in Swagger""" # noqa: E501 + self._id = None + self._campaign = None + self._donor = None + self._amount = None + self._time_created = None + self._updated = None + self._self_link = None + self.discriminator = None + if id is not None: + self.id = id + if campaign is not None: + self.campaign = campaign + if donor is not None: + self.donor = donor + if amount is not None: + self.amount = amount + if time_created is not None: + self.time_created = time_created + if updated is not None: + self.updated = updated + if self_link is not None: + self.self_link = self_link + + @property + def id(self): + """Gets the id of this Donation. # noqa: E501 + + unique, system-assigned identifier # noqa: E501 + + :return: The id of this Donation. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Donation. + + unique, system-assigned identifier # noqa: E501 + + :param id: The id of this Donation. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def campaign(self): + """Gets the campaign of this Donation. # noqa: E501 + + the id of the campaign this donation is for # noqa: E501 + + :return: The campaign of this Donation. # noqa: E501 + :rtype: str + """ + return self._campaign + + @campaign.setter + def campaign(self, campaign): + """Sets the campaign of this Donation. + + the id of the campaign this donation is for # noqa: E501 + + :param campaign: The campaign of this Donation. # noqa: E501 + :type: str + """ + + self._campaign = campaign + + @property + def donor(self): + """Gets the donor of this Donation. # noqa: E501 + + the id of the donor this donation is from # noqa: E501 + + :return: The donor of this Donation. # noqa: E501 + :rtype: str + """ + return self._donor + + @donor.setter + def donor(self, donor): + """Sets the donor of this Donation. + + the id of the donor this donation is from # noqa: E501 + + :param donor: The donor of this Donation. # noqa: E501 + :type: str + """ + + self._donor = donor + + @property + def amount(self): + """Gets the amount of this Donation. # noqa: E501 + + the amount donated, in USD # noqa: E501 + + :return: The amount of this Donation. # noqa: E501 + :rtype: float + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this Donation. + + the amount donated, in USD # noqa: E501 + + :param amount: The amount of this Donation. # noqa: E501 + :type: float + """ + + self._amount = amount + + @property + def time_created(self): + """Gets the time_created of this Donation. # noqa: E501 + + system-assigned creation timestamp # noqa: E501 + + :return: The time_created of this Donation. # noqa: E501 + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """Sets the time_created of this Donation. + + system-assigned creation timestamp # noqa: E501 + + :param time_created: The time_created of this Donation. # noqa: E501 + :type: datetime + """ + + self._time_created = time_created + + @property + def updated(self): + """Gets the updated of this Donation. # noqa: E501 + + system-assigned update timestamp # noqa: E501 + + :return: The updated of this Donation. # noqa: E501 + :rtype: datetime + """ + return self._updated + + @updated.setter + def updated(self, updated): + """Sets the updated of this Donation. + + system-assigned update timestamp # noqa: E501 + + :param updated: The updated of this Donation. # noqa: E501 + :type: datetime + """ + + self._updated = updated + + @property + def self_link(self): + """Gets the self_link of this Donation. # noqa: E501 + + full URI of the resource # noqa: E501 + + :return: The self_link of this Donation. # noqa: E501 + :rtype: str + """ + return self._self_link + + @self_link.setter + def self_link(self, self_link): + """Sets the self_link of this Donation. + + full URI of the resource # noqa: E501 + + :param self_link: The self_link of this Donation. # noqa: E501 + :type: str + """ + + self._self_link = self_link + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Donation, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Donation): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/client-libs/python/swagger_client/models/donor.py b/client-libs/python/swagger_client/models/donor.py new file mode 100644 index 000000000..2fceb47f6 --- /dev/null +++ b/client-libs/python/swagger_client/models/donor.py @@ -0,0 +1,280 @@ +# coding: utf-8 + +""" + Emblem API + + REST API for any Emblem server # noqa: E501 + + OpenAPI spec version: 2021-07-12 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Donor(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'name': 'str', + 'email': 'str', + 'mailing_address': 'str', + 'time_created': 'datetime', + 'updated': 'datetime', + 'self_link': 'str' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'email': 'email', + 'mailing_address': 'mailing_address', + 'time_created': 'timeCreated', + 'updated': 'updated', + 'self_link': 'selfLink' + } + + def __init__(self, id=None, name=None, email=None, mailing_address=None, time_created=None, updated=None, self_link=None): # noqa: E501 + """Donor - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self._email = None + self._mailing_address = None + self._time_created = None + self._updated = None + self._self_link = None + self.discriminator = None + if id is not None: + self.id = id + if name is not None: + self.name = name + if email is not None: + self.email = email + if mailing_address is not None: + self.mailing_address = mailing_address + if time_created is not None: + self.time_created = time_created + if updated is not None: + self.updated = updated + if self_link is not None: + self.self_link = self_link + + @property + def id(self): + """Gets the id of this Donor. # noqa: E501 + + unique, system-assigned identifier # noqa: E501 + + :return: The id of this Donor. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Donor. + + unique, system-assigned identifier # noqa: E501 + + :param id: The id of this Donor. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def name(self): + """Gets the name of this Donor. # noqa: E501 + + the display name of this donor # noqa: E501 + + :return: The name of this Donor. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Donor. + + the display name of this donor # noqa: E501 + + :param name: The name of this Donor. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def email(self): + """Gets the email of this Donor. # noqa: E501 + + the donor's email address # noqa: E501 + + :return: The email of this Donor. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this Donor. + + the donor's email address # noqa: E501 + + :param email: The email of this Donor. # noqa: E501 + :type: str + """ + + self._email = email + + @property + def mailing_address(self): + """Gets the mailing_address of this Donor. # noqa: E501 + + the donor's physical address # noqa: E501 + + :return: The mailing_address of this Donor. # noqa: E501 + :rtype: str + """ + return self._mailing_address + + @mailing_address.setter + def mailing_address(self, mailing_address): + """Sets the mailing_address of this Donor. + + the donor's physical address # noqa: E501 + + :param mailing_address: The mailing_address of this Donor. # noqa: E501 + :type: str + """ + + self._mailing_address = mailing_address + + @property + def time_created(self): + """Gets the time_created of this Donor. # noqa: E501 + + system-assigned creation timestamp # noqa: E501 + + :return: The time_created of this Donor. # noqa: E501 + :rtype: datetime + """ + return self._time_created + + @time_created.setter + def time_created(self, time_created): + """Sets the time_created of this Donor. + + system-assigned creation timestamp # noqa: E501 + + :param time_created: The time_created of this Donor. # noqa: E501 + :type: datetime + """ + + self._time_created = time_created + + @property + def updated(self): + """Gets the updated of this Donor. # noqa: E501 + + system-assigned update timestamp # noqa: E501 + + :return: The updated of this Donor. # noqa: E501 + :rtype: datetime + """ + return self._updated + + @updated.setter + def updated(self, updated): + """Sets the updated of this Donor. + + system-assigned update timestamp # noqa: E501 + + :param updated: The updated of this Donor. # noqa: E501 + :type: datetime + """ + + self._updated = updated + + @property + def self_link(self): + """Gets the self_link of this Donor. # noqa: E501 + + full URI of the resource # noqa: E501 + + :return: The self_link of this Donor. # noqa: E501 + :rtype: str + """ + return self._self_link + + @self_link.setter + def self_link(self, self_link): + """Sets the self_link of this Donor. + + full URI of the resource # noqa: E501 + + :param self_link: The self_link of this Donor. # noqa: E501 + :type: str + """ + + self._self_link = self_link + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Donor, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Donor): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/client-libs/python/swagger_client/rest.py b/client-libs/python/swagger_client/rest.py new file mode 100644 index 000000000..a65be7156 --- /dev/null +++ b/client-libs/python/swagger_client/rest.py @@ -0,0 +1,322 @@ +# coding: utf-8 + +""" + Emblem API + + REST API for any Emblem server # noqa: E501 + + OpenAPI spec version: 2021-07-12 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import io +import json +import logging +import re +import ssl + +import certifi +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import urlencode + +try: + import urllib3 +except ImportError: + raise ImportError('Swagger python client requires urllib3.') + + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.urllib3_response.getheaders() + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.urllib3_response.getheader(name, default) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, + _request_timeout=None): + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if post_params and body: + raise ValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=_request_timeout) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if re.search('json', headers['Content-Type'], re.IGNORECASE): + request_body = '{}' + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=True, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if _preload_content: + r = RESTResponse(r) + + # In the python 3, the response.data is bytes. + # we need to decode it to string. + if six.PY3: + r.data = r.data.decode('utf8') + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + raise ApiException(http_resp=r) + + return r + + def GET(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, + _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + +class ApiException(Exception): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message diff --git a/client-libs/python/test-requirements.txt b/client-libs/python/test-requirements.txt new file mode 100644 index 000000000..2702246c0 --- /dev/null +++ b/client-libs/python/test-requirements.txt @@ -0,0 +1,5 @@ +coverage>=4.0.3 +nose>=1.3.7 +pluggy>=0.3.1 +py>=1.4.31 +randomize>=0.13 diff --git a/client-libs/python/test/__init__.py b/client-libs/python/test/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/client-libs/python/test/test_approver.py b/client-libs/python/test/test_approver.py new file mode 100644 index 000000000..d858e7cc7 --- /dev/null +++ b/client-libs/python/test/test_approver.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Emblem API + + REST API for any Emblem server # noqa: E501 + + OpenAPI spec version: 2021-07-12 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from swagger_client.models.approver import Approver # noqa: E501 +from swagger_client.rest import ApiException + + +class TestApprover(unittest.TestCase): + """Approver unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testApprover(self): + """Test Approver""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.approver.Approver() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/client-libs/python/test/test_campaign.py b/client-libs/python/test/test_campaign.py new file mode 100644 index 000000000..124f99787 --- /dev/null +++ b/client-libs/python/test/test_campaign.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Emblem API + + REST API for any Emblem server # noqa: E501 + + OpenAPI spec version: 2021-07-07 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from swagger_client.models.campaign import Campaign # noqa: E501 +from swagger_client.rest import ApiException + + +class TestCampaign(unittest.TestCase): + """Campaign unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCampaign(self): + """Test Campaign""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.campaign.Campaign() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/client-libs/python/test/test_cause.py b/client-libs/python/test/test_cause.py new file mode 100644 index 000000000..cce17fa57 --- /dev/null +++ b/client-libs/python/test/test_cause.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Emblem API + + REST API for any Emblem server # noqa: E501 + + OpenAPI spec version: 2021-07-07 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from swagger_client.models.cause import Cause # noqa: E501 +from swagger_client.rest import ApiException + + +class TestCause(unittest.TestCase): + """Cause unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCause(self): + """Test Cause""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.cause.Cause() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/client-libs/python/test/test_default_api.py b/client-libs/python/test/test_default_api.py new file mode 100644 index 000000000..445bb580d --- /dev/null +++ b/client-libs/python/test/test_default_api.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + Emblem API + + REST API for any Emblem server # noqa: E501 + + OpenAPI spec version: 2021-07-07 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from swagger_client.api.default_api import DefaultApi # noqa: E501 +from swagger_client.rest import ApiException + + +class TestDefaultApi(unittest.TestCase): + """DefaultApi unit test stubs""" + + def setUp(self): + self.api = DefaultApi() # noqa: E501 + + def tearDown(self): + pass + + def test_campaigns_get(self): + """Test case for campaigns_get + + Returns a list of campaigns # noqa: E501 + """ + pass + + def test_campaigns_id_get(self): + """Test case for campaigns_id_get + + returns a single of campaign # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/client-libs/python/test/test_donation.py b/client-libs/python/test/test_donation.py new file mode 100644 index 000000000..dc2ade7e9 --- /dev/null +++ b/client-libs/python/test/test_donation.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Emblem API + + REST API for any Emblem server # noqa: E501 + + OpenAPI spec version: 2021-07-07 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from swagger_client.models.donation import Donation # noqa: E501 +from swagger_client.rest import ApiException + + +class TestDonation(unittest.TestCase): + """Donation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDonation(self): + """Test Donation""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.donation.Donation() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/client-libs/python/test/test_donor.py b/client-libs/python/test/test_donor.py new file mode 100644 index 000000000..473396d2c --- /dev/null +++ b/client-libs/python/test/test_donor.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Emblem API + + REST API for any Emblem server # noqa: E501 + + OpenAPI spec version: 2021-07-12 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from swagger_client.models.donor import Donor # noqa: E501 +from swagger_client.rest import ApiException + + +class TestDonor(unittest.TestCase): + """Donor unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testDonor(self): + """Test Donor""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.donor.Donor() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/content-api/openapi.yaml b/content-api/openapi.yaml new file mode 100644 index 000000000..6ff25ea4f --- /dev/null +++ b/content-api/openapi.yaml @@ -0,0 +1,750 @@ +openapi: 3.0.0 +info: + title: Emblem API + description: REST API for any Emblem server + version: '2021-07-12' + +servers: +- url: https://api-pwrmtjf4hq-uc.a.run.app + description: Development server + +paths: + /approvers: + get: + summary: Returns a list of approvers + responses: + '200': + description: A JSON array of approvers + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Approver' + '404': + description: not found. The path must have a typo + default: + description: Unexpected error + + post: + summary: Create a new approver + requestBody: + description: JSON representation of a single approver + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Approver' + responses: + '201': + description: Created + '404': + description: approvers must have been misspelled in path + + /approvers/{id}: + get: + summary: returns a single approver + parameters: + - name: id + in: path + description: Approver Id + required: true + schema: + type: string + responses: + '200': + description: JSON representation of a approver + content: + application/json: + schema: + $ref: '#/components/schemas/Approver' + '404': + description: not found + default: + description: Unexpected error + + patch: + summary: updates a single approver + parameters: + - name: id + in: path + description: Approver Id + required: true + schema: + type: string + requestBody: + description: JSON representation of a single approver + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Approver' + responses: + '201': + description: JSON representation of a approver + content: + application/json: + schema: + $ref: '#/components/schemas/Approver' + '404': + description: not found + '409': + description: Conflict. If-Match header provided does not match current contents + default: + description: Unexpected error + + delete: + summary: deletes a single approver + parameters: + - name: id + in: path + description: Approver Id + required: true + schema: + type: string + responses: + '204': + description: No content + '404': + description: not found + '409': + description: Conflict. If-Match header provided does not match current contents + default: + description: Unexpected error + + /campaigns: + get: + summary: Returns a list of campaigns + responses: + '200': + description: A JSON array of campaigns + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Campaign' + '404': + description: not found. The path must have a typo + default: + description: Unexpected error + + post: + summary: Create a new campaign + requestBody: + description: JSON representation of a single campaign + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Campaign' + responses: + '201': + description: Created + '404': + description: campaigns must have been misspelled in path + + /campaigns/{id}: + get: + summary: returns a single campaign + parameters: + - name: id + in: path + description: Campaign Id + required: true + schema: + type: string + responses: + '200': + description: JSON representation of a campaign + content: + application/json: + schema: + $ref: '#/components/schemas/Campaign' + '404': + description: not found + default: + description: Unexpected error + + patch: + summary: updates a single campaign + parameters: + - name: id + in: path + description: Campaign Id + required: true + schema: + type: string + requestBody: + description: JSON representation of a single campaign + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Campaign' + responses: + '201': + description: JSON representation of a campaign + content: + application/json: + schema: + $ref: '#/components/schemas/Campaign' + '404': + description: not found + '409': + description: Conflict. If-Match header provided does not match current contents + default: + description: Unexpected error + + delete: + summary: deletes a single campaign + parameters: + - name: id + in: path + description: Campaign Id + required: true + schema: + type: string + responses: + '204': + description: No content + '404': + description: not found + '409': + description: Conflict. If-Match header provided does not match current contents + default: + description: Unexpected error + + /campaigns/{id}/donations: + get: + summary: lists all donations for the specified campaign + parameters: + - name: id + in: path + description: Campaign Id + required: true + schema: + type: string + responses: + '201': + description: JSON representation of an array of donations + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Donation' + '404': + description: not found + default: + description: Unexpected error + + /causes: + get: + summary: Returns a list of causes + responses: + '200': + description: A JSON array of causes + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Cause' + '404': + description: not found. The path must have a typo + default: + description: Unexpected error + + post: + summary: Create a new cause + requestBody: + description: JSON representation of a single cause + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Cause' + responses: + '201': + description: Created + '404': + description: causes must have been misspelled in path + + /causes/{id}: + get: + summary: returns a single cause + parameters: + - name: id + in: path + description: Cause Id + required: true + schema: + type: string + responses: + '200': + description: JSON representation of a cause + content: + application/json: + schema: + $ref: '#/components/schemas/Cause' + '404': + description: not found + default: + description: Unexpected error + + patch: + summary: updates a single cause + parameters: + - name: id + in: path + description: Cause Id + required: true + schema: + type: string + requestBody: + description: JSON representation of a single cause + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Cause' + responses: + '201': + description: JSON representation of a cause + content: + application/json: + schema: + $ref: '#/components/schemas/Cause' + '404': + description: not found + '409': + description: Conflict. If-Match header provided does not match current contents + default: + description: Unexpected error + + delete: + summary: deletes a single cause + parameters: + - name: id + in: path + description: Cause Id + required: true + schema: + type: string + responses: + '204': + description: No content + '404': + description: not found + '409': + description: Conflict. If-Match header provided does not match current contents + default: + description: Unexpected error + + /donations: + get: + summary: Returns a list of donations + responses: + '200': + description: A JSON array of donations + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Donation' + '404': + description: not found. The path must have a typo + default: + description: Unexpected error + + post: + summary: Create a new donation + requestBody: + description: JSON representation of a single donation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Donation' + responses: + '201': + description: Created + '404': + description: donations must have been misspelled in path + + /donations/{id}: + get: + summary: returns a single donation + parameters: + - name: id + in: path + description: Donation Id + required: true + schema: + type: string + responses: + '200': + description: JSON representation of a donation + content: + application/json: + schema: + $ref: '#/components/schemas/Donation' + '404': + description: not found + default: + description: Unexpected error + + patch: + summary: updates a single donation + parameters: + - name: id + in: path + description: Donation Id + required: true + schema: + type: string + requestBody: + description: JSON representation of a single donation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Donation' + responses: + '201': + description: JSON representation of a donation + content: + application/json: + schema: + $ref: '#/components/schemas/Donation' + '404': + description: not found + '409': + description: Conflict. If-Match header provided does not match current contents + default: + description: Unexpected error + + delete: + summary: deletes a single donation + parameters: + - name: id + in: path + description: Donation Id + required: true + schema: + type: string + responses: + '204': + description: No content + '404': + description: not found + '409': + description: Conflict. If-Match header provided does not match current contents + default: + description: Unexpected error + + /donors: + get: + summary: Returns a list of donors + responses: + '200': + description: A JSON array of donors + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Donor' + '404': + description: not found. The path must have a typo + default: + description: Unexpected error + + post: + summary: Create a new donor + requestBody: + description: JSON representation of a single donor + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Donor' + responses: + '201': + description: Created + '404': + description: donors must have been misspelled in path + + /donors/{id}: + get: + summary: returns a single donor + parameters: + - name: id + in: path + description: Donor Id + required: true + schema: + type: string + responses: + '200': + description: JSON representation of a donor + content: + application/json: + schema: + $ref: '#/components/schemas/Donor' + '404': + description: not found + default: + description: Unexpected error + + patch: + summary: updates a single donor + parameters: + - name: id + in: path + description: Donor Id + required: true + schema: + type: string + requestBody: + description: JSON representation of a single donor + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Donor' + responses: + '201': + description: JSON representation of a donor + content: + application/json: + schema: + $ref: '#/components/schemas/Donor' + '404': + description: not found + '409': + description: Conflict. If-Match header provided does not match current contents + default: + description: Unexpected error + + delete: + summary: deletes a single donor + parameters: + - name: id + in: path + description: Donor Id + required: true + schema: + type: string + responses: + '204': + description: No content + '404': + description: not found + '409': + description: Conflict. If-Match header provided does not match current contents + default: + description: Unexpected error + + /donors/{id}/donations: + get: + summary: lists all donations for the specified donor + parameters: + - name: id + in: path + description: Donor Id + required: true + schema: + type: string + responses: + '201': + description: JSON representation of an array of donations + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Donation' + '404': + description: not found + default: + description: Unexpected error + +components: + schemas: + Approver: + properties: + id: + type: string + readOnly: true + description: unique, system-assigned identifier + name: + type: string + description: the display name of this Approver + email: + type: string + description: the Approver's email address + active: + type: boolean + description: is this approver currently active? + timeCreated: + type: string + format: date-time + readOnly: true + description: system-assigned creation timestamp + updated: + type: string + format: date-time + readOnly: true + description: system-assigned update timestamp + selfLink: + type: string + format: uri + readOnly: true + description: full URI of the resource + + Campaign: + properties: + id: + type: string + readOnly: true + description: unique, system-assigned identifier + name: + type: string + description: the campaign's display name + description: + type: string + description: the purpose of the campaign + cause: + type: string + description: the id of the Cause this campaign is for + managers: + type: array + items: + type: string + format: email + description: a manager's email address + goal: + type: number + description: the fundraising goal, in USD + imageUrl: + type: string + format: uri + description: location of image to display for the campaign + active: + type: boolean + description: is this campaign accepting donations at this time? + timeCreated: + type: string + format: date-time + readOnly: true + description: system-assigned creation timestamp + updated: + type: string + format: date-time + readOnly: true + description: system-assigned update timestamp + selfLink: + type: string + format: uri + readOnly: true + description: full URI of the resource + + Cause: + properties: + id: + type: string + readOnly: true + description: unique, system-assigned identifier + name: + type: string + description: the cause's display name + description: + type: string + description: the purpose of the cause + imageUrl: + type: string + format: uri + description: location of image to display for the cause + active: + type: boolean + description: is this cause accepting donations at this time? + timeCreated: + type: string + format: date-time + readOnly: true + description: system-assigned creation timestamp + updated: + type: string + format: date-time + readOnly: true + description: system-assigned update timestamp + selfLink: + type: string + format: uri + readOnly: true + description: full URI of the resource + + Donation: + properties: + id: + type: string + readOnly: true + description: unique, system-assigned identifier + campaign: + type: string + description: the id of the campaign this donation is for + donor: + type: string + description: the id of the donor this donation is from + amount: + type: number + description: the amount donated, in USD + timeCreated: + type: string + format: date-time + readOnly: true + description: system-assigned creation timestamp + updated: + type: string + format: date-time + readOnly: true + description: system-assigned update timestamp + selfLink: + type: string + format: uri + readOnly: true + description: full URI of the resource + + Donor: + properties: + id: + type: string + readOnly: true + description: unique, system-assigned identifier + name: + type: string + description: the display name of this donor + email: + type: string + description: the donor's email address + mailing_address: + type: string + description: the donor's physical address + timeCreated: + type: string + format: date-time + readOnly: true + description: system-assigned creation timestamp + updated: + type: string + format: date-time + readOnly: true + description: system-assigned update timestamp + selfLink: + type: string + format: uri + readOnly: true + description: full URI of the resource