Skip to content

Commit

Permalink
[Librarian] Regenerated @ 021bab52f93b55d7a5786bd27716bf3a0be2d7b9 aa…
Browse files Browse the repository at this point in the history
…81ca7c51512c448626fafb32aeb46838510334
  • Loading branch information
twilio-dx committed Oct 3, 2024
1 parent 7fc68cb commit 726c36a
Show file tree
Hide file tree
Showing 14 changed files with 79 additions and 3,391 deletions.
16 changes: 16 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@ twilio-python Changelog

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

[2024-10-03] Version 9.3.3
--------------------------
**Library - Chore**
- [PR #816](https://github.com/twilio/twilio-python/pull/816): add assistants init files. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!

**Messaging**
- Add A2P external campaign CnpMigration flag

**Numbers**
- Add address sid to portability API

**Verify**
- Add `SnaClientToken` optional parameter on Verification check.
- Add `EnableSnaClientToken` optional parameter for Verification creation.


[2024-09-25] Version 9.3.2
--------------------------
**Accounts**
Expand Down
12 changes: 6 additions & 6 deletions twilio/rest/iam/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from twilio.base.domain import Domain
from twilio.rest.iam.v1.api_key import ApiKeyList
from twilio.rest.iam.v1.get_api_keys import GetApiKeysList
from twilio.rest.iam.v1.new_api_key import NewApiKeyList
from twilio.rest.iam.v1.key import KeyList


class V1(Version):
Expand All @@ -31,7 +31,7 @@ def __init__(self, domain: Domain):
super().__init__(domain, "v1")
self._api_key: Optional[ApiKeyList] = None
self._get_api_keys: Optional[GetApiKeysList] = None
self._new_api_key: Optional[NewApiKeyList] = None
self._keys: Optional[KeyList] = None

@property
def api_key(self) -> ApiKeyList:
Expand All @@ -46,10 +46,10 @@ def get_api_keys(self) -> GetApiKeysList:
return self._get_api_keys

@property
def new_api_key(self) -> NewApiKeyList:
if self._new_api_key is None:
self._new_api_key = NewApiKeyList(self)
return self._new_api_key
def keys(self) -> KeyList:
if self._keys is None:
self._keys = KeyList(self)
return self._keys

def __repr__(self) -> str:
"""
Expand Down
30 changes: 15 additions & 15 deletions twilio/rest/iam/v1/new_api_key.py → twilio/rest/iam/v1/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from twilio.base.version import Version


class NewApiKeyInstance(InstanceResource):
class KeyInstance(InstanceResource):

class Keytype(object):
RESTRICTED = "restricted"
Expand Down Expand Up @@ -56,14 +56,14 @@ def __repr__(self) -> str:
:returns: Machine friendly representation
"""

return "<Twilio.Iam.V1.NewApiKeyInstance>"
return "<Twilio.Iam.V1.KeyInstance>"


class NewApiKeyList(ListResource):
class KeyList(ListResource):

def __init__(self, version: Version):
"""
Initialize the NewApiKeyList
Initialize the KeyList
:param version: Version that contains the resource
Expand All @@ -76,18 +76,18 @@ def create(
self,
account_sid: str,
friendly_name: Union[str, object] = values.unset,
key_type: Union["NewApiKeyInstance.Keytype", object] = values.unset,
key_type: Union["KeyInstance.Keytype", object] = values.unset,
policy: Union[object, object] = values.unset,
) -> NewApiKeyInstance:
) -> KeyInstance:
"""
Create the NewApiKeyInstance
Create the KeyInstance
:param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource.
:param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long.
:param key_type:
:param policy: The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys).
:returns: The created NewApiKeyInstance
:returns: The created KeyInstance
"""

data = values.of(
Expand All @@ -104,24 +104,24 @@ def create(
method="POST", uri=self._uri, data=data, headers=headers
)

return NewApiKeyInstance(self._version, payload)
return KeyInstance(self._version, payload)

async def create_async(
self,
account_sid: str,
friendly_name: Union[str, object] = values.unset,
key_type: Union["NewApiKeyInstance.Keytype", object] = values.unset,
key_type: Union["KeyInstance.Keytype", object] = values.unset,
policy: Union[object, object] = values.unset,
) -> NewApiKeyInstance:
) -> KeyInstance:
"""
Asynchronously create the NewApiKeyInstance
Asynchronously create the KeyInstance
:param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource.
:param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long.
:param key_type:
:param policy: The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys).
:returns: The created NewApiKeyInstance
:returns: The created KeyInstance
"""

data = values.of(
Expand All @@ -138,12 +138,12 @@ async def create_async(
method="POST", uri=self._uri, data=data, headers=headers
)

return NewApiKeyInstance(self._version, payload)
return KeyInstance(self._version, payload)

def __repr__(self) -> str:
"""
Provide a friendly representation
:returns: Machine friendly representation
"""
return "<Twilio.Iam.V1.NewApiKeyList>"
return "<Twilio.Iam.V1.KeyList>"
24 changes: 20 additions & 4 deletions twilio/rest/numbers/v1/porting_portability.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,31 +85,39 @@ def _proxy(self) -> "PortingPortabilityContext":
return self._context

def fetch(
self, target_account_sid: Union[str, object] = values.unset
self,
target_account_sid: Union[str, object] = values.unset,
address_sid: Union[str, object] = values.unset,
) -> "PortingPortabilityInstance":
"""
Fetch the PortingPortabilityInstance
:param target_account_sid: Account Sid to which the number will be ported. This can be used to determine if a sub account already has the number in its inventory or a different sub account. If this is not provided, the authenticated account will be assumed to be the target account.
:param address_sid: Address Sid of customer to which the number will be ported.
:returns: The fetched PortingPortabilityInstance
"""
return self._proxy.fetch(
target_account_sid=target_account_sid,
address_sid=address_sid,
)

async def fetch_async(
self, target_account_sid: Union[str, object] = values.unset
self,
target_account_sid: Union[str, object] = values.unset,
address_sid: Union[str, object] = values.unset,
) -> "PortingPortabilityInstance":
"""
Asynchronous coroutine to fetch the PortingPortabilityInstance
:param target_account_sid: Account Sid to which the number will be ported. This can be used to determine if a sub account already has the number in its inventory or a different sub account. If this is not provided, the authenticated account will be assumed to be the target account.
:param address_sid: Address Sid of customer to which the number will be ported.
:returns: The fetched PortingPortabilityInstance
"""
return await self._proxy.fetch_async(
target_account_sid=target_account_sid,
address_sid=address_sid,
)

def __repr__(self) -> str:
Expand Down Expand Up @@ -142,19 +150,23 @@ def __init__(self, version: Version, phone_number: str):
)

def fetch(
self, target_account_sid: Union[str, object] = values.unset
self,
target_account_sid: Union[str, object] = values.unset,
address_sid: Union[str, object] = values.unset,
) -> PortingPortabilityInstance:
"""
Fetch the PortingPortabilityInstance
:param target_account_sid: Account Sid to which the number will be ported. This can be used to determine if a sub account already has the number in its inventory or a different sub account. If this is not provided, the authenticated account will be assumed to be the target account.
:param address_sid: Address Sid of customer to which the number will be ported.
:returns: The fetched PortingPortabilityInstance
"""

data = values.of(
{
"TargetAccountSid": target_account_sid,
"AddressSid": address_sid,
}
)

Expand All @@ -167,19 +179,23 @@ def fetch(
)

async def fetch_async(
self, target_account_sid: Union[str, object] = values.unset
self,
target_account_sid: Union[str, object] = values.unset,
address_sid: Union[str, object] = values.unset,
) -> PortingPortabilityInstance:
"""
Asynchronous coroutine to fetch the PortingPortabilityInstance
:param target_account_sid: Account Sid to which the number will be ported. This can be used to determine if a sub account already has the number in its inventory or a different sub account. If this is not provided, the authenticated account will be assumed to be the target account.
:param address_sid: Address Sid of customer to which the number will be ported.
:returns: The fetched PortingPortabilityInstance
"""

data = values.of(
{
"TargetAccountSid": target_account_sid,
"AddressSid": address_sid,
}
)

Expand Down
11 changes: 0 additions & 11 deletions twilio/rest/preview/PreviewBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

from twilio.base.domain import Domain
from twilio.rest import Client
from twilio.rest.preview.deployed_devices import DeployedDevices
from twilio.rest.preview.hosted_numbers import HostedNumbers
from twilio.rest.preview.sync import Sync
from twilio.rest.preview.marketplace import Marketplace
Expand All @@ -29,21 +28,11 @@ def __init__(self, twilio: Client):
:returns: Domain for Preview
"""
super().__init__(twilio, "https://preview.twilio.com")
self._deployed_devices: Optional[DeployedDevices] = None
self._hosted_numbers: Optional[HostedNumbers] = None
self._sync: Optional[Sync] = None
self._marketplace: Optional[Marketplace] = None
self._wireless: Optional[Wireless] = None

@property
def deployed_devices(self) -> DeployedDevices:
"""
:returns: Versions deployed_devices of Preview
"""
if self._deployed_devices is None:
self._deployed_devices = DeployedDevices(self)
return self._deployed_devices

@property
def hosted_numbers(self) -> HostedNumbers:
"""
Expand Down
43 changes: 0 additions & 43 deletions twilio/rest/preview/deployed_devices/__init__.py

This file was deleted.

Loading

0 comments on commit 726c36a

Please sign in to comment.