Skip to content

Commit c6b2adf

Browse files
authored
Merge pull request #21 from messente/travis
Release 2.3.0
2 parents c274a03 + 8e236ec commit c6b2adf

17 files changed

+258
-47
lines changed

.github/workflows/pypi.yml

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
name: Build distribution 📦
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
persist-credentials: false
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.x"
18+
- name: Install pypa/build
19+
run: >-
20+
python3 -m
21+
pip install
22+
build
23+
--user
24+
- name: Build a binary wheel and a source tarball
25+
run: python3 -m build
26+
- name: Store the distribution packages
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: python-package-distributions
30+
path: dist/
31+
32+
publish-to-pypi:
33+
name: >-
34+
Publish Python 🐍 distribution 📦 to PyPI
35+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
36+
needs:
37+
- build
38+
runs-on: ubuntu-latest
39+
environment:
40+
name: pypi
41+
url: https://pypi.org/p/messente-api # Replace <package-name> with your PyPI project name
42+
permissions:
43+
id-token: write # IMPORTANT: mandatory for trusted publishing
44+
45+
steps:
46+
- name: Download all the dists
47+
uses: actions/download-artifact@v4
48+
with:
49+
name: python-package-distributions
50+
path: dist/
51+
- name: Publish distribution 📦 to PyPI
52+
uses: pypa/gh-action-pypi-publish@release/v1
53+
54+
github-release:
55+
name: >-
56+
Sign the Python 🐍 distribution 📦 with Sigstore
57+
and upload them to GitHub Release
58+
needs:
59+
- publish-to-pypi
60+
runs-on: ubuntu-latest
61+
62+
permissions:
63+
contents: write # IMPORTANT: mandatory for making GitHub Releases
64+
id-token: write # IMPORTANT: mandatory for sigstore
65+
66+
steps:
67+
- name: Download all the dists
68+
uses: actions/download-artifact@v4
69+
with:
70+
name: python-package-distributions
71+
path: dist/
72+
- name: Sign the dists with Sigstore
73+
uses: sigstore/[email protected]
74+
with:
75+
inputs: >-
76+
./dist/*.tar.gz
77+
./dist/*.whl
78+
- name: Create GitHub Release
79+
env:
80+
GITHUB_TOKEN: ${{ github.token }}
81+
run: >-
82+
gh release create
83+
"$GITHUB_REF_NAME"
84+
--repo "$GITHUB_REPOSITORY"
85+
--notes ""
86+
- name: Upload artifact signatures to GitHub Release
87+
env:
88+
GITHUB_TOKEN: ${{ github.token }}
89+
# Upload to GitHub Release using the `gh` CLI.
90+
# `dist/` contains the built packages, and the
91+
# sigstore-produced signatures and certificates.
92+
run: >-
93+
gh release upload
94+
"$GITHUB_REF_NAME" dist/**
95+
--repo "$GITHUB_REPOSITORY"

.github/workflows/python.yml

-38
This file was deleted.

.openapi-generator/FILES

+2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ docs/WhatsAppLanguage.md
7171
docs/WhatsAppMedia.md
7272
docs/WhatsAppParameter.md
7373
docs/WhatsAppTemplate.md
74+
docs/WhatsAppText.md
7475
git_push.sh
7576
messente_api/__init__.py
7677
messente_api/api/__init__.py
@@ -146,6 +147,7 @@ messente_api/models/whats_app_language.py
146147
messente_api/models/whats_app_media.py
147148
messente_api/models/whats_app_parameter.py
148149
messente_api/models/whats_app_template.py
150+
messente_api/models/whats_app_text.py
149151
messente_api/py.typed
150152
messente_api/rest.py
151153
pyproject.toml

.travis.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
language: python
2+
dist: jammy
3+
python:
4+
- 3.10
25

36
script:
47
- echo "skipping tests"

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Messente API Library
22

33
- Messente API version: 2.0.0
4-
- Python package version: 2.2.0
4+
- Python package version: 2.3.0
55

66
[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.
77

docs/WhatsApp.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
1010
**validity** | **int** | After how many minutes this channel is considered as failed and the next channel is attempted | [optional]
1111
**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]
1212
**template** | [**WhatsAppTemplate**](WhatsAppTemplate.md) | | [optional]
13+
**text** | [**WhatsAppText**](WhatsAppText.md) | | [optional]
1314
**channel** | **str** | The channel used to deliver the message | [optional] [default to 'whatsapp']
1415

1516
## Example

docs/WhatsAppParameter.md

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Name | Type | Description | Notes
1313
**image** | [**WhatsAppMedia**](WhatsAppMedia.md) | | [optional]
1414
**document** | [**WhatsAppMedia**](WhatsAppMedia.md) | | [optional]
1515
**video** | [**WhatsAppMedia**](WhatsAppMedia.md) | | [optional]
16+
**coupon_code** | **str** | A coupon code. | [optional]
17+
**payload** | **str** | A payload. | [optional]
1618

1719
## Example
1820

docs/WhatsAppText.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# WhatsAppText
2+
3+
A text
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
**preview_url** | **bool** | Whether to display link preview if the message contains a hyperlink | [optional] [default to True]
10+
**body** | **str** | Plaintext content for WhatsApp, can contain URLs, emojis and formatting |
11+
12+
## Example
13+
14+
```python
15+
from messente_api.models.whats_app_text import WhatsAppText
16+
17+
# TODO update the JSON string below
18+
json = "{}"
19+
# create an instance of WhatsAppText from a JSON string
20+
whats_app_text_instance = WhatsAppText.from_json(json)
21+
# print the JSON string representation of the object
22+
print(WhatsAppText.to_json())
23+
24+
# convert the object into a dict
25+
whats_app_text_dict = whats_app_text_instance.to_dict()
26+
# create an instance of WhatsAppText from a dict
27+
whats_app_text_from_dict = WhatsAppText.from_dict(whats_app_text_dict)
28+
```
29+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
30+
31+

messente_api/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
""" # noqa: E501
1616

1717

18-
__version__ = "2.2.0"
18+
__version__ = "2.3.0"
1919

2020
# import apis into sdk package
2121
from messente_api.api.blacklist_api import BlacklistApi
@@ -98,3 +98,4 @@
9898
from messente_api.models.whats_app_media import WhatsAppMedia
9999
from messente_api.models.whats_app_parameter import WhatsAppParameter
100100
from messente_api.models.whats_app_template import WhatsAppTemplate
101+
from messente_api.models.whats_app_text import WhatsAppText

messente_api/api_client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def __init__(
8989
self.default_headers[header_name] = header_value
9090
self.cookie = cookie
9191
# Set default User-Agent.
92-
self.user_agent = 'OpenAPI-Generator/2.2.0/python'
92+
self.user_agent = 'OpenAPI-Generator/2.3.0/python'
9393
self.client_side_validation = configuration.client_side_validation
9494

9595
def __enter__(self):

messente_api/configuration.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ def to_debug_report(self):
395395
"OS: {env}\n"\
396396
"Python Version: {pyversion}\n"\
397397
"Version of the API: 2.0.0\n"\
398-
"SDK Package Version: 2.2.0".\
398+
"SDK Package Version: 2.3.0".\
399399
format(env=sys.platform, pyversion=sys.version)
400400

401401
def get_host_settings(self):

messente_api/models/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,4 @@
7474
from messente_api.models.whats_app_media import WhatsAppMedia
7575
from messente_api.models.whats_app_parameter import WhatsAppParameter
7676
from messente_api.models.whats_app_template import WhatsAppTemplate
77+
from messente_api.models.whats_app_text import WhatsAppText

messente_api/models/whats_app.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
2222
from typing import Any, ClassVar, Dict, List, Optional
2323
from messente_api.models.whats_app_template import WhatsAppTemplate
24+
from messente_api.models.whats_app_text import WhatsAppText
2425
from typing import Optional, Set
2526
from typing_extensions import Self
2627

@@ -32,9 +33,10 @@ class WhatsApp(BaseModel):
3233
validity: Optional[StrictInt] = Field(default=None, description="After how many minutes this channel is considered as failed and the next channel is attempted")
3334
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.")
3435
template: Optional[WhatsAppTemplate] = None
36+
text: Optional[WhatsAppText] = None
3537
channel: Optional[StrictStr] = Field(default='whatsapp', description="The channel used to deliver the message")
3638
additional_properties: Dict[str, Any] = {}
37-
__properties: ClassVar[List[str]] = ["sender", "validity", "ttl", "template", "channel"]
39+
__properties: ClassVar[List[str]] = ["sender", "validity", "ttl", "template", "text", "channel"]
3840

3941
@field_validator('channel')
4042
def channel_validate_enum(cls, value):
@@ -90,6 +92,9 @@ def to_dict(self) -> Dict[str, Any]:
9092
# override the default output from pydantic by calling `to_dict()` of template
9193
if self.template:
9294
_dict['template'] = self.template.to_dict()
95+
# override the default output from pydantic by calling `to_dict()` of text
96+
if self.text:
97+
_dict['text'] = self.text.to_dict()
9398
# puts key-value pairs in additional_properties in the top level
9499
if self.additional_properties is not None:
95100
for _key, _value in self.additional_properties.items():
@@ -111,6 +116,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
111116
"validity": obj.get("validity"),
112117
"ttl": obj.get("ttl"),
113118
"template": WhatsAppTemplate.from_dict(obj["template"]) if obj.get("template") is not None else None,
119+
"text": WhatsAppText.from_dict(obj["text"]) if obj.get("text") is not None else None,
114120
"channel": obj.get("channel") if obj.get("channel") is not None else 'whatsapp'
115121
})
116122
# store additional fields in additional_properties

messente_api/models/whats_app_parameter.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ class WhatsAppParameter(BaseModel):
3737
image: Optional[WhatsAppMedia] = None
3838
document: Optional[WhatsAppMedia] = None
3939
video: Optional[WhatsAppMedia] = None
40+
coupon_code: Optional[StrictStr] = Field(default=None, description="A coupon code.")
41+
payload: Optional[StrictStr] = Field(default=None, description="A payload.")
4042
additional_properties: Dict[str, Any] = {}
41-
__properties: ClassVar[List[str]] = ["type", "text", "currency", "date_time", "image", "document", "video"]
43+
__properties: ClassVar[List[str]] = ["type", "text", "currency", "date_time", "image", "document", "video", "coupon_code", "payload"]
4244

4345
model_config = ConfigDict(
4446
populate_by_name=True,
@@ -119,7 +121,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
119121
"date_time": WhatsAppDatetime.from_dict(obj["date_time"]) if obj.get("date_time") is not None else None,
120122
"image": WhatsAppMedia.from_dict(obj["image"]) if obj.get("image") is not None else None,
121123
"document": WhatsAppMedia.from_dict(obj["document"]) if obj.get("document") is not None else None,
122-
"video": WhatsAppMedia.from_dict(obj["video"]) if obj.get("video") is not None else None
124+
"video": WhatsAppMedia.from_dict(obj["video"]) if obj.get("video") is not None else None,
125+
"coupon_code": obj.get("coupon_code"),
126+
"payload": obj.get("payload")
123127
})
124128
# store additional fields in additional_properties
125129
for _key in obj.keys():

0 commit comments

Comments
 (0)