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,89 @@
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 CreateReadMessage401Response(BaseModel):
28
+ """
29
+ CreateReadMessage401Response
30
+ """ # noqa: E501
31
+ error: Optional[StrictStr] = None
32
+ __properties: ClassVar[List[str]] = ["error"]
33
+
34
+ model_config = ConfigDict(
35
+ validate_by_name=True,
36
+ validate_by_alias=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
+ return json.dumps(to_jsonable_python(self.to_dict()))
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of CreateReadMessage401Response from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ return _dict
74
+
75
+ @classmethod
76
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
+ """Create an instance of CreateReadMessage401Response from a dict"""
78
+ if obj is None:
79
+ return None
80
+
81
+ if not isinstance(obj, dict):
82
+ return cls.model_validate(obj)
83
+
84
+ _obj = cls.model_validate({
85
+ "error": obj.get("error")
86
+ })
87
+ return _obj
88
+
89
+
@@ -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, StrictBool, 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 CreateReadMessageRequest(BaseModel):
28
+ """
29
+ CreateReadMessageRequest
30
+ """ # noqa: E501
31
+ message_id: Optional[StrictStr] = Field(default=None, alias="messageId")
32
+ msg_id: Optional[StrictStr] = Field(default=None, alias="msgId")
33
+ typing_indicator: Optional[StrictBool] = Field(default=False, description="Show WhatsApp typing indicator (max 25s or until reply)", alias="typingIndicator")
34
+ __properties: ClassVar[List[str]] = ["messageId", "msgId", "typingIndicator"]
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 CreateReadMessageRequest 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 CreateReadMessageRequest 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
+ "messageId": obj.get("messageId"),
88
+ "msgId": obj.get("msgId"),
89
+ "typingIndicator": obj.get("typingIndicator") if obj.get("typingIndicator") is not None else False
90
+ })
91
+ return _obj
92
+
93
+
@@ -0,0 +1,109 @@
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
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 DeleteFlowsFlowId200Response(BaseModel):
28
+ """
29
+ DeleteFlowsFlowId200Response
30
+ """ # noqa: E501
31
+ success: Optional[StrictBool] = None
32
+ error: Optional[Any] = Field(default=None, description="Error details returned by the provider. May be a string or a JSON object.")
33
+ additional_properties: Dict[str, Any] = {}
34
+ __properties: ClassVar[List[str]] = ["success", "error"]
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 DeleteFlowsFlowId200Response 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
+ # set to None if error (nullable) is None
83
+ # and model_fields_set contains the field
84
+ if self.error is None and "error" in self.model_fields_set:
85
+ _dict['error'] = None
86
+
87
+ return _dict
88
+
89
+ @classmethod
90
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
91
+ """Create an instance of DeleteFlowsFlowId200Response from a dict"""
92
+ if obj is None:
93
+ return None
94
+
95
+ if not isinstance(obj, dict):
96
+ return cls.model_validate(obj)
97
+
98
+ _obj = cls.model_validate({
99
+ "success": obj.get("success"),
100
+ "error": obj.get("error")
101
+ })
102
+ # store additional fields in additional_properties
103
+ for _key in obj.keys():
104
+ if _key not in cls.__properties:
105
+ _obj.additional_properties[_key] = obj.get(_key)
106
+
107
+ return _obj
108
+
109
+
@@ -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, StrictBool
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 DeleteGroupsGroupId200Response(BaseModel):
28
+ """
29
+ DeleteGroupsGroupId200Response
30
+ """ # noqa: E501
31
+ success: Optional[StrictBool] = None
32
+ response: Optional[Dict[str, Any]] = None
33
+ additional_properties: Dict[str, Any] = {}
34
+ __properties: ClassVar[List[str]] = ["success", "response"]
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 DeleteGroupsGroupId200Response 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 DeleteGroupsGroupId200Response 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
+ "success": obj.get("success"),
95
+ "response": obj.get("response")
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,102 @@
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
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+ from pydantic_core import to_jsonable_python
26
+
27
+ class DeleteMediaLegacyRequest(BaseModel):
28
+ """
29
+ DeleteMediaLegacyRequest
30
+ """ # noqa: E501
31
+ media_id: StrictStr = Field(description="Numeric WABA media id", alias="mediaId")
32
+ additional_properties: Dict[str, Any] = {}
33
+ __properties: ClassVar[List[str]] = ["mediaId"]
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 DeleteMediaLegacyRequest 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
+ * Fields in `self.additional_properties` are added to the output dict.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ "additional_properties",
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ # puts key-value pairs in additional_properties in the top level
77
+ if self.additional_properties is not None:
78
+ for _key, _value in self.additional_properties.items():
79
+ _dict[_key] = _value
80
+
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of DeleteMediaLegacyRequest from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "mediaId": obj.get("mediaId")
94
+ })
95
+ # store additional fields in additional_properties
96
+ for _key in obj.keys():
97
+ if _key not in cls.__properties:
98
+ _obj.additional_properties[_key] = obj.get(_key)
99
+
100
+ return _obj
101
+
102
+
@@ -0,0 +1,89 @@
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 ErrorResponse(BaseModel):
28
+ """
29
+ Standard error response
30
+ """ # noqa: E501
31
+ error: Optional[StrictStr] = Field(default=None, description="Error message")
32
+ __properties: ClassVar[List[str]] = ["error"]
33
+
34
+ model_config = ConfigDict(
35
+ validate_by_name=True,
36
+ validate_by_alias=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
+ return json.dumps(to_jsonable_python(self.to_dict()))
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of ErrorResponse from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ return _dict
74
+
75
+ @classmethod
76
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
+ """Create an instance of ErrorResponse from a dict"""
78
+ if obj is None:
79
+ return None
80
+
81
+ if not isinstance(obj, dict):
82
+ return cls.model_validate(obj)
83
+
84
+ _obj = cls.model_validate({
85
+ "error": obj.get("error")
86
+ })
87
+ return _obj
88
+
89
+
@@ -0,0 +1,106 @@
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, 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 GetCommerce200ResponseInner(BaseModel):
28
+ """
29
+ GetCommerce200ResponseInner
30
+ """ # noqa: E501
31
+ id: Optional[StrictStr] = Field(default=None, description="Catalog id")
32
+ is_cart_enabled: Optional[StrictBool] = Field(default=None, description="Whether the cart is enabled")
33
+ is_catalog_visible: Optional[StrictBool] = Field(default=None, description="Whether the catalog storefront icon is shown")
34
+ additional_properties: Dict[str, Any] = {}
35
+ __properties: ClassVar[List[str]] = ["id", "is_cart_enabled", "is_catalog_visible"]
36
+
37
+ model_config = ConfigDict(
38
+ validate_by_name=True,
39
+ validate_by_alias=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
+ return json.dumps(to_jsonable_python(self.to_dict()))
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of GetCommerce200ResponseInner from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ * Fields in `self.additional_properties` are added to the output dict.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ "additional_properties",
71
+ ])
72
+
73
+ _dict = self.model_dump(
74
+ by_alias=True,
75
+ exclude=excluded_fields,
76
+ exclude_none=True,
77
+ )
78
+ # puts key-value pairs in additional_properties in the top level
79
+ if self.additional_properties is not None:
80
+ for _key, _value in self.additional_properties.items():
81
+ _dict[_key] = _value
82
+
83
+ return _dict
84
+
85
+ @classmethod
86
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
87
+ """Create an instance of GetCommerce200ResponseInner from a dict"""
88
+ if obj is None:
89
+ return None
90
+
91
+ if not isinstance(obj, dict):
92
+ return cls.model_validate(obj)
93
+
94
+ _obj = cls.model_validate({
95
+ "id": obj.get("id"),
96
+ "is_cart_enabled": obj.get("is_cart_enabled"),
97
+ "is_catalog_visible": obj.get("is_catalog_visible")
98
+ })
99
+ # store additional fields in additional_properties
100
+ for _key in obj.keys():
101
+ if _key not in cls.__properties:
102
+ _obj.additional_properties[_key] = obj.get(_key)
103
+
104
+ return _obj
105
+
106
+