one-msg-sdk 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- one_msg_sdk/__init__.py +189 -0
- one_msg_sdk/api/__init__.py +14 -0
- one_msg_sdk/api/calling_api.py +901 -0
- one_msg_sdk/api/catalog_api.py +607 -0
- one_msg_sdk/api/channel_api.py +874 -0
- one_msg_sdk/api/flows_api.py +3212 -0
- one_msg_sdk/api/groups_api.py +1935 -0
- one_msg_sdk/api/messaging_api.py +7419 -0
- one_msg_sdk/api/profile_api.py +609 -0
- one_msg_sdk/api/templates_api.py +1180 -0
- one_msg_sdk/api/users_api.py +903 -0
- one_msg_sdk/api/webhooks_api.py +605 -0
- one_msg_sdk/api_client.py +805 -0
- one_msg_sdk/api_response.py +21 -0
- one_msg_sdk/configuration.py +635 -0
- one_msg_sdk/exceptions.py +219 -0
- one_msg_sdk/models/__init__.py +78 -0
- one_msg_sdk/models/add_template_request.py +108 -0
- one_msg_sdk/models/block_user_request.py +102 -0
- one_msg_sdk/models/conversational_automation.py +115 -0
- one_msg_sdk/models/conversational_automation_commands_inner.py +105 -0
- one_msg_sdk/models/create_commerce200_response.py +102 -0
- one_msg_sdk/models/create_commerce_request.py +106 -0
- one_msg_sdk/models/create_commerce_request_params.py +104 -0
- one_msg_sdk/models/create_groups200_response.py +107 -0
- one_msg_sdk/models/create_read_message200_response.py +102 -0
- one_msg_sdk/models/create_read_message401_response.py +89 -0
- one_msg_sdk/models/create_read_message_request.py +93 -0
- one_msg_sdk/models/delete_flows_flow_id200_response.py +109 -0
- one_msg_sdk/models/delete_groups_group_id200_response.py +104 -0
- one_msg_sdk/models/delete_media_legacy_request.py +102 -0
- one_msg_sdk/models/error_response.py +89 -0
- one_msg_sdk/models/get_commerce200_response_inner.py +106 -0
- one_msg_sdk/models/get_mm_lite_status200_response.py +106 -0
- one_msg_sdk/models/get_webhook200_response.py +102 -0
- one_msg_sdk/models/get_whatsapp_business_encryption200_response.py +116 -0
- one_msg_sdk/models/list_blocked_users200_response.py +102 -0
- one_msg_sdk/models/list_flows200_response.py +115 -0
- one_msg_sdk/models/list_messages200_response.py +104 -0
- one_msg_sdk/models/list_templates200_response.py +106 -0
- one_msg_sdk/models/message_sent_response.py +108 -0
- one_msg_sdk/models/patch_flows_flow_id_assets200_response.py +111 -0
- one_msg_sdk/models/profile_info.py +126 -0
- one_msg_sdk/models/retrieve_media200_response.py +110 -0
- one_msg_sdk/models/send_address_message_request.py +126 -0
- one_msg_sdk/models/send_button_request.py +103 -0
- one_msg_sdk/models/send_button_request_sections_inner.py +95 -0
- one_msg_sdk/models/send_button_request_sections_inner_reply.py +91 -0
- one_msg_sdk/models/send_carousel_request1.py +97 -0
- one_msg_sdk/models/send_contact_request.py +99 -0
- one_msg_sdk/models/send_contact_request_contacts_inner.py +117 -0
- one_msg_sdk/models/send_contact_request_contacts_inner_name.py +99 -0
- one_msg_sdk/models/send_contact_request_contacts_inner_org.py +93 -0
- one_msg_sdk/models/send_contact_request_contacts_inner_phones_inner.py +93 -0
- one_msg_sdk/models/send_cta_url_request.py +116 -0
- one_msg_sdk/models/send_file_request.py +129 -0
- one_msg_sdk/models/send_flow_request1.py +141 -0
- one_msg_sdk/models/send_flow_request1_header.py +144 -0
- one_msg_sdk/models/send_flow_request_header.py +144 -0
- one_msg_sdk/models/send_list_request.py +105 -0
- one_msg_sdk/models/send_list_request_sections_inner.py +99 -0
- one_msg_sdk/models/send_list_request_sections_inner_rows_inner.py +93 -0
- one_msg_sdk/models/send_location_request1.py +101 -0
- one_msg_sdk/models/send_location_request_request.py +91 -0
- one_msg_sdk/models/send_message_request.py +122 -0
- one_msg_sdk/models/send_order_details_request.py +128 -0
- one_msg_sdk/models/send_order_details_request_language.py +104 -0
- one_msg_sdk/models/send_order_details_request_order.py +124 -0
- one_msg_sdk/models/send_order_details_request_order_items_inner.py +112 -0
- one_msg_sdk/models/send_order_details_request_order_items_inner_amount.py +104 -0
- one_msg_sdk/models/send_payment_request_request.py +117 -0
- one_msg_sdk/models/send_reaction_request.py +93 -0
- one_msg_sdk/models/send_sticker_request.py +110 -0
- one_msg_sdk/models/send_template_request.py +107 -0
- one_msg_sdk/models/send_template_request_language.py +91 -0
- one_msg_sdk/models/set_whatsapp_business_encryption_request.py +89 -0
- one_msg_sdk/models/success_response.py +102 -0
- one_msg_sdk/models/update_me_request.py +114 -0
- one_msg_sdk/py.typed +0 -0
- one_msg_sdk/rest.py +264 -0
- one_msg_sdk-1.0.0.dist-info/METADATA +19 -0
- one_msg_sdk-1.0.0.dist-info/RECORD +85 -0
- one_msg_sdk-1.0.0.dist-info/WHEEL +5 -0
- one_msg_sdk-1.0.0.dist-info/licenses/LICENSE +21 -0
- one_msg_sdk-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
1MSG WhatsApp Business API (Public)
|
|
5
|
+
|
|
6
|
+
Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: support@1msg.io
|
|
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, StrictInt
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
26
|
+
|
|
27
|
+
class SendOrderDetailsRequestOrderItemsInnerAmount(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
SendOrderDetailsRequestOrderItemsInnerAmount
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
offset: Optional[StrictInt] = None
|
|
32
|
+
value: Optional[StrictInt] = None
|
|
33
|
+
additional_properties: Dict[str, Any] = {}
|
|
34
|
+
__properties: ClassVar[List[str]] = ["offset", "value"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
validate_by_name=True,
|
|
38
|
+
validate_by_alias=True,
|
|
39
|
+
validate_assignment=True,
|
|
40
|
+
protected_namespaces=(),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of SendOrderDetailsRequestOrderItemsInnerAmount from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
67
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
"additional_properties",
|
|
70
|
+
])
|
|
71
|
+
|
|
72
|
+
_dict = self.model_dump(
|
|
73
|
+
by_alias=True,
|
|
74
|
+
exclude=excluded_fields,
|
|
75
|
+
exclude_none=True,
|
|
76
|
+
)
|
|
77
|
+
# puts key-value pairs in additional_properties in the top level
|
|
78
|
+
if self.additional_properties is not None:
|
|
79
|
+
for _key, _value in self.additional_properties.items():
|
|
80
|
+
_dict[_key] = _value
|
|
81
|
+
|
|
82
|
+
return _dict
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
86
|
+
"""Create an instance of SendOrderDetailsRequestOrderItemsInnerAmount from a dict"""
|
|
87
|
+
if obj is None:
|
|
88
|
+
return None
|
|
89
|
+
|
|
90
|
+
if not isinstance(obj, dict):
|
|
91
|
+
return cls.model_validate(obj)
|
|
92
|
+
|
|
93
|
+
_obj = cls.model_validate({
|
|
94
|
+
"offset": obj.get("offset"),
|
|
95
|
+
"value": obj.get("value")
|
|
96
|
+
})
|
|
97
|
+
# store additional fields in additional_properties
|
|
98
|
+
for _key in obj.keys():
|
|
99
|
+
if _key not in cls.__properties:
|
|
100
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
101
|
+
|
|
102
|
+
return _obj
|
|
103
|
+
|
|
104
|
+
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
1MSG WhatsApp Business API (Public)
|
|
5
|
+
|
|
6
|
+
Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: support@1msg.io
|
|
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, StrictInt, StrictStr, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
26
|
+
|
|
27
|
+
class SendPaymentRequestRequest(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
SendPaymentRequestRequest
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
phone: StrictInt
|
|
32
|
+
region: StrictStr
|
|
33
|
+
body: Optional[StrictStr] = None
|
|
34
|
+
interactive: Optional[Dict[str, Any]] = None
|
|
35
|
+
action: Optional[Dict[str, Any]] = None
|
|
36
|
+
additional_properties: Dict[str, Any] = {}
|
|
37
|
+
__properties: ClassVar[List[str]] = ["phone", "region", "body", "interactive", "action"]
|
|
38
|
+
|
|
39
|
+
@field_validator('region')
|
|
40
|
+
def region_validate_enum(cls, value):
|
|
41
|
+
"""Validates the enum"""
|
|
42
|
+
if value not in set(['IN', 'SG', 'BR']):
|
|
43
|
+
raise ValueError("must be one of enum values ('IN', 'SG', 'BR')")
|
|
44
|
+
return value
|
|
45
|
+
|
|
46
|
+
model_config = ConfigDict(
|
|
47
|
+
validate_by_name=True,
|
|
48
|
+
validate_by_alias=True,
|
|
49
|
+
validate_assignment=True,
|
|
50
|
+
protected_namespaces=(),
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def to_str(self) -> str:
|
|
55
|
+
"""Returns the string representation of the model using alias"""
|
|
56
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
57
|
+
|
|
58
|
+
def to_json(self) -> str:
|
|
59
|
+
"""Returns the JSON representation of the model using alias"""
|
|
60
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
61
|
+
|
|
62
|
+
@classmethod
|
|
63
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
64
|
+
"""Create an instance of SendPaymentRequestRequest from a JSON string"""
|
|
65
|
+
return cls.from_dict(json.loads(json_str))
|
|
66
|
+
|
|
67
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
68
|
+
"""Return the dictionary representation of the model using alias.
|
|
69
|
+
|
|
70
|
+
This has the following differences from calling pydantic's
|
|
71
|
+
`self.model_dump(by_alias=True)`:
|
|
72
|
+
|
|
73
|
+
* `None` is only added to the output dict for nullable fields that
|
|
74
|
+
were set at model initialization. Other fields with value `None`
|
|
75
|
+
are ignored.
|
|
76
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
77
|
+
"""
|
|
78
|
+
excluded_fields: Set[str] = set([
|
|
79
|
+
"additional_properties",
|
|
80
|
+
])
|
|
81
|
+
|
|
82
|
+
_dict = self.model_dump(
|
|
83
|
+
by_alias=True,
|
|
84
|
+
exclude=excluded_fields,
|
|
85
|
+
exclude_none=True,
|
|
86
|
+
)
|
|
87
|
+
# puts key-value pairs in additional_properties in the top level
|
|
88
|
+
if self.additional_properties is not None:
|
|
89
|
+
for _key, _value in self.additional_properties.items():
|
|
90
|
+
_dict[_key] = _value
|
|
91
|
+
|
|
92
|
+
return _dict
|
|
93
|
+
|
|
94
|
+
@classmethod
|
|
95
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
96
|
+
"""Create an instance of SendPaymentRequestRequest from a dict"""
|
|
97
|
+
if obj is None:
|
|
98
|
+
return None
|
|
99
|
+
|
|
100
|
+
if not isinstance(obj, dict):
|
|
101
|
+
return cls.model_validate(obj)
|
|
102
|
+
|
|
103
|
+
_obj = cls.model_validate({
|
|
104
|
+
"phone": obj.get("phone"),
|
|
105
|
+
"region": obj.get("region"),
|
|
106
|
+
"body": obj.get("body"),
|
|
107
|
+
"interactive": obj.get("interactive"),
|
|
108
|
+
"action": obj.get("action")
|
|
109
|
+
})
|
|
110
|
+
# store additional fields in additional_properties
|
|
111
|
+
for _key in obj.keys():
|
|
112
|
+
if _key not in cls.__properties:
|
|
113
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
114
|
+
|
|
115
|
+
return _obj
|
|
116
|
+
|
|
117
|
+
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
1MSG WhatsApp Business API (Public)
|
|
5
|
+
|
|
6
|
+
Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: support@1msg.io
|
|
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, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
26
|
+
|
|
27
|
+
class SendReactionRequest(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
SendReactionRequest
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
phone: Optional[StrictStr] = None
|
|
32
|
+
body: Optional[StrictStr] = None
|
|
33
|
+
quoted_msg_id: Optional[StrictStr] = Field(default=None, alias="quotedMsgId")
|
|
34
|
+
__properties: ClassVar[List[str]] = ["phone", "body", "quotedMsgId"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
validate_by_name=True,
|
|
38
|
+
validate_by_alias=True,
|
|
39
|
+
validate_assignment=True,
|
|
40
|
+
protected_namespaces=(),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of SendReactionRequest from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
return _dict
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
79
|
+
"""Create an instance of SendReactionRequest from a dict"""
|
|
80
|
+
if obj is None:
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
if not isinstance(obj, dict):
|
|
84
|
+
return cls.model_validate(obj)
|
|
85
|
+
|
|
86
|
+
_obj = cls.model_validate({
|
|
87
|
+
"phone": obj.get("phone"),
|
|
88
|
+
"body": obj.get("body"),
|
|
89
|
+
"quotedMsgId": obj.get("quotedMsgId")
|
|
90
|
+
})
|
|
91
|
+
return _obj
|
|
92
|
+
|
|
93
|
+
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
1MSG WhatsApp Business API (Public)
|
|
5
|
+
|
|
6
|
+
Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: support@1msg.io
|
|
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, Optional
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
26
|
+
|
|
27
|
+
class SendStickerRequest(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
SendStickerRequest
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
phone: Optional[StrictInt] = None
|
|
32
|
+
chat_id: Optional[StrictStr] = Field(default=None, alias="chatId")
|
|
33
|
+
media_id: Optional[StrictStr] = Field(default=None, description="WABA media id from uploadMedia", alias="mediaId")
|
|
34
|
+
link: Optional[StrictStr] = Field(default=None, description="Public URL to webp sticker")
|
|
35
|
+
quoted_msg_id: Optional[StrictStr] = Field(default=None, alias="quotedMsgId")
|
|
36
|
+
additional_properties: Dict[str, Any] = {}
|
|
37
|
+
__properties: ClassVar[List[str]] = ["phone", "chatId", "mediaId", "link", "quotedMsgId"]
|
|
38
|
+
|
|
39
|
+
model_config = ConfigDict(
|
|
40
|
+
validate_by_name=True,
|
|
41
|
+
validate_by_alias=True,
|
|
42
|
+
validate_assignment=True,
|
|
43
|
+
protected_namespaces=(),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def to_str(self) -> str:
|
|
48
|
+
"""Returns the string representation of the model using alias"""
|
|
49
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
50
|
+
|
|
51
|
+
def to_json(self) -> str:
|
|
52
|
+
"""Returns the JSON representation of the model using alias"""
|
|
53
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
57
|
+
"""Create an instance of SendStickerRequest from a JSON string"""
|
|
58
|
+
return cls.from_dict(json.loads(json_str))
|
|
59
|
+
|
|
60
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
61
|
+
"""Return the dictionary representation of the model using alias.
|
|
62
|
+
|
|
63
|
+
This has the following differences from calling pydantic's
|
|
64
|
+
`self.model_dump(by_alias=True)`:
|
|
65
|
+
|
|
66
|
+
* `None` is only added to the output dict for nullable fields that
|
|
67
|
+
were set at model initialization. Other fields with value `None`
|
|
68
|
+
are ignored.
|
|
69
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
70
|
+
"""
|
|
71
|
+
excluded_fields: Set[str] = set([
|
|
72
|
+
"additional_properties",
|
|
73
|
+
])
|
|
74
|
+
|
|
75
|
+
_dict = self.model_dump(
|
|
76
|
+
by_alias=True,
|
|
77
|
+
exclude=excluded_fields,
|
|
78
|
+
exclude_none=True,
|
|
79
|
+
)
|
|
80
|
+
# puts key-value pairs in additional_properties in the top level
|
|
81
|
+
if self.additional_properties is not None:
|
|
82
|
+
for _key, _value in self.additional_properties.items():
|
|
83
|
+
_dict[_key] = _value
|
|
84
|
+
|
|
85
|
+
return _dict
|
|
86
|
+
|
|
87
|
+
@classmethod
|
|
88
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
89
|
+
"""Create an instance of SendStickerRequest from a dict"""
|
|
90
|
+
if obj is None:
|
|
91
|
+
return None
|
|
92
|
+
|
|
93
|
+
if not isinstance(obj, dict):
|
|
94
|
+
return cls.model_validate(obj)
|
|
95
|
+
|
|
96
|
+
_obj = cls.model_validate({
|
|
97
|
+
"phone": obj.get("phone"),
|
|
98
|
+
"chatId": obj.get("chatId"),
|
|
99
|
+
"mediaId": obj.get("mediaId"),
|
|
100
|
+
"link": obj.get("link"),
|
|
101
|
+
"quotedMsgId": obj.get("quotedMsgId")
|
|
102
|
+
})
|
|
103
|
+
# store additional fields in additional_properties
|
|
104
|
+
for _key in obj.keys():
|
|
105
|
+
if _key not in cls.__properties:
|
|
106
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
107
|
+
|
|
108
|
+
return _obj
|
|
109
|
+
|
|
110
|
+
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
1MSG WhatsApp Business API (Public)
|
|
5
|
+
|
|
6
|
+
Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: support@1msg.io
|
|
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, StrictBool, StrictInt, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from one_msg_sdk.models.send_template_request_language import SendTemplateRequestLanguage
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
from pydantic_core import to_jsonable_python
|
|
27
|
+
|
|
28
|
+
class SendTemplateRequest(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
SendTemplateRequest
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
template: Optional[StrictStr] = None
|
|
33
|
+
language: Optional[SendTemplateRequestLanguage] = None
|
|
34
|
+
namespace: Optional[StrictStr] = None
|
|
35
|
+
params: Optional[List[Any]] = None
|
|
36
|
+
phone: Optional[StrictStr] = None
|
|
37
|
+
use_m_mlite: Optional[StrictBool] = Field(default=None, description="Force Marketing Messages API (POST marketing_messages). If omitted: auto for MARKETING category when channel has mm_lite_enabled and mm_lite_available service settings. ", alias="useMMlite")
|
|
38
|
+
message_activity_sharing: Optional[StrictBool] = Field(default=None, description="Sets message_activity_sharing on WABA payload. Enables click tracking webhooks. Requires MM Lite path. Ignored on Cloud API fallback. ", alias="messageActivitySharing")
|
|
39
|
+
message_send_ttl_seconds: Optional[StrictInt] = Field(default=None, description="Template message TTL in seconds (message_send_ttl_seconds). MARKETING via MM Lite: 43200–2592000. AUTHENTICATION: 30–900. UTILITY: 30–43200. AUTH/UTILITY also accept -1 (30-day custom TTL). ", alias="messageSendTtlSeconds")
|
|
40
|
+
__properties: ClassVar[List[str]] = ["template", "language", "namespace", "params", "phone", "useMMlite", "messageActivitySharing", "messageSendTtlSeconds"]
|
|
41
|
+
|
|
42
|
+
model_config = ConfigDict(
|
|
43
|
+
validate_by_name=True,
|
|
44
|
+
validate_by_alias=True,
|
|
45
|
+
validate_assignment=True,
|
|
46
|
+
protected_namespaces=(),
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def to_str(self) -> str:
|
|
51
|
+
"""Returns the string representation of the model using alias"""
|
|
52
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
53
|
+
|
|
54
|
+
def to_json(self) -> str:
|
|
55
|
+
"""Returns the JSON representation of the model using alias"""
|
|
56
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
60
|
+
"""Create an instance of SendTemplateRequest from a JSON string"""
|
|
61
|
+
return cls.from_dict(json.loads(json_str))
|
|
62
|
+
|
|
63
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
64
|
+
"""Return the dictionary representation of the model using alias.
|
|
65
|
+
|
|
66
|
+
This has the following differences from calling pydantic's
|
|
67
|
+
`self.model_dump(by_alias=True)`:
|
|
68
|
+
|
|
69
|
+
* `None` is only added to the output dict for nullable fields that
|
|
70
|
+
were set at model initialization. Other fields with value `None`
|
|
71
|
+
are ignored.
|
|
72
|
+
"""
|
|
73
|
+
excluded_fields: Set[str] = set([
|
|
74
|
+
])
|
|
75
|
+
|
|
76
|
+
_dict = self.model_dump(
|
|
77
|
+
by_alias=True,
|
|
78
|
+
exclude=excluded_fields,
|
|
79
|
+
exclude_none=True,
|
|
80
|
+
)
|
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of language
|
|
82
|
+
if self.language:
|
|
83
|
+
_dict['language'] = self.language.to_dict()
|
|
84
|
+
return _dict
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
88
|
+
"""Create an instance of SendTemplateRequest from a dict"""
|
|
89
|
+
if obj is None:
|
|
90
|
+
return None
|
|
91
|
+
|
|
92
|
+
if not isinstance(obj, dict):
|
|
93
|
+
return cls.model_validate(obj)
|
|
94
|
+
|
|
95
|
+
_obj = cls.model_validate({
|
|
96
|
+
"template": obj.get("template"),
|
|
97
|
+
"language": SendTemplateRequestLanguage.from_dict(obj["language"]) if obj.get("language") is not None else None,
|
|
98
|
+
"namespace": obj.get("namespace"),
|
|
99
|
+
"params": obj.get("params"),
|
|
100
|
+
"phone": obj.get("phone"),
|
|
101
|
+
"useMMlite": obj.get("useMMlite"),
|
|
102
|
+
"messageActivitySharing": obj.get("messageActivitySharing"),
|
|
103
|
+
"messageSendTtlSeconds": obj.get("messageSendTtlSeconds")
|
|
104
|
+
})
|
|
105
|
+
return _obj
|
|
106
|
+
|
|
107
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
1MSG WhatsApp Business API (Public)
|
|
5
|
+
|
|
6
|
+
Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: support@1msg.io
|
|
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, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
26
|
+
|
|
27
|
+
class SendTemplateRequestLanguage(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
SendTemplateRequestLanguage
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
policy: Optional[StrictStr] = None
|
|
32
|
+
code: Optional[StrictStr] = None
|
|
33
|
+
__properties: ClassVar[List[str]] = ["policy", "code"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
validate_by_name=True,
|
|
37
|
+
validate_by_alias=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of SendTemplateRequestLanguage 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 SendTemplateRequestLanguage 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
|
+
"policy": obj.get("policy"),
|
|
87
|
+
"code": obj.get("code")
|
|
88
|
+
})
|
|
89
|
+
return _obj
|
|
90
|
+
|
|
91
|
+
|