Skip to content

Commit 163c795

Browse files
committed
Travis update: Sep 2024 (Build 798)
[skip ci]
1 parent 58de7f2 commit 163c795

2 files changed

Lines changed: 3 additions & 11 deletions

File tree

docs/ViberVideo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Name | Type | Description | Notes
99
**url** | **str** | URL pointing to the video resource. |
1010
**thumbnail** | **str** | URL pointing to the video thumbnail resource. |
1111
**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. |
12+
**duration** | **int** | Duration of the video in seconds. Cannot be longer than 600 seconds. |
1313

1414
## Example
1515

messente_api/models/viber_video.py

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

2121
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
2222
from typing import Any, ClassVar, Dict, List
23-
from messente_api.models.whats_app_parameter import WhatsAppParameter
2423
from typing import Optional, Set
2524
from typing_extensions import Self
2625

@@ -31,7 +30,7 @@ class ViberVideo(BaseModel):
3130
url: StrictStr = Field(description="URL pointing to the video resource.")
3231
thumbnail: StrictStr = Field(description="URL pointing to the video thumbnail resource.")
3332
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.")
33+
duration: StrictInt = Field(description="Duration of the video in seconds. Cannot be longer than 600 seconds.")
3534
additional_properties: Dict[str, Any] = {}
3635
__properties: ClassVar[List[str]] = ["url", "thumbnail", "file_size", "duration"]
3736

@@ -76,13 +75,6 @@ def to_dict(self) -> Dict[str, Any]:
7675
exclude=excluded_fields,
7776
exclude_none=True,
7877
)
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
8678
# puts key-value pairs in additional_properties in the top level
8779
if self.additional_properties is not None:
8880
for _key, _value in self.additional_properties.items():
@@ -103,7 +95,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
10395
"url": obj.get("url"),
10496
"thumbnail": obj.get("thumbnail"),
10597
"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
98+
"duration": obj.get("duration")
10799
})
108100
# store additional fields in additional_properties
109101
for _key in obj.keys():

0 commit comments

Comments
 (0)