Skip to content

Release 2.3.0 #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
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 <package-name> 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"
38 changes: 0 additions & 38 deletions .github/workflows/python.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ docs/WhatsAppLanguage.md
docs/WhatsAppMedia.md
docs/WhatsAppParameter.md
docs/WhatsAppTemplate.md
docs/WhatsAppText.md
git_push.sh
messente_api/__init__.py
messente_api/api/__init__.py
Expand Down Expand Up @@ -146,6 +147,7 @@ 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/py.typed
messente_api/rest.py
pyproject.toml
Expand Down
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
language: python
dist: jammy
python:
- 3.10

script:
- echo "skipping tests"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Messente API Library

- Messente API version: 2.0.0
- Python package version: 2.2.0
- Python package version: 2.3.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&#39;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.

Expand Down
1 change: 1 addition & 0 deletions docs/WhatsApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Name | Type | Description | Notes
**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional]
**ttl** | **int** | After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \&quot;ttl\&quot; and \&quot;validity\&quot; can be used. | [optional]
**template** | [**WhatsAppTemplate**](WhatsAppTemplate.md) | | [optional]
**text** | [**WhatsAppText**](WhatsAppText.md) | | [optional]
**channel** | **str** | The channel used to deliver the message | [optional] [default to 'whatsapp']

## Example
Expand Down
2 changes: 2 additions & 0 deletions docs/WhatsAppParameter.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Name | Type | Description | Notes
**image** | [**WhatsAppMedia**](WhatsAppMedia.md) | | [optional]
**document** | [**WhatsAppMedia**](WhatsAppMedia.md) | | [optional]
**video** | [**WhatsAppMedia**](WhatsAppMedia.md) | | [optional]
**coupon_code** | **str** | A coupon code. | [optional]
**payload** | **str** | A payload. | [optional]

## Example

Expand Down
31 changes: 31 additions & 0 deletions docs/WhatsAppText.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# WhatsAppText

A text

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**preview_url** | **bool** | Whether to display link preview if the message contains a hyperlink | [optional] [default to True]
**body** | **str** | Plaintext content for WhatsApp, can contain URLs, emojis and formatting |

## Example

```python
from messente_api.models.whats_app_text import WhatsAppText

# TODO update the JSON string below
json = "{}"
# create an instance of WhatsAppText from a JSON string
whats_app_text_instance = WhatsAppText.from_json(json)
# print the JSON string representation of the object
print(WhatsAppText.to_json())

# convert the object into a dict
whats_app_text_dict = whats_app_text_instance.to_dict()
# create an instance of WhatsAppText from a dict
whats_app_text_from_dict = WhatsAppText.from_dict(whats_app_text_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)


3 changes: 2 additions & 1 deletion messente_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
""" # noqa: E501


__version__ = "2.2.0"
__version__ = "2.3.0"

# import apis into sdk package
from messente_api.api.blacklist_api import BlacklistApi
Expand Down Expand Up @@ -98,3 +98,4 @@
from messente_api.models.whats_app_media import WhatsAppMedia
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
2 changes: 1 addition & 1 deletion messente_api/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def __init__(
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'OpenAPI-Generator/2.2.0/python'
self.user_agent = 'OpenAPI-Generator/2.3.0/python'
self.client_side_validation = configuration.client_side_validation

def __enter__(self):
Expand Down
2 changes: 1 addition & 1 deletion messente_api/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def to_debug_report(self):
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: 2.0.0\n"\
"SDK Package Version: 2.2.0".\
"SDK Package Version: 2.3.0".\
format(env=sys.platform, pyversion=sys.version)

def get_host_settings(self):
Expand Down
1 change: 1 addition & 0 deletions messente_api/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,4 @@
from messente_api.models.whats_app_media import WhatsAppMedia
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
8 changes: 7 additions & 1 deletion messente_api/models/whats_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from messente_api.models.whats_app_template import WhatsAppTemplate
from messente_api.models.whats_app_text import WhatsAppText
from typing import Optional, Set
from typing_extensions import Self

Expand All @@ -32,9 +33,10 @@ class WhatsApp(BaseModel):
validity: Optional[StrictInt] = Field(default=None, description="After how many minutes this channel is considered as failed and the next channel is attempted")
ttl: Optional[StrictInt] = Field(default=None, description="After how many seconds this channel is considered as failed and the next channel is attempted. Only one of \"ttl\" and \"validity\" can be used.")
template: Optional[WhatsAppTemplate] = None
text: Optional[WhatsAppText] = None
channel: Optional[StrictStr] = Field(default='whatsapp', description="The channel used to deliver the message")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["sender", "validity", "ttl", "template", "channel"]
__properties: ClassVar[List[str]] = ["sender", "validity", "ttl", "template", "text", "channel"]

@field_validator('channel')
def channel_validate_enum(cls, value):
Expand Down Expand Up @@ -90,6 +92,9 @@ def to_dict(self) -> Dict[str, Any]:
# override the default output from pydantic by calling `to_dict()` of template
if self.template:
_dict['template'] = self.template.to_dict()
# override the default output from pydantic by calling `to_dict()` of text
if self.text:
_dict['text'] = self.text.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():
Expand All @@ -111,6 +116,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"validity": obj.get("validity"),
"ttl": obj.get("ttl"),
"template": WhatsAppTemplate.from_dict(obj["template"]) if obj.get("template") is not None else None,
"text": WhatsAppText.from_dict(obj["text"]) if obj.get("text") is not None else None,
"channel": obj.get("channel") if obj.get("channel") is not None else 'whatsapp'
})
# store additional fields in additional_properties
Expand Down
8 changes: 6 additions & 2 deletions messente_api/models/whats_app_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ class WhatsAppParameter(BaseModel):
image: Optional[WhatsAppMedia] = None
document: Optional[WhatsAppMedia] = None
video: Optional[WhatsAppMedia] = None
coupon_code: Optional[StrictStr] = Field(default=None, description="A coupon code.")
payload: Optional[StrictStr] = Field(default=None, description="A payload.")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["type", "text", "currency", "date_time", "image", "document", "video"]
__properties: ClassVar[List[str]] = ["type", "text", "currency", "date_time", "image", "document", "video", "coupon_code", "payload"]

model_config = ConfigDict(
populate_by_name=True,
Expand Down Expand Up @@ -119,7 +121,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"date_time": WhatsAppDatetime.from_dict(obj["date_time"]) if obj.get("date_time") is not None else None,
"image": WhatsAppMedia.from_dict(obj["image"]) if obj.get("image") is not None else None,
"document": WhatsAppMedia.from_dict(obj["document"]) if obj.get("document") is not None else None,
"video": WhatsAppMedia.from_dict(obj["video"]) if obj.get("video") is not None else None
"video": WhatsAppMedia.from_dict(obj["video"]) if obj.get("video") is not None else None,
"coupon_code": obj.get("coupon_code"),
"payload": obj.get("payload")
})
# store additional fields in additional_properties
for _key in obj.keys():
Expand Down
Loading
Loading