Skip to content

Commit 9da3b30

Browse files
Merge pull request #18 from messente/travis
Release version 2.1.0
2 parents 35cba0c + 1217645 commit 9da3b30

File tree

12 files changed

+146
-8
lines changed

12 files changed

+146
-8
lines changed

.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ docs/OmniMessageCreateSuccessResponse.md
4949
docs/Omnimessage.md
5050
docs/OmnimessageApi.md
5151
docs/OmnimessageMessagesInner.md
52+
docs/PriceInfo.md
5253
docs/Priority.md
5354
docs/SMS.md
5455
docs/StatisticsApi.md
@@ -123,6 +124,7 @@ messente_api/models/numbers_to_investigate.py
123124
messente_api/models/omni_message_create_success_response.py
124125
messente_api/models/omnimessage.py
125126
messente_api/models/omnimessage_messages_inner.py
127+
messente_api/models/price_info.py
126128
messente_api/models/priority.py
127129
messente_api/models/sms.py
128130
messente_api/models/statistics_report.py

README.md

Lines changed: 1 addition & 1 deletion
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.0.0
4+
- Python package version: 2.1.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'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/DeliveryResult.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Name | Type | Description | Notes
1212
**error** | **str** | Human-readable description of what went wrong, *null* in case of success or if the message has not been processed yet | [optional]
1313
**err** | [**ErrorCodeOmnichannelMachine**](ErrorCodeOmnichannelMachine.md) | | [optional]
1414
**timestamp** | **datetime** | When this status was received by Omnichannel API | [optional]
15+
**price_info** | [**PriceInfo**](PriceInfo.md) | | [optional]
16+
**sender** | **str** | the sender of the message | [optional]
1517

1618
## Example
1719

docs/PriceInfo.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# PriceInfo
2+
3+
Contains price information for the message. This value is *null* if the message is still being processed
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
**part_price** | **str** | price per message part - relevant mostly for SMS |
10+
**parts_count** | **int** | the number of parts the message consists of |
11+
**total_price** | **str** | total price for the message |
12+
13+
## Example
14+
15+
```python
16+
from messente_api.models.price_info import PriceInfo
17+
18+
# TODO update the JSON string below
19+
json = "{}"
20+
# create an instance of PriceInfo from a JSON string
21+
price_info_instance = PriceInfo.from_json(json)
22+
# print the JSON string representation of the object
23+
print(PriceInfo.to_json())
24+
25+
# convert the object into a dict
26+
price_info_dict = price_info_instance.to_dict()
27+
# create an instance of PriceInfo from a dict
28+
price_info_from_dict = PriceInfo.from_dict(price_info_dict)
29+
```
30+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
31+
32+

messente_api/__init__.py

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

1717

18-
__version__ = "2.0.0"
18+
__version__ = "2.1.0"
1919

2020
# import apis into sdk package
2121
from messente_api.api.blacklist_api import BlacklistApi
@@ -77,6 +77,7 @@
7777
from messente_api.models.omni_message_create_success_response import OmniMessageCreateSuccessResponse
7878
from messente_api.models.omnimessage import Omnimessage
7979
from messente_api.models.omnimessage_messages_inner import OmnimessageMessagesInner
80+
from messente_api.models.price_info import PriceInfo
8081
from messente_api.models.priority import Priority
8182
from messente_api.models.sms import SMS
8283
from messente_api.models.statistics_report import StatisticsReport

messente_api/api_client.py

Lines changed: 1 addition & 1 deletion
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.0.0/python'
92+
self.user_agent = 'OpenAPI-Generator/2.1.0/python'
9393
self.client_side_validation = configuration.client_side_validation
9494

9595
def __enter__(self):

messente_api/configuration.py

Lines changed: 1 addition & 1 deletion
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.0.0".\
398+
"SDK Package Version: 2.1.0".\
399399
format(env=sys.platform, pyversion=sys.version)
400400

401401
def get_host_settings(self):

messente_api/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
from messente_api.models.omni_message_create_success_response import OmniMessageCreateSuccessResponse
5454
from messente_api.models.omnimessage import Omnimessage
5555
from messente_api.models.omnimessage_messages_inner import OmnimessageMessagesInner
56+
from messente_api.models.price_info import PriceInfo
5657
from messente_api.models.priority import Priority
5758
from messente_api.models.sms import SMS
5859
from messente_api.models.statistics_report import StatisticsReport

messente_api/models/delivery_result.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from typing import Any, ClassVar, Dict, List, Optional
2424
from messente_api.models.channel import Channel
2525
from messente_api.models.error_code_omnichannel_machine import ErrorCodeOmnichannelMachine
26+
from messente_api.models.price_info import PriceInfo
2627
from messente_api.models.status import Status
2728
from typing import Optional, Set
2829
from typing_extensions import Self
@@ -37,7 +38,9 @@ class DeliveryResult(BaseModel):
3738
error: Optional[StrictStr] = Field(default=None, description="Human-readable description of what went wrong, *null* in case of success or if the message has not been processed yet")
3839
err: Optional[ErrorCodeOmnichannelMachine] = None
3940
timestamp: Optional[datetime] = Field(default=None, description="When this status was received by Omnichannel API")
40-
__properties: ClassVar[List[str]] = ["status", "channel", "message_id", "error", "err", "timestamp"]
41+
price_info: Optional[PriceInfo] = None
42+
sender: Optional[StrictStr] = Field(default=None, description="the sender of the message")
43+
__properties: ClassVar[List[str]] = ["status", "channel", "message_id", "error", "err", "timestamp", "price_info", "sender"]
4144

4245
model_config = ConfigDict(
4346
populate_by_name=True,
@@ -78,6 +81,9 @@ def to_dict(self) -> Dict[str, Any]:
7881
exclude=excluded_fields,
7982
exclude_none=True,
8083
)
84+
# override the default output from pydantic by calling `to_dict()` of price_info
85+
if self.price_info:
86+
_dict['price_info'] = self.price_info.to_dict()
8187
# set to None if error (nullable) is None
8288
# and model_fields_set contains the field
8389
if self.error is None and "error" in self.model_fields_set:
@@ -100,7 +106,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
100106
"message_id": obj.get("message_id"),
101107
"error": obj.get("error"),
102108
"err": obj.get("err"),
103-
"timestamp": obj.get("timestamp")
109+
"timestamp": obj.get("timestamp"),
110+
"price_info": PriceInfo.from_dict(obj["price_info"]) if obj.get("price_info") is not None else None,
111+
"sender": obj.get("sender")
104112
})
105113
return _obj
106114

messente_api/models/price_info.py

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# coding: utf-8
2+
3+
"""
4+
Messente API
5+
6+
[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.
7+
8+
The version of the OpenAPI document: 2.0.0
9+
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
""" # noqa: E501
14+
15+
16+
from __future__ import annotations
17+
import pprint
18+
import re # noqa: F401
19+
import json
20+
21+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
22+
from typing import Any, ClassVar, Dict, List
23+
from typing import Optional, Set
24+
from typing_extensions import Self
25+
26+
class PriceInfo(BaseModel):
27+
"""
28+
Contains price information for the message. This value is *null* if the message is still being processed
29+
""" # noqa: E501
30+
part_price: StrictStr = Field(description="price per message part - relevant mostly for SMS")
31+
parts_count: StrictInt = Field(description="the number of parts the message consists of")
32+
total_price: StrictStr = Field(description="total price for the message")
33+
__properties: ClassVar[List[str]] = ["part_price", "parts_count", "total_price"]
34+
35+
model_config = ConfigDict(
36+
populate_by_name=True,
37+
validate_assignment=True,
38+
protected_namespaces=(),
39+
)
40+
41+
42+
def to_str(self) -> str:
43+
"""Returns the string representation of the model using alias"""
44+
return pprint.pformat(self.model_dump(by_alias=True))
45+
46+
def to_json(self) -> str:
47+
"""Returns the JSON representation of the model using alias"""
48+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49+
return json.dumps(self.to_dict())
50+
51+
@classmethod
52+
def from_json(cls, json_str: str) -> Optional[Self]:
53+
"""Create an instance of PriceInfo from a JSON string"""
54+
return cls.from_dict(json.loads(json_str))
55+
56+
def to_dict(self) -> Dict[str, Any]:
57+
"""Return the dictionary representation of the model using alias.
58+
59+
This has the following differences from calling pydantic's
60+
`self.model_dump(by_alias=True)`:
61+
62+
* `None` is only added to the output dict for nullable fields that
63+
were set at model initialization. Other fields with value `None`
64+
are ignored.
65+
"""
66+
excluded_fields: Set[str] = set([
67+
])
68+
69+
_dict = self.model_dump(
70+
by_alias=True,
71+
exclude=excluded_fields,
72+
exclude_none=True,
73+
)
74+
return _dict
75+
76+
@classmethod
77+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78+
"""Create an instance of PriceInfo from a dict"""
79+
if obj is None:
80+
return None
81+
82+
if not isinstance(obj, dict):
83+
return cls.model_validate(obj)
84+
85+
_obj = cls.model_validate({
86+
"part_price": obj.get("part_price"),
87+
"parts_count": obj.get("parts_count"),
88+
"total_price": obj.get("total_price")
89+
})
90+
return _obj
91+
92+

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "messente_api"
3-
version = "2.0.0"
3+
version = "2.1.0"
44
description = "Messente API"
55
authors = ["Messente <[email protected]>"]
66
license = "Apache-2.0"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# prerequisite: setuptools
2323
# http://pypi.python.org/pypi/setuptools
2424
NAME = "messente-api"
25-
VERSION = "2.0.0"
25+
VERSION = "2.1.0"
2626
PYTHON_REQUIRES = ">=3.7"
2727
REQUIRES = [
2828
"urllib3 >= 1.25.3, < 2.1.0",

0 commit comments

Comments
 (0)