From 53f61f34362fd2e7cc9ea7910310e42336d685c6 Mon Sep 17 00:00:00 2001 From: api-librarian Date: Wed, 26 Mar 2025 09:21:35 +0000 Subject: [PATCH 01/14] Travis update: Mar 2025 (Build 827) [skip ci] --- .github/workflows/pypi.yml | 95 ------------------------------------ .github/workflows/python.yml | 31 ++++++++++++ 2 files changed, 31 insertions(+), 95 deletions(-) delete mode 100644 .github/workflows/pypi.yml create mode 100644 .github/workflows/python.yml diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml deleted file mode 100644 index dff71f3..0000000 --- a/.github/workflows/pypi.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI - -on: push - -jobs: - build: - name: Build distribution 📦 - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.x" - - name: Install pypa/build - run: >- - python3 -m - pip install - build - --user - - name: Build a binary wheel and a source tarball - run: python3 -m build - - name: Store the distribution packages - uses: actions/upload-artifact@v4 - with: - name: python-package-distributions - path: dist/ - - publish-to-pypi: - name: >- - Publish Python 🐍 distribution 📦 to PyPI - if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes - needs: - - build - runs-on: ubuntu-latest - environment: - name: pypi - url: https://pypi.org/p/messente-api # Replace with your PyPI project name - permissions: - id-token: write # IMPORTANT: mandatory for trusted publishing - - steps: - - name: Download all the dists - uses: actions/download-artifact@v4 - with: - name: python-package-distributions - path: dist/ - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - - github-release: - name: >- - Sign the Python 🐍 distribution 📦 with Sigstore - and upload them to GitHub Release - needs: - - publish-to-pypi - runs-on: ubuntu-latest - - permissions: - contents: write # IMPORTANT: mandatory for making GitHub Releases - id-token: write # IMPORTANT: mandatory for sigstore - - steps: - - name: Download all the dists - uses: actions/download-artifact@v4 - with: - name: python-package-distributions - path: dist/ - - name: Sign the dists with Sigstore - uses: sigstore/gh-action-sigstore-python@v3.0.0 - with: - inputs: >- - ./dist/*.tar.gz - ./dist/*.whl - - name: Create GitHub Release - env: - GITHUB_TOKEN: ${{ github.token }} - run: >- - gh release create - "$GITHUB_REF_NAME" - --repo "$GITHUB_REPOSITORY" - --notes "" - - name: Upload artifact signatures to GitHub Release - env: - GITHUB_TOKEN: ${{ github.token }} - # Upload to GitHub Release using the `gh` CLI. - # `dist/` contains the built packages, and the - # sigstore-produced signatures and certificates. - run: >- - gh release upload - "$GITHUB_REF_NAME" dist/** - --repo "$GITHUB_REPOSITORY" \ No newline at end of file diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 0000000..5bb9f51 --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,31 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: messente_api Python package + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r test-requirements.txt + - name: Test with pytest + run: | + pytest --cov={{packageName}} From 0d76d3a1a8b948b2645fa2a8459506a3f383f2e8 Mon Sep 17 00:00:00 2001 From: api-librarian Date: Wed, 23 Apr 2025 17:51:03 +0000 Subject: [PATCH 02/14] Travis update: Apr 2025 (Build 832) [skip ci] --- .openapi-generator/FILES | 36 + README.md | 8 + docs/WhatsAppTemplate.md | 2 +- docs/WhatsAppTemplatesApi.md | 448 +++++ docs/WhatsappButtonType.md | 17 + docs/WhatsappComponentType.md | 17 + docs/WhatsappCreateTemplateRequest.md | 34 + docs/WhatsappCreateTemplateResponse.md | 32 + docs/WhatsappHeaderFormat.md | 11 + docs/WhatsappListTemplatesResponse.md | 31 + docs/WhatsappOtpButtonType.md | 15 + docs/WhatsappPagination.md | 32 + docs/WhatsappPagingCursors.md | 31 + docs/WhatsappSupportedApp.md | 31 + docs/WhatsappTemplateButton.md | 36 + docs/WhatsappTemplateCategory.md | 15 + docs/WhatsappTemplateComponent.md | 34 + docs/WhatsappTemplateExample.md | 31 + docs/WhatsappTemplateResponse.md | 35 + docs/WhatsappTemplateStatus.md | 15 + docs/WhatsappUpdateTemplateRequest.md | 31 + messente_api/__init__.py | 18 + messente_api/api/__init__.py | 1 + messente_api/api/whats_app_templates_api.py | 1652 +++++++++++++++++ messente_api/models/__init__.py | 17 + messente_api/models/whats_app_template.py | 4 +- messente_api/models/whatsapp_button_type.py | 40 + .../models/whatsapp_component_type.py | 40 + .../whatsapp_create_template_request.py | 118 ++ .../whatsapp_create_template_response.py | 107 ++ messente_api/models/whatsapp_header_format.py | 37 + .../whatsapp_list_templates_response.py | 115 ++ .../models/whatsapp_otp_button_type.py | 39 + messente_api/models/whatsapp_pagination.py | 109 ++ .../models/whatsapp_paging_cursors.py | 103 + messente_api/models/whatsapp_supported_app.py | 103 + .../models/whatsapp_template_button.py | 124 ++ .../models/whatsapp_template_category.py | 39 + .../models/whatsapp_template_component.py | 123 ++ .../models/whatsapp_template_example.py | 103 + .../models/whatsapp_template_response.py | 121 ++ .../models/whatsapp_template_status.py | 39 + .../whatsapp_update_template_request.py | 103 + 43 files changed, 4094 insertions(+), 3 deletions(-) create mode 100644 docs/WhatsAppTemplatesApi.md create mode 100644 docs/WhatsappButtonType.md create mode 100644 docs/WhatsappComponentType.md create mode 100644 docs/WhatsappCreateTemplateRequest.md create mode 100644 docs/WhatsappCreateTemplateResponse.md create mode 100644 docs/WhatsappHeaderFormat.md create mode 100644 docs/WhatsappListTemplatesResponse.md create mode 100644 docs/WhatsappOtpButtonType.md create mode 100644 docs/WhatsappPagination.md create mode 100644 docs/WhatsappPagingCursors.md create mode 100644 docs/WhatsappSupportedApp.md create mode 100644 docs/WhatsappTemplateButton.md create mode 100644 docs/WhatsappTemplateCategory.md create mode 100644 docs/WhatsappTemplateComponent.md create mode 100644 docs/WhatsappTemplateExample.md create mode 100644 docs/WhatsappTemplateResponse.md create mode 100644 docs/WhatsappTemplateStatus.md create mode 100644 docs/WhatsappUpdateTemplateRequest.md create mode 100644 messente_api/api/whats_app_templates_api.py create mode 100644 messente_api/models/whatsapp_button_type.py create mode 100644 messente_api/models/whatsapp_component_type.py create mode 100644 messente_api/models/whatsapp_create_template_request.py create mode 100644 messente_api/models/whatsapp_create_template_response.py create mode 100644 messente_api/models/whatsapp_header_format.py create mode 100644 messente_api/models/whatsapp_list_templates_response.py create mode 100644 messente_api/models/whatsapp_otp_button_type.py create mode 100644 messente_api/models/whatsapp_pagination.py create mode 100644 messente_api/models/whatsapp_paging_cursors.py create mode 100644 messente_api/models/whatsapp_supported_app.py create mode 100644 messente_api/models/whatsapp_template_button.py create mode 100644 messente_api/models/whatsapp_template_category.py create mode 100644 messente_api/models/whatsapp_template_component.py create mode 100644 messente_api/models/whatsapp_template_example.py create mode 100644 messente_api/models/whatsapp_template_response.py create mode 100644 messente_api/models/whatsapp_template_status.py create mode 100644 messente_api/models/whatsapp_update_template_request.py diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index d62c762..9cf3f06 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -71,7 +71,25 @@ docs/WhatsAppLanguage.md docs/WhatsAppMedia.md docs/WhatsAppParameter.md docs/WhatsAppTemplate.md +docs/WhatsAppTemplatesApi.md docs/WhatsAppText.md +docs/WhatsappButtonType.md +docs/WhatsappComponentType.md +docs/WhatsappCreateTemplateRequest.md +docs/WhatsappCreateTemplateResponse.md +docs/WhatsappHeaderFormat.md +docs/WhatsappListTemplatesResponse.md +docs/WhatsappOtpButtonType.md +docs/WhatsappPagination.md +docs/WhatsappPagingCursors.md +docs/WhatsappSupportedApp.md +docs/WhatsappTemplateButton.md +docs/WhatsappTemplateCategory.md +docs/WhatsappTemplateComponent.md +docs/WhatsappTemplateExample.md +docs/WhatsappTemplateResponse.md +docs/WhatsappTemplateStatus.md +docs/WhatsappUpdateTemplateRequest.md git_push.sh messente_api/__init__.py messente_api/api/__init__.py @@ -83,6 +101,7 @@ messente_api/api/groups_api.py messente_api/api/number_lookup_api.py messente_api/api/omnimessage_api.py messente_api/api/statistics_api.py +messente_api/api/whats_app_templates_api.py messente_api/api_client.py messente_api/api_response.py messente_api/configuration.py @@ -148,6 +167,23 @@ messente_api/models/whats_app_media.py messente_api/models/whats_app_parameter.py messente_api/models/whats_app_template.py messente_api/models/whats_app_text.py +messente_api/models/whatsapp_button_type.py +messente_api/models/whatsapp_component_type.py +messente_api/models/whatsapp_create_template_request.py +messente_api/models/whatsapp_create_template_response.py +messente_api/models/whatsapp_header_format.py +messente_api/models/whatsapp_list_templates_response.py +messente_api/models/whatsapp_otp_button_type.py +messente_api/models/whatsapp_pagination.py +messente_api/models/whatsapp_paging_cursors.py +messente_api/models/whatsapp_supported_app.py +messente_api/models/whatsapp_template_button.py +messente_api/models/whatsapp_template_category.py +messente_api/models/whatsapp_template_component.py +messente_api/models/whatsapp_template_example.py +messente_api/models/whatsapp_template_response.py +messente_api/models/whatsapp_template_status.py +messente_api/models/whatsapp_update_template_request.py messente_api/py.typed messente_api/rest.py pyproject.toml diff --git a/README.md b/README.md index ae150c3..f4caf96 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,14 @@ Messente API Library provides the operations described below to access the featu 1. Requests statistics reports for each country [`create_statistics_report`](docs/StatisticsApi.md#create_statistics_report) +### WhatsAppTemplatesApi + +1. Creates a WhatsApp template [`create_whatsapp_template`](docs/WhatsAppTemplatesApi.md#create_whatsapp_template) +1. Deletes a WhatsApp template [`delete_whatsapp_template`](docs/WhatsAppTemplatesApi.md#delete_whatsapp_template) +1. Requests a WhatsApp template with the given ID [`get_whatsapp_template_by_id`](docs/WhatsAppTemplatesApi.md#get_whatsapp_template_by_id) +1. Requests a list of WhatsApp templates [`list_whatsapp_templates`](docs/WhatsAppTemplatesApi.md#list_whatsapp_templates) +1. Updates a WhatsApp template [`update_whatsapp_template`](docs/WhatsAppTemplatesApi.md#update_whatsapp_template) + ## Auth **Type**: HTTP basic authentication diff --git a/docs/WhatsAppTemplate.md b/docs/WhatsAppTemplate.md index 4b8397d..6955f1d 100644 --- a/docs/WhatsAppTemplate.md +++ b/docs/WhatsAppTemplate.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Name of the template | **language** | [**WhatsAppLanguage**](WhatsAppLanguage.md) | | -**components** | [**List[WhatsAppComponent]**](WhatsAppComponent.md) | List of template components | [optional] +**components** | [**List[WhatsAppComponent]**](WhatsAppComponent.md) | List of template components | ## Example diff --git a/docs/WhatsAppTemplatesApi.md b/docs/WhatsAppTemplatesApi.md new file mode 100644 index 0000000..6bdfd2e --- /dev/null +++ b/docs/WhatsAppTemplatesApi.md @@ -0,0 +1,448 @@ +# messente_api.WhatsAppTemplatesApi + +All URIs are relative to *https://api.messente.com/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_whatsapp_template**](WhatsAppTemplatesApi.md#create_whatsapp_template) | **POST** /whatsapp/wabas/{wabaId}/templates | Creates a WhatsApp template +[**delete_whatsapp_template**](WhatsAppTemplatesApi.md#delete_whatsapp_template) | **DELETE** /whatsapp/wabas/{wabaId}/templates | Deletes a WhatsApp template +[**get_whatsapp_template_by_id**](WhatsAppTemplatesApi.md#get_whatsapp_template_by_id) | **GET** /whatsapp/wabas/{wabaId}/templates/{templateId} | Requests a WhatsApp template with the given ID +[**list_whatsapp_templates**](WhatsAppTemplatesApi.md#list_whatsapp_templates) | **GET** /whatsapp/wabas/{wabaId}/templates | Requests a list of WhatsApp templates +[**update_whatsapp_template**](WhatsAppTemplatesApi.md#update_whatsapp_template) | **PUT** /whatsapp/wabas/{wabaId}/templates/{templateId} | Updates a WhatsApp template + + +# **create_whatsapp_template** +> WhatsappCreateTemplateResponse create_whatsapp_template(waba_id, whatsapp_create_template_request) + +Creates a WhatsApp template + +### Example + +* Basic Authentication (basicAuth): + +```python +import messente_api +from messente_api.models.whatsapp_create_template_request import WhatsappCreateTemplateRequest +from messente_api.models.whatsapp_create_template_response import WhatsappCreateTemplateResponse +from messente_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.messente.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = messente_api.Configuration( + host = "https://api.messente.com/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = messente_api.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with messente_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = messente_api.WhatsAppTemplatesApi(api_client) + waba_id = 'waba_id_example' # str | The ID of the WABA + whatsapp_create_template_request = messente_api.WhatsappCreateTemplateRequest() # WhatsappCreateTemplateRequest | The WhatsApp template to create + + try: + # Creates a WhatsApp template + api_response = api_instance.create_whatsapp_template(waba_id, whatsapp_create_template_request) + print("The response of WhatsAppTemplatesApi->create_whatsapp_template:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WhatsAppTemplatesApi->create_whatsapp_template: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **waba_id** | **str**| The ID of the WABA | + **whatsapp_create_template_request** | [**WhatsappCreateTemplateRequest**](WhatsappCreateTemplateRequest.md)| The WhatsApp template to create | + +### Return type + +[**WhatsappCreateTemplateResponse**](WhatsappCreateTemplateResponse.md) + +### Authorization + +[basicAuth](../README.md#basicAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Invalid input | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**500** | Internal Server Error | - | + +[[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) + +# **delete_whatsapp_template** +> Dict[str, object] delete_whatsapp_template(waba_id, name, hsm_id=hsm_id) + +Deletes a WhatsApp template + +### Example + +* Basic Authentication (basicAuth): + +```python +import messente_api +from messente_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.messente.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = messente_api.Configuration( + host = "https://api.messente.com/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = messente_api.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with messente_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = messente_api.WhatsAppTemplatesApi(api_client) + waba_id = 'waba_id_example' # str | The ID of the WABA + name = 'template_name' # str | The name of the template to delete + hsm_id = '1' # str | The ID of the template to delete (optional) + + try: + # Deletes a WhatsApp template + api_response = api_instance.delete_whatsapp_template(waba_id, name, hsm_id=hsm_id) + print("The response of WhatsAppTemplatesApi->delete_whatsapp_template:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WhatsAppTemplatesApi->delete_whatsapp_template: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **waba_id** | **str**| The ID of the WABA | + **name** | **str**| The name of the template to delete | + **hsm_id** | **str**| The ID of the template to delete | [optional] + +### Return type + +**Dict[str, object]** + +### Authorization + +[basicAuth](../README.md#basicAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Invalid input | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**500** | Internal Server Error | - | + +[[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) + +# **get_whatsapp_template_by_id** +> WhatsappTemplateResponse get_whatsapp_template_by_id(waba_id, template_id) + +Requests a WhatsApp template with the given ID + +### Example + +* Basic Authentication (basicAuth): + +```python +import messente_api +from messente_api.models.whatsapp_template_response import WhatsappTemplateResponse +from messente_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.messente.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = messente_api.Configuration( + host = "https://api.messente.com/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = messente_api.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with messente_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = messente_api.WhatsAppTemplatesApi(api_client) + waba_id = 'waba_id_example' # str | The ID of the WABA + template_id = 'template_id_example' # str | The ID of the template to retrieve + + try: + # Requests a WhatsApp template with the given ID + api_response = api_instance.get_whatsapp_template_by_id(waba_id, template_id) + print("The response of WhatsAppTemplatesApi->get_whatsapp_template_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WhatsAppTemplatesApi->get_whatsapp_template_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **waba_id** | **str**| The ID of the WABA | + **template_id** | **str**| The ID of the template to retrieve | + +### Return type + +[**WhatsappTemplateResponse**](WhatsappTemplateResponse.md) + +### Authorization + +[basicAuth](../README.md#basicAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Invalid input | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**500** | Internal Server Error | - | + +[[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) + +# **list_whatsapp_templates** +> WhatsappListTemplatesResponse list_whatsapp_templates(waba_id, limit=limit, before=before, after=after, category=category, content=content, language=language, name=name, status=status) + +Requests a list of WhatsApp templates + +### Example + +* Basic Authentication (basicAuth): + +```python +import messente_api +from messente_api.models.whatsapp_list_templates_response import WhatsappListTemplatesResponse +from messente_api.models.whatsapp_template_category import WhatsappTemplateCategory +from messente_api.models.whatsapp_template_status import WhatsappTemplateStatus +from messente_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.messente.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = messente_api.Configuration( + host = "https://api.messente.com/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = messente_api.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with messente_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = messente_api.WhatsAppTemplatesApi(api_client) + waba_id = 'waba_id_example' # str | The ID of the WABA + limit = 25 # int | The number of templates to return in the list. Although the max size is 500, for large datasets it is recommended to use a lower limit and instead use pagination to avoid potential timeouts. Defaults to 25. (optional) (default to 25) + before = 'MAZDZD' # str | A cursor point used for a paginated request to indicate the template to paginate backwards from. (optional) + after = 'MjQZD' # str | A cursor point used for a paginated request to indicate the template to paginate forwards from. (optional) + category = messente_api.WhatsappTemplateCategory() # WhatsappTemplateCategory | A filter for returning only templates matching a specific category. (optional) + content = 'special offer' # str | A search filter representing the content of a template. Only matching templates will be returned in the list. (optional) + language = 'en' # str | A filter for returning only templates matching a specific language code. A list of supported languages is available in the [WhatsApp documentation](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates/) (optional) + name = 'Sample Template' # str | A search filter representing the name, either full or partial, of a template. Only matching templates will be returned in the list. (optional) + status = messente_api.WhatsappTemplateStatus() # WhatsappTemplateStatus | A filter for returning only templates matching a specific status. (optional) + + try: + # Requests a list of WhatsApp templates + api_response = api_instance.list_whatsapp_templates(waba_id, limit=limit, before=before, after=after, category=category, content=content, language=language, name=name, status=status) + print("The response of WhatsAppTemplatesApi->list_whatsapp_templates:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WhatsAppTemplatesApi->list_whatsapp_templates: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **waba_id** | **str**| The ID of the WABA | + **limit** | **int**| The number of templates to return in the list. Although the max size is 500, for large datasets it is recommended to use a lower limit and instead use pagination to avoid potential timeouts. Defaults to 25. | [optional] [default to 25] + **before** | **str**| A cursor point used for a paginated request to indicate the template to paginate backwards from. | [optional] + **after** | **str**| A cursor point used for a paginated request to indicate the template to paginate forwards from. | [optional] + **category** | [**WhatsappTemplateCategory**](.md)| A filter for returning only templates matching a specific category. | [optional] + **content** | **str**| A search filter representing the content of a template. Only matching templates will be returned in the list. | [optional] + **language** | **str**| A filter for returning only templates matching a specific language code. A list of supported languages is available in the [WhatsApp documentation](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates/) | [optional] + **name** | **str**| A search filter representing the name, either full or partial, of a template. Only matching templates will be returned in the list. | [optional] + **status** | [**WhatsappTemplateStatus**](.md)| A filter for returning only templates matching a specific status. | [optional] + +### Return type + +[**WhatsappListTemplatesResponse**](WhatsappListTemplatesResponse.md) + +### Authorization + +[basicAuth](../README.md#basicAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Invalid input | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**500** | Internal Server Error | - | + +[[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) + +# **update_whatsapp_template** +> Dict[str, object] update_whatsapp_template(waba_id, template_id, whatsapp_update_template_request) + +Updates a WhatsApp template + +### Example + +* Basic Authentication (basicAuth): + +```python +import messente_api +from messente_api.models.whatsapp_update_template_request import WhatsappUpdateTemplateRequest +from messente_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.messente.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = messente_api.Configuration( + host = "https://api.messente.com/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: basicAuth +configuration = messente_api.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with messente_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = messente_api.WhatsAppTemplatesApi(api_client) + waba_id = 'waba_id_example' # str | The ID of the WABA + template_id = 'template_id_example' # str | The ID of the template to update + whatsapp_update_template_request = messente_api.WhatsappUpdateTemplateRequest() # WhatsappUpdateTemplateRequest | The template data to be updated + + try: + # Updates a WhatsApp template + api_response = api_instance.update_whatsapp_template(waba_id, template_id, whatsapp_update_template_request) + print("The response of WhatsAppTemplatesApi->update_whatsapp_template:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling WhatsAppTemplatesApi->update_whatsapp_template: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **waba_id** | **str**| The ID of the WABA | + **template_id** | **str**| The ID of the template to update | + **whatsapp_update_template_request** | [**WhatsappUpdateTemplateRequest**](WhatsappUpdateTemplateRequest.md)| The template data to be updated | + +### Return type + +**Dict[str, object]** + +### Authorization + +[basicAuth](../README.md#basicAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Invalid input | - | +**401** | Unauthorized | - | +**403** | Forbidden | - | +**500** | Internal Server Error | - | + +[[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/docs/WhatsappButtonType.md b/docs/WhatsappButtonType.md new file mode 100644 index 0000000..808001a --- /dev/null +++ b/docs/WhatsappButtonType.md @@ -0,0 +1,17 @@ +# WhatsappButtonType + +Type of the button + +## Enum + +* `QUICK_REPLY` (value: `'quick_reply'`) + +* `PHONE_NUMBER` (value: `'phone_number'`) + +* `OTP` (value: `'otp'`) + +* `URL` (value: `'url'`) + +[[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/docs/WhatsappComponentType.md b/docs/WhatsappComponentType.md new file mode 100644 index 0000000..b0bf099 --- /dev/null +++ b/docs/WhatsappComponentType.md @@ -0,0 +1,17 @@ +# WhatsappComponentType + +Type of the component + +## Enum + +* `BODY` (value: `'body'`) + +* `HEADER` (value: `'header'`) + +* `FOOTER` (value: `'footer'`) + +* `BUTTONS` (value: `'buttons'`) + +[[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/docs/WhatsappCreateTemplateRequest.md b/docs/WhatsappCreateTemplateRequest.md new file mode 100644 index 0000000..58c7e01 --- /dev/null +++ b/docs/WhatsappCreateTemplateRequest.md @@ -0,0 +1,34 @@ +# WhatsappCreateTemplateRequest + +Request to create a WhatsApp template + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Name of the template | +**category** | [**WhatsappTemplateCategory**](WhatsappTemplateCategory.md) | | +**allow_category_change** | **bool** | Allow category change | [optional] [default to False] +**language** | **str** | Language of the template | +**components** | [**List[WhatsappTemplateComponent]**](WhatsappTemplateComponent.md) | List of template components | + +## Example + +```python +from messente_api.models.whatsapp_create_template_request import WhatsappCreateTemplateRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of WhatsappCreateTemplateRequest from a JSON string +whatsapp_create_template_request_instance = WhatsappCreateTemplateRequest.from_json(json) +# print the JSON string representation of the object +print(WhatsappCreateTemplateRequest.to_json()) + +# convert the object into a dict +whatsapp_create_template_request_dict = whatsapp_create_template_request_instance.to_dict() +# create an instance of WhatsappCreateTemplateRequest from a dict +whatsapp_create_template_request_from_dict = WhatsappCreateTemplateRequest.from_dict(whatsapp_create_template_request_dict) +``` +[[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/docs/WhatsappCreateTemplateResponse.md b/docs/WhatsappCreateTemplateResponse.md new file mode 100644 index 0000000..17c2913 --- /dev/null +++ b/docs/WhatsappCreateTemplateResponse.md @@ -0,0 +1,32 @@ +# WhatsappCreateTemplateResponse + +Response for creating a WhatsApp template + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Template ID | +**status** | [**WhatsappTemplateStatus**](WhatsappTemplateStatus.md) | | +**category** | [**WhatsappTemplateCategory**](WhatsappTemplateCategory.md) | | + +## Example + +```python +from messente_api.models.whatsapp_create_template_response import WhatsappCreateTemplateResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of WhatsappCreateTemplateResponse from a JSON string +whatsapp_create_template_response_instance = WhatsappCreateTemplateResponse.from_json(json) +# print the JSON string representation of the object +print(WhatsappCreateTemplateResponse.to_json()) + +# convert the object into a dict +whatsapp_create_template_response_dict = whatsapp_create_template_response_instance.to_dict() +# create an instance of WhatsappCreateTemplateResponse from a dict +whatsapp_create_template_response_from_dict = WhatsappCreateTemplateResponse.from_dict(whatsapp_create_template_response_dict) +``` +[[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/docs/WhatsappHeaderFormat.md b/docs/WhatsappHeaderFormat.md new file mode 100644 index 0000000..24b3d58 --- /dev/null +++ b/docs/WhatsappHeaderFormat.md @@ -0,0 +1,11 @@ +# WhatsappHeaderFormat + +Format of the header component + +## Enum + +* `TEXT` (value: `'text'`) + +[[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/docs/WhatsappListTemplatesResponse.md b/docs/WhatsappListTemplatesResponse.md new file mode 100644 index 0000000..613e3c7 --- /dev/null +++ b/docs/WhatsappListTemplatesResponse.md @@ -0,0 +1,31 @@ +# WhatsappListTemplatesResponse + +Whatsapp Cloud API list of templates response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**templates** | [**List[WhatsappTemplateResponse]**](WhatsappTemplateResponse.md) | List of templates | +**paging** | [**WhatsappPagination**](WhatsappPagination.md) | | + +## Example + +```python +from messente_api.models.whatsapp_list_templates_response import WhatsappListTemplatesResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of WhatsappListTemplatesResponse from a JSON string +whatsapp_list_templates_response_instance = WhatsappListTemplatesResponse.from_json(json) +# print the JSON string representation of the object +print(WhatsappListTemplatesResponse.to_json()) + +# convert the object into a dict +whatsapp_list_templates_response_dict = whatsapp_list_templates_response_instance.to_dict() +# create an instance of WhatsappListTemplatesResponse from a dict +whatsapp_list_templates_response_from_dict = WhatsappListTemplatesResponse.from_dict(whatsapp_list_templates_response_dict) +``` +[[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/docs/WhatsappOtpButtonType.md b/docs/WhatsappOtpButtonType.md new file mode 100644 index 0000000..89cbe91 --- /dev/null +++ b/docs/WhatsappOtpButtonType.md @@ -0,0 +1,15 @@ +# WhatsappOtpButtonType + +Type of the OTP button + +## Enum + +* `COPY_CODE` (value: `'copy_code'`) + +* `ONE_TAP` (value: `'one_tap'`) + +* `ZERO_TAP` (value: `'zero_tap'`) + +[[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/docs/WhatsappPagination.md b/docs/WhatsappPagination.md new file mode 100644 index 0000000..e3520cc --- /dev/null +++ b/docs/WhatsappPagination.md @@ -0,0 +1,32 @@ +# WhatsappPagination + +Whatsapp media object. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**previous** | **str** | A URL to ge the previous paginated page. | [optional] +**next** | **str** | A URL to ge the next paginated page. | [optional] +**cursors** | [**WhatsappPagingCursors**](WhatsappPagingCursors.md) | | + +## Example + +```python +from messente_api.models.whatsapp_pagination import WhatsappPagination + +# TODO update the JSON string below +json = "{}" +# create an instance of WhatsappPagination from a JSON string +whatsapp_pagination_instance = WhatsappPagination.from_json(json) +# print the JSON string representation of the object +print(WhatsappPagination.to_json()) + +# convert the object into a dict +whatsapp_pagination_dict = whatsapp_pagination_instance.to_dict() +# create an instance of WhatsappPagination from a dict +whatsapp_pagination_from_dict = WhatsappPagination.from_dict(whatsapp_pagination_dict) +``` +[[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/docs/WhatsappPagingCursors.md b/docs/WhatsappPagingCursors.md new file mode 100644 index 0000000..ff353f2 --- /dev/null +++ b/docs/WhatsappPagingCursors.md @@ -0,0 +1,31 @@ +# WhatsappPagingCursors + +WhatsApp paging cursors object. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**before** | **str** | The template before the first template in the current list | [optional] +**after** | **str** | The template after the last template in the current list | [optional] + +## Example + +```python +from messente_api.models.whatsapp_paging_cursors import WhatsappPagingCursors + +# TODO update the JSON string below +json = "{}" +# create an instance of WhatsappPagingCursors from a JSON string +whatsapp_paging_cursors_instance = WhatsappPagingCursors.from_json(json) +# print the JSON string representation of the object +print(WhatsappPagingCursors.to_json()) + +# convert the object into a dict +whatsapp_paging_cursors_dict = whatsapp_paging_cursors_instance.to_dict() +# create an instance of WhatsappPagingCursors from a dict +whatsapp_paging_cursors_from_dict = WhatsappPagingCursors.from_dict(whatsapp_paging_cursors_dict) +``` +[[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/docs/WhatsappSupportedApp.md b/docs/WhatsappSupportedApp.md new file mode 100644 index 0000000..85ede2b --- /dev/null +++ b/docs/WhatsappSupportedApp.md @@ -0,0 +1,31 @@ +# WhatsappSupportedApp + +Supported app for the button + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**package_name** | **str** | Package name | +**signature_hash** | **str** | Signature hash | + +## Example + +```python +from messente_api.models.whatsapp_supported_app import WhatsappSupportedApp + +# TODO update the JSON string below +json = "{}" +# create an instance of WhatsappSupportedApp from a JSON string +whatsapp_supported_app_instance = WhatsappSupportedApp.from_json(json) +# print the JSON string representation of the object +print(WhatsappSupportedApp.to_json()) + +# convert the object into a dict +whatsapp_supported_app_dict = whatsapp_supported_app_instance.to_dict() +# create an instance of WhatsappSupportedApp from a dict +whatsapp_supported_app_from_dict = WhatsappSupportedApp.from_dict(whatsapp_supported_app_dict) +``` +[[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/docs/WhatsappTemplateButton.md b/docs/WhatsappTemplateButton.md new file mode 100644 index 0000000..2c1d7fa --- /dev/null +++ b/docs/WhatsappTemplateButton.md @@ -0,0 +1,36 @@ +# WhatsappTemplateButton + +Whatsapp button object. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**WhatsappButtonType**](WhatsappButtonType.md) | | [optional] +**otp_type** | [**WhatsappOtpButtonType**](WhatsappOtpButtonType.md) | | [optional] +**autofill_text** | **str** | Text to be autofilled in the OTP field | [optional] +**supported_apps** | [**List[WhatsappSupportedApp]**](WhatsappSupportedApp.md) | List of supported apps for the button | [optional] +**text** | **str** | Text content of the button | [optional] +**phone_number** | **str** | Phone number for the button | [optional] +**url** | **str** | URL for the button | [optional] + +## Example + +```python +from messente_api.models.whatsapp_template_button import WhatsappTemplateButton + +# TODO update the JSON string below +json = "{}" +# create an instance of WhatsappTemplateButton from a JSON string +whatsapp_template_button_instance = WhatsappTemplateButton.from_json(json) +# print the JSON string representation of the object +print(WhatsappTemplateButton.to_json()) + +# convert the object into a dict +whatsapp_template_button_dict = whatsapp_template_button_instance.to_dict() +# create an instance of WhatsappTemplateButton from a dict +whatsapp_template_button_from_dict = WhatsappTemplateButton.from_dict(whatsapp_template_button_dict) +``` +[[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/docs/WhatsappTemplateCategory.md b/docs/WhatsappTemplateCategory.md new file mode 100644 index 0000000..68b63f5 --- /dev/null +++ b/docs/WhatsappTemplateCategory.md @@ -0,0 +1,15 @@ +# WhatsappTemplateCategory + +Template category + +## Enum + +* `AUTHENTICATION` (value: `'authentication'`) + +* `MARKETING` (value: `'marketing'`) + +* `UTILITY` (value: `'utility'`) + +[[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/docs/WhatsappTemplateComponent.md b/docs/WhatsappTemplateComponent.md new file mode 100644 index 0000000..a40ad05 --- /dev/null +++ b/docs/WhatsappTemplateComponent.md @@ -0,0 +1,34 @@ +# WhatsappTemplateComponent + +Template component object + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**WhatsappComponentType**](WhatsappComponentType.md) | | [optional] +**format** | [**WhatsappHeaderFormat**](WhatsappHeaderFormat.md) | | [optional] +**text** | **str** | Text content of the component | [optional] +**example** | [**WhatsappTemplateExample**](WhatsappTemplateExample.md) | | [optional] +**buttons** | [**List[WhatsappTemplateButton]**](WhatsappTemplateButton.md) | List of buttons for the component | [optional] + +## Example + +```python +from messente_api.models.whatsapp_template_component import WhatsappTemplateComponent + +# TODO update the JSON string below +json = "{}" +# create an instance of WhatsappTemplateComponent from a JSON string +whatsapp_template_component_instance = WhatsappTemplateComponent.from_json(json) +# print the JSON string representation of the object +print(WhatsappTemplateComponent.to_json()) + +# convert the object into a dict +whatsapp_template_component_dict = whatsapp_template_component_instance.to_dict() +# create an instance of WhatsappTemplateComponent from a dict +whatsapp_template_component_from_dict = WhatsappTemplateComponent.from_dict(whatsapp_template_component_dict) +``` +[[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/docs/WhatsappTemplateExample.md b/docs/WhatsappTemplateExample.md new file mode 100644 index 0000000..a5266e3 --- /dev/null +++ b/docs/WhatsappTemplateExample.md @@ -0,0 +1,31 @@ +# WhatsappTemplateExample + +Example of the templated content + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**header_text** | **List[List[str]]** | Example of the templated text for the header | [optional] +**body_text** | **List[List[str]]** | Example of the templated text for the body | [optional] + +## Example + +```python +from messente_api.models.whatsapp_template_example import WhatsappTemplateExample + +# TODO update the JSON string below +json = "{}" +# create an instance of WhatsappTemplateExample from a JSON string +whatsapp_template_example_instance = WhatsappTemplateExample.from_json(json) +# print the JSON string representation of the object +print(WhatsappTemplateExample.to_json()) + +# convert the object into a dict +whatsapp_template_example_dict = whatsapp_template_example_instance.to_dict() +# create an instance of WhatsappTemplateExample from a dict +whatsapp_template_example_from_dict = WhatsappTemplateExample.from_dict(whatsapp_template_example_dict) +``` +[[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/docs/WhatsappTemplateResponse.md b/docs/WhatsappTemplateResponse.md new file mode 100644 index 0000000..cea1086 --- /dev/null +++ b/docs/WhatsappTemplateResponse.md @@ -0,0 +1,35 @@ +# WhatsappTemplateResponse + +Whatsapp Cloud API template + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Template ID | +**components** | [**List[WhatsappTemplateComponent]**](WhatsappTemplateComponent.md) | List of template components | +**language** | **str** | Language of the template | +**name** | **str** | Name of the template | +**category** | [**WhatsappTemplateCategory**](WhatsappTemplateCategory.md) | | +**status** | [**WhatsappTemplateStatus**](WhatsappTemplateStatus.md) | | + +## Example + +```python +from messente_api.models.whatsapp_template_response import WhatsappTemplateResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of WhatsappTemplateResponse from a JSON string +whatsapp_template_response_instance = WhatsappTemplateResponse.from_json(json) +# print the JSON string representation of the object +print(WhatsappTemplateResponse.to_json()) + +# convert the object into a dict +whatsapp_template_response_dict = whatsapp_template_response_instance.to_dict() +# create an instance of WhatsappTemplateResponse from a dict +whatsapp_template_response_from_dict = WhatsappTemplateResponse.from_dict(whatsapp_template_response_dict) +``` +[[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/docs/WhatsappTemplateStatus.md b/docs/WhatsappTemplateStatus.md new file mode 100644 index 0000000..aafbf16 --- /dev/null +++ b/docs/WhatsappTemplateStatus.md @@ -0,0 +1,15 @@ +# WhatsappTemplateStatus + +Template status + +## Enum + +* `APPROVED` (value: `'approved'`) + +* `REJECTED` (value: `'rejected'`) + +* `PENDING` (value: `'pending'`) + +[[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/docs/WhatsappUpdateTemplateRequest.md b/docs/WhatsappUpdateTemplateRequest.md new file mode 100644 index 0000000..2a7a6cb --- /dev/null +++ b/docs/WhatsappUpdateTemplateRequest.md @@ -0,0 +1,31 @@ +# WhatsappUpdateTemplateRequest + +Request to create a WhatsApp template + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | [**WhatsappTemplateCategory**](WhatsappTemplateCategory.md) | | [optional] +**components** | [**List[WhatsappTemplateComponent]**](WhatsappTemplateComponent.md) | List of template components | [optional] + +## Example + +```python +from messente_api.models.whatsapp_update_template_request import WhatsappUpdateTemplateRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of WhatsappUpdateTemplateRequest from a JSON string +whatsapp_update_template_request_instance = WhatsappUpdateTemplateRequest.from_json(json) +# print the JSON string representation of the object +print(WhatsappUpdateTemplateRequest.to_json()) + +# convert the object into a dict +whatsapp_update_template_request_dict = whatsapp_update_template_request_instance.to_dict() +# create an instance of WhatsappUpdateTemplateRequest from a dict +whatsapp_update_template_request_from_dict = WhatsappUpdateTemplateRequest.from_dict(whatsapp_update_template_request_dict) +``` +[[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/messente_api/__init__.py b/messente_api/__init__.py index d7ad337..845d422 100644 --- a/messente_api/__init__.py +++ b/messente_api/__init__.py @@ -26,6 +26,7 @@ from messente_api.api.number_lookup_api import NumberLookupApi from messente_api.api.omnimessage_api import OmnimessageApi from messente_api.api.statistics_api import StatisticsApi +from messente_api.api.whats_app_templates_api import WhatsAppTemplatesApi # import ApiClient from messente_api.api_response import ApiResponse @@ -99,3 +100,20 @@ from messente_api.models.whats_app_parameter import WhatsAppParameter from messente_api.models.whats_app_template import WhatsAppTemplate from messente_api.models.whats_app_text import WhatsAppText +from messente_api.models.whatsapp_button_type import WhatsappButtonType +from messente_api.models.whatsapp_component_type import WhatsappComponentType +from messente_api.models.whatsapp_create_template_request import WhatsappCreateTemplateRequest +from messente_api.models.whatsapp_create_template_response import WhatsappCreateTemplateResponse +from messente_api.models.whatsapp_header_format import WhatsappHeaderFormat +from messente_api.models.whatsapp_list_templates_response import WhatsappListTemplatesResponse +from messente_api.models.whatsapp_otp_button_type import WhatsappOtpButtonType +from messente_api.models.whatsapp_pagination import WhatsappPagination +from messente_api.models.whatsapp_paging_cursors import WhatsappPagingCursors +from messente_api.models.whatsapp_supported_app import WhatsappSupportedApp +from messente_api.models.whatsapp_template_button import WhatsappTemplateButton +from messente_api.models.whatsapp_template_category import WhatsappTemplateCategory +from messente_api.models.whatsapp_template_component import WhatsappTemplateComponent +from messente_api.models.whatsapp_template_example import WhatsappTemplateExample +from messente_api.models.whatsapp_template_response import WhatsappTemplateResponse +from messente_api.models.whatsapp_template_status import WhatsappTemplateStatus +from messente_api.models.whatsapp_update_template_request import WhatsappUpdateTemplateRequest diff --git a/messente_api/api/__init__.py b/messente_api/api/__init__.py index f8f4079..2d173f4 100644 --- a/messente_api/api/__init__.py +++ b/messente_api/api/__init__.py @@ -9,4 +9,5 @@ from messente_api.api.number_lookup_api import NumberLookupApi from messente_api.api.omnimessage_api import OmnimessageApi from messente_api.api.statistics_api import StatisticsApi +from messente_api.api.whats_app_templates_api import WhatsAppTemplatesApi diff --git a/messente_api/api/whats_app_templates_api.py b/messente_api/api/whats_app_templates_api.py new file mode 100644 index 0000000..7009036 --- /dev/null +++ b/messente_api/api/whats_app_templates_api.py @@ -0,0 +1,1652 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import Any, Dict, Optional +from typing_extensions import Annotated +from messente_api.models.whatsapp_create_template_request import WhatsappCreateTemplateRequest +from messente_api.models.whatsapp_create_template_response import WhatsappCreateTemplateResponse +from messente_api.models.whatsapp_list_templates_response import WhatsappListTemplatesResponse +from messente_api.models.whatsapp_template_category import WhatsappTemplateCategory +from messente_api.models.whatsapp_template_response import WhatsappTemplateResponse +from messente_api.models.whatsapp_template_status import WhatsappTemplateStatus +from messente_api.models.whatsapp_update_template_request import WhatsappUpdateTemplateRequest + +from messente_api.api_client import ApiClient, RequestSerialized +from messente_api.api_response import ApiResponse +from messente_api.rest import RESTResponseType + + +class WhatsAppTemplatesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def create_whatsapp_template( + self, + waba_id: Annotated[StrictStr, Field(description="The ID of the WABA")], + whatsapp_create_template_request: Annotated[WhatsappCreateTemplateRequest, Field(description="The WhatsApp template to create")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WhatsappCreateTemplateResponse: + """Creates a WhatsApp template + + + :param waba_id: The ID of the WABA (required) + :type waba_id: str + :param whatsapp_create_template_request: The WhatsApp template to create (required) + :type whatsapp_create_template_request: WhatsappCreateTemplateRequest + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_whatsapp_template_serialize( + waba_id=waba_id, + whatsapp_create_template_request=whatsapp_create_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WhatsappCreateTemplateResponse", + '400': "ErrorOmnichannel", + '401': "ErrorOmnichannel", + '403': "ErrorOmnichannel", + '500': "ErrorOmnichannel", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_whatsapp_template_with_http_info( + self, + waba_id: Annotated[StrictStr, Field(description="The ID of the WABA")], + whatsapp_create_template_request: Annotated[WhatsappCreateTemplateRequest, Field(description="The WhatsApp template to create")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WhatsappCreateTemplateResponse]: + """Creates a WhatsApp template + + + :param waba_id: The ID of the WABA (required) + :type waba_id: str + :param whatsapp_create_template_request: The WhatsApp template to create (required) + :type whatsapp_create_template_request: WhatsappCreateTemplateRequest + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_whatsapp_template_serialize( + waba_id=waba_id, + whatsapp_create_template_request=whatsapp_create_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WhatsappCreateTemplateResponse", + '400': "ErrorOmnichannel", + '401': "ErrorOmnichannel", + '403': "ErrorOmnichannel", + '500': "ErrorOmnichannel", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_whatsapp_template_without_preload_content( + self, + waba_id: Annotated[StrictStr, Field(description="The ID of the WABA")], + whatsapp_create_template_request: Annotated[WhatsappCreateTemplateRequest, Field(description="The WhatsApp template to create")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Creates a WhatsApp template + + + :param waba_id: The ID of the WABA (required) + :type waba_id: str + :param whatsapp_create_template_request: The WhatsApp template to create (required) + :type whatsapp_create_template_request: WhatsappCreateTemplateRequest + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_whatsapp_template_serialize( + waba_id=waba_id, + whatsapp_create_template_request=whatsapp_create_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WhatsappCreateTemplateResponse", + '400': "ErrorOmnichannel", + '401': "ErrorOmnichannel", + '403': "ErrorOmnichannel", + '500': "ErrorOmnichannel", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_whatsapp_template_serialize( + self, + waba_id, + whatsapp_create_template_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if waba_id is not None: + _path_params['wabaId'] = waba_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if whatsapp_create_template_request is not None: + _body_params = whatsapp_create_template_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/whatsapp/wabas/{wabaId}/templates', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_whatsapp_template( + self, + waba_id: Annotated[StrictStr, Field(description="The ID of the WABA")], + name: Annotated[StrictStr, Field(description="The name of the template to delete")], + hsm_id: Annotated[Optional[StrictStr], Field(description="The ID of the template to delete")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Dict[str, object]: + """Deletes a WhatsApp template + + + :param waba_id: The ID of the WABA (required) + :type waba_id: str + :param name: The name of the template to delete (required) + :type name: str + :param hsm_id: The ID of the template to delete + :type hsm_id: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_whatsapp_template_serialize( + waba_id=waba_id, + name=name, + hsm_id=hsm_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, object]", + '400': "ErrorOmnichannel", + '401': "ErrorOmnichannel", + '403': "ErrorOmnichannel", + '500': "ErrorOmnichannel", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_whatsapp_template_with_http_info( + self, + waba_id: Annotated[StrictStr, Field(description="The ID of the WABA")], + name: Annotated[StrictStr, Field(description="The name of the template to delete")], + hsm_id: Annotated[Optional[StrictStr], Field(description="The ID of the template to delete")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Dict[str, object]]: + """Deletes a WhatsApp template + + + :param waba_id: The ID of the WABA (required) + :type waba_id: str + :param name: The name of the template to delete (required) + :type name: str + :param hsm_id: The ID of the template to delete + :type hsm_id: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_whatsapp_template_serialize( + waba_id=waba_id, + name=name, + hsm_id=hsm_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, object]", + '400': "ErrorOmnichannel", + '401': "ErrorOmnichannel", + '403': "ErrorOmnichannel", + '500': "ErrorOmnichannel", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_whatsapp_template_without_preload_content( + self, + waba_id: Annotated[StrictStr, Field(description="The ID of the WABA")], + name: Annotated[StrictStr, Field(description="The name of the template to delete")], + hsm_id: Annotated[Optional[StrictStr], Field(description="The ID of the template to delete")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Deletes a WhatsApp template + + + :param waba_id: The ID of the WABA (required) + :type waba_id: str + :param name: The name of the template to delete (required) + :type name: str + :param hsm_id: The ID of the template to delete + :type hsm_id: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_whatsapp_template_serialize( + waba_id=waba_id, + name=name, + hsm_id=hsm_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, object]", + '400': "ErrorOmnichannel", + '401': "ErrorOmnichannel", + '403': "ErrorOmnichannel", + '500': "ErrorOmnichannel", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_whatsapp_template_serialize( + self, + waba_id, + name, + hsm_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if waba_id is not None: + _path_params['wabaId'] = waba_id + # process the query parameters + if name is not None: + + _query_params.append(('name', name)) + + if hsm_id is not None: + + _query_params.append(('hsmId', hsm_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/whatsapp/wabas/{wabaId}/templates', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_whatsapp_template_by_id( + self, + waba_id: Annotated[StrictStr, Field(description="The ID of the WABA")], + template_id: Annotated[StrictStr, Field(description="The ID of the template to retrieve")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WhatsappTemplateResponse: + """Requests a WhatsApp template with the given ID + + + :param waba_id: The ID of the WABA (required) + :type waba_id: str + :param template_id: The ID of the template to retrieve (required) + :type template_id: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_whatsapp_template_by_id_serialize( + waba_id=waba_id, + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WhatsappTemplateResponse", + '400': "ErrorOmnichannel", + '401': "ErrorOmnichannel", + '403': "ErrorOmnichannel", + '500': "ErrorOmnichannel", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_whatsapp_template_by_id_with_http_info( + self, + waba_id: Annotated[StrictStr, Field(description="The ID of the WABA")], + template_id: Annotated[StrictStr, Field(description="The ID of the template to retrieve")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WhatsappTemplateResponse]: + """Requests a WhatsApp template with the given ID + + + :param waba_id: The ID of the WABA (required) + :type waba_id: str + :param template_id: The ID of the template to retrieve (required) + :type template_id: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_whatsapp_template_by_id_serialize( + waba_id=waba_id, + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WhatsappTemplateResponse", + '400': "ErrorOmnichannel", + '401': "ErrorOmnichannel", + '403': "ErrorOmnichannel", + '500': "ErrorOmnichannel", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_whatsapp_template_by_id_without_preload_content( + self, + waba_id: Annotated[StrictStr, Field(description="The ID of the WABA")], + template_id: Annotated[StrictStr, Field(description="The ID of the template to retrieve")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Requests a WhatsApp template with the given ID + + + :param waba_id: The ID of the WABA (required) + :type waba_id: str + :param template_id: The ID of the template to retrieve (required) + :type template_id: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_whatsapp_template_by_id_serialize( + waba_id=waba_id, + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WhatsappTemplateResponse", + '400': "ErrorOmnichannel", + '401': "ErrorOmnichannel", + '403': "ErrorOmnichannel", + '500': "ErrorOmnichannel", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_whatsapp_template_by_id_serialize( + self, + waba_id, + template_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if waba_id is not None: + _path_params['wabaId'] = waba_id + if template_id is not None: + _path_params['templateId'] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/whatsapp/wabas/{wabaId}/templates/{templateId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_whatsapp_templates( + self, + waba_id: Annotated[StrictStr, Field(description="The ID of the WABA")], + limit: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="The number of templates to return in the list. Although the max size is 500, for large datasets it is recommended to use a lower limit and instead use pagination to avoid potential timeouts. Defaults to 25.")] = None, + before: Annotated[Optional[StrictStr], Field(description="A cursor point used for a paginated request to indicate the template to paginate backwards from.")] = None, + after: Annotated[Optional[StrictStr], Field(description="A cursor point used for a paginated request to indicate the template to paginate forwards from.")] = None, + category: Annotated[Optional[WhatsappTemplateCategory], Field(description="A filter for returning only templates matching a specific category.")] = None, + content: Annotated[Optional[StrictStr], Field(description="A search filter representing the content of a template. Only matching templates will be returned in the list.")] = None, + language: Annotated[Optional[StrictStr], Field(description="A filter for returning only templates matching a specific language code. A list of supported languages is available in the [WhatsApp documentation](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates/) ")] = None, + name: Annotated[Optional[StrictStr], Field(description="A search filter representing the name, either full or partial, of a template. Only matching templates will be returned in the list.")] = None, + status: Annotated[Optional[WhatsappTemplateStatus], Field(description="A filter for returning only templates matching a specific status.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WhatsappListTemplatesResponse: + """Requests a list of WhatsApp templates + + + :param waba_id: The ID of the WABA (required) + :type waba_id: str + :param limit: The number of templates to return in the list. Although the max size is 500, for large datasets it is recommended to use a lower limit and instead use pagination to avoid potential timeouts. Defaults to 25. + :type limit: int + :param before: A cursor point used for a paginated request to indicate the template to paginate backwards from. + :type before: str + :param after: A cursor point used for a paginated request to indicate the template to paginate forwards from. + :type after: str + :param category: A filter for returning only templates matching a specific category. + :type category: WhatsappTemplateCategory + :param content: A search filter representing the content of a template. Only matching templates will be returned in the list. + :type content: str + :param language: A filter for returning only templates matching a specific language code. A list of supported languages is available in the [WhatsApp documentation](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates/) + :type language: str + :param name: A search filter representing the name, either full or partial, of a template. Only matching templates will be returned in the list. + :type name: str + :param status: A filter for returning only templates matching a specific status. + :type status: WhatsappTemplateStatus + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_whatsapp_templates_serialize( + waba_id=waba_id, + limit=limit, + before=before, + after=after, + category=category, + content=content, + language=language, + name=name, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WhatsappListTemplatesResponse", + '400': "ErrorOmnichannel", + '401': "ErrorOmnichannel", + '403': "ErrorOmnichannel", + '500': "ErrorOmnichannel", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_whatsapp_templates_with_http_info( + self, + waba_id: Annotated[StrictStr, Field(description="The ID of the WABA")], + limit: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="The number of templates to return in the list. Although the max size is 500, for large datasets it is recommended to use a lower limit and instead use pagination to avoid potential timeouts. Defaults to 25.")] = None, + before: Annotated[Optional[StrictStr], Field(description="A cursor point used for a paginated request to indicate the template to paginate backwards from.")] = None, + after: Annotated[Optional[StrictStr], Field(description="A cursor point used for a paginated request to indicate the template to paginate forwards from.")] = None, + category: Annotated[Optional[WhatsappTemplateCategory], Field(description="A filter for returning only templates matching a specific category.")] = None, + content: Annotated[Optional[StrictStr], Field(description="A search filter representing the content of a template. Only matching templates will be returned in the list.")] = None, + language: Annotated[Optional[StrictStr], Field(description="A filter for returning only templates matching a specific language code. A list of supported languages is available in the [WhatsApp documentation](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates/) ")] = None, + name: Annotated[Optional[StrictStr], Field(description="A search filter representing the name, either full or partial, of a template. Only matching templates will be returned in the list.")] = None, + status: Annotated[Optional[WhatsappTemplateStatus], Field(description="A filter for returning only templates matching a specific status.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WhatsappListTemplatesResponse]: + """Requests a list of WhatsApp templates + + + :param waba_id: The ID of the WABA (required) + :type waba_id: str + :param limit: The number of templates to return in the list. Although the max size is 500, for large datasets it is recommended to use a lower limit and instead use pagination to avoid potential timeouts. Defaults to 25. + :type limit: int + :param before: A cursor point used for a paginated request to indicate the template to paginate backwards from. + :type before: str + :param after: A cursor point used for a paginated request to indicate the template to paginate forwards from. + :type after: str + :param category: A filter for returning only templates matching a specific category. + :type category: WhatsappTemplateCategory + :param content: A search filter representing the content of a template. Only matching templates will be returned in the list. + :type content: str + :param language: A filter for returning only templates matching a specific language code. A list of supported languages is available in the [WhatsApp documentation](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates/) + :type language: str + :param name: A search filter representing the name, either full or partial, of a template. Only matching templates will be returned in the list. + :type name: str + :param status: A filter for returning only templates matching a specific status. + :type status: WhatsappTemplateStatus + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_whatsapp_templates_serialize( + waba_id=waba_id, + limit=limit, + before=before, + after=after, + category=category, + content=content, + language=language, + name=name, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WhatsappListTemplatesResponse", + '400': "ErrorOmnichannel", + '401': "ErrorOmnichannel", + '403': "ErrorOmnichannel", + '500': "ErrorOmnichannel", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_whatsapp_templates_without_preload_content( + self, + waba_id: Annotated[StrictStr, Field(description="The ID of the WABA")], + limit: Annotated[Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="The number of templates to return in the list. Although the max size is 500, for large datasets it is recommended to use a lower limit and instead use pagination to avoid potential timeouts. Defaults to 25.")] = None, + before: Annotated[Optional[StrictStr], Field(description="A cursor point used for a paginated request to indicate the template to paginate backwards from.")] = None, + after: Annotated[Optional[StrictStr], Field(description="A cursor point used for a paginated request to indicate the template to paginate forwards from.")] = None, + category: Annotated[Optional[WhatsappTemplateCategory], Field(description="A filter for returning only templates matching a specific category.")] = None, + content: Annotated[Optional[StrictStr], Field(description="A search filter representing the content of a template. Only matching templates will be returned in the list.")] = None, + language: Annotated[Optional[StrictStr], Field(description="A filter for returning only templates matching a specific language code. A list of supported languages is available in the [WhatsApp documentation](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates/) ")] = None, + name: Annotated[Optional[StrictStr], Field(description="A search filter representing the name, either full or partial, of a template. Only matching templates will be returned in the list.")] = None, + status: Annotated[Optional[WhatsappTemplateStatus], Field(description="A filter for returning only templates matching a specific status.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Requests a list of WhatsApp templates + + + :param waba_id: The ID of the WABA (required) + :type waba_id: str + :param limit: The number of templates to return in the list. Although the max size is 500, for large datasets it is recommended to use a lower limit and instead use pagination to avoid potential timeouts. Defaults to 25. + :type limit: int + :param before: A cursor point used for a paginated request to indicate the template to paginate backwards from. + :type before: str + :param after: A cursor point used for a paginated request to indicate the template to paginate forwards from. + :type after: str + :param category: A filter for returning only templates matching a specific category. + :type category: WhatsappTemplateCategory + :param content: A search filter representing the content of a template. Only matching templates will be returned in the list. + :type content: str + :param language: A filter for returning only templates matching a specific language code. A list of supported languages is available in the [WhatsApp documentation](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates/) + :type language: str + :param name: A search filter representing the name, either full or partial, of a template. Only matching templates will be returned in the list. + :type name: str + :param status: A filter for returning only templates matching a specific status. + :type status: WhatsappTemplateStatus + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_whatsapp_templates_serialize( + waba_id=waba_id, + limit=limit, + before=before, + after=after, + category=category, + content=content, + language=language, + name=name, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WhatsappListTemplatesResponse", + '400': "ErrorOmnichannel", + '401': "ErrorOmnichannel", + '403': "ErrorOmnichannel", + '500': "ErrorOmnichannel", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_whatsapp_templates_serialize( + self, + waba_id, + limit, + before, + after, + category, + content, + language, + name, + status, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if waba_id is not None: + _path_params['wabaId'] = waba_id + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if before is not None: + + _query_params.append(('before', before)) + + if after is not None: + + _query_params.append(('after', after)) + + if category is not None: + + _query_params.append(('category', category.value)) + + if content is not None: + + _query_params.append(('content', content)) + + if language is not None: + + _query_params.append(('language', language)) + + if name is not None: + + _query_params.append(('name', name)) + + if status is not None: + + _query_params.append(('status', status.value)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/whatsapp/wabas/{wabaId}/templates', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_whatsapp_template( + self, + waba_id: Annotated[StrictStr, Field(description="The ID of the WABA")], + template_id: Annotated[StrictStr, Field(description="The ID of the template to update")], + whatsapp_update_template_request: Annotated[Optional[WhatsappUpdateTemplateRequest], Field(description="The template data to be updated")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Dict[str, object]: + """Updates a WhatsApp template + + + :param waba_id: The ID of the WABA (required) + :type waba_id: str + :param template_id: The ID of the template to update (required) + :type template_id: str + :param whatsapp_update_template_request: The template data to be updated (required) + :type whatsapp_update_template_request: WhatsappUpdateTemplateRequest + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_whatsapp_template_serialize( + waba_id=waba_id, + template_id=template_id, + whatsapp_update_template_request=whatsapp_update_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, object]", + '400': "ErrorOmnichannel", + '401': "ErrorOmnichannel", + '403': "ErrorOmnichannel", + '500': "ErrorOmnichannel", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_whatsapp_template_with_http_info( + self, + waba_id: Annotated[StrictStr, Field(description="The ID of the WABA")], + template_id: Annotated[StrictStr, Field(description="The ID of the template to update")], + whatsapp_update_template_request: Annotated[Optional[WhatsappUpdateTemplateRequest], Field(description="The template data to be updated")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Dict[str, object]]: + """Updates a WhatsApp template + + + :param waba_id: The ID of the WABA (required) + :type waba_id: str + :param template_id: The ID of the template to update (required) + :type template_id: str + :param whatsapp_update_template_request: The template data to be updated (required) + :type whatsapp_update_template_request: WhatsappUpdateTemplateRequest + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_whatsapp_template_serialize( + waba_id=waba_id, + template_id=template_id, + whatsapp_update_template_request=whatsapp_update_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, object]", + '400': "ErrorOmnichannel", + '401': "ErrorOmnichannel", + '403': "ErrorOmnichannel", + '500': "ErrorOmnichannel", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_whatsapp_template_without_preload_content( + self, + waba_id: Annotated[StrictStr, Field(description="The ID of the WABA")], + template_id: Annotated[StrictStr, Field(description="The ID of the template to update")], + whatsapp_update_template_request: Annotated[Optional[WhatsappUpdateTemplateRequest], Field(description="The template data to be updated")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Updates a WhatsApp template + + + :param waba_id: The ID of the WABA (required) + :type waba_id: str + :param template_id: The ID of the template to update (required) + :type template_id: str + :param whatsapp_update_template_request: The template data to be updated (required) + :type whatsapp_update_template_request: WhatsappUpdateTemplateRequest + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_whatsapp_template_serialize( + waba_id=waba_id, + template_id=template_id, + whatsapp_update_template_request=whatsapp_update_template_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Dict[str, object]", + '400': "ErrorOmnichannel", + '401': "ErrorOmnichannel", + '403': "ErrorOmnichannel", + '500': "ErrorOmnichannel", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_whatsapp_template_serialize( + self, + waba_id, + template_id, + whatsapp_update_template_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if waba_id is not None: + _path_params['wabaId'] = waba_id + if template_id is not None: + _path_params['templateId'] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if whatsapp_update_template_request is not None: + _body_params = whatsapp_update_template_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'basicAuth' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/whatsapp/wabas/{wabaId}/templates/{templateId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/messente_api/models/__init__.py b/messente_api/models/__init__.py index 57fc05d..27d451d 100644 --- a/messente_api/models/__init__.py +++ b/messente_api/models/__init__.py @@ -75,3 +75,20 @@ from messente_api.models.whats_app_parameter import WhatsAppParameter from messente_api.models.whats_app_template import WhatsAppTemplate from messente_api.models.whats_app_text import WhatsAppText +from messente_api.models.whatsapp_button_type import WhatsappButtonType +from messente_api.models.whatsapp_component_type import WhatsappComponentType +from messente_api.models.whatsapp_create_template_request import WhatsappCreateTemplateRequest +from messente_api.models.whatsapp_create_template_response import WhatsappCreateTemplateResponse +from messente_api.models.whatsapp_header_format import WhatsappHeaderFormat +from messente_api.models.whatsapp_list_templates_response import WhatsappListTemplatesResponse +from messente_api.models.whatsapp_otp_button_type import WhatsappOtpButtonType +from messente_api.models.whatsapp_pagination import WhatsappPagination +from messente_api.models.whatsapp_paging_cursors import WhatsappPagingCursors +from messente_api.models.whatsapp_supported_app import WhatsappSupportedApp +from messente_api.models.whatsapp_template_button import WhatsappTemplateButton +from messente_api.models.whatsapp_template_category import WhatsappTemplateCategory +from messente_api.models.whatsapp_template_component import WhatsappTemplateComponent +from messente_api.models.whatsapp_template_example import WhatsappTemplateExample +from messente_api.models.whatsapp_template_response import WhatsappTemplateResponse +from messente_api.models.whatsapp_template_status import WhatsappTemplateStatus +from messente_api.models.whatsapp_update_template_request import WhatsappUpdateTemplateRequest diff --git a/messente_api/models/whats_app_template.py b/messente_api/models/whats_app_template.py index 3e79767..091e1c8 100644 --- a/messente_api/models/whats_app_template.py +++ b/messente_api/models/whats_app_template.py @@ -19,7 +19,7 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from typing import Any, ClassVar, Dict, List from messente_api.models.whats_app_component import WhatsAppComponent from messente_api.models.whats_app_language import WhatsAppLanguage from typing import Optional, Set @@ -31,7 +31,7 @@ class WhatsAppTemplate(BaseModel): """ # noqa: E501 name: StrictStr = Field(description="Name of the template") language: WhatsAppLanguage - components: Optional[List[WhatsAppComponent]] = Field(default=None, description="List of template components") + components: List[WhatsAppComponent] = Field(description="List of template components") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["name", "language", "components"] diff --git a/messente_api/models/whatsapp_button_type.py b/messente_api/models/whatsapp_button_type.py new file mode 100644 index 0000000..27bad33 --- /dev/null +++ b/messente_api/models/whatsapp_button_type.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class WhatsappButtonType(str, Enum): + """ + Type of the button + """ + + """ + allowed enum values + """ + QUICK_REPLY = 'quick_reply' + PHONE_NUMBER = 'phone_number' + OTP = 'otp' + URL = 'url' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of WhatsappButtonType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/messente_api/models/whatsapp_component_type.py b/messente_api/models/whatsapp_component_type.py new file mode 100644 index 0000000..519265d --- /dev/null +++ b/messente_api/models/whatsapp_component_type.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class WhatsappComponentType(str, Enum): + """ + Type of the component + """ + + """ + allowed enum values + """ + BODY = 'body' + HEADER = 'header' + FOOTER = 'footer' + BUTTONS = 'buttons' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of WhatsappComponentType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/messente_api/models/whatsapp_create_template_request.py b/messente_api/models/whatsapp_create_template_request.py new file mode 100644 index 0000000..2554acd --- /dev/null +++ b/messente_api/models/whatsapp_create_template_request.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from messente_api.models.whatsapp_template_category import WhatsappTemplateCategory +from messente_api.models.whatsapp_template_component import WhatsappTemplateComponent +from typing import Optional, Set +from typing_extensions import Self + +class WhatsappCreateTemplateRequest(BaseModel): + """ + Request to create a WhatsApp template + """ # noqa: E501 + name: StrictStr = Field(description="Name of the template") + category: WhatsappTemplateCategory + allow_category_change: Optional[StrictBool] = Field(default=False, description="Allow category change") + language: StrictStr = Field(description="Language of the template") + components: List[WhatsappTemplateComponent] = Field(description="List of template components") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["name", "category", "allow_category_change", "language", "components"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WhatsappCreateTemplateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in components (list) + _items = [] + if self.components: + for _item_components in self.components: + if _item_components: + _items.append(_item_components.to_dict()) + _dict['components'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WhatsappCreateTemplateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "category": obj.get("category"), + "allow_category_change": obj.get("allow_category_change") if obj.get("allow_category_change") is not None else False, + "language": obj.get("language"), + "components": [WhatsappTemplateComponent.from_dict(_item) for _item in obj["components"]] if obj.get("components") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/messente_api/models/whatsapp_create_template_response.py b/messente_api/models/whatsapp_create_template_response.py new file mode 100644 index 0000000..07c0366 --- /dev/null +++ b/messente_api/models/whatsapp_create_template_response.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from messente_api.models.whatsapp_template_category import WhatsappTemplateCategory +from messente_api.models.whatsapp_template_status import WhatsappTemplateStatus +from typing import Optional, Set +from typing_extensions import Self + +class WhatsappCreateTemplateResponse(BaseModel): + """ + Response for creating a WhatsApp template + """ # noqa: E501 + id: StrictStr = Field(description="Template ID") + status: WhatsappTemplateStatus + category: WhatsappTemplateCategory + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "status", "category"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WhatsappCreateTemplateResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WhatsappCreateTemplateResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "status": obj.get("status"), + "category": obj.get("category") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/messente_api/models/whatsapp_header_format.py b/messente_api/models/whatsapp_header_format.py new file mode 100644 index 0000000..ed0a067 --- /dev/null +++ b/messente_api/models/whatsapp_header_format.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class WhatsappHeaderFormat(str, Enum): + """ + Format of the header component + """ + + """ + allowed enum values + """ + TEXT = 'text' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of WhatsappHeaderFormat from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/messente_api/models/whatsapp_list_templates_response.py b/messente_api/models/whatsapp_list_templates_response.py new file mode 100644 index 0000000..a601679 --- /dev/null +++ b/messente_api/models/whatsapp_list_templates_response.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from messente_api.models.whatsapp_pagination import WhatsappPagination +from messente_api.models.whatsapp_template_response import WhatsappTemplateResponse +from typing import Optional, Set +from typing_extensions import Self + +class WhatsappListTemplatesResponse(BaseModel): + """ + Whatsapp Cloud API list of templates response + """ # noqa: E501 + templates: List[WhatsappTemplateResponse] = Field(description="List of templates") + paging: WhatsappPagination + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["templates", "paging"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WhatsappListTemplatesResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in templates (list) + _items = [] + if self.templates: + for _item_templates in self.templates: + if _item_templates: + _items.append(_item_templates.to_dict()) + _dict['templates'] = _items + # override the default output from pydantic by calling `to_dict()` of paging + if self.paging: + _dict['paging'] = self.paging.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WhatsappListTemplatesResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "templates": [WhatsappTemplateResponse.from_dict(_item) for _item in obj["templates"]] if obj.get("templates") is not None else None, + "paging": WhatsappPagination.from_dict(obj["paging"]) if obj.get("paging") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/messente_api/models/whatsapp_otp_button_type.py b/messente_api/models/whatsapp_otp_button_type.py new file mode 100644 index 0000000..06a5dcd --- /dev/null +++ b/messente_api/models/whatsapp_otp_button_type.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class WhatsappOtpButtonType(str, Enum): + """ + Type of the OTP button + """ + + """ + allowed enum values + """ + COPY_CODE = 'copy_code' + ONE_TAP = 'one_tap' + ZERO_TAP = 'zero_tap' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of WhatsappOtpButtonType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/messente_api/models/whatsapp_pagination.py b/messente_api/models/whatsapp_pagination.py new file mode 100644 index 0000000..e354e53 --- /dev/null +++ b/messente_api/models/whatsapp_pagination.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from messente_api.models.whatsapp_paging_cursors import WhatsappPagingCursors +from typing import Optional, Set +from typing_extensions import Self + +class WhatsappPagination(BaseModel): + """ + Whatsapp media object. + """ # noqa: E501 + previous: Optional[StrictStr] = Field(default=None, description="A URL to ge the previous paginated page.") + next: Optional[StrictStr] = Field(default=None, description="A URL to ge the next paginated page.") + cursors: WhatsappPagingCursors + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["previous", "next", "cursors"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WhatsappPagination from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of cursors + if self.cursors: + _dict['cursors'] = self.cursors.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WhatsappPagination from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "previous": obj.get("previous"), + "next": obj.get("next"), + "cursors": WhatsappPagingCursors.from_dict(obj["cursors"]) if obj.get("cursors") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/messente_api/models/whatsapp_paging_cursors.py b/messente_api/models/whatsapp_paging_cursors.py new file mode 100644 index 0000000..1080b45 --- /dev/null +++ b/messente_api/models/whatsapp_paging_cursors.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class WhatsappPagingCursors(BaseModel): + """ + WhatsApp paging cursors object. + """ # noqa: E501 + before: Optional[StrictStr] = Field(default=None, description="The template before the first template in the current list") + after: Optional[StrictStr] = Field(default=None, description="The template after the last template in the current list") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["before", "after"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WhatsappPagingCursors from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WhatsappPagingCursors from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "before": obj.get("before"), + "after": obj.get("after") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/messente_api/models/whatsapp_supported_app.py b/messente_api/models/whatsapp_supported_app.py new file mode 100644 index 0000000..ec9fc4b --- /dev/null +++ b/messente_api/models/whatsapp_supported_app.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class WhatsappSupportedApp(BaseModel): + """ + Supported app for the button + """ # noqa: E501 + package_name: StrictStr = Field(description="Package name") + signature_hash: StrictStr = Field(description="Signature hash") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["package_name", "signature_hash"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WhatsappSupportedApp from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WhatsappSupportedApp from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "package_name": obj.get("package_name"), + "signature_hash": obj.get("signature_hash") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/messente_api/models/whatsapp_template_button.py b/messente_api/models/whatsapp_template_button.py new file mode 100644 index 0000000..5a117a8 --- /dev/null +++ b/messente_api/models/whatsapp_template_button.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from messente_api.models.whatsapp_button_type import WhatsappButtonType +from messente_api.models.whatsapp_otp_button_type import WhatsappOtpButtonType +from messente_api.models.whatsapp_supported_app import WhatsappSupportedApp +from typing import Optional, Set +from typing_extensions import Self + +class WhatsappTemplateButton(BaseModel): + """ + Whatsapp button object. + """ # noqa: E501 + type: Optional[WhatsappButtonType] = None + otp_type: Optional[WhatsappOtpButtonType] = None + autofill_text: Optional[StrictStr] = Field(default=None, description="Text to be autofilled in the OTP field") + supported_apps: Optional[List[WhatsappSupportedApp]] = Field(default=None, description="List of supported apps for the button") + text: Optional[Annotated[str, Field(strict=True, max_length=25)]] = Field(default=None, description="Text content of the button") + phone_number: Optional[Annotated[str, Field(strict=True, max_length=20)]] = Field(default=None, description="Phone number for the button") + url: Optional[Annotated[str, Field(strict=True, max_length=2000)]] = Field(default=None, description="URL for the button") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type", "otp_type", "autofill_text", "supported_apps", "text", "phone_number", "url"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WhatsappTemplateButton from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in supported_apps (list) + _items = [] + if self.supported_apps: + for _item_supported_apps in self.supported_apps: + if _item_supported_apps: + _items.append(_item_supported_apps.to_dict()) + _dict['supported_apps'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WhatsappTemplateButton from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "otp_type": obj.get("otp_type"), + "autofill_text": obj.get("autofill_text"), + "supported_apps": [WhatsappSupportedApp.from_dict(_item) for _item in obj["supported_apps"]] if obj.get("supported_apps") is not None else None, + "text": obj.get("text"), + "phone_number": obj.get("phone_number"), + "url": obj.get("url") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/messente_api/models/whatsapp_template_category.py b/messente_api/models/whatsapp_template_category.py new file mode 100644 index 0000000..d319742 --- /dev/null +++ b/messente_api/models/whatsapp_template_category.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class WhatsappTemplateCategory(str, Enum): + """ + Template category + """ + + """ + allowed enum values + """ + AUTHENTICATION = 'authentication' + MARKETING = 'marketing' + UTILITY = 'utility' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of WhatsappTemplateCategory from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/messente_api/models/whatsapp_template_component.py b/messente_api/models/whatsapp_template_component.py new file mode 100644 index 0000000..c1bd75b --- /dev/null +++ b/messente_api/models/whatsapp_template_component.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from messente_api.models.whatsapp_component_type import WhatsappComponentType +from messente_api.models.whatsapp_header_format import WhatsappHeaderFormat +from messente_api.models.whatsapp_template_button import WhatsappTemplateButton +from messente_api.models.whatsapp_template_example import WhatsappTemplateExample +from typing import Optional, Set +from typing_extensions import Self + +class WhatsappTemplateComponent(BaseModel): + """ + Template component object + """ # noqa: E501 + type: Optional[WhatsappComponentType] = None + format: Optional[WhatsappHeaderFormat] = None + text: Optional[StrictStr] = Field(default=None, description="Text content of the component") + example: Optional[WhatsappTemplateExample] = None + buttons: Optional[List[WhatsappTemplateButton]] = Field(default=None, description="List of buttons for the component") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type", "format", "text", "example", "buttons"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WhatsappTemplateComponent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of example + if self.example: + _dict['example'] = self.example.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in buttons (list) + _items = [] + if self.buttons: + for _item_buttons in self.buttons: + if _item_buttons: + _items.append(_item_buttons.to_dict()) + _dict['buttons'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WhatsappTemplateComponent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "format": obj.get("format"), + "text": obj.get("text"), + "example": WhatsappTemplateExample.from_dict(obj["example"]) if obj.get("example") is not None else None, + "buttons": [WhatsappTemplateButton.from_dict(_item) for _item in obj["buttons"]] if obj.get("buttons") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/messente_api/models/whatsapp_template_example.py b/messente_api/models/whatsapp_template_example.py new file mode 100644 index 0000000..6294dce --- /dev/null +++ b/messente_api/models/whatsapp_template_example.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class WhatsappTemplateExample(BaseModel): + """ + Example of the templated content + """ # noqa: E501 + header_text: Optional[List[List[StrictStr]]] = Field(default=None, description="Example of the templated text for the header") + body_text: Optional[List[List[StrictStr]]] = Field(default=None, description="Example of the templated text for the body") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["header_text", "body_text"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WhatsappTemplateExample from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WhatsappTemplateExample from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "header_text": obj.get("header_text"), + "body_text": obj.get("body_text") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/messente_api/models/whatsapp_template_response.py b/messente_api/models/whatsapp_template_response.py new file mode 100644 index 0000000..7ccc083 --- /dev/null +++ b/messente_api/models/whatsapp_template_response.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from messente_api.models.whatsapp_template_category import WhatsappTemplateCategory +from messente_api.models.whatsapp_template_component import WhatsappTemplateComponent +from messente_api.models.whatsapp_template_status import WhatsappTemplateStatus +from typing import Optional, Set +from typing_extensions import Self + +class WhatsappTemplateResponse(BaseModel): + """ + Whatsapp Cloud API template + """ # noqa: E501 + id: StrictStr = Field(description="Template ID") + components: List[WhatsappTemplateComponent] = Field(description="List of template components") + language: StrictStr = Field(description="Language of the template") + name: StrictStr = Field(description="Name of the template") + category: WhatsappTemplateCategory + status: WhatsappTemplateStatus + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "components", "language", "name", "category", "status"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WhatsappTemplateResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in components (list) + _items = [] + if self.components: + for _item_components in self.components: + if _item_components: + _items.append(_item_components.to_dict()) + _dict['components'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WhatsappTemplateResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "components": [WhatsappTemplateComponent.from_dict(_item) for _item in obj["components"]] if obj.get("components") is not None else None, + "language": obj.get("language"), + "name": obj.get("name"), + "category": obj.get("category"), + "status": obj.get("status") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/messente_api/models/whatsapp_template_status.py b/messente_api/models/whatsapp_template_status.py new file mode 100644 index 0000000..834f430 --- /dev/null +++ b/messente_api/models/whatsapp_template_status.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class WhatsappTemplateStatus(str, Enum): + """ + Template status + """ + + """ + allowed enum values + """ + APPROVED = 'approved' + REJECTED = 'rejected' + PENDING = 'pending' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of WhatsappTemplateStatus from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/messente_api/models/whatsapp_update_template_request.py b/messente_api/models/whatsapp_update_template_request.py new file mode 100644 index 0000000..fc53593 --- /dev/null +++ b/messente_api/models/whatsapp_update_template_request.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from messente_api.models.whatsapp_template_category import WhatsappTemplateCategory +from messente_api.models.whatsapp_template_component import WhatsappTemplateComponent +from typing import Optional, Set +from typing_extensions import Self + +class WhatsappUpdateTemplateRequest(BaseModel): + """ + Request to create a WhatsApp template + """ # noqa: E501 + category: Optional[WhatsappTemplateCategory] = None + components: Optional[List[WhatsappTemplateComponent]] = Field(default=None, description="List of template components") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = [] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WhatsappUpdateTemplateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WhatsappUpdateTemplateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + From 67760c7dc3a103289dfbdd9c9cc97ff5ff3ae93d Mon Sep 17 00:00:00 2001 From: api-librarian Date: Tue, 29 Apr 2025 13:09:42 +0000 Subject: [PATCH 03/14] Travis update: Apr 2025 (Build 833) [skip ci] --- docs/WhatsappButtonType.md | 6 ++++++ docs/WhatsappTemplateExample.md | 2 +- docs/WhatsappTemplateStatus.md | 2 ++ messente_api/models/whatsapp_button_type.py | 3 +++ messente_api/models/whatsapp_template_example.py | 2 +- messente_api/models/whatsapp_template_status.py | 1 + 6 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/WhatsappButtonType.md b/docs/WhatsappButtonType.md index 808001a..d3eb77d 100644 --- a/docs/WhatsappButtonType.md +++ b/docs/WhatsappButtonType.md @@ -12,6 +12,12 @@ Type of the button * `URL` (value: `'url'`) +* `CATALOG` (value: `'catalog'`) + +* `FLOW` (value: `'flow'`) + +* `COPY_CODE` (value: `'copy_code'`) + [[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/docs/WhatsappTemplateExample.md b/docs/WhatsappTemplateExample.md index a5266e3..615f5d0 100644 --- a/docs/WhatsappTemplateExample.md +++ b/docs/WhatsappTemplateExample.md @@ -6,7 +6,7 @@ Example of the templated content Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**header_text** | **List[List[str]]** | Example of the templated text for the header | [optional] +**header_text** | **List[str]** | Example of the templated text for the header | [optional] **body_text** | **List[List[str]]** | Example of the templated text for the body | [optional] ## Example diff --git a/docs/WhatsappTemplateStatus.md b/docs/WhatsappTemplateStatus.md index aafbf16..7074773 100644 --- a/docs/WhatsappTemplateStatus.md +++ b/docs/WhatsappTemplateStatus.md @@ -10,6 +10,8 @@ Template status * `PENDING` (value: `'pending'`) +* `PENDING_DELETION` (value: `'pending_deletion'`) + [[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/messente_api/models/whatsapp_button_type.py b/messente_api/models/whatsapp_button_type.py index 27bad33..f69e71e 100644 --- a/messente_api/models/whatsapp_button_type.py +++ b/messente_api/models/whatsapp_button_type.py @@ -31,6 +31,9 @@ class WhatsappButtonType(str, Enum): PHONE_NUMBER = 'phone_number' OTP = 'otp' URL = 'url' + CATALOG = 'catalog' + FLOW = 'flow' + COPY_CODE = 'copy_code' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/messente_api/models/whatsapp_template_example.py b/messente_api/models/whatsapp_template_example.py index 6294dce..fe42e24 100644 --- a/messente_api/models/whatsapp_template_example.py +++ b/messente_api/models/whatsapp_template_example.py @@ -27,7 +27,7 @@ class WhatsappTemplateExample(BaseModel): """ Example of the templated content """ # noqa: E501 - header_text: Optional[List[List[StrictStr]]] = Field(default=None, description="Example of the templated text for the header") + header_text: Optional[List[StrictStr]] = Field(default=None, description="Example of the templated text for the header") body_text: Optional[List[List[StrictStr]]] = Field(default=None, description="Example of the templated text for the body") additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["header_text", "body_text"] diff --git a/messente_api/models/whatsapp_template_status.py b/messente_api/models/whatsapp_template_status.py index 834f430..86bba4e 100644 --- a/messente_api/models/whatsapp_template_status.py +++ b/messente_api/models/whatsapp_template_status.py @@ -30,6 +30,7 @@ class WhatsappTemplateStatus(str, Enum): APPROVED = 'approved' REJECTED = 'rejected' PENDING = 'pending' + PENDING_DELETION = 'pending_deletion' @classmethod def from_json(cls, json_str: str) -> Self: From 23a160a7b1d794e4689cee7aab74b1b5c1ab497b Mon Sep 17 00:00:00 2001 From: api-librarian Date: Tue, 29 Apr 2025 13:24:55 +0000 Subject: [PATCH 04/14] Travis update: Apr 2025 (Build 834) [skip ci] --- docs/WhatsappTemplateStatus.md | 10 ++++++++++ messente_api/models/whatsapp_template_status.py | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/docs/WhatsappTemplateStatus.md b/docs/WhatsappTemplateStatus.md index 7074773..293e3ab 100644 --- a/docs/WhatsappTemplateStatus.md +++ b/docs/WhatsappTemplateStatus.md @@ -6,12 +6,22 @@ Template status * `APPROVED` (value: `'approved'`) +* `IN_APPEAL` (value: `'in_appeal'`) + * `REJECTED` (value: `'rejected'`) * `PENDING` (value: `'pending'`) * `PENDING_DELETION` (value: `'pending_deletion'`) +* `DELETED` (value: `'deleted'`) + +* `DISABLED` (value: `'disabled'`) + +* `PAUSED` (value: `'paused'`) + +* `LIMIT_EXCEEDED` (value: `'limit_exceeded'`) + [[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/messente_api/models/whatsapp_template_status.py b/messente_api/models/whatsapp_template_status.py index 86bba4e..de9dc07 100644 --- a/messente_api/models/whatsapp_template_status.py +++ b/messente_api/models/whatsapp_template_status.py @@ -28,9 +28,14 @@ class WhatsappTemplateStatus(str, Enum): allowed enum values """ APPROVED = 'approved' + IN_APPEAL = 'in_appeal' REJECTED = 'rejected' PENDING = 'pending' PENDING_DELETION = 'pending_deletion' + DELETED = 'deleted' + DISABLED = 'disabled' + PAUSED = 'paused' + LIMIT_EXCEEDED = 'limit_exceeded' @classmethod def from_json(cls, json_str: str) -> Self: From 03d4e496a9c94bc5e20b40df9c55f24921466859 Mon Sep 17 00:00:00 2001 From: api-librarian Date: Tue, 29 Apr 2025 13:26:08 +0000 Subject: [PATCH 05/14] Travis update: Apr 2025 (Build 835) [skip ci] --- docs/WhatsappCreateTemplateRequest.md | 1 - messente_api/models/whatsapp_create_template_request.py | 8 +++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/WhatsappCreateTemplateRequest.md b/docs/WhatsappCreateTemplateRequest.md index 58c7e01..992d2a8 100644 --- a/docs/WhatsappCreateTemplateRequest.md +++ b/docs/WhatsappCreateTemplateRequest.md @@ -8,7 +8,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Name of the template | **category** | [**WhatsappTemplateCategory**](WhatsappTemplateCategory.md) | | -**allow_category_change** | **bool** | Allow category change | [optional] [default to False] **language** | **str** | Language of the template | **components** | [**List[WhatsappTemplateComponent]**](WhatsappTemplateComponent.md) | List of template components | diff --git a/messente_api/models/whatsapp_create_template_request.py b/messente_api/models/whatsapp_create_template_request.py index 2554acd..7289ab2 100644 --- a/messente_api/models/whatsapp_create_template_request.py +++ b/messente_api/models/whatsapp_create_template_request.py @@ -18,8 +18,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List from messente_api.models.whatsapp_template_category import WhatsappTemplateCategory from messente_api.models.whatsapp_template_component import WhatsappTemplateComponent from typing import Optional, Set @@ -31,11 +31,10 @@ class WhatsappCreateTemplateRequest(BaseModel): """ # noqa: E501 name: StrictStr = Field(description="Name of the template") category: WhatsappTemplateCategory - allow_category_change: Optional[StrictBool] = Field(default=False, description="Allow category change") language: StrictStr = Field(description="Language of the template") components: List[WhatsappTemplateComponent] = Field(description="List of template components") additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["name", "category", "allow_category_change", "language", "components"] + __properties: ClassVar[List[str]] = ["name", "category", "language", "components"] model_config = ConfigDict( populate_by_name=True, @@ -104,7 +103,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "name": obj.get("name"), "category": obj.get("category"), - "allow_category_change": obj.get("allow_category_change") if obj.get("allow_category_change") is not None else False, "language": obj.get("language"), "components": [WhatsappTemplateComponent.from_dict(_item) for _item in obj["components"]] if obj.get("components") is not None else None }) From d003559b27ffc7c67ddf0bd1a4a53cf544ac9a9b Mon Sep 17 00:00:00 2001 From: api-librarian Date: Tue, 29 Apr 2025 13:41:18 +0000 Subject: [PATCH 06/14] Travis update: Apr 2025 (Build 836) [skip ci] --- docs/WhatsAppTemplatesApi.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/WhatsAppTemplatesApi.md b/docs/WhatsAppTemplatesApi.md index 6bdfd2e..f8e3bb8 100644 --- a/docs/WhatsAppTemplatesApi.md +++ b/docs/WhatsAppTemplatesApi.md @@ -171,7 +171,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | OK | - | +**200** | template deletion successful | - | **400** | Invalid input | - | **401** | Unauthorized | - | **403** | Forbidden | - | @@ -353,7 +353,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | OK | - | +**200** | template list fetched successfully | - | **400** | Invalid input | - | **401** | Unauthorized | - | **403** | Forbidden | - | @@ -438,7 +438,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | OK | - | +**200** | template update successful | - | **400** | Invalid input | - | **401** | Unauthorized | - | **403** | Forbidden | - | From 59e921ec3972fdc568432d4a911d5c26fab1d48e Mon Sep 17 00:00:00 2001 From: api-librarian Date: Tue, 29 Apr 2025 13:43:58 +0000 Subject: [PATCH 07/14] Travis update: Apr 2025 (Build 837) [skip ci] --- docs/WhatsAppTemplatesApi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/WhatsAppTemplatesApi.md b/docs/WhatsAppTemplatesApi.md index f8e3bb8..791a118 100644 --- a/docs/WhatsAppTemplatesApi.md +++ b/docs/WhatsAppTemplatesApi.md @@ -87,7 +87,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | OK | - | +**200** | template creation successful | - | **400** | Invalid input | - | **401** | Unauthorized | - | **403** | Forbidden | - | @@ -254,7 +254,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | OK | - | +**200** | template fetched successfully | - | **400** | Invalid input | - | **401** | Unauthorized | - | **403** | Forbidden | - | From ef8eb28a51d3174310d323ed4845be30d53051b6 Mon Sep 17 00:00:00 2001 From: api-librarian Date: Thu, 8 May 2025 14:19:31 +0000 Subject: [PATCH 08/14] Travis update: May 2025 (Build 842) [skip ci] --- .openapi-generator/FILES | 8 + README.md | 10 + docs/AccountBalanceApi.md | 180 ++++++ docs/Price.md | 33 + docs/PriceNetworksInner.md | 32 + docs/PricingApi.md | 185 ++++++ messente_api/__init__.py | 4 + messente_api/api/__init__.py | 2 + messente_api/api/account_balance_api.py | 600 ++++++++++++++++++ messente_api/api/pricing_api.py | 638 ++++++++++++++++++++ messente_api/configuration.py | 39 ++ messente_api/models/__init__.py | 2 + messente_api/models/price.py | 115 ++++ messente_api/models/price_networks_inner.py | 105 ++++ 14 files changed, 1953 insertions(+) create mode 100644 docs/AccountBalanceApi.md create mode 100644 docs/Price.md create mode 100644 docs/PriceNetworksInner.md create mode 100644 docs/PricingApi.md create mode 100644 messente_api/api/account_balance_api.py create mode 100644 messente_api/api/pricing_api.py create mode 100644 messente_api/models/price.py create mode 100644 messente_api/models/price_networks_inner.py diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 9cf3f06..426ebd7 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -4,6 +4,7 @@ .openapi-generator-ignore .travis.yml README.md +docs/AccountBalanceApi.md docs/BlacklistApi.md docs/BulkMessagingApi.md docs/BulkOmniMessageCreateSuccessResponse.md @@ -49,7 +50,10 @@ docs/OmniMessageCreateSuccessResponse.md docs/Omnimessage.md docs/OmnimessageApi.md docs/OmnimessageMessagesInner.md +docs/Price.md docs/PriceInfo.md +docs/PriceNetworksInner.md +docs/PricingApi.md docs/Priority.md docs/SMS.md docs/StatisticsApi.md @@ -93,6 +97,7 @@ docs/WhatsappUpdateTemplateRequest.md git_push.sh messente_api/__init__.py messente_api/api/__init__.py +messente_api/api/account_balance_api.py messente_api/api/blacklist_api.py messente_api/api/bulk_messaging_api.py messente_api/api/contacts_api.py @@ -100,6 +105,7 @@ messente_api/api/delivery_report_api.py messente_api/api/groups_api.py messente_api/api/number_lookup_api.py messente_api/api/omnimessage_api.py +messente_api/api/pricing_api.py messente_api/api/statistics_api.py messente_api/api/whats_app_templates_api.py messente_api/api_client.py @@ -145,7 +151,9 @@ messente_api/models/numbers_to_investigate.py messente_api/models/omni_message_create_success_response.py messente_api/models/omnimessage.py messente_api/models/omnimessage_messages_inner.py +messente_api/models/price.py messente_api/models/price_info.py +messente_api/models/price_networks_inner.py messente_api/models/priority.py messente_api/models/sms.py messente_api/models/statistics_report.py diff --git a/README.md b/README.md index f4caf96..81fe197 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,11 @@ Messente API has the following features: Messente API Library provides the operations described below to access the features. +### AccountBalanceApi + +1. Get account balance [`get_account_balance`](docs/AccountBalanceApi.md#get_account_balance) +1. Get account balance [`get_account_balance_using_post`](docs/AccountBalanceApi.md#get_account_balance_using_post) + ### BlacklistApi 1. Adds a phone number to the blacklist [`add_to_blacklist`](docs/BlacklistApi.md#add_to_blacklist) @@ -61,6 +66,11 @@ Messente API Library provides the operations described below to access the featu 1. Cancels a scheduled Omnimessage [`cancel_scheduled_message`](docs/OmnimessageApi.md#cancel_scheduled_message) 1. Sends an Omnimessage [`send_omnimessage`](docs/OmnimessageApi.md#send_omnimessage) +### PricingApi + +1. Get pricelist for account [`get_pricelist`](docs/PricingApi.md#get_pricelist) +1. Get pricing for a specific country [`get_prices`](docs/PricingApi.md#get_prices) + ### StatisticsApi 1. Requests statistics reports for each country [`create_statistics_report`](docs/StatisticsApi.md#create_statistics_report) diff --git a/docs/AccountBalanceApi.md b/docs/AccountBalanceApi.md new file mode 100644 index 0000000..acf0ff6 --- /dev/null +++ b/docs/AccountBalanceApi.md @@ -0,0 +1,180 @@ +# messente_api.AccountBalanceApi + +All URIs are relative to *https://api.messente.com/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_account_balance**](AccountBalanceApi.md#get_account_balance) | **GET** /get_balance | Get account balance +[**get_account_balance_using_post**](AccountBalanceApi.md#get_account_balance_using_post) | **POST** /get_balance | Get account balance + + +# **get_account_balance** +> str get_account_balance(username, password) + +Get account balance + +### Example + +* Api Key Authentication (apiPassword): +* Api Key Authentication (apiUsername): + +```python +import messente_api +from messente_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.messente.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = messente_api.Configuration( + host = "https://api.messente.com/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: apiPassword +configuration.api_key['apiPassword'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiPassword'] = 'Bearer' + +# Configure API key authorization: apiUsername +configuration.api_key['apiUsername'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiUsername'] = 'Bearer' + +# Enter a context with an instance of the API client +with messente_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = messente_api.AccountBalanceApi(api_client) + username = 'username_example' # str | The API username + password = 'password_example' # str | The API password + + try: + # Get account balance + api_response = api_instance.get_account_balance(username, password) + print("The response of AccountBalanceApi->get_account_balance:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountBalanceApi->get_account_balance: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The API username | + **password** | **str**| The API password | + +### Return type + +**str** + +### Authorization + +[apiPassword](../README.md#apiPassword), [apiUsername](../README.md#apiUsername) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Both errors and success responses are returned as plain text with HTTP status 200. | - | + +[[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) + +# **get_account_balance_using_post** +> str get_account_balance_using_post(username, password) + +Get account balance + +### Example + +* Api Key Authentication (apiPassword): +* Api Key Authentication (apiUsername): + +```python +import messente_api +from messente_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.messente.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = messente_api.Configuration( + host = "https://api.messente.com/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: apiPassword +configuration.api_key['apiPassword'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiPassword'] = 'Bearer' + +# Configure API key authorization: apiUsername +configuration.api_key['apiUsername'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiUsername'] = 'Bearer' + +# Enter a context with an instance of the API client +with messente_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = messente_api.AccountBalanceApi(api_client) + username = 'username_example' # str | The API username + password = 'password_example' # str | The API password + + try: + # Get account balance + api_response = api_instance.get_account_balance_using_post(username, password) + print("The response of AccountBalanceApi->get_account_balance_using_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AccountBalanceApi->get_account_balance_using_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The API username | + **password** | **str**| The API password | + +### Return type + +**str** + +### Authorization + +[apiPassword](../README.md#apiPassword), [apiUsername](../README.md#apiUsername) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Both errors and success responses are returned as plain text with HTTP status 200. | - | + +[[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/docs/Price.md b/docs/Price.md new file mode 100644 index 0000000..0972adc --- /dev/null +++ b/docs/Price.md @@ -0,0 +1,33 @@ +# Price + +An object containing the pricing information for a given country + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country** | **str** | The alpha-2 code for the country | +**name** | **str** | The name of the country | +**prefix** | **str** | The country code prefix | +**networks** | [**List[PriceNetworksInner]**](PriceNetworksInner.md) | A list of networks available in the country | + +## Example + +```python +from messente_api.models.price import Price + +# TODO update the JSON string below +json = "{}" +# create an instance of Price from a JSON string +price_instance = Price.from_json(json) +# print the JSON string representation of the object +print(Price.to_json()) + +# convert the object into a dict +price_dict = price_instance.to_dict() +# create an instance of Price from a dict +price_from_dict = Price.from_dict(price_dict) +``` +[[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/docs/PriceNetworksInner.md b/docs/PriceNetworksInner.md new file mode 100644 index 0000000..692da00 --- /dev/null +++ b/docs/PriceNetworksInner.md @@ -0,0 +1,32 @@ +# PriceNetworksInner + +An object containing the network information + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name of the network | +**price** | **str** | The price for sending a message to this network | +**mccmnc** | **float** | The MCCMNC code for the network | + +## Example + +```python +from messente_api.models.price_networks_inner import PriceNetworksInner + +# TODO update the JSON string below +json = "{}" +# create an instance of PriceNetworksInner from a JSON string +price_networks_inner_instance = PriceNetworksInner.from_json(json) +# print the JSON string representation of the object +print(PriceNetworksInner.to_json()) + +# convert the object into a dict +price_networks_inner_dict = price_networks_inner_instance.to_dict() +# create an instance of PriceNetworksInner from a dict +price_networks_inner_from_dict = PriceNetworksInner.from_dict(price_networks_inner_dict) +``` +[[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/docs/PricingApi.md b/docs/PricingApi.md new file mode 100644 index 0000000..3384a88 --- /dev/null +++ b/docs/PricingApi.md @@ -0,0 +1,185 @@ +# messente_api.PricingApi + +All URIs are relative to *https://api.messente.com/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_pricelist**](PricingApi.md#get_pricelist) | **GET** /pricelist | Get pricelist for account +[**get_prices**](PricingApi.md#get_prices) | **GET** /prices | Get pricing for a specific country + + +# **get_pricelist** +> str get_pricelist(username, password) + +Get pricelist for account + +### Example + +* Api Key Authentication (apiPassword): +* Api Key Authentication (apiUsername): + +```python +import messente_api +from messente_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.messente.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = messente_api.Configuration( + host = "https://api.messente.com/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: apiPassword +configuration.api_key['apiPassword'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiPassword'] = 'Bearer' + +# Configure API key authorization: apiUsername +configuration.api_key['apiUsername'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiUsername'] = 'Bearer' + +# Enter a context with an instance of the API client +with messente_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = messente_api.PricingApi(api_client) + username = 'username_example' # str | The API username + password = 'password_example' # str | The API password + + try: + # Get pricelist for account + api_response = api_instance.get_pricelist(username, password) + print("The response of PricingApi->get_pricelist:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PricingApi->get_pricelist: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The API username | + **password** | **str**| The API password | + +### Return type + +**str** + +### Authorization + +[apiPassword](../README.md#apiPassword), [apiUsername](../README.md#apiUsername) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Both errors and success responses are returned as plain text with HTTP status 200. Unsuccessful responses contain the error code, while successful ones contain the pricelist in CSV format. | - | + +[[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) + +# **get_prices** +> Price get_prices(username, password, country, format=format) + +Get pricing for a specific country + +### Example + +* Api Key Authentication (apiPassword): +* Api Key Authentication (apiUsername): + +```python +import messente_api +from messente_api.models.price import Price +from messente_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.messente.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = messente_api.Configuration( + host = "https://api.messente.com/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: apiPassword +configuration.api_key['apiPassword'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiPassword'] = 'Bearer' + +# Configure API key authorization: apiUsername +configuration.api_key['apiUsername'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiUsername'] = 'Bearer' + +# Enter a context with an instance of the API client +with messente_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = messente_api.PricingApi(api_client) + username = 'username_example' # str | The API username + password = 'password_example' # str | The API password + country = 'country_example' # str | The country code, for which to get the prices + format = 'format_example' # str | The format of the response. Can be either 'json' or 'xml'. If not specified, defaults to 'json'. (optional) + + try: + # Get pricing for a specific country + api_response = api_instance.get_prices(username, password, country, format=format) + print("The response of PricingApi->get_prices:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PricingApi->get_prices: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The API username | + **password** | **str**| The API password | + **country** | **str**| The country code, for which to get the prices | + **format** | **str**| The format of the response. Can be either 'json' or 'xml'. If not specified, defaults to 'json'. | [optional] + +### Return type + +[**Price**](Price.md) + +### Authorization + +[apiPassword](../README.md#apiPassword), [apiUsername](../README.md#apiUsername) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml, text/plain; charset=utf-8 + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Unsuccessful responses are returned as plain text with an error code, while successful ones contain either JSON or XML depending on the user's choice. | - | + +[[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/messente_api/__init__.py b/messente_api/__init__.py index 845d422..fb06a85 100644 --- a/messente_api/__init__.py +++ b/messente_api/__init__.py @@ -18,6 +18,7 @@ __version__ = "2.4.0" # import apis into sdk package +from messente_api.api.account_balance_api import AccountBalanceApi from messente_api.api.blacklist_api import BlacklistApi from messente_api.api.bulk_messaging_api import BulkMessagingApi from messente_api.api.contacts_api import ContactsApi @@ -25,6 +26,7 @@ from messente_api.api.groups_api import GroupsApi from messente_api.api.number_lookup_api import NumberLookupApi from messente_api.api.omnimessage_api import OmnimessageApi +from messente_api.api.pricing_api import PricingApi from messente_api.api.statistics_api import StatisticsApi from messente_api.api.whats_app_templates_api import WhatsAppTemplatesApi @@ -78,7 +80,9 @@ from messente_api.models.omni_message_create_success_response import OmniMessageCreateSuccessResponse from messente_api.models.omnimessage import Omnimessage from messente_api.models.omnimessage_messages_inner import OmnimessageMessagesInner +from messente_api.models.price import Price from messente_api.models.price_info import PriceInfo +from messente_api.models.price_networks_inner import PriceNetworksInner from messente_api.models.priority import Priority from messente_api.models.sms import SMS from messente_api.models.statistics_report import StatisticsReport diff --git a/messente_api/api/__init__.py b/messente_api/api/__init__.py index 2d173f4..49e6f13 100644 --- a/messente_api/api/__init__.py +++ b/messente_api/api/__init__.py @@ -1,6 +1,7 @@ # flake8: noqa # import apis into api package +from messente_api.api.account_balance_api import AccountBalanceApi from messente_api.api.blacklist_api import BlacklistApi from messente_api.api.bulk_messaging_api import BulkMessagingApi from messente_api.api.contacts_api import ContactsApi @@ -8,6 +9,7 @@ from messente_api.api.groups_api import GroupsApi from messente_api.api.number_lookup_api import NumberLookupApi from messente_api.api.omnimessage_api import OmnimessageApi +from messente_api.api.pricing_api import PricingApi from messente_api.api.statistics_api import StatisticsApi from messente_api.api.whats_app_templates_api import WhatsAppTemplatesApi diff --git a/messente_api/api/account_balance_api.py b/messente_api/api/account_balance_api.py new file mode 100644 index 0000000..4cd7fbf --- /dev/null +++ b/messente_api/api/account_balance_api.py @@ -0,0 +1,600 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing_extensions import Annotated + +from messente_api.api_client import ApiClient, RequestSerialized +from messente_api.api_response import ApiResponse +from messente_api.rest import RESTResponseType + + +class AccountBalanceApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def get_account_balance( + self, + username: Annotated[StrictStr, Field(description="The API username")], + password: Annotated[StrictStr, Field(description="The API password")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> str: + """Get account balance + + + :param username: The API username (required) + :type username: str + :param password: The API password (required) + :type password: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_account_balance_serialize( + username=username, + password=password, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_account_balance_with_http_info( + self, + username: Annotated[StrictStr, Field(description="The API username")], + password: Annotated[StrictStr, Field(description="The API password")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> ApiResponse[str]: + """Get account balance + + + :param username: The API username (required) + :type username: str + :param password: The API password (required) + :type password: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_account_balance_serialize( + username=username, + password=password, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_account_balance_without_preload_content( + self, + username: Annotated[StrictStr, Field(description="The API username")], + password: Annotated[StrictStr, Field(description="The API password")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> RESTResponseType: + """Get account balance + + + :param username: The API username (required) + :type username: str + :param password: The API password (required) + :type password: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_account_balance_serialize( + username=username, + password=password, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_account_balance_serialize( + self, + username, + password, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _hosts = [ + 'https://api2.messente.com' + ] + _host = _hosts[_host_index] + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if username is not None: + + _query_params.append(('username', username)) + + if password is not None: + + _query_params.append(('password', password)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'apiPassword', + 'apiUsername' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/get_balance', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_account_balance_using_post( + self, + username: Annotated[StrictStr, Field(description="The API username")], + password: Annotated[StrictStr, Field(description="The API password")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> str: + """Get account balance + + + :param username: The API username (required) + :type username: str + :param password: The API password (required) + :type password: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_account_balance_using_post_serialize( + username=username, + password=password, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_account_balance_using_post_with_http_info( + self, + username: Annotated[StrictStr, Field(description="The API username")], + password: Annotated[StrictStr, Field(description="The API password")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> ApiResponse[str]: + """Get account balance + + + :param username: The API username (required) + :type username: str + :param password: The API password (required) + :type password: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_account_balance_using_post_serialize( + username=username, + password=password, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_account_balance_using_post_without_preload_content( + self, + username: Annotated[StrictStr, Field(description="The API username")], + password: Annotated[StrictStr, Field(description="The API password")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> RESTResponseType: + """Get account balance + + + :param username: The API username (required) + :type username: str + :param password: The API password (required) + :type password: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_account_balance_using_post_serialize( + username=username, + password=password, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_account_balance_using_post_serialize( + self, + username, + password, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _hosts = [ + 'https://api2.messente.com' + ] + _host = _hosts[_host_index] + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if username is not None: + + _query_params.append(('username', username)) + + if password is not None: + + _query_params.append(('password', password)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'apiPassword', + 'apiUsername' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/get_balance', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/messente_api/api/pricing_api.py b/messente_api/api/pricing_api.py new file mode 100644 index 0000000..11582f2 --- /dev/null +++ b/messente_api/api/pricing_api.py @@ -0,0 +1,638 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from messente_api.models.price import Price + +from messente_api.api_client import ApiClient, RequestSerialized +from messente_api.api_response import ApiResponse +from messente_api.rest import RESTResponseType + + +class PricingApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def get_pricelist( + self, + username: Annotated[StrictStr, Field(description="The API username")], + password: Annotated[StrictStr, Field(description="The API password")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> str: + """Get pricelist for account + + + :param username: The API username (required) + :type username: str + :param password: The API password (required) + :type password: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_pricelist_serialize( + username=username, + password=password, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_pricelist_with_http_info( + self, + username: Annotated[StrictStr, Field(description="The API username")], + password: Annotated[StrictStr, Field(description="The API password")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> ApiResponse[str]: + """Get pricelist for account + + + :param username: The API username (required) + :type username: str + :param password: The API password (required) + :type password: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_pricelist_serialize( + username=username, + password=password, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_pricelist_without_preload_content( + self, + username: Annotated[StrictStr, Field(description="The API username")], + password: Annotated[StrictStr, Field(description="The API password")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> RESTResponseType: + """Get pricelist for account + + + :param username: The API username (required) + :type username: str + :param password: The API password (required) + :type password: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_pricelist_serialize( + username=username, + password=password, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_pricelist_serialize( + self, + username, + password, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _hosts = [ + 'https://api2.messente.com' + ] + _host = _hosts[_host_index] + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if username is not None: + + _query_params.append(('username', username)) + + if password is not None: + + _query_params.append(('password', password)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'apiPassword', + 'apiUsername' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pricelist', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_prices( + self, + username: Annotated[StrictStr, Field(description="The API username")], + password: Annotated[StrictStr, Field(description="The API password")], + country: Annotated[StrictStr, Field(description="The country code, for which to get the prices")], + format: Annotated[Optional[StrictStr], Field(description="The format of the response. Can be either 'json' or 'xml'. If not specified, defaults to 'json'.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> Price: + """Get pricing for a specific country + + + :param username: The API username (required) + :type username: str + :param password: The API password (required) + :type password: str + :param country: The country code, for which to get the prices (required) + :type country: str + :param format: The format of the response. Can be either 'json' or 'xml'. If not specified, defaults to 'json'. + :type format: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_prices_serialize( + username=username, + password=password, + country=country, + format=format, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Price", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_prices_with_http_info( + self, + username: Annotated[StrictStr, Field(description="The API username")], + password: Annotated[StrictStr, Field(description="The API password")], + country: Annotated[StrictStr, Field(description="The country code, for which to get the prices")], + format: Annotated[Optional[StrictStr], Field(description="The format of the response. Can be either 'json' or 'xml'. If not specified, defaults to 'json'.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> ApiResponse[Price]: + """Get pricing for a specific country + + + :param username: The API username (required) + :type username: str + :param password: The API password (required) + :type password: str + :param country: The country code, for which to get the prices (required) + :type country: str + :param format: The format of the response. Can be either 'json' or 'xml'. If not specified, defaults to 'json'. + :type format: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_prices_serialize( + username=username, + password=password, + country=country, + format=format, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Price", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_prices_without_preload_content( + self, + username: Annotated[StrictStr, Field(description="The API username")], + password: Annotated[StrictStr, Field(description="The API password")], + country: Annotated[StrictStr, Field(description="The country code, for which to get the prices")], + format: Annotated[Optional[StrictStr], Field(description="The format of the response. Can be either 'json' or 'xml'. If not specified, defaults to 'json'.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> RESTResponseType: + """Get pricing for a specific country + + + :param username: The API username (required) + :type username: str + :param password: The API password (required) + :type password: str + :param country: The country code, for which to get the prices (required) + :type country: str + :param format: The format of the response. Can be either 'json' or 'xml'. If not specified, defaults to 'json'. + :type format: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_prices_serialize( + username=username, + password=password, + country=country, + format=format, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Price", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_prices_serialize( + self, + username, + password, + country, + format, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _hosts = [ + 'https://api2.messente.com' + ] + _host = _hosts[_host_index] + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if username is not None: + + _query_params.append(('username', username)) + + if password is not None: + + _query_params.append(('password', password)) + + if country is not None: + + _query_params.append(('country', country)) + + if format is not None: + + _query_params.append(('format', format)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/xml', + 'text/plain; charset=utf-8' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'apiPassword', + 'apiUsername' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/prices', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/messente_api/configuration.py b/messente_api/configuration.py index 1ff6537..51a876b 100644 --- a/messente_api/configuration.py +++ b/messente_api/configuration.py @@ -115,6 +115,8 @@ "AuthSettings", { "basicAuth": BasicAuthSetting, + "apiUsername": APIKeyAuthSetting, + "apiPassword": APIKeyAuthSetting, }, total=False, ) @@ -165,6 +167,25 @@ class Configuration: :Example: + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + +conf = messente_api.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 + HTTP Basic Authentication Example. Given the following security scheme in the OpenAPI specification: components: @@ -509,6 +530,24 @@ def auth_settings(self)-> AuthSettings: 'key': 'Authorization', 'value': self.get_basic_auth_token() } + if 'apiUsername' in self.api_key: + auth['apiUsername'] = { + 'type': 'api_key', + 'in': 'query', + 'key': 'username', + 'value': self.get_api_key_with_prefix( + 'apiUsername', + ), + } + if 'apiPassword' in self.api_key: + auth['apiPassword'] = { + 'type': 'api_key', + 'in': 'query', + 'key': 'password', + 'value': self.get_api_key_with_prefix( + 'apiPassword', + ), + } return auth def to_debug_report(self) -> str: diff --git a/messente_api/models/__init__.py b/messente_api/models/__init__.py index 27d451d..f17de8e 100644 --- a/messente_api/models/__init__.py +++ b/messente_api/models/__init__.py @@ -53,7 +53,9 @@ from messente_api.models.omni_message_create_success_response import OmniMessageCreateSuccessResponse from messente_api.models.omnimessage import Omnimessage from messente_api.models.omnimessage_messages_inner import OmnimessageMessagesInner +from messente_api.models.price import Price from messente_api.models.price_info import PriceInfo +from messente_api.models.price_networks_inner import PriceNetworksInner from messente_api.models.priority import Priority from messente_api.models.sms import SMS from messente_api.models.statistics_report import StatisticsReport diff --git a/messente_api/models/price.py b/messente_api/models/price.py new file mode 100644 index 0000000..8ca0777 --- /dev/null +++ b/messente_api/models/price.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from messente_api.models.price_networks_inner import PriceNetworksInner +from typing import Optional, Set +from typing_extensions import Self + +class Price(BaseModel): + """ + An object containing the pricing information for a given country + """ # noqa: E501 + country: StrictStr = Field(description="The alpha-2 code for the country") + name: StrictStr = Field(description="The name of the country") + prefix: StrictStr = Field(description="The country code prefix") + networks: List[PriceNetworksInner] = Field(description="A list of networks available in the country") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["country", "name", "prefix", "networks"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Price from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in networks (list) + _items = [] + if self.networks: + for _item_networks in self.networks: + if _item_networks: + _items.append(_item_networks.to_dict()) + _dict['networks'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Price from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "country": obj.get("country"), + "name": obj.get("name"), + "prefix": obj.get("prefix"), + "networks": [PriceNetworksInner.from_dict(_item) for _item in obj["networks"]] if obj.get("networks") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/messente_api/models/price_networks_inner.py b/messente_api/models/price_networks_inner.py new file mode 100644 index 0000000..3837891 --- /dev/null +++ b/messente_api/models/price_networks_inner.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self + +class PriceNetworksInner(BaseModel): + """ + An object containing the network information + """ # noqa: E501 + name: StrictStr = Field(description="The name of the network") + price: StrictStr = Field(description="The price for sending a message to this network") + mccmnc: Union[StrictFloat, StrictInt] = Field(description="The MCCMNC code for the network") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["name", "price", "mccmnc"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PriceNetworksInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PriceNetworksInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "price": obj.get("price"), + "mccmnc": obj.get("mccmnc") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + From e292e0aa7ef94a40567ee73a1dd6dba7900aa27d Mon Sep 17 00:00:00 2001 From: api-librarian Date: Fri, 9 May 2025 14:16:59 +0000 Subject: [PATCH 09/14] Travis update: May 2025 (Build 843) [skip ci] --- .openapi-generator/FILES | 2 + README.md | 5 + docs/NumberVerificationApi.md | 210 +++++ messente_api/__init__.py | 1 + messente_api/api/__init__.py | 1 + messente_api/api/number_verification_api.py | 856 ++++++++++++++++++++ 6 files changed, 1075 insertions(+) create mode 100644 docs/NumberVerificationApi.md create mode 100644 messente_api/api/number_verification_api.py diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 426ebd7..4cf2620 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -45,6 +45,7 @@ docs/MessageResult.md docs/MobileNetwork.md docs/NumberLookupApi.md docs/NumberToBlacklist.md +docs/NumberVerificationApi.md docs/NumbersToInvestigate.md docs/OmniMessageCreateSuccessResponse.md docs/Omnimessage.md @@ -104,6 +105,7 @@ messente_api/api/contacts_api.py messente_api/api/delivery_report_api.py messente_api/api/groups_api.py messente_api/api/number_lookup_api.py +messente_api/api/number_verification_api.py messente_api/api/omnimessage_api.py messente_api/api/pricing_api.py messente_api/api/statistics_api.py diff --git a/README.md b/README.md index 81fe197..c099362 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,11 @@ Messente API Library provides the operations described below to access the featu 1. Returns all groups [`fetch_groups`](docs/GroupsApi.md#fetch_groups) 1. Updates a group with the provided name [`update_group`](docs/GroupsApi.md#update_group) +### NumberVerificationApi + +1. verify number [`verify_number`](docs/NumberVerificationApi.md#verify_number) +1. verified the PIN code entered by the user. [`verify_pin`](docs/NumberVerificationApi.md#verify_pin) + ### NumberLookupApi 1. Requests info about phone numbers [`fetch_info`](docs/NumberLookupApi.md#fetch_info) diff --git a/docs/NumberVerificationApi.md b/docs/NumberVerificationApi.md new file mode 100644 index 0000000..18b7cb2 --- /dev/null +++ b/docs/NumberVerificationApi.md @@ -0,0 +1,210 @@ +# messente_api.NumberVerificationApi + +All URIs are relative to *https://api.messente.com/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**verify_number**](NumberVerificationApi.md#verify_number) | **POST** /verify/start | verify number +[**verify_pin**](NumberVerificationApi.md#verify_pin) | **POST** /verify/pin | verified the PIN code entered by the user. + + +# **verify_number** +> str verify_number(username, password, to, template=template, pin_length=pin_length, var_from=var_from, max_tries=max_tries, retry_delay=retry_delay, validity=validity, ip=ip, browser=browser, cookie=cookie) + +verify number + +### Example + +* Api Key Authentication (apiPassword): +* Api Key Authentication (apiUsername): + +```python +import messente_api +from messente_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.messente.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = messente_api.Configuration( + host = "https://api.messente.com/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: apiPassword +configuration.api_key['apiPassword'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiPassword'] = 'Bearer' + +# Configure API key authorization: apiUsername +configuration.api_key['apiUsername'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiUsername'] = 'Bearer' + +# Enter a context with an instance of the API client +with messente_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = messente_api.NumberVerificationApi(api_client) + username = 'username_example' # str | The API username + password = 'password_example' # str | The API password + to = 'to_example' # str | Receiver's phone number with the country code + template = 'template_example' # str | Template of the message, including PIN code. Placeholder for PIN code is . When not set, default template is used: \"Your Verification PIN code is \". (optional) + pin_length = 'pin_length_example' # str | Length of the PIN code. Minumum 4 digits, maximum 16. Defaults to 4. (optional) + var_from = 'var_from_example' # str | Sender name. When not set, the default Sender name \"Verigator\" is used. This sender ID also needs to be added to your account beforehand. (optional) + max_tries = 'max_tries_example' # str | Maximum number of times the PIN code is sent in total. Defaults to \"2\" - initial PIN code and one retry. It is discouraged to set this value to \"1\" as only the initial PIN code is sent and retry is disabled. (optional) + retry_delay = 'retry_delay_example' # str | For how long (in seconds) to wait for next retry, if the correct PIN code has not been entered yet? Defaults to 30 seconds. (optional) + validity = 'validity_example' # str | For how long (in seconds) is the PIN code valid. Defaults to 5 minutes (300 seconds). Maximum 30 minutes (1800 seconds). (optional) + ip = 'ip_example' # str | IP address of the client making verification request. (optional) + browser = 'browser_example' # str | User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\". (optional) + cookie = 'cookie_example' # str | Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed. (optional) + + try: + # verify number + api_response = api_instance.verify_number(username, password, to, template=template, pin_length=pin_length, var_from=var_from, max_tries=max_tries, retry_delay=retry_delay, validity=validity, ip=ip, browser=browser, cookie=cookie) + print("The response of NumberVerificationApi->verify_number:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NumberVerificationApi->verify_number: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The API username | + **password** | **str**| The API password | + **to** | **str**| Receiver's phone number with the country code | + **template** | **str**| Template of the message, including PIN code. Placeholder for PIN code is <PIN>. When not set, default template is used: \"Your Verification PIN code is <PIN>\". | [optional] + **pin_length** | **str**| Length of the PIN code. Minumum 4 digits, maximum 16. Defaults to 4. | [optional] + **var_from** | **str**| Sender name. When not set, the default Sender name \"Verigator\" is used. This sender ID also needs to be added to your account beforehand. | [optional] + **max_tries** | **str**| Maximum number of times the PIN code is sent in total. Defaults to \"2\" - initial PIN code and one retry. It is discouraged to set this value to \"1\" as only the initial PIN code is sent and retry is disabled. | [optional] + **retry_delay** | **str**| For how long (in seconds) to wait for next retry, if the correct PIN code has not been entered yet? Defaults to 30 seconds. | [optional] + **validity** | **str**| For how long (in seconds) is the PIN code valid. Defaults to 5 minutes (300 seconds). Maximum 30 minutes (1800 seconds). | [optional] + **ip** | **str**| IP address of the client making verification request. | [optional] + **browser** | **str**| User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\". | [optional] + **cookie** | **str**| Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed. | [optional] + +### Return type + +**str** + +### Authorization + +[apiPassword](../README.md#apiPassword), [apiUsername](../README.md#apiUsername) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Both errors and success responses are returned as plain text with HTTP status 200. | - | + +[[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) + +# **verify_pin** +> str verify_pin(username, password, verification_id, pin, ip=ip, browser=browser, cookie=cookie) + +verified the PIN code entered by the user. + +### Example + +* Api Key Authentication (apiPassword): +* Api Key Authentication (apiUsername): + +```python +import messente_api +from messente_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.messente.com/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = messente_api.Configuration( + host = "https://api.messente.com/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: apiPassword +configuration.api_key['apiPassword'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiPassword'] = 'Bearer' + +# Configure API key authorization: apiUsername +configuration.api_key['apiUsername'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiUsername'] = 'Bearer' + +# Enter a context with an instance of the API client +with messente_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = messente_api.NumberVerificationApi(api_client) + username = 'username_example' # str | The API username + password = 'password_example' # str | The API password + verification_id = 'verification_id_example' # str | Verification ID returned by the successful verification request. + pin = 'pin_example' # str | PIN code entered by the user. + ip = 'ip_example' # str | IP address of the client making verification request. If the IP address is from another country, PIN is required even if the cookies match. (optional) + browser = 'browser_example' # str | User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\". (optional) + cookie = 'cookie_example' # str | Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed. (optional) + + try: + # verified the PIN code entered by the user. + api_response = api_instance.verify_pin(username, password, verification_id, pin, ip=ip, browser=browser, cookie=cookie) + print("The response of NumberVerificationApi->verify_pin:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling NumberVerificationApi->verify_pin: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **str**| The API username | + **password** | **str**| The API password | + **verification_id** | **str**| Verification ID returned by the successful verification request. | + **pin** | **str**| PIN code entered by the user. | + **ip** | **str**| IP address of the client making verification request. If the IP address is from another country, PIN is required even if the cookies match. | [optional] + **browser** | **str**| User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\". | [optional] + **cookie** | **str**| Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed. | [optional] + +### Return type + +**str** + +### Authorization + +[apiPassword](../README.md#apiPassword), [apiUsername](../README.md#apiUsername) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Both errors and success responses are returned as plain text with HTTP status 200. | - | + +[[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/messente_api/__init__.py b/messente_api/__init__.py index fb06a85..c681ff3 100644 --- a/messente_api/__init__.py +++ b/messente_api/__init__.py @@ -24,6 +24,7 @@ from messente_api.api.contacts_api import ContactsApi from messente_api.api.delivery_report_api import DeliveryReportApi from messente_api.api.groups_api import GroupsApi +from messente_api.api.number_verification_api import NumberVerificationApi from messente_api.api.number_lookup_api import NumberLookupApi from messente_api.api.omnimessage_api import OmnimessageApi from messente_api.api.pricing_api import PricingApi diff --git a/messente_api/api/__init__.py b/messente_api/api/__init__.py index 49e6f13..7903f2e 100644 --- a/messente_api/api/__init__.py +++ b/messente_api/api/__init__.py @@ -7,6 +7,7 @@ from messente_api.api.contacts_api import ContactsApi from messente_api.api.delivery_report_api import DeliveryReportApi from messente_api.api.groups_api import GroupsApi +from messente_api.api.number_verification_api import NumberVerificationApi from messente_api.api.number_lookup_api import NumberLookupApi from messente_api.api.omnimessage_api import OmnimessageApi from messente_api.api.pricing_api import PricingApi diff --git a/messente_api/api/number_verification_api.py b/messente_api/api/number_verification_api.py new file mode 100644 index 0000000..0bdc6e6 --- /dev/null +++ b/messente_api/api/number_verification_api.py @@ -0,0 +1,856 @@ +# coding: utf-8 + +""" + Messente API + + [Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. + + The version of the OpenAPI document: 2.0.0 + Contact: messente@messente.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated + +from messente_api.api_client import ApiClient, RequestSerialized +from messente_api.api_response import ApiResponse +from messente_api.rest import RESTResponseType + + +class NumberVerificationApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def verify_number( + self, + username: Annotated[StrictStr, Field(description="The API username")], + password: Annotated[StrictStr, Field(description="The API password")], + to: Annotated[StrictStr, Field(description="Receiver's phone number with the country code")], + template: Annotated[Optional[StrictStr], Field(description="Template of the message, including PIN code. Placeholder for PIN code is . When not set, default template is used: \"Your Verification PIN code is \". ")] = None, + pin_length: Annotated[Optional[StrictStr], Field(description="Length of the PIN code. Minumum 4 digits, maximum 16. Defaults to 4.")] = None, + var_from: Annotated[Optional[StrictStr], Field(description="Sender name. When not set, the default Sender name \"Verigator\" is used. This sender ID also needs to be added to your account beforehand.")] = None, + max_tries: Annotated[Optional[StrictStr], Field(description="Maximum number of times the PIN code is sent in total. Defaults to \"2\" - initial PIN code and one retry. It is discouraged to set this value to \"1\" as only the initial PIN code is sent and retry is disabled. ")] = None, + retry_delay: Annotated[Optional[StrictStr], Field(description="For how long (in seconds) to wait for next retry, if the correct PIN code has not been entered yet? Defaults to 30 seconds.")] = None, + validity: Annotated[Optional[StrictStr], Field(description="For how long (in seconds) is the PIN code valid. Defaults to 5 minutes (300 seconds). Maximum 30 minutes (1800 seconds).")] = None, + ip: Annotated[Optional[StrictStr], Field(description="IP address of the client making verification request.")] = None, + browser: Annotated[Optional[StrictStr], Field(description="User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\".")] = None, + cookie: Annotated[Optional[StrictStr], Field(description="Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> str: + """verify number + + + :param username: The API username (required) + :type username: str + :param password: The API password (required) + :type password: str + :param to: Receiver's phone number with the country code (required) + :type to: str + :param template: Template of the message, including PIN code. Placeholder for PIN code is . When not set, default template is used: \"Your Verification PIN code is \". + :type template: str + :param pin_length: Length of the PIN code. Minumum 4 digits, maximum 16. Defaults to 4. + :type pin_length: str + :param var_from: Sender name. When not set, the default Sender name \"Verigator\" is used. This sender ID also needs to be added to your account beforehand. + :type var_from: str + :param max_tries: Maximum number of times the PIN code is sent in total. Defaults to \"2\" - initial PIN code and one retry. It is discouraged to set this value to \"1\" as only the initial PIN code is sent and retry is disabled. + :type max_tries: str + :param retry_delay: For how long (in seconds) to wait for next retry, if the correct PIN code has not been entered yet? Defaults to 30 seconds. + :type retry_delay: str + :param validity: For how long (in seconds) is the PIN code valid. Defaults to 5 minutes (300 seconds). Maximum 30 minutes (1800 seconds). + :type validity: str + :param ip: IP address of the client making verification request. + :type ip: str + :param browser: User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\". + :type browser: str + :param cookie: Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed. + :type cookie: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._verify_number_serialize( + username=username, + password=password, + to=to, + template=template, + pin_length=pin_length, + var_from=var_from, + max_tries=max_tries, + retry_delay=retry_delay, + validity=validity, + ip=ip, + browser=browser, + cookie=cookie, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def verify_number_with_http_info( + self, + username: Annotated[StrictStr, Field(description="The API username")], + password: Annotated[StrictStr, Field(description="The API password")], + to: Annotated[StrictStr, Field(description="Receiver's phone number with the country code")], + template: Annotated[Optional[StrictStr], Field(description="Template of the message, including PIN code. Placeholder for PIN code is . When not set, default template is used: \"Your Verification PIN code is \". ")] = None, + pin_length: Annotated[Optional[StrictStr], Field(description="Length of the PIN code. Minumum 4 digits, maximum 16. Defaults to 4.")] = None, + var_from: Annotated[Optional[StrictStr], Field(description="Sender name. When not set, the default Sender name \"Verigator\" is used. This sender ID also needs to be added to your account beforehand.")] = None, + max_tries: Annotated[Optional[StrictStr], Field(description="Maximum number of times the PIN code is sent in total. Defaults to \"2\" - initial PIN code and one retry. It is discouraged to set this value to \"1\" as only the initial PIN code is sent and retry is disabled. ")] = None, + retry_delay: Annotated[Optional[StrictStr], Field(description="For how long (in seconds) to wait for next retry, if the correct PIN code has not been entered yet? Defaults to 30 seconds.")] = None, + validity: Annotated[Optional[StrictStr], Field(description="For how long (in seconds) is the PIN code valid. Defaults to 5 minutes (300 seconds). Maximum 30 minutes (1800 seconds).")] = None, + ip: Annotated[Optional[StrictStr], Field(description="IP address of the client making verification request.")] = None, + browser: Annotated[Optional[StrictStr], Field(description="User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\".")] = None, + cookie: Annotated[Optional[StrictStr], Field(description="Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> ApiResponse[str]: + """verify number + + + :param username: The API username (required) + :type username: str + :param password: The API password (required) + :type password: str + :param to: Receiver's phone number with the country code (required) + :type to: str + :param template: Template of the message, including PIN code. Placeholder for PIN code is . When not set, default template is used: \"Your Verification PIN code is \". + :type template: str + :param pin_length: Length of the PIN code. Minumum 4 digits, maximum 16. Defaults to 4. + :type pin_length: str + :param var_from: Sender name. When not set, the default Sender name \"Verigator\" is used. This sender ID also needs to be added to your account beforehand. + :type var_from: str + :param max_tries: Maximum number of times the PIN code is sent in total. Defaults to \"2\" - initial PIN code and one retry. It is discouraged to set this value to \"1\" as only the initial PIN code is sent and retry is disabled. + :type max_tries: str + :param retry_delay: For how long (in seconds) to wait for next retry, if the correct PIN code has not been entered yet? Defaults to 30 seconds. + :type retry_delay: str + :param validity: For how long (in seconds) is the PIN code valid. Defaults to 5 minutes (300 seconds). Maximum 30 minutes (1800 seconds). + :type validity: str + :param ip: IP address of the client making verification request. + :type ip: str + :param browser: User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\". + :type browser: str + :param cookie: Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed. + :type cookie: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._verify_number_serialize( + username=username, + password=password, + to=to, + template=template, + pin_length=pin_length, + var_from=var_from, + max_tries=max_tries, + retry_delay=retry_delay, + validity=validity, + ip=ip, + browser=browser, + cookie=cookie, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def verify_number_without_preload_content( + self, + username: Annotated[StrictStr, Field(description="The API username")], + password: Annotated[StrictStr, Field(description="The API password")], + to: Annotated[StrictStr, Field(description="Receiver's phone number with the country code")], + template: Annotated[Optional[StrictStr], Field(description="Template of the message, including PIN code. Placeholder for PIN code is . When not set, default template is used: \"Your Verification PIN code is \". ")] = None, + pin_length: Annotated[Optional[StrictStr], Field(description="Length of the PIN code. Minumum 4 digits, maximum 16. Defaults to 4.")] = None, + var_from: Annotated[Optional[StrictStr], Field(description="Sender name. When not set, the default Sender name \"Verigator\" is used. This sender ID also needs to be added to your account beforehand.")] = None, + max_tries: Annotated[Optional[StrictStr], Field(description="Maximum number of times the PIN code is sent in total. Defaults to \"2\" - initial PIN code and one retry. It is discouraged to set this value to \"1\" as only the initial PIN code is sent and retry is disabled. ")] = None, + retry_delay: Annotated[Optional[StrictStr], Field(description="For how long (in seconds) to wait for next retry, if the correct PIN code has not been entered yet? Defaults to 30 seconds.")] = None, + validity: Annotated[Optional[StrictStr], Field(description="For how long (in seconds) is the PIN code valid. Defaults to 5 minutes (300 seconds). Maximum 30 minutes (1800 seconds).")] = None, + ip: Annotated[Optional[StrictStr], Field(description="IP address of the client making verification request.")] = None, + browser: Annotated[Optional[StrictStr], Field(description="User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\".")] = None, + cookie: Annotated[Optional[StrictStr], Field(description="Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> RESTResponseType: + """verify number + + + :param username: The API username (required) + :type username: str + :param password: The API password (required) + :type password: str + :param to: Receiver's phone number with the country code (required) + :type to: str + :param template: Template of the message, including PIN code. Placeholder for PIN code is . When not set, default template is used: \"Your Verification PIN code is \". + :type template: str + :param pin_length: Length of the PIN code. Minumum 4 digits, maximum 16. Defaults to 4. + :type pin_length: str + :param var_from: Sender name. When not set, the default Sender name \"Verigator\" is used. This sender ID also needs to be added to your account beforehand. + :type var_from: str + :param max_tries: Maximum number of times the PIN code is sent in total. Defaults to \"2\" - initial PIN code and one retry. It is discouraged to set this value to \"1\" as only the initial PIN code is sent and retry is disabled. + :type max_tries: str + :param retry_delay: For how long (in seconds) to wait for next retry, if the correct PIN code has not been entered yet? Defaults to 30 seconds. + :type retry_delay: str + :param validity: For how long (in seconds) is the PIN code valid. Defaults to 5 minutes (300 seconds). Maximum 30 minutes (1800 seconds). + :type validity: str + :param ip: IP address of the client making verification request. + :type ip: str + :param browser: User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\". + :type browser: str + :param cookie: Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed. + :type cookie: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._verify_number_serialize( + username=username, + password=password, + to=to, + template=template, + pin_length=pin_length, + var_from=var_from, + max_tries=max_tries, + retry_delay=retry_delay, + validity=validity, + ip=ip, + browser=browser, + cookie=cookie, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _verify_number_serialize( + self, + username, + password, + to, + template, + pin_length, + var_from, + max_tries, + retry_delay, + validity, + ip, + browser, + cookie, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _hosts = [ + 'https://api2.messente.com' + ] + _host = _hosts[_host_index] + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if username is not None: + + _query_params.append(('username', username)) + + if password is not None: + + _query_params.append(('password', password)) + + if to is not None: + + _query_params.append(('to', to)) + + if template is not None: + + _query_params.append(('template', template)) + + if pin_length is not None: + + _query_params.append(('pin_length', pin_length)) + + if var_from is not None: + + _query_params.append(('from', var_from)) + + if max_tries is not None: + + _query_params.append(('max_tries', max_tries)) + + if retry_delay is not None: + + _query_params.append(('retry_delay', retry_delay)) + + if validity is not None: + + _query_params.append(('validity', validity)) + + if ip is not None: + + _query_params.append(('ip', ip)) + + if browser is not None: + + _query_params.append(('browser', browser)) + + if cookie is not None: + + _query_params.append(('cookie', cookie)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'apiPassword', + 'apiUsername' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/verify/start', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def verify_pin( + self, + username: Annotated[StrictStr, Field(description="The API username")], + password: Annotated[StrictStr, Field(description="The API password")], + verification_id: Annotated[StrictStr, Field(description="Verification ID returned by the successful verification request.")], + pin: Annotated[StrictStr, Field(description="PIN code entered by the user.")], + ip: Annotated[Optional[StrictStr], Field(description="IP address of the client making verification request. If the IP address is from another country, PIN is required even if the cookies match.")] = None, + browser: Annotated[Optional[StrictStr], Field(description="User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\".")] = None, + cookie: Annotated[Optional[StrictStr], Field(description="Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> str: + """verified the PIN code entered by the user. + + + :param username: The API username (required) + :type username: str + :param password: The API password (required) + :type password: str + :param verification_id: Verification ID returned by the successful verification request. (required) + :type verification_id: str + :param pin: PIN code entered by the user. (required) + :type pin: str + :param ip: IP address of the client making verification request. If the IP address is from another country, PIN is required even if the cookies match. + :type ip: str + :param browser: User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\". + :type browser: str + :param cookie: Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed. + :type cookie: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._verify_pin_serialize( + username=username, + password=password, + verification_id=verification_id, + pin=pin, + ip=ip, + browser=browser, + cookie=cookie, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def verify_pin_with_http_info( + self, + username: Annotated[StrictStr, Field(description="The API username")], + password: Annotated[StrictStr, Field(description="The API password")], + verification_id: Annotated[StrictStr, Field(description="Verification ID returned by the successful verification request.")], + pin: Annotated[StrictStr, Field(description="PIN code entered by the user.")], + ip: Annotated[Optional[StrictStr], Field(description="IP address of the client making verification request. If the IP address is from another country, PIN is required even if the cookies match.")] = None, + browser: Annotated[Optional[StrictStr], Field(description="User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\".")] = None, + cookie: Annotated[Optional[StrictStr], Field(description="Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> ApiResponse[str]: + """verified the PIN code entered by the user. + + + :param username: The API username (required) + :type username: str + :param password: The API password (required) + :type password: str + :param verification_id: Verification ID returned by the successful verification request. (required) + :type verification_id: str + :param pin: PIN code entered by the user. (required) + :type pin: str + :param ip: IP address of the client making verification request. If the IP address is from another country, PIN is required even if the cookies match. + :type ip: str + :param browser: User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\". + :type browser: str + :param cookie: Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed. + :type cookie: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._verify_pin_serialize( + username=username, + password=password, + verification_id=verification_id, + pin=pin, + ip=ip, + browser=browser, + cookie=cookie, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def verify_pin_without_preload_content( + self, + username: Annotated[StrictStr, Field(description="The API username")], + password: Annotated[StrictStr, Field(description="The API password")], + verification_id: Annotated[StrictStr, Field(description="Verification ID returned by the successful verification request.")], + pin: Annotated[StrictStr, Field(description="PIN code entered by the user.")], + ip: Annotated[Optional[StrictStr], Field(description="IP address of the client making verification request. If the IP address is from another country, PIN is required even if the cookies match.")] = None, + browser: Annotated[Optional[StrictStr], Field(description="User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\".")] = None, + cookie: Annotated[Optional[StrictStr], Field(description="Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=1)] = 0, + ) -> RESTResponseType: + """verified the PIN code entered by the user. + + + :param username: The API username (required) + :type username: str + :param password: The API password (required) + :type password: str + :param verification_id: Verification ID returned by the successful verification request. (required) + :type verification_id: str + :param pin: PIN code entered by the user. (required) + :type pin: str + :param ip: IP address of the client making verification request. If the IP address is from another country, PIN is required even if the cookies match. + :type ip: str + :param browser: User Agent of the browser. For example \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36\". + :type browser: str + :param cookie: Unique cookie assigned to this session. If a user tries logging in with the same cookie present, user is automatically logged in and no PIN code verification is needed. + :type cookie: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._verify_pin_serialize( + username=username, + password=password, + verification_id=verification_id, + pin=pin, + ip=ip, + browser=browser, + cookie=cookie, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _verify_pin_serialize( + self, + username, + password, + verification_id, + pin, + ip, + browser, + cookie, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _hosts = [ + 'https://api2.messente.com' + ] + _host = _hosts[_host_index] + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if username is not None: + + _query_params.append(('username', username)) + + if password is not None: + + _query_params.append(('password', password)) + + if verification_id is not None: + + _query_params.append(('verification_id', verification_id)) + + if pin is not None: + + _query_params.append(('pin', pin)) + + if ip is not None: + + _query_params.append(('ip', ip)) + + if browser is not None: + + _query_params.append(('browser', browser)) + + if cookie is not None: + + _query_params.append(('cookie', cookie)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/plain' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'apiPassword', + 'apiUsername' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/verify/pin', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + From 99b3c4a5a9c7e3d70f88ec6b14fca32de4af0788 Mon Sep 17 00:00:00 2001 From: api-librarian Date: Thu, 5 Jun 2025 11:13:38 +0000 Subject: [PATCH 10/14] Travis update: Jun 2025 (Build 858) [skip ci] --- .github/workflows/python.yml | 31 - .gitignore | 66 - .gitlab-ci.yml | 31 - .openapi-generator-ignore | 23 - .openapi-generator/FILES | 204 -- .openapi-generator/VERSION | 1 - .travis.yml | 12 - README.md | 171 -- docs/AccountBalanceApi.md | 180 -- docs/BlacklistApi.md | 321 --- docs/BulkMessagingApi.md | 89 - docs/BulkOmniMessageCreateSuccessResponse.md | 30 - ...ssageCreateSuccessResponseMessagesInner.md | 32 - docs/BulkOmnimessage.md | 30 - docs/Channel.md | 17 - docs/ContactEnvelope.md | 30 - docs/ContactFields.md | 39 - docs/ContactListEnvelope.md | 30 - docs/ContactResponseFields.md | 40 - docs/ContactUpdateFields.md | 38 - docs/ContactsApi.md | 663 ----- docs/DeliveryReportApi.md | 88 - docs/DeliveryReportResponse.md | 32 - docs/DeliveryResult.md | 37 - docs/ErrorCodeOmnichannel.md | 23 - docs/ErrorCodeOmnichannelMachine.md | 33 - docs/ErrorCodePhonebook.md | 21 - docs/ErrorCodeStatistics.md | 17 - docs/ErrorItemNumberLookup.md | 30 - docs/ErrorItemNumberLookupError.md | 31 - docs/ErrorItemOmnichannel.md | 33 - docs/ErrorItemPhonebook.md | 32 - docs/ErrorItemStatistics.md | 32 - docs/ErrorNumberLookup.md | 30 - docs/ErrorOmnichannel.md | 30 - docs/ErrorPhonebook.md | 30 - docs/ErrorStatistics.md | 30 - docs/ErrorTitleOmnichannel.md | 23 - docs/ErrorTitlePhonebook.md | 21 - docs/FetchBlacklistSuccess.md | 30 - docs/GroupEnvelope.md | 30 - docs/GroupListEnvelope.md | 30 - docs/GroupName.md | 30 - docs/GroupResponseFields.md | 33 - docs/GroupsApi.md | 409 --- docs/MessageResult.md | 32 - docs/MobileNetwork.md | 34 - docs/NumberLookupApi.md | 90 - docs/NumberToBlacklist.md | 30 - docs/NumberVerificationApi.md | 210 -- docs/NumbersToInvestigate.md | 30 - docs/OmniMessageCreateSuccessResponse.md | 32 - docs/Omnimessage.md | 35 - docs/OmnimessageApi.md | 168 -- docs/OmnimessageMessagesInner.md | 42 - docs/Price.md | 33 - docs/PriceInfo.md | 32 - docs/PriceNetworksInner.md | 32 - docs/PricingApi.md | 185 -- docs/Priority.md | 15 - docs/SMS.md | 36 - docs/StatisticsApi.md | 91 - docs/StatisticsReport.md | 32 - docs/StatisticsReportSettings.md | 32 - docs/StatisticsReportSuccess.md | 30 - docs/Status.md | 31 - docs/SyncNumberLookupResult.md | 38 - docs/SyncNumberLookupSuccess.md | 31 - docs/Telegram.md | 36 - docs/TextStore.md | 15 - docs/Viber.md | 38 - docs/ViberVideo.md | 33 - docs/WhatsApp.md | 35 - docs/WhatsAppComponent.md | 33 - docs/WhatsAppCurrency.md | 32 - docs/WhatsAppDatetime.md | 30 - docs/WhatsAppLanguage.md | 31 - docs/WhatsAppMedia.md | 33 - docs/WhatsAppParameter.md | 38 - docs/WhatsAppTemplate.md | 32 - docs/WhatsAppTemplatesApi.md | 448 ---- docs/WhatsAppText.md | 31 - docs/WhatsappButtonType.md | 23 - docs/WhatsappComponentType.md | 17 - docs/WhatsappCreateTemplateRequest.md | 33 - docs/WhatsappCreateTemplateResponse.md | 32 - docs/WhatsappHeaderFormat.md | 11 - docs/WhatsappListTemplatesResponse.md | 31 - docs/WhatsappOtpButtonType.md | 15 - docs/WhatsappPagination.md | 32 - docs/WhatsappPagingCursors.md | 31 - docs/WhatsappSupportedApp.md | 31 - docs/WhatsappTemplateButton.md | 36 - docs/WhatsappTemplateCategory.md | 15 - docs/WhatsappTemplateComponent.md | 34 - docs/WhatsappTemplateExample.md | 31 - docs/WhatsappTemplateResponse.md | 35 - docs/WhatsappTemplateStatus.md | 27 - docs/WhatsappUpdateTemplateRequest.md | 31 - git_push.sh | 57 - messente_api/__init__.py | 124 - messente_api/api/__init__.py | 16 - messente_api/api/account_balance_api.py | 600 ----- messente_api/api/blacklist_api.py | 1100 -------- messente_api/api/bulk_messaging_api.py | 317 --- messente_api/api/contacts_api.py | 2254 ----------------- messente_api/api/delivery_report_api.py | 303 --- messente_api/api/groups_api.py | 1387 ---------- messente_api/api/number_lookup_api.py | 320 --- messente_api/api/number_verification_api.py | 856 ------- messente_api/api/omnimessage_api.py | 582 ----- messente_api/api/pricing_api.py | 638 ----- messente_api/api/statistics_api.py | 323 --- messente_api/api/whats_app_templates_api.py | 1652 ------------ messente_api/api_client.py | 798 ------ messente_api/api_response.py | 21 - messente_api/configuration.py | 630 ----- messente_api/exceptions.py | 217 -- messente_api/models/__init__.py | 96 - ...lk_omni_message_create_success_response.py | 109 - ..._create_success_response_messages_inner.py | 138 - messente_api/models/bulk_omnimessage.py | 109 - messente_api/models/channel.py | 40 - messente_api/models/contact_envelope.py | 105 - messente_api/models/contact_fields.py | 164 -- messente_api/models/contact_list_envelope.py | 109 - .../models/contact_response_fields.py | 172 -- messente_api/models/contact_update_fields.py | 162 -- .../models/delivery_report_response.py | 113 - messente_api/models/delivery_result.py | 128 - messente_api/models/error_code_omnichannel.py | 43 - .../models/error_code_omnichannel_machine.py | 48 - messente_api/models/error_code_phonebook.py | 42 - messente_api/models/error_code_statistics.py | 40 - .../models/error_item_number_lookup.py | 105 - .../models/error_item_number_lookup_error.py | 104 - messente_api/models/error_item_omnichannel.py | 114 - messente_api/models/error_item_phonebook.py | 107 - messente_api/models/error_item_statistics.py | 106 - messente_api/models/error_number_lookup.py | 109 - messente_api/models/error_omnichannel.py | 109 - messente_api/models/error_phonebook.py | 109 - messente_api/models/error_statistics.py | 109 - .../models/error_title_omnichannel.py | 43 - messente_api/models/error_title_phonebook.py | 42 - .../models/fetch_blacklist_success.py | 101 - messente_api/models/group_envelope.py | 105 - messente_api/models/group_list_envelope.py | 109 - messente_api/models/group_name.py | 102 - messente_api/models/group_response_fields.py | 112 - messente_api/models/message_result.py | 106 - messente_api/models/mobile_network.py | 109 - messente_api/models/number_to_blacklist.py | 101 - messente_api/models/numbers_to_investigate.py | 102 - .../omni_message_create_success_response.py | 113 - messente_api/models/omnimessage.py | 122 - .../models/omnimessage_messages_inner.py | 166 -- messente_api/models/price.py | 115 - messente_api/models/price_info.py | 105 - messente_api/models/price_networks_inner.py | 105 - messente_api/models/priority.py | 39 - messente_api/models/sms.py | 133 - messente_api/models/statistics_report.py | 105 - .../models/statistics_report_settings.py | 106 - .../models/statistics_report_success.py | 109 - messente_api/models/status.py | 47 - .../models/sync_number_lookup_result.py | 175 -- .../models/sync_number_lookup_success.py | 111 - messente_api/models/telegram.py | 123 - messente_api/models/text_store.py | 39 - messente_api/models/viber.py | 131 - messente_api/models/viber_video.py | 107 - messente_api/models/whats_app.py | 129 - messente_api/models/whats_app_component.py | 115 - messente_api/models/whats_app_currency.py | 105 - messente_api/models/whats_app_datetime.py | 101 - messente_api/models/whats_app_language.py | 103 - messente_api/models/whats_app_media.py | 107 - messente_api/models/whats_app_parameter.py | 135 - messente_api/models/whats_app_template.py | 117 - messente_api/models/whats_app_text.py | 103 - messente_api/models/whatsapp_button_type.py | 43 - .../models/whatsapp_component_type.py | 40 - .../whatsapp_create_template_request.py | 116 - .../whatsapp_create_template_response.py | 107 - messente_api/models/whatsapp_header_format.py | 37 - .../whatsapp_list_templates_response.py | 115 - .../models/whatsapp_otp_button_type.py | 39 - messente_api/models/whatsapp_pagination.py | 109 - .../models/whatsapp_paging_cursors.py | 103 - messente_api/models/whatsapp_supported_app.py | 103 - .../models/whatsapp_template_button.py | 124 - .../models/whatsapp_template_category.py | 39 - .../models/whatsapp_template_component.py | 123 - .../models/whatsapp_template_example.py | 103 - .../models/whatsapp_template_response.py | 121 - .../models/whatsapp_template_status.py | 45 - .../whatsapp_update_template_request.py | 103 - messente_api/py.typed | 0 messente_api/rest.py | 258 -- pyproject.toml | 89 - requirements.txt | 4 - setup.cfg | 2 - setup.py | 51 - test-requirements.txt | 6 - tox.ini | 9 - 206 files changed, 26536 deletions(-) delete mode 100644 .github/workflows/python.yml delete mode 100644 .gitignore delete mode 100644 .gitlab-ci.yml delete mode 100644 .openapi-generator-ignore delete mode 100644 .openapi-generator/FILES delete mode 100644 .openapi-generator/VERSION delete mode 100644 .travis.yml delete mode 100644 README.md delete mode 100644 docs/AccountBalanceApi.md delete mode 100644 docs/BlacklistApi.md delete mode 100644 docs/BulkMessagingApi.md delete mode 100644 docs/BulkOmniMessageCreateSuccessResponse.md delete mode 100644 docs/BulkOmniMessageCreateSuccessResponseMessagesInner.md delete mode 100644 docs/BulkOmnimessage.md delete mode 100644 docs/Channel.md delete mode 100644 docs/ContactEnvelope.md delete mode 100644 docs/ContactFields.md delete mode 100644 docs/ContactListEnvelope.md delete mode 100644 docs/ContactResponseFields.md delete mode 100644 docs/ContactUpdateFields.md delete mode 100644 docs/ContactsApi.md delete mode 100644 docs/DeliveryReportApi.md delete mode 100644 docs/DeliveryReportResponse.md delete mode 100644 docs/DeliveryResult.md delete mode 100644 docs/ErrorCodeOmnichannel.md delete mode 100644 docs/ErrorCodeOmnichannelMachine.md delete mode 100644 docs/ErrorCodePhonebook.md delete mode 100644 docs/ErrorCodeStatistics.md delete mode 100644 docs/ErrorItemNumberLookup.md delete mode 100644 docs/ErrorItemNumberLookupError.md delete mode 100644 docs/ErrorItemOmnichannel.md delete mode 100644 docs/ErrorItemPhonebook.md delete mode 100644 docs/ErrorItemStatistics.md delete mode 100644 docs/ErrorNumberLookup.md delete mode 100644 docs/ErrorOmnichannel.md delete mode 100644 docs/ErrorPhonebook.md delete mode 100644 docs/ErrorStatistics.md delete mode 100644 docs/ErrorTitleOmnichannel.md delete mode 100644 docs/ErrorTitlePhonebook.md delete mode 100644 docs/FetchBlacklistSuccess.md delete mode 100644 docs/GroupEnvelope.md delete mode 100644 docs/GroupListEnvelope.md delete mode 100644 docs/GroupName.md delete mode 100644 docs/GroupResponseFields.md delete mode 100644 docs/GroupsApi.md delete mode 100644 docs/MessageResult.md delete mode 100644 docs/MobileNetwork.md delete mode 100644 docs/NumberLookupApi.md delete mode 100644 docs/NumberToBlacklist.md delete mode 100644 docs/NumberVerificationApi.md delete mode 100644 docs/NumbersToInvestigate.md delete mode 100644 docs/OmniMessageCreateSuccessResponse.md delete mode 100644 docs/Omnimessage.md delete mode 100644 docs/OmnimessageApi.md delete mode 100644 docs/OmnimessageMessagesInner.md delete mode 100644 docs/Price.md delete mode 100644 docs/PriceInfo.md delete mode 100644 docs/PriceNetworksInner.md delete mode 100644 docs/PricingApi.md delete mode 100644 docs/Priority.md delete mode 100644 docs/SMS.md delete mode 100644 docs/StatisticsApi.md delete mode 100644 docs/StatisticsReport.md delete mode 100644 docs/StatisticsReportSettings.md delete mode 100644 docs/StatisticsReportSuccess.md delete mode 100644 docs/Status.md delete mode 100644 docs/SyncNumberLookupResult.md delete mode 100644 docs/SyncNumberLookupSuccess.md delete mode 100644 docs/Telegram.md delete mode 100644 docs/TextStore.md delete mode 100644 docs/Viber.md delete mode 100644 docs/ViberVideo.md delete mode 100644 docs/WhatsApp.md delete mode 100644 docs/WhatsAppComponent.md delete mode 100644 docs/WhatsAppCurrency.md delete mode 100644 docs/WhatsAppDatetime.md delete mode 100644 docs/WhatsAppLanguage.md delete mode 100644 docs/WhatsAppMedia.md delete mode 100644 docs/WhatsAppParameter.md delete mode 100644 docs/WhatsAppTemplate.md delete mode 100644 docs/WhatsAppTemplatesApi.md delete mode 100644 docs/WhatsAppText.md delete mode 100644 docs/WhatsappButtonType.md delete mode 100644 docs/WhatsappComponentType.md delete mode 100644 docs/WhatsappCreateTemplateRequest.md delete mode 100644 docs/WhatsappCreateTemplateResponse.md delete mode 100644 docs/WhatsappHeaderFormat.md delete mode 100644 docs/WhatsappListTemplatesResponse.md delete mode 100644 docs/WhatsappOtpButtonType.md delete mode 100644 docs/WhatsappPagination.md delete mode 100644 docs/WhatsappPagingCursors.md delete mode 100644 docs/WhatsappSupportedApp.md delete mode 100644 docs/WhatsappTemplateButton.md delete mode 100644 docs/WhatsappTemplateCategory.md delete mode 100644 docs/WhatsappTemplateComponent.md delete mode 100644 docs/WhatsappTemplateExample.md delete mode 100644 docs/WhatsappTemplateResponse.md delete mode 100644 docs/WhatsappTemplateStatus.md delete mode 100644 docs/WhatsappUpdateTemplateRequest.md delete mode 100644 git_push.sh delete mode 100644 messente_api/__init__.py delete mode 100644 messente_api/api/__init__.py delete mode 100644 messente_api/api/account_balance_api.py delete mode 100644 messente_api/api/blacklist_api.py delete mode 100644 messente_api/api/bulk_messaging_api.py delete mode 100644 messente_api/api/contacts_api.py delete mode 100644 messente_api/api/delivery_report_api.py delete mode 100644 messente_api/api/groups_api.py delete mode 100644 messente_api/api/number_lookup_api.py delete mode 100644 messente_api/api/number_verification_api.py delete mode 100644 messente_api/api/omnimessage_api.py delete mode 100644 messente_api/api/pricing_api.py delete mode 100644 messente_api/api/statistics_api.py delete mode 100644 messente_api/api/whats_app_templates_api.py delete mode 100644 messente_api/api_client.py delete mode 100644 messente_api/api_response.py delete mode 100644 messente_api/configuration.py delete mode 100644 messente_api/exceptions.py delete mode 100644 messente_api/models/__init__.py delete mode 100644 messente_api/models/bulk_omni_message_create_success_response.py delete mode 100644 messente_api/models/bulk_omni_message_create_success_response_messages_inner.py delete mode 100644 messente_api/models/bulk_omnimessage.py delete mode 100644 messente_api/models/channel.py delete mode 100644 messente_api/models/contact_envelope.py delete mode 100644 messente_api/models/contact_fields.py delete mode 100644 messente_api/models/contact_list_envelope.py delete mode 100644 messente_api/models/contact_response_fields.py delete mode 100644 messente_api/models/contact_update_fields.py delete mode 100644 messente_api/models/delivery_report_response.py delete mode 100644 messente_api/models/delivery_result.py delete mode 100644 messente_api/models/error_code_omnichannel.py delete mode 100644 messente_api/models/error_code_omnichannel_machine.py delete mode 100644 messente_api/models/error_code_phonebook.py delete mode 100644 messente_api/models/error_code_statistics.py delete mode 100644 messente_api/models/error_item_number_lookup.py delete mode 100644 messente_api/models/error_item_number_lookup_error.py delete mode 100644 messente_api/models/error_item_omnichannel.py delete mode 100644 messente_api/models/error_item_phonebook.py delete mode 100644 messente_api/models/error_item_statistics.py delete mode 100644 messente_api/models/error_number_lookup.py delete mode 100644 messente_api/models/error_omnichannel.py delete mode 100644 messente_api/models/error_phonebook.py delete mode 100644 messente_api/models/error_statistics.py delete mode 100644 messente_api/models/error_title_omnichannel.py delete mode 100644 messente_api/models/error_title_phonebook.py delete mode 100644 messente_api/models/fetch_blacklist_success.py delete mode 100644 messente_api/models/group_envelope.py delete mode 100644 messente_api/models/group_list_envelope.py delete mode 100644 messente_api/models/group_name.py delete mode 100644 messente_api/models/group_response_fields.py delete mode 100644 messente_api/models/message_result.py delete mode 100644 messente_api/models/mobile_network.py delete mode 100644 messente_api/models/number_to_blacklist.py delete mode 100644 messente_api/models/numbers_to_investigate.py delete mode 100644 messente_api/models/omni_message_create_success_response.py delete mode 100644 messente_api/models/omnimessage.py delete mode 100644 messente_api/models/omnimessage_messages_inner.py delete mode 100644 messente_api/models/price.py delete mode 100644 messente_api/models/price_info.py delete mode 100644 messente_api/models/price_networks_inner.py delete mode 100644 messente_api/models/priority.py delete mode 100644 messente_api/models/sms.py delete mode 100644 messente_api/models/statistics_report.py delete mode 100644 messente_api/models/statistics_report_settings.py delete mode 100644 messente_api/models/statistics_report_success.py delete mode 100644 messente_api/models/status.py delete mode 100644 messente_api/models/sync_number_lookup_result.py delete mode 100644 messente_api/models/sync_number_lookup_success.py delete mode 100644 messente_api/models/telegram.py delete mode 100644 messente_api/models/text_store.py delete mode 100644 messente_api/models/viber.py delete mode 100644 messente_api/models/viber_video.py delete mode 100644 messente_api/models/whats_app.py delete mode 100644 messente_api/models/whats_app_component.py delete mode 100644 messente_api/models/whats_app_currency.py delete mode 100644 messente_api/models/whats_app_datetime.py delete mode 100644 messente_api/models/whats_app_language.py delete mode 100644 messente_api/models/whats_app_media.py delete mode 100644 messente_api/models/whats_app_parameter.py delete mode 100644 messente_api/models/whats_app_template.py delete mode 100644 messente_api/models/whats_app_text.py delete mode 100644 messente_api/models/whatsapp_button_type.py delete mode 100644 messente_api/models/whatsapp_component_type.py delete mode 100644 messente_api/models/whatsapp_create_template_request.py delete mode 100644 messente_api/models/whatsapp_create_template_response.py delete mode 100644 messente_api/models/whatsapp_header_format.py delete mode 100644 messente_api/models/whatsapp_list_templates_response.py delete mode 100644 messente_api/models/whatsapp_otp_button_type.py delete mode 100644 messente_api/models/whatsapp_pagination.py delete mode 100644 messente_api/models/whatsapp_paging_cursors.py delete mode 100644 messente_api/models/whatsapp_supported_app.py delete mode 100644 messente_api/models/whatsapp_template_button.py delete mode 100644 messente_api/models/whatsapp_template_category.py delete mode 100644 messente_api/models/whatsapp_template_component.py delete mode 100644 messente_api/models/whatsapp_template_example.py delete mode 100644 messente_api/models/whatsapp_template_response.py delete mode 100644 messente_api/models/whatsapp_template_status.py delete mode 100644 messente_api/models/whatsapp_update_template_request.py delete mode 100644 messente_api/py.typed delete mode 100644 messente_api/rest.py delete mode 100644 pyproject.toml delete mode 100644 requirements.txt delete mode 100644 setup.cfg delete mode 100644 setup.py delete mode 100644 test-requirements.txt delete mode 100644 tox.ini diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml deleted file mode 100644 index 5bb9f51..0000000 --- a/.github/workflows/python.yml +++ /dev/null @@ -1,31 +0,0 @@ -# NOTE: This file is auto generated by OpenAPI Generator. -# URL: https://openapi-generator.tech -# -# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python - -name: messente_api Python package - -on: [push, pull_request] - -jobs: - build: - - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -r test-requirements.txt - - name: Test with pytest - run: | - pytest --cov={{packageName}} diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 43995bd..0000000 --- a/.gitignore +++ /dev/null @@ -1,66 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*,cover -.hypothesis/ -venv/ -.venv/ -.python-version -.pytest_cache - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -#Ipython Notebook -.ipynb_checkpoints diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 8fef266..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,31 +0,0 @@ -# NOTE: This file is auto generated by OpenAPI Generator. -# URL: https://openapi-generator.tech -# -# ref: https://docs.gitlab.com/ee/ci/README.html -# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml - -stages: - - test - -.pytest: - stage: test - script: - - pip install -r requirements.txt - - pip install -r test-requirements.txt - - pytest --cov=messente_api - -pytest-3.8: - extends: .pytest - image: python:3.8-alpine -pytest-3.9: - extends: .pytest - image: python:3.9-alpine -pytest-3.10: - extends: .pytest - image: python:3.10-alpine -pytest-3.11: - extends: .pytest - image: python:3.11-alpine -pytest-3.12: - extends: .pytest - image: python:3.12-alpine diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore deleted file mode 100644 index 7484ee5..0000000 --- a/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES deleted file mode 100644 index 4cf2620..0000000 --- a/.openapi-generator/FILES +++ /dev/null @@ -1,204 +0,0 @@ -.github/workflows/python.yml -.gitignore -.gitlab-ci.yml -.openapi-generator-ignore -.travis.yml -README.md -docs/AccountBalanceApi.md -docs/BlacklistApi.md -docs/BulkMessagingApi.md -docs/BulkOmniMessageCreateSuccessResponse.md -docs/BulkOmniMessageCreateSuccessResponseMessagesInner.md -docs/BulkOmnimessage.md -docs/Channel.md -docs/ContactEnvelope.md -docs/ContactFields.md -docs/ContactListEnvelope.md -docs/ContactResponseFields.md -docs/ContactUpdateFields.md -docs/ContactsApi.md -docs/DeliveryReportApi.md -docs/DeliveryReportResponse.md -docs/DeliveryResult.md -docs/ErrorCodeOmnichannel.md -docs/ErrorCodeOmnichannelMachine.md -docs/ErrorCodePhonebook.md -docs/ErrorCodeStatistics.md -docs/ErrorItemNumberLookup.md -docs/ErrorItemNumberLookupError.md -docs/ErrorItemOmnichannel.md -docs/ErrorItemPhonebook.md -docs/ErrorItemStatistics.md -docs/ErrorNumberLookup.md -docs/ErrorOmnichannel.md -docs/ErrorPhonebook.md -docs/ErrorStatistics.md -docs/ErrorTitleOmnichannel.md -docs/ErrorTitlePhonebook.md -docs/FetchBlacklistSuccess.md -docs/GroupEnvelope.md -docs/GroupListEnvelope.md -docs/GroupName.md -docs/GroupResponseFields.md -docs/GroupsApi.md -docs/MessageResult.md -docs/MobileNetwork.md -docs/NumberLookupApi.md -docs/NumberToBlacklist.md -docs/NumberVerificationApi.md -docs/NumbersToInvestigate.md -docs/OmniMessageCreateSuccessResponse.md -docs/Omnimessage.md -docs/OmnimessageApi.md -docs/OmnimessageMessagesInner.md -docs/Price.md -docs/PriceInfo.md -docs/PriceNetworksInner.md -docs/PricingApi.md -docs/Priority.md -docs/SMS.md -docs/StatisticsApi.md -docs/StatisticsReport.md -docs/StatisticsReportSettings.md -docs/StatisticsReportSuccess.md -docs/Status.md -docs/SyncNumberLookupResult.md -docs/SyncNumberLookupSuccess.md -docs/Telegram.md -docs/TextStore.md -docs/Viber.md -docs/ViberVideo.md -docs/WhatsApp.md -docs/WhatsAppComponent.md -docs/WhatsAppCurrency.md -docs/WhatsAppDatetime.md -docs/WhatsAppLanguage.md -docs/WhatsAppMedia.md -docs/WhatsAppParameter.md -docs/WhatsAppTemplate.md -docs/WhatsAppTemplatesApi.md -docs/WhatsAppText.md -docs/WhatsappButtonType.md -docs/WhatsappComponentType.md -docs/WhatsappCreateTemplateRequest.md -docs/WhatsappCreateTemplateResponse.md -docs/WhatsappHeaderFormat.md -docs/WhatsappListTemplatesResponse.md -docs/WhatsappOtpButtonType.md -docs/WhatsappPagination.md -docs/WhatsappPagingCursors.md -docs/WhatsappSupportedApp.md -docs/WhatsappTemplateButton.md -docs/WhatsappTemplateCategory.md -docs/WhatsappTemplateComponent.md -docs/WhatsappTemplateExample.md -docs/WhatsappTemplateResponse.md -docs/WhatsappTemplateStatus.md -docs/WhatsappUpdateTemplateRequest.md -git_push.sh -messente_api/__init__.py -messente_api/api/__init__.py -messente_api/api/account_balance_api.py -messente_api/api/blacklist_api.py -messente_api/api/bulk_messaging_api.py -messente_api/api/contacts_api.py -messente_api/api/delivery_report_api.py -messente_api/api/groups_api.py -messente_api/api/number_lookup_api.py -messente_api/api/number_verification_api.py -messente_api/api/omnimessage_api.py -messente_api/api/pricing_api.py -messente_api/api/statistics_api.py -messente_api/api/whats_app_templates_api.py -messente_api/api_client.py -messente_api/api_response.py -messente_api/configuration.py -messente_api/exceptions.py -messente_api/models/__init__.py -messente_api/models/bulk_omni_message_create_success_response.py -messente_api/models/bulk_omni_message_create_success_response_messages_inner.py -messente_api/models/bulk_omnimessage.py -messente_api/models/channel.py -messente_api/models/contact_envelope.py -messente_api/models/contact_fields.py -messente_api/models/contact_list_envelope.py -messente_api/models/contact_response_fields.py -messente_api/models/contact_update_fields.py -messente_api/models/delivery_report_response.py -messente_api/models/delivery_result.py -messente_api/models/error_code_omnichannel.py -messente_api/models/error_code_omnichannel_machine.py -messente_api/models/error_code_phonebook.py -messente_api/models/error_code_statistics.py -messente_api/models/error_item_number_lookup.py -messente_api/models/error_item_number_lookup_error.py -messente_api/models/error_item_omnichannel.py -messente_api/models/error_item_phonebook.py -messente_api/models/error_item_statistics.py -messente_api/models/error_number_lookup.py -messente_api/models/error_omnichannel.py -messente_api/models/error_phonebook.py -messente_api/models/error_statistics.py -messente_api/models/error_title_omnichannel.py -messente_api/models/error_title_phonebook.py -messente_api/models/fetch_blacklist_success.py -messente_api/models/group_envelope.py -messente_api/models/group_list_envelope.py -messente_api/models/group_name.py -messente_api/models/group_response_fields.py -messente_api/models/message_result.py -messente_api/models/mobile_network.py -messente_api/models/number_to_blacklist.py -messente_api/models/numbers_to_investigate.py -messente_api/models/omni_message_create_success_response.py -messente_api/models/omnimessage.py -messente_api/models/omnimessage_messages_inner.py -messente_api/models/price.py -messente_api/models/price_info.py -messente_api/models/price_networks_inner.py -messente_api/models/priority.py -messente_api/models/sms.py -messente_api/models/statistics_report.py -messente_api/models/statistics_report_settings.py -messente_api/models/statistics_report_success.py -messente_api/models/status.py -messente_api/models/sync_number_lookup_result.py -messente_api/models/sync_number_lookup_success.py -messente_api/models/telegram.py -messente_api/models/text_store.py -messente_api/models/viber.py -messente_api/models/viber_video.py -messente_api/models/whats_app.py -messente_api/models/whats_app_component.py -messente_api/models/whats_app_currency.py -messente_api/models/whats_app_datetime.py -messente_api/models/whats_app_language.py -messente_api/models/whats_app_media.py -messente_api/models/whats_app_parameter.py -messente_api/models/whats_app_template.py -messente_api/models/whats_app_text.py -messente_api/models/whatsapp_button_type.py -messente_api/models/whatsapp_component_type.py -messente_api/models/whatsapp_create_template_request.py -messente_api/models/whatsapp_create_template_response.py -messente_api/models/whatsapp_header_format.py -messente_api/models/whatsapp_list_templates_response.py -messente_api/models/whatsapp_otp_button_type.py -messente_api/models/whatsapp_pagination.py -messente_api/models/whatsapp_paging_cursors.py -messente_api/models/whatsapp_supported_app.py -messente_api/models/whatsapp_template_button.py -messente_api/models/whatsapp_template_category.py -messente_api/models/whatsapp_template_component.py -messente_api/models/whatsapp_template_example.py -messente_api/models/whatsapp_template_response.py -messente_api/models/whatsapp_template_status.py -messente_api/models/whatsapp_update_template_request.py -messente_api/py.typed -messente_api/rest.py -pyproject.toml -requirements.txt -setup.cfg -setup.py -test-requirements.txt -tox.ini diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION deleted file mode 100644 index b23eb27..0000000 --- a/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.11.0 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1b62c4f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: python - -script: -- echo "skipping tests" - -deploy: - provider: pypi - user: messente - password: - secure: T6b+hfVKTyJUUprT/7c6+nuEpqjENHWbZ5OrFLq/fo0N++aUgB7/VgsY7L2U9vmuog2xf34Di0C66fe/Tmy5czc+iXbwSnS6uP0aJk6dnERrdhiarUHgsDq4/txx59qYXZfelCO38M54GBPAlDzVp5/ONocbOrrJUPnt++0t/ocwbq2x5m6RSycJCEBWjxkBuLclrIkUvI+0IgJl/CXUro2OeVUg4J7rrwI68XAKAZF2SOQm/V3Ak30ax7CE2XFScVSvfz2g5kJbvtamFwdPRAwA5ThU4q6TDlL49DEblZCSKzAwOTkKkIkjFY5m6PPkNnxFAEsBjRyU5tl+T1pPvM0Gd/AY3lBXruRbU8SmGJgZbz59q1SQ1NRm5gHKpFEQ0kwWJvEJMOwRDLH16nFY4XX15ffVWFqw8Pkaso6NV6RTRVFTV3rVY2YPa1ili2QvkHYjejMZRDG+13MR+gJGWbjU2Uql3kj/QbIBFMyzXcfbLSpdn65KkzI5Svvzl/CsBZ0NsXIhH8rRsK464bZUuDY7qLbNca4IxARZRb2jH9C3Zas4kjJzl9J5TjkZTc8HTl+5PB8k+XsBaPSa1BvGvS3YEpQF6mVOr/SkQGX/yMV/WcmZJekSaWVrgdt5twPlfah0bwfKx60FKJqQYP2+2HeoA56UPrwSGT5ocz0wQC8= - on: - tags: true diff --git a/README.md b/README.md deleted file mode 100644 index c099362..0000000 --- a/README.md +++ /dev/null @@ -1,171 +0,0 @@ -# Messente API Library - -- Messente API version: 2.0.0 -- Python package version: 2.4.0 - -[Messente](https://messente.com) is a global provider of messaging and user verification services. * Send and receive SMS, Viber, WhatsApp and Telegram messages. * Manage contacts and groups. * Fetch detailed info about phone numbers. * Blacklist phone numbers to make sure you're not sending any unwanted messages. Messente builds [tools](https://messente.com/documentation) to help organizations connect their services to people anywhere in the world. - -## Installation - -Install Messente API library with `pip install messente-api`. - -## Features - -Messente API has the following features: - -- Omnichannel ([external docs](https://messente.com/documentation/omnichannel-api)), -- Phonebook ([external docs](https://messente.com/documentation/phonebook-api)). - -Messente API Library provides the operations described below to access the features. - -### AccountBalanceApi - -1. Get account balance [`get_account_balance`](docs/AccountBalanceApi.md#get_account_balance) -1. Get account balance [`get_account_balance_using_post`](docs/AccountBalanceApi.md#get_account_balance_using_post) - -### BlacklistApi - -1. Adds a phone number to the blacklist [`add_to_blacklist`](docs/BlacklistApi.md#add_to_blacklist) -1. Deletes a phone number from the blacklist [`delete_from_blacklist`](docs/BlacklistApi.md#delete_from_blacklist) -1. Returns all blacklisted phone numbers [`fetch_blacklist`](docs/BlacklistApi.md#fetch_blacklist) -1. Checks if a phone number is blacklisted [`is_blacklisted`](docs/BlacklistApi.md#is_blacklisted) - -### BulkMessagingApi - -1. Sends a bulk Omnimessage [`send_bulk_omnimessage`](docs/BulkMessagingApi.md#send_bulk_omnimessage) - -### ContactsApi - -1. Adds a contact to a group [`add_contact_to_group`](docs/ContactsApi.md#add_contact_to_group) -1. Creates a new contact [`create_contact`](docs/ContactsApi.md#create_contact) -1. Deletes a contact [`delete_contact`](docs/ContactsApi.md#delete_contact) -1. Lists a contact [`fetch_contact`](docs/ContactsApi.md#fetch_contact) -1. Lists groups of a contact [`fetch_contact_groups`](docs/ContactsApi.md#fetch_contact_groups) -1. Returns all contacts [`fetch_contacts`](docs/ContactsApi.md#fetch_contacts) -1. Removes a contact from a group [`remove_contact_from_group`](docs/ContactsApi.md#remove_contact_from_group) -1. Updates a contact [`update_contact`](docs/ContactsApi.md#update_contact) - -### DeliveryReportApi - -1. Retrieves the delivery report for the Omnimessage [`retrieve_delivery_report`](docs/DeliveryReportApi.md#retrieve_delivery_report) - -### GroupsApi - -1. Creates a new group with the provided name [`create_group`](docs/GroupsApi.md#create_group) -1. Deletes a group [`delete_group`](docs/GroupsApi.md#delete_group) -1. Lists a group [`fetch_group`](docs/GroupsApi.md#fetch_group) -1. Returns all groups [`fetch_groups`](docs/GroupsApi.md#fetch_groups) -1. Updates a group with the provided name [`update_group`](docs/GroupsApi.md#update_group) - -### NumberVerificationApi - -1. verify number [`verify_number`](docs/NumberVerificationApi.md#verify_number) -1. verified the PIN code entered by the user. [`verify_pin`](docs/NumberVerificationApi.md#verify_pin) - -### NumberLookupApi - -1. Requests info about phone numbers [`fetch_info`](docs/NumberLookupApi.md#fetch_info) - -### OmnimessageApi - -1. Cancels a scheduled Omnimessage [`cancel_scheduled_message`](docs/OmnimessageApi.md#cancel_scheduled_message) -1. Sends an Omnimessage [`send_omnimessage`](docs/OmnimessageApi.md#send_omnimessage) - -### PricingApi - -1. Get pricelist for account [`get_pricelist`](docs/PricingApi.md#get_pricelist) -1. Get pricing for a specific country [`get_prices`](docs/PricingApi.md#get_prices) - -### StatisticsApi - -1. Requests statistics reports for each country [`create_statistics_report`](docs/StatisticsApi.md#create_statistics_report) - -### WhatsAppTemplatesApi - -1. Creates a WhatsApp template [`create_whatsapp_template`](docs/WhatsAppTemplatesApi.md#create_whatsapp_template) -1. Deletes a WhatsApp template [`delete_whatsapp_template`](docs/WhatsAppTemplatesApi.md#delete_whatsapp_template) -1. Requests a WhatsApp template with the given ID [`get_whatsapp_template_by_id`](docs/WhatsAppTemplatesApi.md#get_whatsapp_template_by_id) -1. Requests a list of WhatsApp templates [`list_whatsapp_templates`](docs/WhatsAppTemplatesApi.md#list_whatsapp_templates) -1. Updates a WhatsApp template [`update_whatsapp_template`](docs/WhatsAppTemplatesApi.md#update_whatsapp_template) - -## Auth - -**Type**: HTTP basic authentication - -Read the [external getting-started article](https://messente.com/documentation/getting-started) which explains API keys and Sender ID logic. - -## Getting started: sending an omnimessage - -```python -from pprint import pprint -from messente_api import ( - OmnimessageApi, - Omnimessage, - OmnimessageMessagesInner, - Configuration, - ApiClient, - Viber, - SMS, - WhatsApp, - WhatsAppParameter, - WhatsAppComponent, - WhatsAppTemplate, - WhatsAppLanguage, -) -from messente_api.rest import ApiException - -# API information from https://dashboard.messente.com/api-settings -configuration = Configuration() -configuration.username = '' -configuration.password = '' - -# create an instance of the API class -api_instance = OmnimessageApi(ApiClient(configuration)) - -wa_parameters = [WhatsAppParameter(type='text', text='hello whatsapp')] -wa_component = WhatsAppComponent(type='body', parameters=wa_parameters) -wa_template = WhatsAppTemplate(name='