Skip to content

Commit 22db349

Browse files
committed
Travis update: Sep 2024 (Build 796)
[skip ci]
1 parent 0681f09 commit 22db349

8 files changed

Lines changed: 162 additions & 2 deletions

File tree

.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ docs/SyncNumberLookupSuccess.md
6262
docs/Telegram.md
6363
docs/TextStore.md
6464
docs/Viber.md
65+
docs/ViberVideo.md
6566
docs/WhatsApp.md
6667
docs/WhatsAppComponent.md
6768
docs/WhatsAppCurrency.md
@@ -136,6 +137,7 @@ messente_api/models/sync_number_lookup_success.py
136137
messente_api/models/telegram.py
137138
messente_api/models/text_store.py
138139
messente_api/models/viber.py
140+
messente_api/models/viber_video.py
139141
messente_api/models/whats_app.py
140142
messente_api/models/whats_app_component.py
141143
messente_api/models/whats_app_currency.py

docs/OmnimessageMessagesInner.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Name | Type | Description | Notes
1313
**button_url** | **str** | URL of the button, must be specified along with ''text'', ''button_text'' and ''image_url'' (optional) | [optional]
1414
**button_text** | **str** | Must be specified along with ''text'', ''button_url'', ''button_text'', ''image_url'' (optional) | [optional]
1515
**channel** | **str** | The channel used to deliver the message | [optional] [default to 'telegram']
16+
**video** | [**ViberVideo**](ViberVideo.md) | | [optional]
1617
**autoconvert** | **str** | Defines how non-GSM characters will be treated: - \"on\" Use replacement settings from the account's [API Auto Replace settings page](https://dashboard.messente.com/api-settings/auto-replace) (default) - \"full\" All non GSM 03.38 characters will be replaced with suitable alternatives - \"off\" Message content is not modified in any way | [optional]
1718
**udh** | **str** | hex-encoded string containing SMS UDH | [optional]
1819
**template** | [**WhatsAppTemplate**](WhatsAppTemplate.md) | | [optional]

docs/Viber.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Name | Type | Description | Notes
1414
**button_url** | **str** | URL of the button, must be specified along with ''text'', ''button_text'' and ''image_url'' (optional) | [optional]
1515
**button_text** | **str** | Must be specified along with ''text'', ''button_url'', ''button_text'', ''image_url'' (optional) | [optional]
1616
**channel** | **str** | The channel used to deliver the message | [optional] [default to 'viber']
17+
**video** | [**ViberVideo**](ViberVideo.md) | | [optional]
1718

1819
## Example
1920

docs/ViberVideo.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# ViberVideo
2+
3+
Viber video object
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
**url** | **str** | URL pointing to the video resource. |
10+
**thumbnail** | **str** | URL pointing to the video thumbnail resource. |
11+
**file_size** | **int** | Size of the video file in bytes. Cannot be larger than 200MB. |
12+
**duration** | [**List[WhatsAppParameter]**](WhatsAppParameter.md) | Duration of the video in seconds. Cannot be longer than 600 seconds. |
13+
14+
## Example
15+
16+
```python
17+
from messente_api.models.viber_video import ViberVideo
18+
19+
# TODO update the JSON string below
20+
json = "{}"
21+
# create an instance of ViberVideo from a JSON string
22+
viber_video_instance = ViberVideo.from_json(json)
23+
# print the JSON string representation of the object
24+
print(ViberVideo.to_json())
25+
26+
# convert the object into a dict
27+
viber_video_dict = viber_video_instance.to_dict()
28+
# create an instance of ViberVideo from a dict
29+
viber_video_from_dict = ViberVideo.from_dict(viber_video_dict)
30+
```
31+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
32+
33+

messente_api/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
from messente_api.models.telegram import Telegram
9090
from messente_api.models.text_store import TextStore
9191
from messente_api.models.viber import Viber
92+
from messente_api.models.viber_video import ViberVideo
9293
from messente_api.models.whats_app import WhatsApp
9394
from messente_api.models.whats_app_component import WhatsAppComponent
9495
from messente_api.models.whats_app_currency import WhatsAppCurrency

messente_api/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
from messente_api.models.telegram import Telegram
6666
from messente_api.models.text_store import TextStore
6767
from messente_api.models.viber import Viber
68+
from messente_api.models.viber_video import ViberVideo
6869
from messente_api.models.whats_app import WhatsApp
6970
from messente_api.models.whats_app_component import WhatsAppComponent
7071
from messente_api.models.whats_app_currency import WhatsAppCurrency

messente_api/models/viber.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
2222
from typing import Any, ClassVar, Dict, List, Optional
23+
from messente_api.models.viber_video import ViberVideo
2324
from typing import Optional, Set
2425
from typing_extensions import Self
2526

@@ -35,8 +36,9 @@ class Viber(BaseModel):
3536
button_url: Optional[StrictStr] = Field(default=None, description="URL of the button, must be specified along with ''text'', ''button_text'' and ''image_url'' (optional)")
3637
button_text: Optional[StrictStr] = Field(default=None, description="Must be specified along with ''text'', ''button_url'', ''button_text'', ''image_url'' (optional)")
3738
channel: Optional[StrictStr] = Field(default='viber', description="The channel used to deliver the message")
39+
video: Optional[ViberVideo] = None
3840
additional_properties: Dict[str, Any] = {}
39-
__properties: ClassVar[List[str]] = ["sender", "validity", "ttl", "text", "image_url", "button_url", "button_text", "channel"]
41+
__properties: ClassVar[List[str]] = ["sender", "validity", "ttl", "text", "image_url", "button_url", "button_text", "channel", "video"]
4042

4143
@field_validator('channel')
4244
def channel_validate_enum(cls, value):
@@ -89,6 +91,9 @@ def to_dict(self) -> Dict[str, Any]:
8991
exclude=excluded_fields,
9092
exclude_none=True,
9193
)
94+
# override the default output from pydantic by calling `to_dict()` of video
95+
if self.video:
96+
_dict['video'] = self.video.to_dict()
9297
# puts key-value pairs in additional_properties in the top level
9398
if self.additional_properties is not None:
9499
for _key, _value in self.additional_properties.items():
@@ -113,7 +118,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
113118
"image_url": obj.get("image_url"),
114119
"button_url": obj.get("button_url"),
115120
"button_text": obj.get("button_text"),
116-
"channel": obj.get("channel") if obj.get("channel") is not None else 'viber'
121+
"channel": obj.get("channel") if obj.get("channel") is not None else 'viber',
122+
"video": ViberVideo.from_dict(obj["video"]) if obj.get("video") is not None else None
117123
})
118124
# store additional fields in additional_properties
119125
for _key in obj.keys():

messente_api/models/viber_video.py

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
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+
Contact: messente@messente.com
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 messente_api.models.whats_app_parameter import WhatsAppParameter
24+
from typing import Optional, Set
25+
from typing_extensions import Self
26+
27+
class ViberVideo(BaseModel):
28+
"""
29+
Viber video object
30+
""" # noqa: E501
31+
url: StrictStr = Field(description="URL pointing to the video resource.")
32+
thumbnail: StrictStr = Field(description="URL pointing to the video thumbnail resource.")
33+
file_size: StrictInt = Field(description="Size of the video file in bytes. Cannot be larger than 200MB.")
34+
duration: List[WhatsAppParameter] = Field(description="Duration of the video in seconds. Cannot be longer than 600 seconds.")
35+
additional_properties: Dict[str, Any] = {}
36+
__properties: ClassVar[List[str]] = ["url", "thumbnail", "file_size", "duration"]
37+
38+
model_config = ConfigDict(
39+
populate_by_name=True,
40+
validate_assignment=True,
41+
protected_namespaces=(),
42+
)
43+
44+
45+
def to_str(self) -> str:
46+
"""Returns the string representation of the model using alias"""
47+
return pprint.pformat(self.model_dump(by_alias=True))
48+
49+
def to_json(self) -> str:
50+
"""Returns the JSON representation of the model using alias"""
51+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52+
return json.dumps(self.to_dict())
53+
54+
@classmethod
55+
def from_json(cls, json_str: str) -> Optional[Self]:
56+
"""Create an instance of ViberVideo from a JSON string"""
57+
return cls.from_dict(json.loads(json_str))
58+
59+
def to_dict(self) -> Dict[str, Any]:
60+
"""Return the dictionary representation of the model using alias.
61+
62+
This has the following differences from calling pydantic's
63+
`self.model_dump(by_alias=True)`:
64+
65+
* `None` is only added to the output dict for nullable fields that
66+
were set at model initialization. Other fields with value `None`
67+
are ignored.
68+
* Fields in `self.additional_properties` are added to the output dict.
69+
"""
70+
excluded_fields: Set[str] = set([
71+
"additional_properties",
72+
])
73+
74+
_dict = self.model_dump(
75+
by_alias=True,
76+
exclude=excluded_fields,
77+
exclude_none=True,
78+
)
79+
# override the default output from pydantic by calling `to_dict()` of each item in duration (list)
80+
_items = []
81+
if self.duration:
82+
for _item in self.duration:
83+
if _item:
84+
_items.append(_item.to_dict())
85+
_dict['duration'] = _items
86+
# puts key-value pairs in additional_properties in the top level
87+
if self.additional_properties is not None:
88+
for _key, _value in self.additional_properties.items():
89+
_dict[_key] = _value
90+
91+
return _dict
92+
93+
@classmethod
94+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
95+
"""Create an instance of ViberVideo from a dict"""
96+
if obj is None:
97+
return None
98+
99+
if not isinstance(obj, dict):
100+
return cls.model_validate(obj)
101+
102+
_obj = cls.model_validate({
103+
"url": obj.get("url"),
104+
"thumbnail": obj.get("thumbnail"),
105+
"file_size": obj.get("file_size"),
106+
"duration": [WhatsAppParameter.from_dict(_item) for _item in obj["duration"]] if obj.get("duration") is not None else None
107+
})
108+
# store additional fields in additional_properties
109+
for _key in obj.keys():
110+
if _key not in cls.__properties:
111+
_obj.additional_properties[_key] = obj.get(_key)
112+
113+
return _obj
114+
115+

0 commit comments

Comments
 (0)