Skip to content

Commit 7bdf1b5

Browse files
authored
Merge branch 'main' into asabu_Python_changes
2 parents d78d5d5 + 0f81bbb commit 7bdf1b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+8522
-1421
lines changed

CHANGES.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,83 @@ 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+
17+
[2024-09-18] Version 9.3.1
18+
--------------------------
19+
**Library - Chore**
20+
- [PR #813](https://github.com/twilio/twilio-python/pull/813): add static init file to iam domain. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!
21+
22+
**Intelligence**
23+
- Remove public from operator_type
24+
- Update operator_type to include general-availablity and deprecated
25+
26+
**Numbers**
27+
- Remove beta flag for bundle clone API
28+
29+
30+
[2024-09-05] Version 9.3.0
31+
--------------------------
32+
**Iam**
33+
- updated library_visibility public for new public apikeys
34+
35+
**Numbers**
36+
- Add new field in Error Codes for Regulatory Compliance.
37+
- Change typing of Port In Request date_created field to date_time instead of date **(breaking change)**
38+
39+
40+
[2024-08-26] Version 9.2.4
41+
--------------------------
42+
**Library - Chore**
43+
- [PR #810](https://github.com/twilio/twilio-python/pull/810): add license identifier to project metadata. Thanks to [@mschoettle](https://github.com/mschoettle)!
44+
- [PR #808](https://github.com/twilio/twilio-python/pull/808): preview iam removal. Thanks to [@manisha1997](https://github.com/manisha1997)!
45+
- [PR #807](https://github.com/twilio/twilio-python/pull/807): update intersphinx_mapping. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!
46+
- [PR #804](https://github.com/twilio/twilio-python/pull/804): add init file. Thanks to [@manisha1997](https://github.com/manisha1997)!
47+
48+
**Api**
49+
- Update documentation of `error_code` and `error_message` on the Message resource.
50+
- Remove generic parameters from `transcription` resource
51+
- Added public documentation for Payload Data retrieval API
52+
53+
**Flex**
54+
- Adding update Flex User api
55+
56+
**Insights**
57+
- Added 'branded', 'business_profile' and 'voice_integrity' fields in List Call Summary
58+
59+
**Intelligence**
60+
- Add `words` array information to the Sentences v2 entity.
61+
- Add `X-Rate-Limit-Limit`, `X-Rate-Limit-Remaining`, and `X-Rate-Limit-Config` headers for Operator Results.
62+
- Change the path parameter when fetching an `/OperatorType/{}` from `sid<EY>` to `string` to support searching by SID or by name
63+
- Add `X-Rate-Limit-Limit`, `X-Rate-Limit-Remaining`, and `X-Rate-Limit-Config` headers for Transcript and Service endpoints.
64+
65+
**Messaging**
66+
- Adds two new channel senders api to add/remove channel senders to/from a messaging service
67+
- Extend ERC api to accept an optional attribute in request body to indicate CNP migration for an ERC
68+
69+
**Numbers**
70+
- Modify visibility to public in bundle clone API
71+
- Add `port_date` field to Port In Request and Port In Phone Numbers Fetch APIs
72+
- Change properties docs for port in phone numbers api
73+
- Add is_test body param to the Bundle Create API
74+
- Change properties docs for port in api
75+
76+
**Trusthub**
77+
- Add new field in themeSetId in compliance_inquiry.
78+
79+
**Verify**
80+
- Update `custom_code_enabled` description on verification docs
81+
82+
683
[2024-07-02] Version 9.2.3
784
--------------------------
885
**Intelligence**

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,4 +203,4 @@
203203
# -- Options for intersphinx extension ---------------------------------------
204204

205205
# Example configuration for intersphinx: refer to the Python standard library.
206-
intersphinx_mapping = {"https://docs.python.org/": None}
206+
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ universal = 1
33

44
[metadata]
55
description-file = README.md
6+
license = MIT
67

78
[flake8]
89
exclude = ./twilio/rest,./twilio/twiml,./tests/integration

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
setup(
1515
name="twilio",
16-
version="9.2.3",
16+
version="9.3.2",
1717
description="Twilio API client and TwiML generator",
1818
author="Twilio",
1919
help_center="https://www.twilio.com/help/contact",

twilio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version_info__ = ("9", "2", "3")
1+
__version_info__ = ("9", "3", "2")
22
__version__ = ".".join(__version_info__)

twilio/rest/__init__.py

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616
if TYPE_CHECKING:
1717
from twilio.rest.accounts import Accounts
1818
from twilio.rest.api import Api
19+
from twilio.rest.assistants import Assistants
1920
from twilio.rest.bulkexports import Bulkexports
2021
from twilio.rest.chat import Chat
2122
from twilio.rest.content import Content
2223
from twilio.rest.conversations import Conversations
2324
from twilio.rest.events import Events
2425
from twilio.rest.flex_api import FlexApi
2526
from twilio.rest.frontline_api import FrontlineApi
26-
from twilio.rest.preview_iam import PreviewIam
27+
from twilio.rest.iam import Iam
2728
from twilio.rest.insights import Insights
2829
from twilio.rest.intelligence import Intelligence
2930
from twilio.rest.ip_messaging import IpMessaging
@@ -127,6 +128,7 @@ def __init__(
127128
# Domains
128129
self._accounts: Optional["Accounts"] = None
129130
self._api: Optional["Api"] = None
131+
self._assistants: Optional["Assistants"] = None
130132
self._bulkexports: Optional["Bulkexports"] = None
131133
self._chat: Optional["Chat"] = None
132134
self._content: Optional["Content"] = None
@@ -188,6 +190,19 @@ def api(self) -> "Api":
188190
self._api = Api(self)
189191
return self._api
190192

193+
@property
194+
def assistants(self) -> "Assistants":
195+
"""
196+
Access the Assistants Twilio Domain
197+
198+
:returns: Assistants Twilio Domain
199+
"""
200+
if self._assistants is None:
201+
from twilio.rest.assistants import Assistants
202+
203+
self._assistants = Assistants(self)
204+
return self._assistants
205+
191206
@property
192207
def bulkexports(self) -> "Bulkexports":
193208
"""
@@ -280,17 +295,17 @@ def frontline_api(self) -> "FrontlineApi":
280295
return self._frontline_api
281296

282297
@property
283-
def preview_iam(self) -> "PreviewIam":
298+
def iam(self) -> "Iam":
284299
"""
285-
Access the PreviewIam Twilio Domain
300+
Access the Iam Twilio Domain
286301
287-
:returns: PreviewIam Twilio Domain
302+
:returns: Iam Twilio Domain
288303
"""
289-
if self._preview_iam is None:
290-
from twilio.rest.preview_iam import PreviewIam
304+
if self._iam is None:
305+
from twilio.rest.iam import Iam
291306

292-
self._preview_iam = PreviewIam(self)
293-
return self._preview_iam
307+
self._iam = Iam(self)
308+
return self._iam
294309

295310
@property
296311
def insights(self) -> "Insights":

twilio/rest/accounts/v1/__init__.py

Lines changed: 16 additions & 0 deletions
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:
Lines changed: 106 additions & 0 deletions
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>"

0 commit comments

Comments
 (0)