Skip to content

Commit 75e8b14

Browse files
committed
[Librarian] Regenerated @ 08245333f4a8c9235d547b189cd9c422f73e0e7e 7bb98153c25ebfee95e6e85bd4c57969e6d02435
1 parent 4168b09 commit 75e8b14

File tree

14 files changed

+1778
-32
lines changed

14 files changed

+1778
-32
lines changed

CHANGES.md

+11
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ twilio-python Changelog
33

44
Here you can see the full list of changes between each twilio-python release.
55

6+
[2024-09-25] Version 9.3.2
7+
--------------------------
8+
**Accounts**
9+
- Update docs and mounts.
10+
- Change library visibility to public
11+
- Enable consent and contact bulk upsert APIs in prod.
12+
13+
**Serverless**
14+
- Add is_plugin parameter in deployments api to check if it is plugins deployment
15+
16+
617
[2024-09-18] Version 9.3.1
718
--------------------------
819
**Library - Chore**

twilio/rest/accounts/v1/__init__.py

+16
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
from twilio.base.version import Version
1717
from twilio.base.domain import Domain
1818
from twilio.rest.accounts.v1.auth_token_promotion import AuthTokenPromotionList
19+
from twilio.rest.accounts.v1.bulk_consents import BulkConsentsList
20+
from twilio.rest.accounts.v1.bulk_contacts import BulkContactsList
1921
from twilio.rest.accounts.v1.credential import CredentialList
2022
from twilio.rest.accounts.v1.safelist import SafelistList
2123
from twilio.rest.accounts.v1.secondary_auth_token import SecondaryAuthTokenList
@@ -31,6 +33,8 @@ def __init__(self, domain: Domain):
3133
"""
3234
super().__init__(domain, "v1")
3335
self._auth_token_promotion: Optional[AuthTokenPromotionList] = None
36+
self._bulk_consents: Optional[BulkConsentsList] = None
37+
self._bulk_contacts: Optional[BulkContactsList] = None
3438
self._credentials: Optional[CredentialList] = None
3539
self._safelist: Optional[SafelistList] = None
3640
self._secondary_auth_token: Optional[SecondaryAuthTokenList] = None
@@ -41,6 +45,18 @@ def auth_token_promotion(self) -> AuthTokenPromotionList:
4145
self._auth_token_promotion = AuthTokenPromotionList(self)
4246
return self._auth_token_promotion
4347

48+
@property
49+
def bulk_consents(self) -> BulkConsentsList:
50+
if self._bulk_consents is None:
51+
self._bulk_consents = BulkConsentsList(self)
52+
return self._bulk_consents
53+
54+
@property
55+
def bulk_contacts(self) -> BulkContactsList:
56+
if self._bulk_contacts is None:
57+
self._bulk_contacts = BulkContactsList(self)
58+
return self._bulk_contacts
59+
4460
@property
4561
def credentials(self) -> CredentialList:
4662
if self._credentials is None:
+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
r"""
2+
This code was generated by
3+
___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4+
| | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5+
| |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6+
7+
Twilio - Accounts
8+
This is the public Twilio REST API.
9+
10+
NOTE: This class is auto generated by OpenAPI Generator.
11+
https://openapi-generator.tech
12+
Do not edit the class manually.
13+
"""
14+
15+
from typing import Any, Dict, List, Optional
16+
from twilio.base import serialize, values
17+
18+
from twilio.base.instance_resource import InstanceResource
19+
from twilio.base.list_resource import ListResource
20+
from twilio.base.version import Version
21+
22+
23+
class BulkConsentsInstance(InstanceResource):
24+
"""
25+
:ivar items: A list of objects where each object represents the result of processing a `correlation_id`. Each object contains the following fields: `correlation_id`, a unique 32-character UUID that maps the response to the original request; `error_code`, an integer where 0 indicates success and any non-zero value represents an error; and `error_messages`, an array of strings describing specific validation errors encountered. If the request is successful, the error_messages array will be empty.
26+
"""
27+
28+
def __init__(self, version: Version, payload: Dict[str, Any]):
29+
super().__init__(version)
30+
31+
self.items: Optional[Dict[str, object]] = payload.get("items")
32+
33+
def __repr__(self) -> str:
34+
"""
35+
Provide a friendly representation
36+
37+
:returns: Machine friendly representation
38+
"""
39+
40+
return "<Twilio.Accounts.V1.BulkConsentsInstance>"
41+
42+
43+
class BulkConsentsList(ListResource):
44+
45+
def __init__(self, version: Version):
46+
"""
47+
Initialize the BulkConsentsList
48+
49+
:param version: Version that contains the resource
50+
51+
"""
52+
super().__init__(version)
53+
54+
self._uri = "/Consents/Bulk"
55+
56+
def create(self, items: List[object]) -> BulkConsentsInstance:
57+
"""
58+
Create the BulkConsentsInstance
59+
60+
:param items: This is a list of objects that describes a contact's opt-in status. Each object contains the following fields: `contact_id`, which must be a string representing phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164); `correlation_id`, a unique 32-character UUID used to uniquely map the request item with the response item; `sender_id`, which can be either a valid messaging service SID or a from phone number; `status`, a string representing the consent status. Can be one of [`opt-in`, `opt-out`]; and `source`, a string indicating the medium through which the consent was collected. Can be one of [`website`, `offline`, `opt-in-message`, `opt-out-message`, `others`].
61+
62+
:returns: The created BulkConsentsInstance
63+
"""
64+
65+
data = values.of(
66+
{
67+
"Items": serialize.map(items, lambda e: serialize.object(e)),
68+
}
69+
)
70+
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})
71+
72+
payload = self._version.create(
73+
method="POST", uri=self._uri, data=data, headers=headers
74+
)
75+
76+
return BulkConsentsInstance(self._version, payload)
77+
78+
async def create_async(self, items: List[object]) -> BulkConsentsInstance:
79+
"""
80+
Asynchronously create the BulkConsentsInstance
81+
82+
:param items: This is a list of objects that describes a contact's opt-in status. Each object contains the following fields: `contact_id`, which must be a string representing phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164); `correlation_id`, a unique 32-character UUID used to uniquely map the request item with the response item; `sender_id`, which can be either a valid messaging service SID or a from phone number; `status`, a string representing the consent status. Can be one of [`opt-in`, `opt-out`]; and `source`, a string indicating the medium through which the consent was collected. Can be one of [`website`, `offline`, `opt-in-message`, `opt-out-message`, `others`].
83+
84+
:returns: The created BulkConsentsInstance
85+
"""
86+
87+
data = values.of(
88+
{
89+
"Items": serialize.map(items, lambda e: serialize.object(e)),
90+
}
91+
)
92+
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})
93+
94+
payload = await self._version.create_async(
95+
method="POST", uri=self._uri, data=data, headers=headers
96+
)
97+
98+
return BulkConsentsInstance(self._version, payload)
99+
100+
def __repr__(self) -> str:
101+
"""
102+
Provide a friendly representation
103+
104+
:returns: Machine friendly representation
105+
"""
106+
return "<Twilio.Accounts.V1.BulkConsentsList>"
+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
r"""
2+
This code was generated by
3+
___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4+
| | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5+
| |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6+
7+
Twilio - Accounts
8+
This is the public Twilio REST API.
9+
10+
NOTE: This class is auto generated by OpenAPI Generator.
11+
https://openapi-generator.tech
12+
Do not edit the class manually.
13+
"""
14+
15+
from typing import Any, Dict, List, Optional
16+
from twilio.base import serialize, values
17+
18+
from twilio.base.instance_resource import InstanceResource
19+
from twilio.base.list_resource import ListResource
20+
from twilio.base.version import Version
21+
22+
23+
class BulkContactsInstance(InstanceResource):
24+
"""
25+
:ivar items: A list of objects where each object represents the result of processing a `correlation_id`. Each object contains the following fields: `correlation_id`, a unique 32-character UUID that maps the response to the original request; `error_code`, an integer where 0 indicates success and any non-zero value represents an error; and `error_messages`, an array of strings describing specific validation errors encountered. If the request is successful, the error_messages array will be empty.
26+
"""
27+
28+
def __init__(self, version: Version, payload: Dict[str, Any]):
29+
super().__init__(version)
30+
31+
self.items: Optional[Dict[str, object]] = payload.get("items")
32+
33+
def __repr__(self) -> str:
34+
"""
35+
Provide a friendly representation
36+
37+
:returns: Machine friendly representation
38+
"""
39+
40+
return "<Twilio.Accounts.V1.BulkContactsInstance>"
41+
42+
43+
class BulkContactsList(ListResource):
44+
45+
def __init__(self, version: Version):
46+
"""
47+
Initialize the BulkContactsList
48+
49+
:param version: Version that contains the resource
50+
51+
"""
52+
super().__init__(version)
53+
54+
self._uri = "/Contacts/Bulk"
55+
56+
def create(self, items: List[object]) -> BulkContactsInstance:
57+
"""
58+
Create the BulkContactsInstance
59+
60+
:param items: A list of objects where each object represents a contact's details. Each object includes the following fields: `contact_id`, which must be a string representing phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164); `correlation_id`, a unique 32-character UUID that maps the response to the original request; `country_iso_code`, a string representing the country using the ISO format (e.g., US for the United States); and `zip_code`, a string representing the postal code.
61+
62+
:returns: The created BulkContactsInstance
63+
"""
64+
65+
data = values.of(
66+
{
67+
"Items": serialize.map(items, lambda e: serialize.object(e)),
68+
}
69+
)
70+
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})
71+
72+
payload = self._version.create(
73+
method="POST", uri=self._uri, data=data, headers=headers
74+
)
75+
76+
return BulkContactsInstance(self._version, payload)
77+
78+
async def create_async(self, items: List[object]) -> BulkContactsInstance:
79+
"""
80+
Asynchronously create the BulkContactsInstance
81+
82+
:param items: A list of objects where each object represents a contact's details. Each object includes the following fields: `contact_id`, which must be a string representing phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164); `correlation_id`, a unique 32-character UUID that maps the response to the original request; `country_iso_code`, a string representing the country using the ISO format (e.g., US for the United States); and `zip_code`, a string representing the postal code.
83+
84+
:returns: The created BulkContactsInstance
85+
"""
86+
87+
data = values.of(
88+
{
89+
"Items": serialize.map(items, lambda e: serialize.object(e)),
90+
}
91+
)
92+
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})
93+
94+
payload = await self._version.create_async(
95+
method="POST", uri=self._uri, data=data, headers=headers
96+
)
97+
98+
return BulkContactsInstance(self._version, payload)
99+
100+
def __repr__(self) -> str:
101+
"""
102+
Provide a friendly representation
103+
104+
:returns: Machine friendly representation
105+
"""
106+
return "<Twilio.Accounts.V1.BulkContactsList>"

twilio/rest/assistants/v1/assistant/__init__.py

+67
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@
2020
from twilio.base.list_resource import ListResource
2121
from twilio.base.version import Version
2222
from twilio.base.page import Page
23+
from twilio.rest.assistants.v1.assistant.assistants_knowledge import (
24+
AssistantsKnowledgeList,
25+
)
26+
from twilio.rest.assistants.v1.assistant.assistants_tool import AssistantsToolList
2327
from twilio.rest.assistants.v1.assistant.feedback import FeedbackList
28+
from twilio.rest.assistants.v1.assistant.message import MessageList
2429

2530

2631
class AssistantInstance(InstanceResource):
@@ -31,6 +36,7 @@ class AssistantInstance(InstanceResource):
3136
:ivar model: The default model used by the assistant.
3237
:ivar name: The name of the assistant.
3338
:ivar owner: The owner/company of the assistant.
39+
:ivar url: The url of the assistant resource.
3440
:ivar personality_prompt: The personality prompt to be used for assistant.
3541
:ivar date_created: The date and time in GMT when the Assistant was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
3642
:ivar date_updated: The date and time in GMT when the Assistant was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
@@ -49,6 +55,7 @@ def __init__(
4955
self.model: Optional[str] = payload.get("model")
5056
self.name: Optional[str] = payload.get("name")
5157
self.owner: Optional[str] = payload.get("owner")
58+
self.url: Optional[str] = payload.get("url")
5259
self.personality_prompt: Optional[str] = payload.get("personality_prompt")
5360
self.date_created: Optional[datetime] = deserialize.iso8601_datetime(
5461
payload.get("date_created")
@@ -149,13 +156,34 @@ async def update_async(
149156
assistants_v1_service_update_assistant_request=assistants_v1_service_update_assistant_request,
150157
)
151158

159+
@property
160+
def assistants_knowledge(self) -> AssistantsKnowledgeList:
161+
"""
162+
Access the assistants_knowledge
163+
"""
164+
return self._proxy.assistants_knowledge
165+
166+
@property
167+
def assistants_tools(self) -> AssistantsToolList:
168+
"""
169+
Access the assistants_tools
170+
"""
171+
return self._proxy.assistants_tools
172+
152173
@property
153174
def feedbacks(self) -> FeedbackList:
154175
"""
155176
Access the feedbacks
156177
"""
157178
return self._proxy.feedbacks
158179

180+
@property
181+
def messages(self) -> MessageList:
182+
"""
183+
Access the messages
184+
"""
185+
return self._proxy.messages
186+
159187
def __repr__(self) -> str:
160188
"""
161189
Provide a friendly representation
@@ -183,7 +211,10 @@ def __init__(self, version: Version, id: str):
183211
}
184212
self._uri = "/Assistants/{id}".format(**self._solution)
185213

214+
self._assistants_knowledge: Optional[AssistantsKnowledgeList] = None
215+
self._assistants_tools: Optional[AssistantsToolList] = None
186216
self._feedbacks: Optional[FeedbackList] = None
217+
self._messages: Optional[MessageList] = None
187218

188219
def delete(self) -> bool:
189220
"""
@@ -299,6 +330,30 @@ async def update_async(
299330

300331
return AssistantInstance(self._version, payload, id=self._solution["id"])
301332

333+
@property
334+
def assistants_knowledge(self) -> AssistantsKnowledgeList:
335+
"""
336+
Access the assistants_knowledge
337+
"""
338+
if self._assistants_knowledge is None:
339+
self._assistants_knowledge = AssistantsKnowledgeList(
340+
self._version,
341+
self._solution["id"],
342+
)
343+
return self._assistants_knowledge
344+
345+
@property
346+
def assistants_tools(self) -> AssistantsToolList:
347+
"""
348+
Access the assistants_tools
349+
"""
350+
if self._assistants_tools is None:
351+
self._assistants_tools = AssistantsToolList(
352+
self._version,
353+
self._solution["id"],
354+
)
355+
return self._assistants_tools
356+
302357
@property
303358
def feedbacks(self) -> FeedbackList:
304359
"""
@@ -311,6 +366,18 @@ def feedbacks(self) -> FeedbackList:
311366
)
312367
return self._feedbacks
313368

369+
@property
370+
def messages(self) -> MessageList:
371+
"""
372+
Access the messages
373+
"""
374+
if self._messages is None:
375+
self._messages = MessageList(
376+
self._version,
377+
self._solution["id"],
378+
)
379+
return self._messages
380+
314381
def __repr__(self) -> str:
315382
"""
316383
Provide a friendly representation

0 commit comments

Comments
 (0)