Skip to content

Commit a72ada6

Browse files
committed
[Librarian] Regenerated @ 8d92bd85f8ef40c37285966629e30e5c7cb9312b e615ab0d23ebf4a44fbefcca67df047f8de43ea5
1 parent da6aa6b commit a72ada6

File tree

16 files changed

+4962
-233
lines changed

16 files changed

+4962
-233
lines changed

CHANGES.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@ twilio-python Changelog
33

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

6+
[2025-05-29] Version 9.6.2
7+
--------------------------
8+
**Library - Chore**
9+
- [PR #862](https://github.com/twilio/twilio-python/pull/862): update iam token endpoint. Thanks to [@manisha1997](https://github.com/manisha1997)!
10+
11+
**Api**
12+
- Added several usage category enums to `usage_record` API
13+
14+
**Numbers**
15+
- Update the porting documentation
16+
17+
**Verify**
18+
- Update `ienum` type for Channels in Verify Attempts API
19+
20+
621
[2025-05-13] Version 9.6.1
722
--------------------------
823
**Accounts**

twilio/rest/api/v2010/account/usage/record/__init__.py

Lines changed: 491 additions & 5 deletions
Large diffs are not rendered by default.

twilio/rest/api/v2010/account/usage/record/all_time.py

Lines changed: 491 additions & 5 deletions
Large diffs are not rendered by default.

twilio/rest/api/v2010/account/usage/record/daily.py

Lines changed: 491 additions & 5 deletions
Large diffs are not rendered by default.

twilio/rest/api/v2010/account/usage/record/last_month.py

Lines changed: 491 additions & 5 deletions
Large diffs are not rendered by default.

twilio/rest/api/v2010/account/usage/record/monthly.py

Lines changed: 491 additions & 5 deletions
Large diffs are not rendered by default.

twilio/rest/api/v2010/account/usage/record/this_month.py

Lines changed: 491 additions & 5 deletions
Large diffs are not rendered by default.

twilio/rest/api/v2010/account/usage/record/today.py

Lines changed: 491 additions & 5 deletions
Large diffs are not rendered by default.

twilio/rest/api/v2010/account/usage/record/yearly.py

Lines changed: 491 additions & 5 deletions
Large diffs are not rendered by default.

twilio/rest/api/v2010/account/usage/record/yesterday.py

Lines changed: 491 additions & 5 deletions
Large diffs are not rendered by default.

twilio/rest/api/v2010/account/usage/trigger.py

Lines changed: 491 additions & 5 deletions
Large diffs are not rendered by default.

twilio/rest/messaging/v2/channels_sender.py

Lines changed: 12 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -68,67 +68,21 @@ def __init__(self, payload: Dict[str, Any]):
6868
self.about: Optional[str] = payload.get("about")
6969
self.address: Optional[str] = payload.get("address")
7070
self.description: Optional[str] = payload.get("description")
71-
self.emails: Optional[
72-
List[ChannelsSenderList.MessagingV2ChannelsSenderProfileEmails]
73-
] = payload.get("emails")
71+
self.emails: Optional[Dict[str, object]] = payload.get("emails")
7472
self.logo_url: Optional[str] = payload.get("logo_url")
7573
self.vertical: Optional[str] = payload.get("vertical")
76-
self.websites: Optional[
77-
List[ChannelsSenderList.MessagingV2ChannelsSenderProfileWebsites]
78-
] = payload.get("websites")
74+
self.websites: Optional[Dict[str, object]] = payload.get("websites")
7975

8076
def to_dict(self):
8177
return {
8278
"name": self.name,
8379
"about": self.about,
8480
"address": self.address,
8581
"description": self.description,
86-
"emails": (
87-
[emails.to_dict() for emails in self.emails]
88-
if self.emails is not None
89-
else None
90-
),
82+
"emails": self.emails,
9183
"logo_url": self.logo_url,
9284
"vertical": self.vertical,
93-
"websites": (
94-
[websites.to_dict() for websites in self.websites]
95-
if self.websites is not None
96-
else None
97-
),
98-
}
99-
100-
class MessagingV2ChannelsSenderProfileEmails(object):
101-
"""
102-
:ivar email: The email of the sender.
103-
:ivar label: The label of the sender.
104-
"""
105-
106-
def __init__(self, payload: Dict[str, Any]):
107-
108-
self.email: Optional[str] = payload.get("email")
109-
self.label: Optional[str] = payload.get("label")
110-
111-
def to_dict(self):
112-
return {
113-
"email": self.email,
114-
"label": self.label,
115-
}
116-
117-
class MessagingV2ChannelsSenderProfileWebsites(object):
118-
"""
119-
:ivar label: The label of the sender.
120-
:ivar website: The website of the sender.
121-
"""
122-
123-
def __init__(self, payload: Dict[str, Any]):
124-
125-
self.label: Optional[str] = payload.get("label")
126-
self.website: Optional[str] = payload.get("website")
127-
128-
def to_dict(self):
129-
return {
130-
"label": self.label,
131-
"website": self.website,
85+
"websites": self.websites,
13286
}
13387

13488
class MessagingV2ChannelsSenderRequestsCreate(object):
@@ -412,67 +366,21 @@ def __init__(self, payload: Dict[str, Any]):
412366
self.about: Optional[str] = payload.get("about")
413367
self.address: Optional[str] = payload.get("address")
414368
self.description: Optional[str] = payload.get("description")
415-
self.emails: Optional[
416-
List[ChannelsSenderList.MessagingV2ChannelsSenderProfileEmails]
417-
] = payload.get("emails")
369+
self.emails: Optional[Dict[str, object]] = payload.get("emails")
418370
self.logo_url: Optional[str] = payload.get("logo_url")
419371
self.vertical: Optional[str] = payload.get("vertical")
420-
self.websites: Optional[
421-
List[ChannelsSenderList.MessagingV2ChannelsSenderProfileWebsites]
422-
] = payload.get("websites")
372+
self.websites: Optional[Dict[str, object]] = payload.get("websites")
423373

424374
def to_dict(self):
425375
return {
426376
"name": self.name,
427377
"about": self.about,
428378
"address": self.address,
429379
"description": self.description,
430-
"emails": (
431-
[emails.to_dict() for emails in self.emails]
432-
if self.emails is not None
433-
else None
434-
),
380+
"emails": self.emails,
435381
"logo_url": self.logo_url,
436382
"vertical": self.vertical,
437-
"websites": (
438-
[websites.to_dict() for websites in self.websites]
439-
if self.websites is not None
440-
else None
441-
),
442-
}
443-
444-
class MessagingV2ChannelsSenderProfileEmails(object):
445-
"""
446-
:ivar email: The email of the sender.
447-
:ivar label: The label of the sender.
448-
"""
449-
450-
def __init__(self, payload: Dict[str, Any]):
451-
452-
self.email: Optional[str] = payload.get("email")
453-
self.label: Optional[str] = payload.get("label")
454-
455-
def to_dict(self):
456-
return {
457-
"email": self.email,
458-
"label": self.label,
459-
}
460-
461-
class MessagingV2ChannelsSenderProfileWebsites(object):
462-
"""
463-
:ivar label: The label of the sender.
464-
:ivar website: The website of the sender.
465-
"""
466-
467-
def __init__(self, payload: Dict[str, Any]):
468-
469-
self.label: Optional[str] = payload.get("label")
470-
self.website: Optional[str] = payload.get("website")
471-
472-
def to_dict(self):
473-
return {
474-
"label": self.label,
475-
"website": self.website,
383+
"websites": self.websites,
476384
}
477385

478386
class MessagingV2ChannelsSenderRequestsCreate(object):
@@ -786,67 +694,21 @@ def __init__(self, payload: Dict[str, Any]):
786694
self.about: Optional[str] = payload.get("about")
787695
self.address: Optional[str] = payload.get("address")
788696
self.description: Optional[str] = payload.get("description")
789-
self.emails: Optional[
790-
List[ChannelsSenderList.MessagingV2ChannelsSenderProfileEmails]
791-
] = payload.get("emails")
697+
self.emails: Optional[Dict[str, object]] = payload.get("emails")
792698
self.logo_url: Optional[str] = payload.get("logo_url")
793699
self.vertical: Optional[str] = payload.get("vertical")
794-
self.websites: Optional[
795-
List[ChannelsSenderList.MessagingV2ChannelsSenderProfileWebsites]
796-
] = payload.get("websites")
700+
self.websites: Optional[Dict[str, object]] = payload.get("websites")
797701

798702
def to_dict(self):
799703
return {
800704
"name": self.name,
801705
"about": self.about,
802706
"address": self.address,
803707
"description": self.description,
804-
"emails": (
805-
[emails.to_dict() for emails in self.emails]
806-
if self.emails is not None
807-
else None
808-
),
708+
"emails": self.emails,
809709
"logo_url": self.logo_url,
810710
"vertical": self.vertical,
811-
"websites": (
812-
[websites.to_dict() for websites in self.websites]
813-
if self.websites is not None
814-
else None
815-
),
816-
}
817-
818-
class MessagingV2ChannelsSenderProfileEmails(object):
819-
"""
820-
:ivar email: The email of the sender.
821-
:ivar label: The label of the sender.
822-
"""
823-
824-
def __init__(self, payload: Dict[str, Any]):
825-
826-
self.email: Optional[str] = payload.get("email")
827-
self.label: Optional[str] = payload.get("label")
828-
829-
def to_dict(self):
830-
return {
831-
"email": self.email,
832-
"label": self.label,
833-
}
834-
835-
class MessagingV2ChannelsSenderProfileWebsites(object):
836-
"""
837-
:ivar label: The label of the sender.
838-
:ivar website: The website of the sender.
839-
"""
840-
841-
def __init__(self, payload: Dict[str, Any]):
842-
843-
self.label: Optional[str] = payload.get("label")
844-
self.website: Optional[str] = payload.get("website")
845-
846-
def to_dict(self):
847-
return {
848-
"label": self.label,
849-
"website": self.website,
711+
"websites": self.websites,
850712
}
851713

852714
class MessagingV2ChannelsSenderRequestsCreate(object):

twilio/rest/numbers/v1/__init__.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,10 @@
2828
from twilio.rest.numbers.v1.porting_webhook_configuration_delete import (
2929
PortingWebhookConfigurationDeleteList,
3030
)
31-
from twilio.rest.numbers.v1.porting_webhook_configuration_fetch import (
32-
PortingWebhookConfigurationFetchList,
33-
)
3431
from twilio.rest.numbers.v1.signing_request_configuration import (
3532
SigningRequestConfigurationList,
3633
)
34+
from twilio.rest.numbers.v1.webhook import WebhookList
3735

3836

3937
class V1(Version):
@@ -58,12 +56,10 @@ def __init__(self, domain: Domain):
5856
self._porting_webhook_configurations_delete: Optional[
5957
PortingWebhookConfigurationDeleteList
6058
] = None
61-
self._porting_webhook_configuration_fetch: Optional[
62-
PortingWebhookConfigurationFetchList
63-
] = None
6459
self._signing_request_configurations: Optional[
6560
SigningRequestConfigurationList
6661
] = None
62+
self._webhook: Optional[WebhookList] = None
6763

6864
@property
6965
def bulk_eligibilities(self) -> BulkEligibilityList:
@@ -111,22 +107,18 @@ def porting_webhook_configurations_delete(
111107
)
112108
return self._porting_webhook_configurations_delete
113109

114-
@property
115-
def porting_webhook_configuration_fetch(
116-
self,
117-
) -> PortingWebhookConfigurationFetchList:
118-
if self._porting_webhook_configuration_fetch is None:
119-
self._porting_webhook_configuration_fetch = (
120-
PortingWebhookConfigurationFetchList(self)
121-
)
122-
return self._porting_webhook_configuration_fetch
123-
124110
@property
125111
def signing_request_configurations(self) -> SigningRequestConfigurationList:
126112
if self._signing_request_configurations is None:
127113
self._signing_request_configurations = SigningRequestConfigurationList(self)
128114
return self._signing_request_configurations
129115

116+
@property
117+
def webhook(self) -> WebhookList:
118+
if self._webhook is None:
119+
self._webhook = WebhookList(self)
120+
return self._webhook
121+
130122
def __repr__(self) -> str:
131123
"""
132124
Provide a friendly representation

twilio/rest/numbers/v1/porting_port_in.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ class PortingPortInInstance(InstanceResource):
2727
:ivar url: The URL of this Port In request
2828
:ivar account_sid: Account Sid or subaccount where the phone number(s) will be Ported
2929
:ivar notification_emails: Additional emails to send a copy of the signed LOA to.
30-
:ivar target_port_in_date: Target date to port the number. We cannot guarantee that this date will be honored by the other carriers, please work with Ops to get a confirmation of the firm order commitment (FOC) date. Expected format is ISO Local Date, example: ‘2011-12-03`. This date must be at least 7 days in the future for US ports and 10 days in the future for Japanese ports. (This value is only available for custom porting customers.)
31-
:ivar target_port_in_time_range_start: The earliest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00'. (This value is only available for custom porting customers.)
32-
:ivar target_port_in_time_range_end: The latest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00'. (This value is only available for custom porting customers.)
30+
:ivar target_port_in_date: Target date to port the number. We cannot guarantee that this date will be honored by the other carriers, please work with Ops to get a confirmation of the firm order commitment (FOC) date. Expected format is ISO Local Date, example: ‘2011-12-03`. This date must be at least 7 days in the future for US ports and 10 days in the future for Japanese ports. We can't guarantee the exact date and time, as this depends on the losing carrier
31+
:ivar target_port_in_time_range_start: The earliest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00'. We can't guarantee the exact date and time, as this depends on the losing carrier
32+
:ivar target_port_in_time_range_end: The latest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00'. We can't guarantee the exact date and time, as this depends on the losing carrier
3333
:ivar port_in_request_status: The status of the port in request. The possible values are: In progress, Completed, Expired, In review, Waiting for Signature, Action Required, and Canceled.
3434
:ivar losing_carrier_information: Details regarding the customer’s information with the losing carrier. These values will be used to generate the letter of authorization and should match the losing carrier’s data as closely as possible to ensure the port is accepted.
3535
:ivar phone_numbers:

twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py renamed to twilio/rest/numbers/v1/webhook.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from twilio.base.version import Version
2222

2323

24-
class PortingWebhookConfigurationFetchInstance(InstanceResource):
24+
class WebhookInstance(InstanceResource):
2525
"""
2626
:ivar url: The URL of the webhook configuration request
2727
:ivar port_in_target_url: The complete webhook url that will be called when a notification event for port in request or port in phone number happens
@@ -52,14 +52,14 @@ def __repr__(self) -> str:
5252
:returns: Machine friendly representation
5353
"""
5454

55-
return "<Twilio.Numbers.V1.PortingWebhookConfigurationFetchInstance>"
55+
return "<Twilio.Numbers.V1.WebhookInstance>"
5656

5757

58-
class PortingWebhookConfigurationFetchList(ListResource):
58+
class WebhookList(ListResource):
5959

6060
def __init__(self, version: Version):
6161
"""
62-
Initialize the PortingWebhookConfigurationFetchList
62+
Initialize the WebhookList
6363
6464
:param version: Version that contains the resource
6565
@@ -68,27 +68,27 @@ def __init__(self, version: Version):
6868

6969
self._uri = "/Porting/Configuration/Webhook"
7070

71-
def fetch(self) -> PortingWebhookConfigurationFetchInstance:
71+
def fetch(self) -> WebhookInstance:
7272
"""
73-
Asynchronously fetch the PortingWebhookConfigurationFetchInstance
73+
Asynchronously fetch the WebhookInstance
7474
7575
76-
:returns: The fetched PortingWebhookConfigurationFetchInstance
76+
:returns: The fetched WebhookInstance
7777
"""
7878
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})
7979

8080
headers["Accept"] = "application/json"
8181

8282
payload = self._version.fetch(method="GET", uri=self._uri, headers=headers)
8383

84-
return PortingWebhookConfigurationFetchInstance(self._version, payload)
84+
return WebhookInstance(self._version, payload)
8585

86-
async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance:
86+
async def fetch_async(self) -> WebhookInstance:
8787
"""
88-
Asynchronously fetch the PortingWebhookConfigurationFetchInstance
88+
Asynchronously fetch the WebhookInstance
8989
9090
91-
:returns: The fetched PortingWebhookConfigurationFetchInstance
91+
:returns: The fetched WebhookInstance
9292
"""
9393
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})
9494

@@ -98,12 +98,12 @@ async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance:
9898
method="GET", uri=self._uri, headers=headers
9999
)
100100

101-
return PortingWebhookConfigurationFetchInstance(self._version, payload)
101+
return WebhookInstance(self._version, payload)
102102

103103
def __repr__(self) -> str:
104104
"""
105105
Provide a friendly representation
106106
107107
:returns: Machine friendly representation
108108
"""
109-
return "<Twilio.Numbers.V1.PortingWebhookConfigurationFetchList>"
109+
return "<Twilio.Numbers.V1.WebhookList>"

twilio/rest/verify/v2/service/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ServiceInstance(InstanceResource):
3535
"""
3636
:ivar sid: The unique string that we created to identify the Service resource.
3737
:ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource.
38-
:ivar friendly_name: The name that appears in the body of your verification messages. It can be up to 30 characters long and can include letters, numbers, spaces, dashes, underscores. Phone numbers, special characters or links are NOT allowed. **This value should not contain PII.**
38+
:ivar friendly_name: The name that appears in the body of your verification messages. It can be up to 30 characters long and can include letters, numbers, spaces, dashes, underscores. Phone numbers, special characters or links are NOT allowed. It cannot contain more than 4 (consecutive or non-consecutive) digits. **This value should not contain PII.**
3939
:ivar code_length: The length of the verification code to generate.
4040
:ivar lookup_enabled: Whether to perform a lookup with each verification started and return info about the phone number.
4141
:ivar psd2_enabled: Whether to pass PSD2 transaction parameters when starting a verification.

0 commit comments

Comments
 (0)