Skip to content

Commit

Permalink
[Librarian] Regenerated @ a412066ed53a791734369f33f4b2f579662850b3 e4…
Browse files Browse the repository at this point in the history
…3180215d9b6a7f705d187446184940bb3dfac1
  • Loading branch information
twilio-dx committed Jul 2, 2024
1 parent 35bc174 commit bd426ae
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 43 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ twilio-python Changelog

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

[2024-07-02] Version 9.2.3
--------------------------
**Intelligence**
- Deprecate account flag api.twilio-intelligence.v2


[2024-06-27] Version 9.2.2
--------------------------
**Api**
Expand Down
32 changes: 18 additions & 14 deletions twilio/rest/content/v1/content/approval_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ApprovalFetchInstance(InstanceResource):
:ivar url: The URL of the resource, relative to `https://content.twilio.com`.
"""

def __init__(self, version: Version, payload: Dict[str, Any], sid: str):
def __init__(self, version: Version, payload: Dict[str, Any], content_sid: str):
super().__init__(version)

self.sid: Optional[str] = payload.get("sid")
Expand All @@ -36,7 +36,7 @@ def __init__(self, version: Version, payload: Dict[str, Any], sid: str):
self.url: Optional[str] = payload.get("url")

self._solution = {
"sid": sid,
"content_sid": content_sid,
}
self._context: Optional[ApprovalFetchContext] = None

Expand All @@ -51,7 +51,7 @@ def _proxy(self) -> "ApprovalFetchContext":
if self._context is None:
self._context = ApprovalFetchContext(
self._version,
sid=self._solution["sid"],
content_sid=self._solution["content_sid"],
)
return self._context

Expand Down Expand Up @@ -85,20 +85,20 @@ def __repr__(self) -> str:

class ApprovalFetchContext(InstanceContext):

def __init__(self, version: Version, sid: str):
def __init__(self, version: Version, content_sid: str):
"""
Initialize the ApprovalFetchContext
:param version: Version that contains the resource
:param sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch.
:param content_sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch.
"""
super().__init__(version)

# Path Solution
self._solution = {
"sid": sid,
"content_sid": content_sid,
}
self._uri = "/Content/{sid}/ApprovalRequests".format(**self._solution)
self._uri = "/Content/{content_sid}/ApprovalRequests".format(**self._solution)

def fetch(self) -> ApprovalFetchInstance:
"""
Expand All @@ -116,7 +116,7 @@ def fetch(self) -> ApprovalFetchInstance:
return ApprovalFetchInstance(
self._version,
payload,
sid=self._solution["sid"],
content_sid=self._solution["content_sid"],
)

async def fetch_async(self) -> ApprovalFetchInstance:
Expand All @@ -135,7 +135,7 @@ async def fetch_async(self) -> ApprovalFetchInstance:
return ApprovalFetchInstance(
self._version,
payload,
sid=self._solution["sid"],
content_sid=self._solution["content_sid"],
)

def __repr__(self) -> str:
Expand All @@ -150,34 +150,38 @@ def __repr__(self) -> str:

class ApprovalFetchList(ListResource):

def __init__(self, version: Version, sid: str):
def __init__(self, version: Version, content_sid: str):
"""
Initialize the ApprovalFetchList
:param version: Version that contains the resource
:param sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch.
:param content_sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch.
"""
super().__init__(version)

# Path Solution
self._solution = {
"sid": sid,
"content_sid": content_sid,
}

def get(self) -> ApprovalFetchContext:
"""
Constructs a ApprovalFetchContext
"""
return ApprovalFetchContext(self._version, sid=self._solution["sid"])
return ApprovalFetchContext(
self._version, content_sid=self._solution["content_sid"]
)

def __call__(self) -> ApprovalFetchContext:
"""
Constructs a ApprovalFetchContext
"""
return ApprovalFetchContext(self._version, sid=self._solution["sid"])
return ApprovalFetchContext(
self._version, content_sid=self._solution["content_sid"]
)

def __repr__(self) -> str:
"""
Expand Down
24 changes: 8 additions & 16 deletions twilio/rest/numbers/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@
from twilio.rest.numbers.v1.porting_webhook_configuration_delete import (
PortingWebhookConfigurationDeleteList,
)
from twilio.rest.numbers.v1.porting_webhook_configuration_fetch import (
PortingWebhookConfigurationFetchList,
)
from twilio.rest.numbers.v1.signing_request_configuration import (
SigningRequestConfigurationList,
)
from twilio.rest.numbers.v1.webhook import WebhookList


class V1(Version):
Expand All @@ -58,12 +56,10 @@ def __init__(self, domain: Domain):
self._porting_webhook_configurations_delete: Optional[
PortingWebhookConfigurationDeleteList
] = None
self._porting_webhook_configuration_fetch: Optional[
PortingWebhookConfigurationFetchList
] = None
self._signing_request_configurations: Optional[
SigningRequestConfigurationList
] = None
self._webhook: Optional[WebhookList] = None

@property
def bulk_eligibilities(self) -> BulkEligibilityList:
Expand Down Expand Up @@ -111,22 +107,18 @@ def porting_webhook_configurations_delete(
)
return self._porting_webhook_configurations_delete

@property
def porting_webhook_configuration_fetch(
self,
) -> PortingWebhookConfigurationFetchList:
if self._porting_webhook_configuration_fetch is None:
self._porting_webhook_configuration_fetch = (
PortingWebhookConfigurationFetchList(self)
)
return self._porting_webhook_configuration_fetch

@property
def signing_request_configurations(self) -> SigningRequestConfigurationList:
if self._signing_request_configurations is None:
self._signing_request_configurations = SigningRequestConfigurationList(self)
return self._signing_request_configurations

@property
def webhook(self) -> WebhookList:
if self._webhook is None:
self._webhook = WebhookList(self)
return self._webhook

def __repr__(self) -> str:
"""
Provide a friendly representation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from twilio.base.version import Version


class PortingWebhookConfigurationFetchInstance(InstanceResource):
class WebhookInstance(InstanceResource):
"""
:ivar url: The URL of the webhook configuration request
:ivar port_in_target_url: Webhook URL to send a request when a port in request or port in phone number event happens
Expand Down Expand Up @@ -52,14 +52,14 @@ def __repr__(self) -> str:
:returns: Machine friendly representation
"""

return "<Twilio.Numbers.V1.PortingWebhookConfigurationFetchInstance>"
return "<Twilio.Numbers.V1.WebhookInstance>"


class PortingWebhookConfigurationFetchList(ListResource):
class WebhookList(ListResource):

def __init__(self, version: Version):
"""
Initialize the PortingWebhookConfigurationFetchList
Initialize the WebhookList
:param version: Version that contains the resource
Expand All @@ -68,38 +68,38 @@ def __init__(self, version: Version):

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

def fetch(self) -> PortingWebhookConfigurationFetchInstance:
def fetch(self) -> WebhookInstance:
"""
Asynchronously fetch the PortingWebhookConfigurationFetchInstance
Asynchronously fetch the WebhookInstance
:returns: The fetched PortingWebhookConfigurationFetchInstance
:returns: The fetched WebhookInstance
"""
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})

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

return PortingWebhookConfigurationFetchInstance(self._version, payload)
return WebhookInstance(self._version, payload)

async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance:
async def fetch_async(self) -> WebhookInstance:
"""
Asynchronously fetch the PortingWebhookConfigurationFetchInstance
Asynchronously fetch the WebhookInstance
:returns: The fetched PortingWebhookConfigurationFetchInstance
:returns: The fetched WebhookInstance
"""
headers = values.of({"Content-Type": "application/x-www-form-urlencoded"})

payload = await self._version.fetch_async(
method="GET", uri=self._uri, headers=headers
)

return PortingWebhookConfigurationFetchInstance(self._version, payload)
return WebhookInstance(self._version, payload)

def __repr__(self) -> str:
"""
Provide a friendly representation
:returns: Machine friendly representation
"""
return "<Twilio.Numbers.V1.PortingWebhookConfigurationFetchList>"
return "<Twilio.Numbers.V1.WebhookList>"

0 comments on commit bd426ae

Please sign in to comment.