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.
Files changed (85) hide show
  1. one_msg_sdk/__init__.py +189 -0
  2. one_msg_sdk/api/__init__.py +14 -0
  3. one_msg_sdk/api/calling_api.py +901 -0
  4. one_msg_sdk/api/catalog_api.py +607 -0
  5. one_msg_sdk/api/channel_api.py +874 -0
  6. one_msg_sdk/api/flows_api.py +3212 -0
  7. one_msg_sdk/api/groups_api.py +1935 -0
  8. one_msg_sdk/api/messaging_api.py +7419 -0
  9. one_msg_sdk/api/profile_api.py +609 -0
  10. one_msg_sdk/api/templates_api.py +1180 -0
  11. one_msg_sdk/api/users_api.py +903 -0
  12. one_msg_sdk/api/webhooks_api.py +605 -0
  13. one_msg_sdk/api_client.py +805 -0
  14. one_msg_sdk/api_response.py +21 -0
  15. one_msg_sdk/configuration.py +635 -0
  16. one_msg_sdk/exceptions.py +219 -0
  17. one_msg_sdk/models/__init__.py +78 -0
  18. one_msg_sdk/models/add_template_request.py +108 -0
  19. one_msg_sdk/models/block_user_request.py +102 -0
  20. one_msg_sdk/models/conversational_automation.py +115 -0
  21. one_msg_sdk/models/conversational_automation_commands_inner.py +105 -0
  22. one_msg_sdk/models/create_commerce200_response.py +102 -0
  23. one_msg_sdk/models/create_commerce_request.py +106 -0
  24. one_msg_sdk/models/create_commerce_request_params.py +104 -0
  25. one_msg_sdk/models/create_groups200_response.py +107 -0
  26. one_msg_sdk/models/create_read_message200_response.py +102 -0
  27. one_msg_sdk/models/create_read_message401_response.py +89 -0
  28. one_msg_sdk/models/create_read_message_request.py +93 -0
  29. one_msg_sdk/models/delete_flows_flow_id200_response.py +109 -0
  30. one_msg_sdk/models/delete_groups_group_id200_response.py +104 -0
  31. one_msg_sdk/models/delete_media_legacy_request.py +102 -0
  32. one_msg_sdk/models/error_response.py +89 -0
  33. one_msg_sdk/models/get_commerce200_response_inner.py +106 -0
  34. one_msg_sdk/models/get_mm_lite_status200_response.py +106 -0
  35. one_msg_sdk/models/get_webhook200_response.py +102 -0
  36. one_msg_sdk/models/get_whatsapp_business_encryption200_response.py +116 -0
  37. one_msg_sdk/models/list_blocked_users200_response.py +102 -0
  38. one_msg_sdk/models/list_flows200_response.py +115 -0
  39. one_msg_sdk/models/list_messages200_response.py +104 -0
  40. one_msg_sdk/models/list_templates200_response.py +106 -0
  41. one_msg_sdk/models/message_sent_response.py +108 -0
  42. one_msg_sdk/models/patch_flows_flow_id_assets200_response.py +111 -0
  43. one_msg_sdk/models/profile_info.py +126 -0
  44. one_msg_sdk/models/retrieve_media200_response.py +110 -0
  45. one_msg_sdk/models/send_address_message_request.py +126 -0
  46. one_msg_sdk/models/send_button_request.py +103 -0
  47. one_msg_sdk/models/send_button_request_sections_inner.py +95 -0
  48. one_msg_sdk/models/send_button_request_sections_inner_reply.py +91 -0
  49. one_msg_sdk/models/send_carousel_request1.py +97 -0
  50. one_msg_sdk/models/send_contact_request.py +99 -0
  51. one_msg_sdk/models/send_contact_request_contacts_inner.py +117 -0
  52. one_msg_sdk/models/send_contact_request_contacts_inner_name.py +99 -0
  53. one_msg_sdk/models/send_contact_request_contacts_inner_org.py +93 -0
  54. one_msg_sdk/models/send_contact_request_contacts_inner_phones_inner.py +93 -0
  55. one_msg_sdk/models/send_cta_url_request.py +116 -0
  56. one_msg_sdk/models/send_file_request.py +129 -0
  57. one_msg_sdk/models/send_flow_request1.py +141 -0
  58. one_msg_sdk/models/send_flow_request1_header.py +144 -0
  59. one_msg_sdk/models/send_flow_request_header.py +144 -0
  60. one_msg_sdk/models/send_list_request.py +105 -0
  61. one_msg_sdk/models/send_list_request_sections_inner.py +99 -0
  62. one_msg_sdk/models/send_list_request_sections_inner_rows_inner.py +93 -0
  63. one_msg_sdk/models/send_location_request1.py +101 -0
  64. one_msg_sdk/models/send_location_request_request.py +91 -0
  65. one_msg_sdk/models/send_message_request.py +122 -0
  66. one_msg_sdk/models/send_order_details_request.py +128 -0
  67. one_msg_sdk/models/send_order_details_request_language.py +104 -0
  68. one_msg_sdk/models/send_order_details_request_order.py +124 -0
  69. one_msg_sdk/models/send_order_details_request_order_items_inner.py +112 -0
  70. one_msg_sdk/models/send_order_details_request_order_items_inner_amount.py +104 -0
  71. one_msg_sdk/models/send_payment_request_request.py +117 -0
  72. one_msg_sdk/models/send_reaction_request.py +93 -0
  73. one_msg_sdk/models/send_sticker_request.py +110 -0
  74. one_msg_sdk/models/send_template_request.py +107 -0
  75. one_msg_sdk/models/send_template_request_language.py +91 -0
  76. one_msg_sdk/models/set_whatsapp_business_encryption_request.py +89 -0
  77. one_msg_sdk/models/success_response.py +102 -0
  78. one_msg_sdk/models/update_me_request.py +114 -0
  79. one_msg_sdk/py.typed +0 -0
  80. one_msg_sdk/rest.py +264 -0
  81. one_msg_sdk-1.0.0.dist-info/METADATA +19 -0
  82. one_msg_sdk-1.0.0.dist-info/RECORD +85 -0
  83. one_msg_sdk-1.0.0.dist-info/WHEEL +5 -0
  84. one_msg_sdk-1.0.0.dist-info/licenses/LICENSE +21 -0
  85. one_msg_sdk-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,144 @@
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 json
18
+ import pprint
19
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
20
+ from typing import Any, Dict, List, Optional
21
+ from pydantic import StrictStr, Field
22
+ from typing import Union, List, Set, Optional, Dict
23
+ from typing_extensions import Literal, Self
24
+
25
+ SENDFLOWREQUEST1HEADER_ONE_OF_SCHEMAS = ["object", "str"]
26
+
27
+ class SendFlowRequest1Header(BaseModel):
28
+ """
29
+ SendFlowRequest1Header
30
+ """
31
+ # data type: str
32
+ oneof_schema_1_validator: Optional[StrictStr] = None
33
+ # data type: object
34
+ oneof_schema_2_validator: Optional[Dict[str, Any]] = None
35
+ actual_instance: Optional[Union[object, str]] = None
36
+ one_of_schemas: Set[str] = { "object", "str" }
37
+
38
+ model_config = ConfigDict(
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def __init__(self, *args, **kwargs) -> None:
45
+ if args:
46
+ if len(args) > 1:
47
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
48
+ if kwargs:
49
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
50
+ super().__init__(actual_instance=args[0])
51
+ else:
52
+ super().__init__(**kwargs)
53
+
54
+ @field_validator('actual_instance')
55
+ def actual_instance_must_validate_oneof(cls, v):
56
+ instance = SendFlowRequest1Header.model_construct()
57
+ error_messages = []
58
+ match = 0
59
+ # validate data type: str
60
+ try:
61
+ instance.oneof_schema_1_validator = v
62
+ match += 1
63
+ except (ValidationError, ValueError) as e:
64
+ error_messages.append(str(e))
65
+ # validate data type: object
66
+ try:
67
+ instance.oneof_schema_2_validator = v
68
+ match += 1
69
+ except (ValidationError, ValueError) as e:
70
+ error_messages.append(str(e))
71
+ if match > 1:
72
+ # more than 1 match
73
+ raise ValueError("Multiple matches found when setting `actual_instance` in SendFlowRequest1Header with oneOf schemas: object, str. Details: " + ", ".join(error_messages))
74
+ elif match == 0:
75
+ # no match
76
+ raise ValueError("No match found when setting `actual_instance` in SendFlowRequest1Header with oneOf schemas: object, str. Details: " + ", ".join(error_messages))
77
+ else:
78
+ return v
79
+
80
+ @classmethod
81
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
82
+ return cls.from_json(json.dumps(obj))
83
+
84
+ @classmethod
85
+ def from_json(cls, json_str: str) -> Self:
86
+ """Returns the object represented by the json string"""
87
+ instance = cls.model_construct()
88
+ error_messages = []
89
+ match = 0
90
+
91
+ # deserialize data into str
92
+ try:
93
+ # validation
94
+ instance.oneof_schema_1_validator = json.loads(json_str)
95
+ # assign value to actual_instance
96
+ instance.actual_instance = instance.oneof_schema_1_validator
97
+ match += 1
98
+ except (ValidationError, ValueError) as e:
99
+ error_messages.append(str(e))
100
+ # deserialize data into object
101
+ try:
102
+ # validation
103
+ instance.oneof_schema_2_validator = json.loads(json_str)
104
+ # assign value to actual_instance
105
+ instance.actual_instance = instance.oneof_schema_2_validator
106
+ match += 1
107
+ except (ValidationError, ValueError) as e:
108
+ error_messages.append(str(e))
109
+
110
+ if match > 1:
111
+ # more than 1 match
112
+ raise ValueError("Multiple matches found when deserializing the JSON string into SendFlowRequest1Header with oneOf schemas: object, str. Details: " + ", ".join(error_messages))
113
+ elif match == 0:
114
+ # no match
115
+ raise ValueError("No match found when deserializing the JSON string into SendFlowRequest1Header with oneOf schemas: object, str. Details: " + ", ".join(error_messages))
116
+ else:
117
+ return instance
118
+
119
+ def to_json(self) -> str:
120
+ """Returns the JSON representation of the actual instance"""
121
+ if self.actual_instance is None:
122
+ return "null"
123
+
124
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
125
+ return self.actual_instance.to_json()
126
+ else:
127
+ return json.dumps(self.actual_instance)
128
+
129
+ def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]:
130
+ """Returns the dict representation of the actual instance"""
131
+ if self.actual_instance is None:
132
+ return None
133
+
134
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
135
+ return self.actual_instance.to_dict()
136
+ else:
137
+ # primitive type
138
+ return self.actual_instance
139
+
140
+ def to_str(self) -> str:
141
+ """Returns the string representation of the actual instance"""
142
+ return pprint.pformat(self.model_dump())
143
+
144
+
@@ -0,0 +1,144 @@
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 json
18
+ import pprint
19
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
20
+ from typing import Any, Dict, List, Optional
21
+ from pydantic import StrictStr, Field
22
+ from typing import Union, List, Set, Optional, Dict
23
+ from typing_extensions import Literal, Self
24
+
25
+ SENDFLOWREQUESTHEADER_ONE_OF_SCHEMAS = ["object", "str"]
26
+
27
+ class SendFlowRequestHeader(BaseModel):
28
+ """
29
+ Flow header (string or text header object)
30
+ """
31
+ # data type: str
32
+ oneof_schema_1_validator: Optional[StrictStr] = None
33
+ # data type: object
34
+ oneof_schema_2_validator: Optional[Dict[str, Any]] = None
35
+ actual_instance: Optional[Union[object, str]] = None
36
+ one_of_schemas: Set[str] = { "object", "str" }
37
+
38
+ model_config = ConfigDict(
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def __init__(self, *args, **kwargs) -> None:
45
+ if args:
46
+ if len(args) > 1:
47
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
48
+ if kwargs:
49
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
50
+ super().__init__(actual_instance=args[0])
51
+ else:
52
+ super().__init__(**kwargs)
53
+
54
+ @field_validator('actual_instance')
55
+ def actual_instance_must_validate_oneof(cls, v):
56
+ instance = SendFlowRequestHeader.model_construct()
57
+ error_messages = []
58
+ match = 0
59
+ # validate data type: str
60
+ try:
61
+ instance.oneof_schema_1_validator = v
62
+ match += 1
63
+ except (ValidationError, ValueError) as e:
64
+ error_messages.append(str(e))
65
+ # validate data type: object
66
+ try:
67
+ instance.oneof_schema_2_validator = v
68
+ match += 1
69
+ except (ValidationError, ValueError) as e:
70
+ error_messages.append(str(e))
71
+ if match > 1:
72
+ # more than 1 match
73
+ raise ValueError("Multiple matches found when setting `actual_instance` in SendFlowRequestHeader with oneOf schemas: object, str. Details: " + ", ".join(error_messages))
74
+ elif match == 0:
75
+ # no match
76
+ raise ValueError("No match found when setting `actual_instance` in SendFlowRequestHeader with oneOf schemas: object, str. Details: " + ", ".join(error_messages))
77
+ else:
78
+ return v
79
+
80
+ @classmethod
81
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
82
+ return cls.from_json(json.dumps(obj))
83
+
84
+ @classmethod
85
+ def from_json(cls, json_str: str) -> Self:
86
+ """Returns the object represented by the json string"""
87
+ instance = cls.model_construct()
88
+ error_messages = []
89
+ match = 0
90
+
91
+ # deserialize data into str
92
+ try:
93
+ # validation
94
+ instance.oneof_schema_1_validator = json.loads(json_str)
95
+ # assign value to actual_instance
96
+ instance.actual_instance = instance.oneof_schema_1_validator
97
+ match += 1
98
+ except (ValidationError, ValueError) as e:
99
+ error_messages.append(str(e))
100
+ # deserialize data into object
101
+ try:
102
+ # validation
103
+ instance.oneof_schema_2_validator = json.loads(json_str)
104
+ # assign value to actual_instance
105
+ instance.actual_instance = instance.oneof_schema_2_validator
106
+ match += 1
107
+ except (ValidationError, ValueError) as e:
108
+ error_messages.append(str(e))
109
+
110
+ if match > 1:
111
+ # more than 1 match
112
+ raise ValueError("Multiple matches found when deserializing the JSON string into SendFlowRequestHeader with oneOf schemas: object, str. Details: " + ", ".join(error_messages))
113
+ elif match == 0:
114
+ # no match
115
+ raise ValueError("No match found when deserializing the JSON string into SendFlowRequestHeader with oneOf schemas: object, str. Details: " + ", ".join(error_messages))
116
+ else:
117
+ return instance
118
+
119
+ def to_json(self) -> str:
120
+ """Returns the JSON representation of the actual instance"""
121
+ if self.actual_instance is None:
122
+ return "null"
123
+
124
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
125
+ return self.actual_instance.to_json()
126
+ else:
127
+ return json.dumps(self.actual_instance)
128
+
129
+ def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]:
130
+ """Returns the dict representation of the actual instance"""
131
+ if self.actual_instance is None:
132
+ return None
133
+
134
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
135
+ return self.actual_instance.to_dict()
136
+ else:
137
+ # primitive type
138
+ return self.actual_instance
139
+
140
+ def to_str(self) -> str:
141
+ """Returns the string representation of the actual instance"""
142
+ return pprint.pformat(self.model_dump())
143
+
144
+
@@ -0,0 +1,105 @@
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 one_msg_sdk.models.send_list_request_sections_inner import SendListRequestSectionsInner
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
27
+
28
+ class SendListRequest(BaseModel):
29
+ """
30
+ SendListRequest
31
+ """ # noqa: E501
32
+ phone: Optional[StrictStr] = None
33
+ body: Optional[StrictStr] = None
34
+ button_text: Optional[StrictStr] = Field(default=None, alias="buttonText")
35
+ action: Optional[StrictStr] = None
36
+ sections: Optional[List[SendListRequestSectionsInner]] = None
37
+ __properties: ClassVar[List[str]] = ["phone", "body", "buttonText", "action", "sections"]
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 SendListRequest 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
+ """
70
+ excluded_fields: Set[str] = set([
71
+ ])
72
+
73
+ _dict = self.model_dump(
74
+ by_alias=True,
75
+ exclude=excluded_fields,
76
+ exclude_none=True,
77
+ )
78
+ # override the default output from pydantic by calling `to_dict()` of each item in sections (list)
79
+ _items = []
80
+ if self.sections:
81
+ for _item_sections in self.sections:
82
+ if _item_sections:
83
+ _items.append(_item_sections.to_dict())
84
+ _dict['sections'] = _items
85
+ return _dict
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
+ """Create an instance of SendListRequest 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
+ "body": obj.get("body"),
99
+ "buttonText": obj.get("buttonText"),
100
+ "action": obj.get("action"),
101
+ "sections": [SendListRequestSectionsInner.from_dict(_item) for _item in obj["sections"]] if obj.get("sections") is not None else None
102
+ })
103
+ return _obj
104
+
105
+
@@ -0,0 +1,99 @@
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 one_msg_sdk.models.send_list_request_sections_inner_rows_inner import SendListRequestSectionsInnerRowsInner
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
27
+
28
+ class SendListRequestSectionsInner(BaseModel):
29
+ """
30
+ SendListRequestSectionsInner
31
+ """ # noqa: E501
32
+ title: Optional[StrictStr] = None
33
+ rows: Optional[List[SendListRequestSectionsInnerRowsInner]] = None
34
+ __properties: ClassVar[List[str]] = ["title", "rows"]
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 SendListRequestSectionsInner 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
+ # override the default output from pydantic by calling `to_dict()` of each item in rows (list)
76
+ _items = []
77
+ if self.rows:
78
+ for _item_rows in self.rows:
79
+ if _item_rows:
80
+ _items.append(_item_rows.to_dict())
81
+ _dict['rows'] = _items
82
+ return _dict
83
+
84
+ @classmethod
85
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
86
+ """Create an instance of SendListRequestSectionsInner 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
+ "title": obj.get("title"),
95
+ "rows": [SendListRequestSectionsInnerRowsInner.from_dict(_item) for _item in obj["rows"]] if obj.get("rows") is not None else None
96
+ })
97
+ return _obj
98
+
99
+
@@ -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, 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 SendListRequestSectionsInnerRowsInner(BaseModel):
28
+ """
29
+ SendListRequestSectionsInnerRowsInner
30
+ """ # noqa: E501
31
+ id: Optional[StrictStr] = None
32
+ title: Optional[StrictStr] = None
33
+ description: Optional[StrictStr] = None
34
+ __properties: ClassVar[List[str]] = ["id", "title", "description"]
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 SendListRequestSectionsInnerRowsInner 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 SendListRequestSectionsInnerRowsInner 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
+ "id": obj.get("id"),
88
+ "title": obj.get("title"),
89
+ "description": obj.get("description")
90
+ })
91
+ return _obj
92
+
93
+
@@ -0,0 +1,101 @@
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 SendLocationRequest1(BaseModel):
28
+ """
29
+ SendLocationRequest1
30
+ """ # noqa: E501
31
+ lat: StrictStr
32
+ lng: StrictStr
33
+ address: Optional[StrictStr] = None
34
+ name: Optional[StrictStr] = None
35
+ quoted_msg_id: Optional[StrictStr] = Field(default=None, alias="quotedMsgId")
36
+ chat_id: Optional[StrictStr] = Field(default=None, alias="chatId")
37
+ phone: Optional[StrictInt] = None
38
+ __properties: ClassVar[List[str]] = ["lat", "lng", "address", "name", "quotedMsgId", "chatId", "phone"]
39
+
40
+ model_config = ConfigDict(
41
+ validate_by_name=True,
42
+ validate_by_alias=True,
43
+ validate_assignment=True,
44
+ protected_namespaces=(),
45
+ )
46
+
47
+
48
+ def to_str(self) -> str:
49
+ """Returns the string representation of the model using alias"""
50
+ return pprint.pformat(self.model_dump(by_alias=True))
51
+
52
+ def to_json(self) -> str:
53
+ """Returns the JSON representation of the model using alias"""
54
+ return json.dumps(to_jsonable_python(self.to_dict()))
55
+
56
+ @classmethod
57
+ def from_json(cls, json_str: str) -> Optional[Self]:
58
+ """Create an instance of SendLocationRequest1 from a JSON string"""
59
+ return cls.from_dict(json.loads(json_str))
60
+
61
+ def to_dict(self) -> Dict[str, Any]:
62
+ """Return the dictionary representation of the model using alias.
63
+
64
+ This has the following differences from calling pydantic's
65
+ `self.model_dump(by_alias=True)`:
66
+
67
+ * `None` is only added to the output dict for nullable fields that
68
+ were set at model initialization. Other fields with value `None`
69
+ are ignored.
70
+ """
71
+ excluded_fields: Set[str] = set([
72
+ ])
73
+
74
+ _dict = self.model_dump(
75
+ by_alias=True,
76
+ exclude=excluded_fields,
77
+ exclude_none=True,
78
+ )
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of SendLocationRequest1 from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "lat": obj.get("lat"),
92
+ "lng": obj.get("lng"),
93
+ "address": obj.get("address"),
94
+ "name": obj.get("name"),
95
+ "quotedMsgId": obj.get("quotedMsgId"),
96
+ "chatId": obj.get("chatId"),
97
+ "phone": obj.get("phone")
98
+ })
99
+ return _obj
100
+
101
+