id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 51 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
225,400 | twilio/twilio-python | twilio/rest/ip_messaging/v2/service/user/__init__.py | UserList.get | def get(self, sid):
"""
Constructs a UserContext
:param sid: The unique string that identifies the resource
:returns: twilio.rest.chat.v2.service.user.UserContext
:rtype: twilio.rest.chat.v2.service.user.UserContext
"""
return UserContext(self._version, service_sid=self._solution['service_sid'], sid=sid, ) | python | def get(self, sid):
return UserContext(self._version, service_sid=self._solution['service_sid'], sid=sid, ) | [
"def",
"get",
"(",
"self",
",",
"sid",
")",
":",
"return",
"UserContext",
"(",
"self",
".",
"_version",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_sid'",
"]",
",",
"sid",
"=",
"sid",
",",
")"
] | Constructs a UserContext
:param sid: The unique string that identifies the resource
:returns: twilio.rest.chat.v2.service.user.UserContext
:rtype: twilio.rest.chat.v2.service.user.UserContext | [
"Constructs",
"a",
"UserContext"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/ip_messaging/v2/service/user/__init__.py#L147-L156 |
225,401 | twilio/twilio-python | twilio/rest/ip_messaging/v2/service/user/__init__.py | UserPage.get_instance | def get_instance(self, payload):
"""
Build an instance of UserInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.chat.v2.service.user.UserInstance
:rtype: twilio.rest.chat.v2.service.user.UserInstance
"""
return UserInstance(self._version, payload, service_sid=self._solution['service_sid'], ) | python | def get_instance(self, payload):
return UserInstance(self._version, payload, service_sid=self._solution['service_sid'], ) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"UserInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_sid'",
"]",
",",
")"
] | Build an instance of UserInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.chat.v2.service.user.UserInstance
:rtype: twilio.rest.chat.v2.service.user.UserInstance | [
"Build",
"an",
"instance",
"of",
"UserInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/ip_messaging/v2/service/user/__init__.py#L198-L207 |
225,402 | twilio/twilio-python | twilio/rest/ip_messaging/v2/service/user/__init__.py | UserContext.user_channels | def user_channels(self):
"""
Access the user_channels
:returns: twilio.rest.chat.v2.service.user.user_channel.UserChannelList
:rtype: twilio.rest.chat.v2.service.user.user_channel.UserChannelList
"""
if self._user_channels is None:
self._user_channels = UserChannelList(
self._version,
service_sid=self._solution['service_sid'],
user_sid=self._solution['sid'],
)
return self._user_channels | python | def user_channels(self):
if self._user_channels is None:
self._user_channels = UserChannelList(
self._version,
service_sid=self._solution['service_sid'],
user_sid=self._solution['sid'],
)
return self._user_channels | [
"def",
"user_channels",
"(",
"self",
")",
":",
"if",
"self",
".",
"_user_channels",
"is",
"None",
":",
"self",
".",
"_user_channels",
"=",
"UserChannelList",
"(",
"self",
".",
"_version",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_sid'... | Access the user_channels
:returns: twilio.rest.chat.v2.service.user.user_channel.UserChannelList
:rtype: twilio.rest.chat.v2.service.user.user_channel.UserChannelList | [
"Access",
"the",
"user_channels"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/ip_messaging/v2/service/user/__init__.py#L302-L315 |
225,403 | twilio/twilio-python | twilio/rest/ip_messaging/v2/service/user/__init__.py | UserContext.user_bindings | def user_bindings(self):
"""
Access the user_bindings
:returns: twilio.rest.chat.v2.service.user.user_binding.UserBindingList
:rtype: twilio.rest.chat.v2.service.user.user_binding.UserBindingList
"""
if self._user_bindings is None:
self._user_bindings = UserBindingList(
self._version,
service_sid=self._solution['service_sid'],
user_sid=self._solution['sid'],
)
return self._user_bindings | python | def user_bindings(self):
if self._user_bindings is None:
self._user_bindings = UserBindingList(
self._version,
service_sid=self._solution['service_sid'],
user_sid=self._solution['sid'],
)
return self._user_bindings | [
"def",
"user_bindings",
"(",
"self",
")",
":",
"if",
"self",
".",
"_user_bindings",
"is",
"None",
":",
"self",
".",
"_user_bindings",
"=",
"UserBindingList",
"(",
"self",
".",
"_version",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_sid'... | Access the user_bindings
:returns: twilio.rest.chat.v2.service.user.user_binding.UserBindingList
:rtype: twilio.rest.chat.v2.service.user.user_binding.UserBindingList | [
"Access",
"the",
"user_bindings"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/ip_messaging/v2/service/user/__init__.py#L318-L331 |
225,404 | twilio/twilio-python | twilio/rest/authy/v1/form.py | FormContext.fetch | def fetch(self):
"""
Fetch a FormInstance
:returns: Fetched FormInstance
:rtype: twilio.rest.authy.v1.form.FormInstance
"""
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return FormInstance(self._version, payload, form_type=self._solution['form_type'], ) | python | def fetch(self):
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return FormInstance(self._version, payload, form_type=self._solution['form_type'], ) | [
"def",
"fetch",
"(",
"self",
")",
":",
"params",
"=",
"values",
".",
"of",
"(",
"{",
"}",
")",
"payload",
"=",
"self",
".",
"_version",
".",
"fetch",
"(",
"'GET'",
",",
"self",
".",
"_uri",
",",
"params",
"=",
"params",
",",
")",
"return",
"FormI... | Fetch a FormInstance
:returns: Fetched FormInstance
:rtype: twilio.rest.authy.v1.form.FormInstance | [
"Fetch",
"a",
"FormInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/authy/v1/form.py#L129-L144 |
225,405 | twilio/twilio-python | twilio/rest/ip_messaging/v2/service/channel/invite.py | InviteList.create | def create(self, identity, role_sid=values.unset):
"""
Create a new InviteInstance
:param unicode identity: The `identity` value that identifies the new resource's User
:param unicode role_sid: The Role assigned to the new member
:returns: Newly created InviteInstance
:rtype: twilio.rest.chat.v2.service.channel.invite.InviteInstance
"""
data = values.of({'Identity': identity, 'RoleSid': role_sid, })
payload = self._version.create(
'POST',
self._uri,
data=data,
)
return InviteInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
channel_sid=self._solution['channel_sid'],
) | python | def create(self, identity, role_sid=values.unset):
data = values.of({'Identity': identity, 'RoleSid': role_sid, })
payload = self._version.create(
'POST',
self._uri,
data=data,
)
return InviteInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
channel_sid=self._solution['channel_sid'],
) | [
"def",
"create",
"(",
"self",
",",
"identity",
",",
"role_sid",
"=",
"values",
".",
"unset",
")",
":",
"data",
"=",
"values",
".",
"of",
"(",
"{",
"'Identity'",
":",
"identity",
",",
"'RoleSid'",
":",
"role_sid",
",",
"}",
")",
"payload",
"=",
"self"... | Create a new InviteInstance
:param unicode identity: The `identity` value that identifies the new resource's User
:param unicode role_sid: The Role assigned to the new member
:returns: Newly created InviteInstance
:rtype: twilio.rest.chat.v2.service.channel.invite.InviteInstance | [
"Create",
"a",
"new",
"InviteInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/ip_messaging/v2/service/channel/invite.py#L38-L61 |
225,406 | twilio/twilio-python | twilio/rest/ip_messaging/v2/service/channel/invite.py | InviteList.get | def get(self, sid):
"""
Constructs a InviteContext
:param sid: The unique string that identifies the resource
:returns: twilio.rest.chat.v2.service.channel.invite.InviteContext
:rtype: twilio.rest.chat.v2.service.channel.invite.InviteContext
"""
return InviteContext(
self._version,
service_sid=self._solution['service_sid'],
channel_sid=self._solution['channel_sid'],
sid=sid,
) | python | def get(self, sid):
return InviteContext(
self._version,
service_sid=self._solution['service_sid'],
channel_sid=self._solution['channel_sid'],
sid=sid,
) | [
"def",
"get",
"(",
"self",
",",
"sid",
")",
":",
"return",
"InviteContext",
"(",
"self",
".",
"_version",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_sid'",
"]",
",",
"channel_sid",
"=",
"self",
".",
"_solution",
"[",
"'channel_sid'",... | Constructs a InviteContext
:param sid: The unique string that identifies the resource
:returns: twilio.rest.chat.v2.service.channel.invite.InviteContext
:rtype: twilio.rest.chat.v2.service.channel.invite.InviteContext | [
"Constructs",
"a",
"InviteContext"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/ip_messaging/v2/service/channel/invite.py#L152-L166 |
225,407 | twilio/twilio-python | twilio/rest/ip_messaging/v2/service/channel/invite.py | InvitePage.get_instance | def get_instance(self, payload):
"""
Build an instance of InviteInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.chat.v2.service.channel.invite.InviteInstance
:rtype: twilio.rest.chat.v2.service.channel.invite.InviteInstance
"""
return InviteInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
channel_sid=self._solution['channel_sid'],
) | python | def get_instance(self, payload):
return InviteInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
channel_sid=self._solution['channel_sid'],
) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"InviteInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_sid'",
"]",
",",
"channel_sid",
"=",
"self",
".",
"_so... | Build an instance of InviteInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.chat.v2.service.channel.invite.InviteInstance
:rtype: twilio.rest.chat.v2.service.channel.invite.InviteInstance | [
"Build",
"an",
"instance",
"of",
"InviteInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/ip_messaging/v2/service/channel/invite.py#L214-L228 |
225,408 | twilio/twilio-python | twilio/rest/ip_messaging/v2/service/channel/invite.py | InviteContext.fetch | def fetch(self):
"""
Fetch a InviteInstance
:returns: Fetched InviteInstance
:rtype: twilio.rest.chat.v2.service.channel.invite.InviteInstance
"""
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return InviteInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
channel_sid=self._solution['channel_sid'],
sid=self._solution['sid'],
) | python | def fetch(self):
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return InviteInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
channel_sid=self._solution['channel_sid'],
sid=self._solution['sid'],
) | [
"def",
"fetch",
"(",
"self",
")",
":",
"params",
"=",
"values",
".",
"of",
"(",
"{",
"}",
")",
"payload",
"=",
"self",
".",
"_version",
".",
"fetch",
"(",
"'GET'",
",",
"self",
".",
"_uri",
",",
"params",
"=",
"params",
",",
")",
"return",
"Invit... | Fetch a InviteInstance
:returns: Fetched InviteInstance
:rtype: twilio.rest.chat.v2.service.channel.invite.InviteInstance | [
"Fetch",
"a",
"InviteInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/ip_messaging/v2/service/channel/invite.py#L261-L282 |
225,409 | twilio/twilio-python | twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py | IpAddressList.get | def get(self, sid):
"""
Constructs a IpAddressContext
:param sid: A string that identifies the IpAddress resource to fetch
:returns: twilio.rest.api.v2010.account.sip.ip_access_control_list.ip_address.IpAddressContext
:rtype: twilio.rest.api.v2010.account.sip.ip_access_control_list.ip_address.IpAddressContext
"""
return IpAddressContext(
self._version,
account_sid=self._solution['account_sid'],
ip_access_control_list_sid=self._solution['ip_access_control_list_sid'],
sid=sid,
) | python | def get(self, sid):
return IpAddressContext(
self._version,
account_sid=self._solution['account_sid'],
ip_access_control_list_sid=self._solution['ip_access_control_list_sid'],
sid=sid,
) | [
"def",
"get",
"(",
"self",
",",
"sid",
")",
":",
"return",
"IpAddressContext",
"(",
"self",
".",
"_version",
",",
"account_sid",
"=",
"self",
".",
"_solution",
"[",
"'account_sid'",
"]",
",",
"ip_access_control_list_sid",
"=",
"self",
".",
"_solution",
"[",
... | Constructs a IpAddressContext
:param sid: A string that identifies the IpAddress resource to fetch
:returns: twilio.rest.api.v2010.account.sip.ip_access_control_list.ip_address.IpAddressContext
:rtype: twilio.rest.api.v2010.account.sip.ip_access_control_list.ip_address.IpAddressContext | [
"Constructs",
"a",
"IpAddressContext"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py#L151-L165 |
225,410 | twilio/twilio-python | twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py | IpAddressPage.get_instance | def get_instance(self, payload):
"""
Build an instance of IpAddressInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.api.v2010.account.sip.ip_access_control_list.ip_address.IpAddressInstance
:rtype: twilio.rest.api.v2010.account.sip.ip_access_control_list.ip_address.IpAddressInstance
"""
return IpAddressInstance(
self._version,
payload,
account_sid=self._solution['account_sid'],
ip_access_control_list_sid=self._solution['ip_access_control_list_sid'],
) | python | def get_instance(self, payload):
return IpAddressInstance(
self._version,
payload,
account_sid=self._solution['account_sid'],
ip_access_control_list_sid=self._solution['ip_access_control_list_sid'],
) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"IpAddressInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"account_sid",
"=",
"self",
".",
"_solution",
"[",
"'account_sid'",
"]",
",",
"ip_access_control_list_sid",
"=",
"se... | Build an instance of IpAddressInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.api.v2010.account.sip.ip_access_control_list.ip_address.IpAddressInstance
:rtype: twilio.rest.api.v2010.account.sip.ip_access_control_list.ip_address.IpAddressInstance | [
"Build",
"an",
"instance",
"of",
"IpAddressInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py#L213-L227 |
225,411 | twilio/twilio-python | twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py | IpAddressContext.fetch | def fetch(self):
"""
Fetch a IpAddressInstance
:returns: Fetched IpAddressInstance
:rtype: twilio.rest.api.v2010.account.sip.ip_access_control_list.ip_address.IpAddressInstance
"""
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return IpAddressInstance(
self._version,
payload,
account_sid=self._solution['account_sid'],
ip_access_control_list_sid=self._solution['ip_access_control_list_sid'],
sid=self._solution['sid'],
) | python | def fetch(self):
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return IpAddressInstance(
self._version,
payload,
account_sid=self._solution['account_sid'],
ip_access_control_list_sid=self._solution['ip_access_control_list_sid'],
sid=self._solution['sid'],
) | [
"def",
"fetch",
"(",
"self",
")",
":",
"params",
"=",
"values",
".",
"of",
"(",
"{",
"}",
")",
"payload",
"=",
"self",
".",
"_version",
".",
"fetch",
"(",
"'GET'",
",",
"self",
".",
"_uri",
",",
"params",
"=",
"params",
",",
")",
"return",
"IpAdd... | Fetch a IpAddressInstance
:returns: Fetched IpAddressInstance
:rtype: twilio.rest.api.v2010.account.sip.ip_access_control_list.ip_address.IpAddressInstance | [
"Fetch",
"a",
"IpAddressInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py#L264-L285 |
225,412 | twilio/twilio-python | twilio/rest/autopilot/v1/assistant/task/__init__.py | TaskContext.fields | def fields(self):
"""
Access the fields
:returns: twilio.rest.autopilot.v1.assistant.task.field.FieldList
:rtype: twilio.rest.autopilot.v1.assistant.task.field.FieldList
"""
if self._fields is None:
self._fields = FieldList(
self._version,
assistant_sid=self._solution['assistant_sid'],
task_sid=self._solution['sid'],
)
return self._fields | python | def fields(self):
if self._fields is None:
self._fields = FieldList(
self._version,
assistant_sid=self._solution['assistant_sid'],
task_sid=self._solution['sid'],
)
return self._fields | [
"def",
"fields",
"(",
"self",
")",
":",
"if",
"self",
".",
"_fields",
"is",
"None",
":",
"self",
".",
"_fields",
"=",
"FieldList",
"(",
"self",
".",
"_version",
",",
"assistant_sid",
"=",
"self",
".",
"_solution",
"[",
"'assistant_sid'",
"]",
",",
"tas... | Access the fields
:returns: twilio.rest.autopilot.v1.assistant.task.field.FieldList
:rtype: twilio.rest.autopilot.v1.assistant.task.field.FieldList | [
"Access",
"the",
"fields"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/autopilot/v1/assistant/task/__init__.py#L319-L332 |
225,413 | twilio/twilio-python | twilio/rest/autopilot/v1/assistant/task/__init__.py | TaskContext.samples | def samples(self):
"""
Access the samples
:returns: twilio.rest.autopilot.v1.assistant.task.sample.SampleList
:rtype: twilio.rest.autopilot.v1.assistant.task.sample.SampleList
"""
if self._samples is None:
self._samples = SampleList(
self._version,
assistant_sid=self._solution['assistant_sid'],
task_sid=self._solution['sid'],
)
return self._samples | python | def samples(self):
if self._samples is None:
self._samples = SampleList(
self._version,
assistant_sid=self._solution['assistant_sid'],
task_sid=self._solution['sid'],
)
return self._samples | [
"def",
"samples",
"(",
"self",
")",
":",
"if",
"self",
".",
"_samples",
"is",
"None",
":",
"self",
".",
"_samples",
"=",
"SampleList",
"(",
"self",
".",
"_version",
",",
"assistant_sid",
"=",
"self",
".",
"_solution",
"[",
"'assistant_sid'",
"]",
",",
... | Access the samples
:returns: twilio.rest.autopilot.v1.assistant.task.sample.SampleList
:rtype: twilio.rest.autopilot.v1.assistant.task.sample.SampleList | [
"Access",
"the",
"samples"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/autopilot/v1/assistant/task/__init__.py#L335-L348 |
225,414 | twilio/twilio-python | twilio/rest/autopilot/v1/assistant/task/__init__.py | TaskContext.task_actions | def task_actions(self):
"""
Access the task_actions
:returns: twilio.rest.autopilot.v1.assistant.task.task_actions.TaskActionsList
:rtype: twilio.rest.autopilot.v1.assistant.task.task_actions.TaskActionsList
"""
if self._task_actions is None:
self._task_actions = TaskActionsList(
self._version,
assistant_sid=self._solution['assistant_sid'],
task_sid=self._solution['sid'],
)
return self._task_actions | python | def task_actions(self):
if self._task_actions is None:
self._task_actions = TaskActionsList(
self._version,
assistant_sid=self._solution['assistant_sid'],
task_sid=self._solution['sid'],
)
return self._task_actions | [
"def",
"task_actions",
"(",
"self",
")",
":",
"if",
"self",
".",
"_task_actions",
"is",
"None",
":",
"self",
".",
"_task_actions",
"=",
"TaskActionsList",
"(",
"self",
".",
"_version",
",",
"assistant_sid",
"=",
"self",
".",
"_solution",
"[",
"'assistant_sid... | Access the task_actions
:returns: twilio.rest.autopilot.v1.assistant.task.task_actions.TaskActionsList
:rtype: twilio.rest.autopilot.v1.assistant.task.task_actions.TaskActionsList | [
"Access",
"the",
"task_actions"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/autopilot/v1/assistant/task/__init__.py#L351-L364 |
225,415 | twilio/twilio-python | twilio/rest/serverless/v1/service/asset/__init__.py | AssetList.create | def create(self, friendly_name):
"""
Create a new AssetInstance
:param unicode friendly_name: The friendly_name
:returns: Newly created AssetInstance
:rtype: twilio.rest.serverless.v1.service.asset.AssetInstance
"""
data = values.of({'FriendlyName': friendly_name, })
payload = self._version.create(
'POST',
self._uri,
data=data,
)
return AssetInstance(self._version, payload, service_sid=self._solution['service_sid'], ) | python | def create(self, friendly_name):
data = values.of({'FriendlyName': friendly_name, })
payload = self._version.create(
'POST',
self._uri,
data=data,
)
return AssetInstance(self._version, payload, service_sid=self._solution['service_sid'], ) | [
"def",
"create",
"(",
"self",
",",
"friendly_name",
")",
":",
"data",
"=",
"values",
".",
"of",
"(",
"{",
"'FriendlyName'",
":",
"friendly_name",
",",
"}",
")",
"payload",
"=",
"self",
".",
"_version",
".",
"create",
"(",
"'POST'",
",",
"self",
".",
... | Create a new AssetInstance
:param unicode friendly_name: The friendly_name
:returns: Newly created AssetInstance
:rtype: twilio.rest.serverless.v1.service.asset.AssetInstance | [
"Create",
"a",
"new",
"AssetInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/serverless/v1/service/asset/__init__.py#L120-L137 |
225,416 | twilio/twilio-python | twilio/rest/serverless/v1/service/asset/__init__.py | AssetList.get | def get(self, sid):
"""
Constructs a AssetContext
:param sid: The sid
:returns: twilio.rest.serverless.v1.service.asset.AssetContext
:rtype: twilio.rest.serverless.v1.service.asset.AssetContext
"""
return AssetContext(self._version, service_sid=self._solution['service_sid'], sid=sid, ) | python | def get(self, sid):
return AssetContext(self._version, service_sid=self._solution['service_sid'], sid=sid, ) | [
"def",
"get",
"(",
"self",
",",
"sid",
")",
":",
"return",
"AssetContext",
"(",
"self",
".",
"_version",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_sid'",
"]",
",",
"sid",
"=",
"sid",
",",
")"
] | Constructs a AssetContext
:param sid: The sid
:returns: twilio.rest.serverless.v1.service.asset.AssetContext
:rtype: twilio.rest.serverless.v1.service.asset.AssetContext | [
"Constructs",
"a",
"AssetContext"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/serverless/v1/service/asset/__init__.py#L139-L148 |
225,417 | twilio/twilio-python | twilio/rest/serverless/v1/service/asset/__init__.py | AssetPage.get_instance | def get_instance(self, payload):
"""
Build an instance of AssetInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.serverless.v1.service.asset.AssetInstance
:rtype: twilio.rest.serverless.v1.service.asset.AssetInstance
"""
return AssetInstance(self._version, payload, service_sid=self._solution['service_sid'], ) | python | def get_instance(self, payload):
return AssetInstance(self._version, payload, service_sid=self._solution['service_sid'], ) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"AssetInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_sid'",
"]",
",",
")"
] | Build an instance of AssetInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.serverless.v1.service.asset.AssetInstance
:rtype: twilio.rest.serverless.v1.service.asset.AssetInstance | [
"Build",
"an",
"instance",
"of",
"AssetInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/serverless/v1/service/asset/__init__.py#L192-L201 |
225,418 | twilio/twilio-python | twilio/rest/serverless/v1/service/asset/__init__.py | AssetContext.asset_versions | def asset_versions(self):
"""
Access the asset_versions
:returns: twilio.rest.serverless.v1.service.asset.asset_version.AssetVersionList
:rtype: twilio.rest.serverless.v1.service.asset.asset_version.AssetVersionList
"""
if self._asset_versions is None:
self._asset_versions = AssetVersionList(
self._version,
service_sid=self._solution['service_sid'],
asset_sid=self._solution['sid'],
)
return self._asset_versions | python | def asset_versions(self):
if self._asset_versions is None:
self._asset_versions = AssetVersionList(
self._version,
service_sid=self._solution['service_sid'],
asset_sid=self._solution['sid'],
)
return self._asset_versions | [
"def",
"asset_versions",
"(",
"self",
")",
":",
"if",
"self",
".",
"_asset_versions",
"is",
"None",
":",
"self",
".",
"_asset_versions",
"=",
"AssetVersionList",
"(",
"self",
".",
"_version",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_... | Access the asset_versions
:returns: twilio.rest.serverless.v1.service.asset.asset_version.AssetVersionList
:rtype: twilio.rest.serverless.v1.service.asset.asset_version.AssetVersionList | [
"Access",
"the",
"asset_versions"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/serverless/v1/service/asset/__init__.py#L285-L298 |
225,419 | twilio/twilio-python | twilio/rest/autopilot/v1/assistant/query.py | QueryList.page | def page(self, language=values.unset, model_build=values.unset,
status=values.unset, page_token=values.unset, page_number=values.unset,
page_size=values.unset):
"""
Retrieve a single page of QueryInstance records from the API.
Request is executed immediately
:param unicode language: The ISO language-country string that specifies the language used by the Query resources to read
:param unicode model_build: The SID or unique name of the Model Build to be queried
:param unicode status: The status of the resources to read
:param str page_token: PageToken provided by the API
:param int page_number: Page Number, this value is simply for client state
:param int page_size: Number of records to return, defaults to 50
:returns: Page of QueryInstance
:rtype: twilio.rest.autopilot.v1.assistant.query.QueryPage
"""
params = values.of({
'Language': language,
'ModelBuild': model_build,
'Status': status,
'PageToken': page_token,
'Page': page_number,
'PageSize': page_size,
})
response = self._version.page(
'GET',
self._uri,
params=params,
)
return QueryPage(self._version, response, self._solution) | python | def page(self, language=values.unset, model_build=values.unset,
status=values.unset, page_token=values.unset, page_number=values.unset,
page_size=values.unset):
params = values.of({
'Language': language,
'ModelBuild': model_build,
'Status': status,
'PageToken': page_token,
'Page': page_number,
'PageSize': page_size,
})
response = self._version.page(
'GET',
self._uri,
params=params,
)
return QueryPage(self._version, response, self._solution) | [
"def",
"page",
"(",
"self",
",",
"language",
"=",
"values",
".",
"unset",
",",
"model_build",
"=",
"values",
".",
"unset",
",",
"status",
"=",
"values",
".",
"unset",
",",
"page_token",
"=",
"values",
".",
"unset",
",",
"page_number",
"=",
"values",
".... | Retrieve a single page of QueryInstance records from the API.
Request is executed immediately
:param unicode language: The ISO language-country string that specifies the language used by the Query resources to read
:param unicode model_build: The SID or unique name of the Model Build to be queried
:param unicode status: The status of the resources to read
:param str page_token: PageToken provided by the API
:param int page_number: Page Number, this value is simply for client state
:param int page_size: Number of records to return, defaults to 50
:returns: Page of QueryInstance
:rtype: twilio.rest.autopilot.v1.assistant.query.QueryPage | [
"Retrieve",
"a",
"single",
"page",
"of",
"QueryInstance",
"records",
"from",
"the",
"API",
".",
"Request",
"is",
"executed",
"immediately"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/autopilot/v1/assistant/query.py#L98-L130 |
225,420 | twilio/twilio-python | twilio/rest/autopilot/v1/assistant/query.py | QueryList.get | def get(self, sid):
"""
Constructs a QueryContext
:param sid: The unique string that identifies the resource
:returns: twilio.rest.autopilot.v1.assistant.query.QueryContext
:rtype: twilio.rest.autopilot.v1.assistant.query.QueryContext
"""
return QueryContext(self._version, assistant_sid=self._solution['assistant_sid'], sid=sid, ) | python | def get(self, sid):
return QueryContext(self._version, assistant_sid=self._solution['assistant_sid'], sid=sid, ) | [
"def",
"get",
"(",
"self",
",",
"sid",
")",
":",
"return",
"QueryContext",
"(",
"self",
".",
"_version",
",",
"assistant_sid",
"=",
"self",
".",
"_solution",
"[",
"'assistant_sid'",
"]",
",",
"sid",
"=",
"sid",
",",
")"
] | Constructs a QueryContext
:param sid: The unique string that identifies the resource
:returns: twilio.rest.autopilot.v1.assistant.query.QueryContext
:rtype: twilio.rest.autopilot.v1.assistant.query.QueryContext | [
"Constructs",
"a",
"QueryContext"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/autopilot/v1/assistant/query.py#L171-L180 |
225,421 | twilio/twilio-python | twilio/rest/autopilot/v1/assistant/query.py | QueryPage.get_instance | def get_instance(self, payload):
"""
Build an instance of QueryInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.autopilot.v1.assistant.query.QueryInstance
:rtype: twilio.rest.autopilot.v1.assistant.query.QueryInstance
"""
return QueryInstance(self._version, payload, assistant_sid=self._solution['assistant_sid'], ) | python | def get_instance(self, payload):
return QueryInstance(self._version, payload, assistant_sid=self._solution['assistant_sid'], ) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"QueryInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"assistant_sid",
"=",
"self",
".",
"_solution",
"[",
"'assistant_sid'",
"]",
",",
")"
] | Build an instance of QueryInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.autopilot.v1.assistant.query.QueryInstance
:rtype: twilio.rest.autopilot.v1.assistant.query.QueryInstance | [
"Build",
"an",
"instance",
"of",
"QueryInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/autopilot/v1/assistant/query.py#L224-L233 |
225,422 | twilio/twilio-python | twilio/rest/preview/deployed_devices/fleet/device.py | DeviceList.create | def create(self, unique_name=values.unset, friendly_name=values.unset,
identity=values.unset, deployment_sid=values.unset,
enabled=values.unset):
"""
Create a new DeviceInstance
:param unicode unique_name: A unique, addressable name of this Device.
:param unicode friendly_name: A human readable description for this Device.
:param unicode identity: An identifier of the Device user.
:param unicode deployment_sid: The unique SID of the Deployment group.
:param bool enabled: The enabled
:returns: Newly created DeviceInstance
:rtype: twilio.rest.preview.deployed_devices.fleet.device.DeviceInstance
"""
data = values.of({
'UniqueName': unique_name,
'FriendlyName': friendly_name,
'Identity': identity,
'DeploymentSid': deployment_sid,
'Enabled': enabled,
})
payload = self._version.create(
'POST',
self._uri,
data=data,
)
return DeviceInstance(self._version, payload, fleet_sid=self._solution['fleet_sid'], ) | python | def create(self, unique_name=values.unset, friendly_name=values.unset,
identity=values.unset, deployment_sid=values.unset,
enabled=values.unset):
data = values.of({
'UniqueName': unique_name,
'FriendlyName': friendly_name,
'Identity': identity,
'DeploymentSid': deployment_sid,
'Enabled': enabled,
})
payload = self._version.create(
'POST',
self._uri,
data=data,
)
return DeviceInstance(self._version, payload, fleet_sid=self._solution['fleet_sid'], ) | [
"def",
"create",
"(",
"self",
",",
"unique_name",
"=",
"values",
".",
"unset",
",",
"friendly_name",
"=",
"values",
".",
"unset",
",",
"identity",
"=",
"values",
".",
"unset",
",",
"deployment_sid",
"=",
"values",
".",
"unset",
",",
"enabled",
"=",
"valu... | Create a new DeviceInstance
:param unicode unique_name: A unique, addressable name of this Device.
:param unicode friendly_name: A human readable description for this Device.
:param unicode identity: An identifier of the Device user.
:param unicode deployment_sid: The unique SID of the Deployment group.
:param bool enabled: The enabled
:returns: Newly created DeviceInstance
:rtype: twilio.rest.preview.deployed_devices.fleet.device.DeviceInstance | [
"Create",
"a",
"new",
"DeviceInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/preview/deployed_devices/fleet/device.py#L38-L67 |
225,423 | twilio/twilio-python | twilio/rest/preview/deployed_devices/fleet/device.py | DeviceList.get | def get(self, sid):
"""
Constructs a DeviceContext
:param sid: A string that uniquely identifies the Device.
:returns: twilio.rest.preview.deployed_devices.fleet.device.DeviceContext
:rtype: twilio.rest.preview.deployed_devices.fleet.device.DeviceContext
"""
return DeviceContext(self._version, fleet_sid=self._solution['fleet_sid'], sid=sid, ) | python | def get(self, sid):
return DeviceContext(self._version, fleet_sid=self._solution['fleet_sid'], sid=sid, ) | [
"def",
"get",
"(",
"self",
",",
"sid",
")",
":",
"return",
"DeviceContext",
"(",
"self",
".",
"_version",
",",
"fleet_sid",
"=",
"self",
".",
"_solution",
"[",
"'fleet_sid'",
"]",
",",
"sid",
"=",
"sid",
",",
")"
] | Constructs a DeviceContext
:param sid: A string that uniquely identifies the Device.
:returns: twilio.rest.preview.deployed_devices.fleet.device.DeviceContext
:rtype: twilio.rest.preview.deployed_devices.fleet.device.DeviceContext | [
"Constructs",
"a",
"DeviceContext"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/preview/deployed_devices/fleet/device.py#L158-L167 |
225,424 | twilio/twilio-python | twilio/rest/preview/deployed_devices/fleet/device.py | DevicePage.get_instance | def get_instance(self, payload):
"""
Build an instance of DeviceInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.preview.deployed_devices.fleet.device.DeviceInstance
:rtype: twilio.rest.preview.deployed_devices.fleet.device.DeviceInstance
"""
return DeviceInstance(self._version, payload, fleet_sid=self._solution['fleet_sid'], ) | python | def get_instance(self, payload):
return DeviceInstance(self._version, payload, fleet_sid=self._solution['fleet_sid'], ) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"DeviceInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"fleet_sid",
"=",
"self",
".",
"_solution",
"[",
"'fleet_sid'",
"]",
",",
")"
] | Build an instance of DeviceInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.preview.deployed_devices.fleet.device.DeviceInstance
:rtype: twilio.rest.preview.deployed_devices.fleet.device.DeviceInstance | [
"Build",
"an",
"instance",
"of",
"DeviceInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/preview/deployed_devices/fleet/device.py#L211-L220 |
225,425 | twilio/twilio-python | twilio/rest/api/v2010/account/recording/__init__.py | RecordingList.get | def get(self, sid):
"""
Constructs a RecordingContext
:param sid: The unique string that identifies the resource
:returns: twilio.rest.api.v2010.account.recording.RecordingContext
:rtype: twilio.rest.api.v2010.account.recording.RecordingContext
"""
return RecordingContext(self._version, account_sid=self._solution['account_sid'], sid=sid, ) | python | def get(self, sid):
return RecordingContext(self._version, account_sid=self._solution['account_sid'], sid=sid, ) | [
"def",
"get",
"(",
"self",
",",
"sid",
")",
":",
"return",
"RecordingContext",
"(",
"self",
".",
"_version",
",",
"account_sid",
"=",
"self",
".",
"_solution",
"[",
"'account_sid'",
"]",
",",
"sid",
"=",
"sid",
",",
")"
] | Constructs a RecordingContext
:param sid: The unique string that identifies the resource
:returns: twilio.rest.api.v2010.account.recording.RecordingContext
:rtype: twilio.rest.api.v2010.account.recording.RecordingContext | [
"Constructs",
"a",
"RecordingContext"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/recording/__init__.py#L165-L174 |
225,426 | twilio/twilio-python | twilio/rest/api/v2010/account/recording/__init__.py | RecordingContext.add_on_results | def add_on_results(self):
"""
Access the add_on_results
:returns: twilio.rest.api.v2010.account.recording.add_on_result.AddOnResultList
:rtype: twilio.rest.api.v2010.account.recording.add_on_result.AddOnResultList
"""
if self._add_on_results is None:
self._add_on_results = AddOnResultList(
self._version,
account_sid=self._solution['account_sid'],
reference_sid=self._solution['sid'],
)
return self._add_on_results | python | def add_on_results(self):
if self._add_on_results is None:
self._add_on_results = AddOnResultList(
self._version,
account_sid=self._solution['account_sid'],
reference_sid=self._solution['sid'],
)
return self._add_on_results | [
"def",
"add_on_results",
"(",
"self",
")",
":",
"if",
"self",
".",
"_add_on_results",
"is",
"None",
":",
"self",
".",
"_add_on_results",
"=",
"AddOnResultList",
"(",
"self",
".",
"_version",
",",
"account_sid",
"=",
"self",
".",
"_solution",
"[",
"'account_s... | Access the add_on_results
:returns: twilio.rest.api.v2010.account.recording.add_on_result.AddOnResultList
:rtype: twilio.rest.api.v2010.account.recording.add_on_result.AddOnResultList | [
"Access",
"the",
"add_on_results"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/recording/__init__.py#L309-L322 |
225,427 | twilio/twilio-python | twilio/rest/insights/v1/summary.py | CallSummaryContext.fetch | def fetch(self):
"""
Fetch a CallSummaryInstance
:returns: Fetched CallSummaryInstance
:rtype: twilio.rest.insights.v1.summary.CallSummaryInstance
"""
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return CallSummaryInstance(self._version, payload, call_sid=self._solution['call_sid'], ) | python | def fetch(self):
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return CallSummaryInstance(self._version, payload, call_sid=self._solution['call_sid'], ) | [
"def",
"fetch",
"(",
"self",
")",
":",
"params",
"=",
"values",
".",
"of",
"(",
"{",
"}",
")",
"payload",
"=",
"self",
".",
"_version",
".",
"fetch",
"(",
"'GET'",
",",
"self",
".",
"_uri",
",",
"params",
"=",
"params",
",",
")",
"return",
"CallS... | Fetch a CallSummaryInstance
:returns: Fetched CallSummaryInstance
:rtype: twilio.rest.insights.v1.summary.CallSummaryInstance | [
"Fetch",
"a",
"CallSummaryInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/insights/v1/summary.py#L130-L145 |
225,428 | twilio/twilio-python | twilio/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/__init__.py | AuthTypeCallsPage.get_instance | def get_instance(self, payload):
"""
Build an instance of AuthTypeCallsInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.api.v2010.account.sip.domain.auth_types.auth_calls_mapping.AuthTypeCallsInstance
:rtype: twilio.rest.api.v2010.account.sip.domain.auth_types.auth_calls_mapping.AuthTypeCallsInstance
"""
return AuthTypeCallsInstance(
self._version,
payload,
account_sid=self._solution['account_sid'],
domain_sid=self._solution['domain_sid'],
) | python | def get_instance(self, payload):
return AuthTypeCallsInstance(
self._version,
payload,
account_sid=self._solution['account_sid'],
domain_sid=self._solution['domain_sid'],
) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"AuthTypeCallsInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"account_sid",
"=",
"self",
".",
"_solution",
"[",
"'account_sid'",
"]",
",",
"domain_sid",
"=",
"self",
".",
... | Build an instance of AuthTypeCallsInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.api.v2010.account.sip.domain.auth_types.auth_calls_mapping.AuthTypeCallsInstance
:rtype: twilio.rest.api.v2010.account.sip.domain.auth_types.auth_calls_mapping.AuthTypeCallsInstance | [
"Build",
"an",
"instance",
"of",
"AuthTypeCallsInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/__init__.py#L101-L115 |
225,429 | twilio/twilio-python | twilio/base/serialize.py | prefixed_collapsible_map | def prefixed_collapsible_map(m, prefix):
"""
Return a dict of params corresponding to those in m with the added prefix
"""
if m == values.unset:
return {}
def flatten_dict(d, result={}, prv_keys=[]):
for k, v in d.items():
if isinstance(v, dict):
flatten_dict(v, result, prv_keys + [k])
else:
result['.'.join(prv_keys + [k])] = v
return result
if isinstance(m, dict):
flattened = flatten_dict(m)
return {'{}.{}'.format(prefix, k): v for k, v in flattened.items()}
return {} | python | def prefixed_collapsible_map(m, prefix):
if m == values.unset:
return {}
def flatten_dict(d, result={}, prv_keys=[]):
for k, v in d.items():
if isinstance(v, dict):
flatten_dict(v, result, prv_keys + [k])
else:
result['.'.join(prv_keys + [k])] = v
return result
if isinstance(m, dict):
flattened = flatten_dict(m)
return {'{}.{}'.format(prefix, k): v for k, v in flattened.items()}
return {} | [
"def",
"prefixed_collapsible_map",
"(",
"m",
",",
"prefix",
")",
":",
"if",
"m",
"==",
"values",
".",
"unset",
":",
"return",
"{",
"}",
"def",
"flatten_dict",
"(",
"d",
",",
"result",
"=",
"{",
"}",
",",
"prv_keys",
"=",
"[",
"]",
")",
":",
"for",
... | Return a dict of params corresponding to those in m with the added prefix | [
"Return",
"a",
"dict",
"of",
"params",
"corresponding",
"to",
"those",
"in",
"m",
"with",
"the",
"added",
"prefix"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/base/serialize.py#L35-L55 |
225,430 | twilio/twilio-python | twilio/base/serialize.py | object | def object(obj):
"""
Return a jsonified string represenation of obj if obj is jsonifiable else
return obj untouched
"""
if isinstance(obj, dict) or isinstance(obj, list):
return json.dumps(obj)
return obj | python | def object(obj):
if isinstance(obj, dict) or isinstance(obj, list):
return json.dumps(obj)
return obj | [
"def",
"object",
"(",
"obj",
")",
":",
"if",
"isinstance",
"(",
"obj",
",",
"dict",
")",
"or",
"isinstance",
"(",
"obj",
",",
"list",
")",
":",
"return",
"json",
".",
"dumps",
"(",
"obj",
")",
"return",
"obj"
] | Return a jsonified string represenation of obj if obj is jsonifiable else
return obj untouched | [
"Return",
"a",
"jsonified",
"string",
"represenation",
"of",
"obj",
"if",
"obj",
"is",
"jsonifiable",
"else",
"return",
"obj",
"untouched"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/base/serialize.py#L58-L65 |
225,431 | twilio/twilio-python | twilio/base/serialize.py | map | def map(lst, serialize_func):
"""
Applies serialize_func to every element in lst
"""
if not isinstance(lst, list):
return lst
return [serialize_func(e) for e in lst] | python | def map(lst, serialize_func):
if not isinstance(lst, list):
return lst
return [serialize_func(e) for e in lst] | [
"def",
"map",
"(",
"lst",
",",
"serialize_func",
")",
":",
"if",
"not",
"isinstance",
"(",
"lst",
",",
"list",
")",
":",
"return",
"lst",
"return",
"[",
"serialize_func",
"(",
"e",
")",
"for",
"e",
"in",
"lst",
"]"
] | Applies serialize_func to every element in lst | [
"Applies",
"serialize_func",
"to",
"every",
"element",
"in",
"lst"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/base/serialize.py#L68-L74 |
225,432 | twilio/twilio-python | twilio/jwt/access_token/__init__.py | AccessToken.add_grant | def add_grant(self, grant):
"""Add a grant to this AccessToken"""
if not isinstance(grant, AccessTokenGrant):
raise ValueError('Grant must be an instance of AccessTokenGrant.')
self.grants.append(grant) | python | def add_grant(self, grant):
if not isinstance(grant, AccessTokenGrant):
raise ValueError('Grant must be an instance of AccessTokenGrant.')
self.grants.append(grant) | [
"def",
"add_grant",
"(",
"self",
",",
"grant",
")",
":",
"if",
"not",
"isinstance",
"(",
"grant",
",",
"AccessTokenGrant",
")",
":",
"raise",
"ValueError",
"(",
"'Grant must be an instance of AccessTokenGrant.'",
")",
"self",
".",
"grants",
".",
"append",
"(",
... | Add a grant to this AccessToken | [
"Add",
"a",
"grant",
"to",
"this",
"AccessToken"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/jwt/access_token/__init__.py#L43-L47 |
225,433 | twilio/twilio-python | twilio/rest/api/v2010/account/available_phone_number/__init__.py | AvailablePhoneNumberCountryList.get | def get(self, country_code):
"""
Constructs a AvailablePhoneNumberCountryContext
:param country_code: The ISO country code of the country to fetch available phone number information about
:returns: twilio.rest.api.v2010.account.available_phone_number.AvailablePhoneNumberCountryContext
:rtype: twilio.rest.api.v2010.account.available_phone_number.AvailablePhoneNumberCountryContext
"""
return AvailablePhoneNumberCountryContext(
self._version,
account_sid=self._solution['account_sid'],
country_code=country_code,
) | python | def get(self, country_code):
return AvailablePhoneNumberCountryContext(
self._version,
account_sid=self._solution['account_sid'],
country_code=country_code,
) | [
"def",
"get",
"(",
"self",
",",
"country_code",
")",
":",
"return",
"AvailablePhoneNumberCountryContext",
"(",
"self",
".",
"_version",
",",
"account_sid",
"=",
"self",
".",
"_solution",
"[",
"'account_sid'",
"]",
",",
"country_code",
"=",
"country_code",
",",
... | Constructs a AvailablePhoneNumberCountryContext
:param country_code: The ISO country code of the country to fetch available phone number information about
:returns: twilio.rest.api.v2010.account.available_phone_number.AvailablePhoneNumberCountryContext
:rtype: twilio.rest.api.v2010.account.available_phone_number.AvailablePhoneNumberCountryContext | [
"Constructs",
"a",
"AvailablePhoneNumberCountryContext"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/available_phone_number/__init__.py#L123-L136 |
225,434 | twilio/twilio-python | twilio/rest/api/v2010/account/available_phone_number/__init__.py | AvailablePhoneNumberCountryPage.get_instance | def get_instance(self, payload):
"""
Build an instance of AvailablePhoneNumberCountryInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.api.v2010.account.available_phone_number.AvailablePhoneNumberCountryInstance
:rtype: twilio.rest.api.v2010.account.available_phone_number.AvailablePhoneNumberCountryInstance
"""
return AvailablePhoneNumberCountryInstance(
self._version,
payload,
account_sid=self._solution['account_sid'],
) | python | def get_instance(self, payload):
return AvailablePhoneNumberCountryInstance(
self._version,
payload,
account_sid=self._solution['account_sid'],
) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"AvailablePhoneNumberCountryInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"account_sid",
"=",
"self",
".",
"_solution",
"[",
"'account_sid'",
"]",
",",
")"
] | Build an instance of AvailablePhoneNumberCountryInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.api.v2010.account.available_phone_number.AvailablePhoneNumberCountryInstance
:rtype: twilio.rest.api.v2010.account.available_phone_number.AvailablePhoneNumberCountryInstance | [
"Build",
"an",
"instance",
"of",
"AvailablePhoneNumberCountryInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/available_phone_number/__init__.py#L182-L195 |
225,435 | twilio/twilio-python | twilio/rest/api/v2010/account/available_phone_number/__init__.py | AvailablePhoneNumberCountryContext.fetch | def fetch(self):
"""
Fetch a AvailablePhoneNumberCountryInstance
:returns: Fetched AvailablePhoneNumberCountryInstance
:rtype: twilio.rest.api.v2010.account.available_phone_number.AvailablePhoneNumberCountryInstance
"""
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return AvailablePhoneNumberCountryInstance(
self._version,
payload,
account_sid=self._solution['account_sid'],
country_code=self._solution['country_code'],
) | python | def fetch(self):
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return AvailablePhoneNumberCountryInstance(
self._version,
payload,
account_sid=self._solution['account_sid'],
country_code=self._solution['country_code'],
) | [
"def",
"fetch",
"(",
"self",
")",
":",
"params",
"=",
"values",
".",
"of",
"(",
"{",
"}",
")",
"payload",
"=",
"self",
".",
"_version",
".",
"fetch",
"(",
"'GET'",
",",
"self",
".",
"_uri",
",",
"params",
"=",
"params",
",",
")",
"return",
"Avail... | Fetch a AvailablePhoneNumberCountryInstance
:returns: Fetched AvailablePhoneNumberCountryInstance
:rtype: twilio.rest.api.v2010.account.available_phone_number.AvailablePhoneNumberCountryInstance | [
"Fetch",
"a",
"AvailablePhoneNumberCountryInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/available_phone_number/__init__.py#L236-L256 |
225,436 | twilio/twilio-python | twilio/rest/api/v2010/account/available_phone_number/__init__.py | AvailablePhoneNumberCountryContext.local | def local(self):
"""
Access the local
:returns: twilio.rest.api.v2010.account.available_phone_number.local.LocalList
:rtype: twilio.rest.api.v2010.account.available_phone_number.local.LocalList
"""
if self._local is None:
self._local = LocalList(
self._version,
account_sid=self._solution['account_sid'],
country_code=self._solution['country_code'],
)
return self._local | python | def local(self):
if self._local is None:
self._local = LocalList(
self._version,
account_sid=self._solution['account_sid'],
country_code=self._solution['country_code'],
)
return self._local | [
"def",
"local",
"(",
"self",
")",
":",
"if",
"self",
".",
"_local",
"is",
"None",
":",
"self",
".",
"_local",
"=",
"LocalList",
"(",
"self",
".",
"_version",
",",
"account_sid",
"=",
"self",
".",
"_solution",
"[",
"'account_sid'",
"]",
",",
"country_co... | Access the local
:returns: twilio.rest.api.v2010.account.available_phone_number.local.LocalList
:rtype: twilio.rest.api.v2010.account.available_phone_number.local.LocalList | [
"Access",
"the",
"local"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/available_phone_number/__init__.py#L259-L272 |
225,437 | twilio/twilio-python | twilio/rest/api/v2010/account/available_phone_number/__init__.py | AvailablePhoneNumberCountryContext.national | def national(self):
"""
Access the national
:returns: twilio.rest.api.v2010.account.available_phone_number.national.NationalList
:rtype: twilio.rest.api.v2010.account.available_phone_number.national.NationalList
"""
if self._national is None:
self._national = NationalList(
self._version,
account_sid=self._solution['account_sid'],
country_code=self._solution['country_code'],
)
return self._national | python | def national(self):
if self._national is None:
self._national = NationalList(
self._version,
account_sid=self._solution['account_sid'],
country_code=self._solution['country_code'],
)
return self._national | [
"def",
"national",
"(",
"self",
")",
":",
"if",
"self",
".",
"_national",
"is",
"None",
":",
"self",
".",
"_national",
"=",
"NationalList",
"(",
"self",
".",
"_version",
",",
"account_sid",
"=",
"self",
".",
"_solution",
"[",
"'account_sid'",
"]",
",",
... | Access the national
:returns: twilio.rest.api.v2010.account.available_phone_number.national.NationalList
:rtype: twilio.rest.api.v2010.account.available_phone_number.national.NationalList | [
"Access",
"the",
"national"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/available_phone_number/__init__.py#L307-L320 |
225,438 | twilio/twilio-python | twilio/rest/api/v2010/account/available_phone_number/__init__.py | AvailablePhoneNumberCountryContext.voip | def voip(self):
"""
Access the voip
:returns: twilio.rest.api.v2010.account.available_phone_number.voip.VoipList
:rtype: twilio.rest.api.v2010.account.available_phone_number.voip.VoipList
"""
if self._voip is None:
self._voip = VoipList(
self._version,
account_sid=self._solution['account_sid'],
country_code=self._solution['country_code'],
)
return self._voip | python | def voip(self):
if self._voip is None:
self._voip = VoipList(
self._version,
account_sid=self._solution['account_sid'],
country_code=self._solution['country_code'],
)
return self._voip | [
"def",
"voip",
"(",
"self",
")",
":",
"if",
"self",
".",
"_voip",
"is",
"None",
":",
"self",
".",
"_voip",
"=",
"VoipList",
"(",
"self",
".",
"_version",
",",
"account_sid",
"=",
"self",
".",
"_solution",
"[",
"'account_sid'",
"]",
",",
"country_code",... | Access the voip
:returns: twilio.rest.api.v2010.account.available_phone_number.voip.VoipList
:rtype: twilio.rest.api.v2010.account.available_phone_number.voip.VoipList | [
"Access",
"the",
"voip"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/available_phone_number/__init__.py#L323-L336 |
225,439 | twilio/twilio-python | twilio/rest/api/v2010/account/available_phone_number/__init__.py | AvailablePhoneNumberCountryContext.shared_cost | def shared_cost(self):
"""
Access the shared_cost
:returns: twilio.rest.api.v2010.account.available_phone_number.shared_cost.SharedCostList
:rtype: twilio.rest.api.v2010.account.available_phone_number.shared_cost.SharedCostList
"""
if self._shared_cost is None:
self._shared_cost = SharedCostList(
self._version,
account_sid=self._solution['account_sid'],
country_code=self._solution['country_code'],
)
return self._shared_cost | python | def shared_cost(self):
if self._shared_cost is None:
self._shared_cost = SharedCostList(
self._version,
account_sid=self._solution['account_sid'],
country_code=self._solution['country_code'],
)
return self._shared_cost | [
"def",
"shared_cost",
"(",
"self",
")",
":",
"if",
"self",
".",
"_shared_cost",
"is",
"None",
":",
"self",
".",
"_shared_cost",
"=",
"SharedCostList",
"(",
"self",
".",
"_version",
",",
"account_sid",
"=",
"self",
".",
"_solution",
"[",
"'account_sid'",
"]... | Access the shared_cost
:returns: twilio.rest.api.v2010.account.available_phone_number.shared_cost.SharedCostList
:rtype: twilio.rest.api.v2010.account.available_phone_number.shared_cost.SharedCostList | [
"Access",
"the",
"shared_cost"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/available_phone_number/__init__.py#L339-L352 |
225,440 | twilio/twilio-python | twilio/rest/api/v2010/account/available_phone_number/__init__.py | AvailablePhoneNumberCountryContext.machine_to_machine | def machine_to_machine(self):
"""
Access the machine_to_machine
:returns: twilio.rest.api.v2010.account.available_phone_number.machine_to_machine.MachineToMachineList
:rtype: twilio.rest.api.v2010.account.available_phone_number.machine_to_machine.MachineToMachineList
"""
if self._machine_to_machine is None:
self._machine_to_machine = MachineToMachineList(
self._version,
account_sid=self._solution['account_sid'],
country_code=self._solution['country_code'],
)
return self._machine_to_machine | python | def machine_to_machine(self):
if self._machine_to_machine is None:
self._machine_to_machine = MachineToMachineList(
self._version,
account_sid=self._solution['account_sid'],
country_code=self._solution['country_code'],
)
return self._machine_to_machine | [
"def",
"machine_to_machine",
"(",
"self",
")",
":",
"if",
"self",
".",
"_machine_to_machine",
"is",
"None",
":",
"self",
".",
"_machine_to_machine",
"=",
"MachineToMachineList",
"(",
"self",
".",
"_version",
",",
"account_sid",
"=",
"self",
".",
"_solution",
"... | Access the machine_to_machine
:returns: twilio.rest.api.v2010.account.available_phone_number.machine_to_machine.MachineToMachineList
:rtype: twilio.rest.api.v2010.account.available_phone_number.machine_to_machine.MachineToMachineList | [
"Access",
"the",
"machine_to_machine"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/available_phone_number/__init__.py#L355-L368 |
225,441 | twilio/twilio-python | twilio/rest/video/v1/room/room_participant/room_participant_published_track.py | PublishedTrackList.get | def get(self, sid):
"""
Constructs a PublishedTrackContext
:param sid: A 34 character string that uniquely identifies this resource.
:returns: twilio.rest.video.v1.room.room_participant.room_participant_published_track.PublishedTrackContext
:rtype: twilio.rest.video.v1.room.room_participant.room_participant_published_track.PublishedTrackContext
"""
return PublishedTrackContext(
self._version,
room_sid=self._solution['room_sid'],
participant_sid=self._solution['participant_sid'],
sid=sid,
) | python | def get(self, sid):
return PublishedTrackContext(
self._version,
room_sid=self._solution['room_sid'],
participant_sid=self._solution['participant_sid'],
sid=sid,
) | [
"def",
"get",
"(",
"self",
",",
"sid",
")",
":",
"return",
"PublishedTrackContext",
"(",
"self",
".",
"_version",
",",
"room_sid",
"=",
"self",
".",
"_solution",
"[",
"'room_sid'",
"]",
",",
"participant_sid",
"=",
"self",
".",
"_solution",
"[",
"'particip... | Constructs a PublishedTrackContext
:param sid: A 34 character string that uniquely identifies this resource.
:returns: twilio.rest.video.v1.room.room_participant.room_participant_published_track.PublishedTrackContext
:rtype: twilio.rest.video.v1.room.room_participant.room_participant_published_track.PublishedTrackContext | [
"Constructs",
"a",
"PublishedTrackContext"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/video/v1/room/room_participant/room_participant_published_track.py#L118-L132 |
225,442 | twilio/twilio-python | twilio/rest/video/v1/room/room_participant/room_participant_published_track.py | PublishedTrackPage.get_instance | def get_instance(self, payload):
"""
Build an instance of PublishedTrackInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.video.v1.room.room_participant.room_participant_published_track.PublishedTrackInstance
:rtype: twilio.rest.video.v1.room.room_participant.room_participant_published_track.PublishedTrackInstance
"""
return PublishedTrackInstance(
self._version,
payload,
room_sid=self._solution['room_sid'],
participant_sid=self._solution['participant_sid'],
) | python | def get_instance(self, payload):
return PublishedTrackInstance(
self._version,
payload,
room_sid=self._solution['room_sid'],
participant_sid=self._solution['participant_sid'],
) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"PublishedTrackInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"room_sid",
"=",
"self",
".",
"_solution",
"[",
"'room_sid'",
"]",
",",
"participant_sid",
"=",
"self",
".",
... | Build an instance of PublishedTrackInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.video.v1.room.room_participant.room_participant_published_track.PublishedTrackInstance
:rtype: twilio.rest.video.v1.room.room_participant.room_participant_published_track.PublishedTrackInstance | [
"Build",
"an",
"instance",
"of",
"PublishedTrackInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/video/v1/room/room_participant/room_participant_published_track.py#L180-L194 |
225,443 | twilio/twilio-python | twilio/rest/video/v1/room/room_participant/room_participant_published_track.py | PublishedTrackContext.fetch | def fetch(self):
"""
Fetch a PublishedTrackInstance
:returns: Fetched PublishedTrackInstance
:rtype: twilio.rest.video.v1.room.room_participant.room_participant_published_track.PublishedTrackInstance
"""
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return PublishedTrackInstance(
self._version,
payload,
room_sid=self._solution['room_sid'],
participant_sid=self._solution['participant_sid'],
sid=self._solution['sid'],
) | python | def fetch(self):
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return PublishedTrackInstance(
self._version,
payload,
room_sid=self._solution['room_sid'],
participant_sid=self._solution['participant_sid'],
sid=self._solution['sid'],
) | [
"def",
"fetch",
"(",
"self",
")",
":",
"params",
"=",
"values",
".",
"of",
"(",
"{",
"}",
")",
"payload",
"=",
"self",
".",
"_version",
".",
"fetch",
"(",
"'GET'",
",",
"self",
".",
"_uri",
",",
"params",
"=",
"params",
",",
")",
"return",
"Publi... | Fetch a PublishedTrackInstance
:returns: Fetched PublishedTrackInstance
:rtype: twilio.rest.video.v1.room.room_participant.room_participant_published_track.PublishedTrackInstance | [
"Fetch",
"a",
"PublishedTrackInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/video/v1/room/room_participant/room_participant_published_track.py#L227-L248 |
225,444 | twilio/twilio-python | twilio/rest/api/v2010/account/queue/__init__.py | QueueList.get | def get(self, sid):
"""
Constructs a QueueContext
:param sid: The unique string that identifies this resource
:returns: twilio.rest.api.v2010.account.queue.QueueContext
:rtype: twilio.rest.api.v2010.account.queue.QueueContext
"""
return QueueContext(self._version, account_sid=self._solution['account_sid'], sid=sid, ) | python | def get(self, sid):
return QueueContext(self._version, account_sid=self._solution['account_sid'], sid=sid, ) | [
"def",
"get",
"(",
"self",
",",
"sid",
")",
":",
"return",
"QueueContext",
"(",
"self",
".",
"_version",
",",
"account_sid",
"=",
"self",
".",
"_solution",
"[",
"'account_sid'",
"]",
",",
"sid",
"=",
"sid",
",",
")"
] | Constructs a QueueContext
:param sid: The unique string that identifies this resource
:returns: twilio.rest.api.v2010.account.queue.QueueContext
:rtype: twilio.rest.api.v2010.account.queue.QueueContext | [
"Constructs",
"a",
"QueueContext"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/queue/__init__.py#L138-L147 |
225,445 | twilio/twilio-python | twilio/rest/api/v2010/account/queue/__init__.py | QueuePage.get_instance | def get_instance(self, payload):
"""
Build an instance of QueueInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.api.v2010.account.queue.QueueInstance
:rtype: twilio.rest.api.v2010.account.queue.QueueInstance
"""
return QueueInstance(self._version, payload, account_sid=self._solution['account_sid'], ) | python | def get_instance(self, payload):
return QueueInstance(self._version, payload, account_sid=self._solution['account_sid'], ) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"QueueInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"account_sid",
"=",
"self",
".",
"_solution",
"[",
"'account_sid'",
"]",
",",
")"
] | Build an instance of QueueInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.api.v2010.account.queue.QueueInstance
:rtype: twilio.rest.api.v2010.account.queue.QueueInstance | [
"Build",
"an",
"instance",
"of",
"QueueInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/queue/__init__.py#L189-L198 |
225,446 | twilio/twilio-python | twilio/rest/api/v2010/account/queue/__init__.py | QueueInstance.update | def update(self, friendly_name=values.unset, max_size=values.unset):
"""
Update the QueueInstance
:param unicode friendly_name: A string to describe this resource
:param unicode max_size: The max number of calls allowed in the queue
:returns: Updated QueueInstance
:rtype: twilio.rest.api.v2010.account.queue.QueueInstance
"""
return self._proxy.update(friendly_name=friendly_name, max_size=max_size, ) | python | def update(self, friendly_name=values.unset, max_size=values.unset):
return self._proxy.update(friendly_name=friendly_name, max_size=max_size, ) | [
"def",
"update",
"(",
"self",
",",
"friendly_name",
"=",
"values",
".",
"unset",
",",
"max_size",
"=",
"values",
".",
"unset",
")",
":",
"return",
"self",
".",
"_proxy",
".",
"update",
"(",
"friendly_name",
"=",
"friendly_name",
",",
"max_size",
"=",
"ma... | Update the QueueInstance
:param unicode friendly_name: A string to describe this resource
:param unicode max_size: The max number of calls allowed in the queue
:returns: Updated QueueInstance
:rtype: twilio.rest.api.v2010.account.queue.QueueInstance | [
"Update",
"the",
"QueueInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/queue/__init__.py#L452-L462 |
225,447 | twilio/twilio-python | twilio/rest/api/v2010/account/conference/participant.py | ParticipantList.stream | def stream(self, muted=values.unset, hold=values.unset, coaching=values.unset,
limit=None, page_size=None):
"""
Streams ParticipantInstance records from the API as a generator stream.
This operation lazily loads records as efficiently as possible until the limit
is reached.
The results are returned as a generator, so this operation is memory efficient.
:param bool muted: Whether to return only participants that are muted
:param bool hold: Whether to return only participants that are on hold
:param bool coaching: Whether to return only participants who are coaching another call
:param int limit: Upper limit for the number of records to return. stream()
guarantees to never return more than limit. Default is no limit
:param int page_size: Number of records to fetch per request, when not set will use
the default value of 50 records. If no page_size is defined
but a limit is defined, stream() will attempt to read the
limit with the most efficient page size, i.e. min(limit, 1000)
:returns: Generator that will yield up to limit results
:rtype: list[twilio.rest.api.v2010.account.conference.participant.ParticipantInstance]
"""
limits = self._version.read_limits(limit, page_size)
page = self.page(muted=muted, hold=hold, coaching=coaching, page_size=limits['page_size'], )
return self._version.stream(page, limits['limit'], limits['page_limit']) | python | def stream(self, muted=values.unset, hold=values.unset, coaching=values.unset,
limit=None, page_size=None):
limits = self._version.read_limits(limit, page_size)
page = self.page(muted=muted, hold=hold, coaching=coaching, page_size=limits['page_size'], )
return self._version.stream(page, limits['limit'], limits['page_limit']) | [
"def",
"stream",
"(",
"self",
",",
"muted",
"=",
"values",
".",
"unset",
",",
"hold",
"=",
"values",
".",
"unset",
",",
"coaching",
"=",
"values",
".",
"unset",
",",
"limit",
"=",
"None",
",",
"page_size",
"=",
"None",
")",
":",
"limits",
"=",
"sel... | Streams ParticipantInstance records from the API as a generator stream.
This operation lazily loads records as efficiently as possible until the limit
is reached.
The results are returned as a generator, so this operation is memory efficient.
:param bool muted: Whether to return only participants that are muted
:param bool hold: Whether to return only participants that are on hold
:param bool coaching: Whether to return only participants who are coaching another call
:param int limit: Upper limit for the number of records to return. stream()
guarantees to never return more than limit. Default is no limit
:param int page_size: Number of records to fetch per request, when not set will use
the default value of 50 records. If no page_size is defined
but a limit is defined, stream() will attempt to read the
limit with the most efficient page size, i.e. min(limit, 1000)
:returns: Generator that will yield up to limit results
:rtype: list[twilio.rest.api.v2010.account.conference.participant.ParticipantInstance] | [
"Streams",
"ParticipantInstance",
"records",
"from",
"the",
"API",
"as",
"a",
"generator",
"stream",
".",
"This",
"operation",
"lazily",
"loads",
"records",
"as",
"efficiently",
"as",
"possible",
"until",
"the",
"limit",
"is",
"reached",
".",
"The",
"results",
... | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/conference/participant.py#L147-L172 |
225,448 | twilio/twilio-python | twilio/rest/api/v2010/account/conference/participant.py | ParticipantContext.fetch | def fetch(self):
"""
Fetch a ParticipantInstance
:returns: Fetched ParticipantInstance
:rtype: twilio.rest.api.v2010.account.conference.participant.ParticipantInstance
"""
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return ParticipantInstance(
self._version,
payload,
account_sid=self._solution['account_sid'],
conference_sid=self._solution['conference_sid'],
call_sid=self._solution['call_sid'],
) | python | def fetch(self):
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return ParticipantInstance(
self._version,
payload,
account_sid=self._solution['account_sid'],
conference_sid=self._solution['conference_sid'],
call_sid=self._solution['call_sid'],
) | [
"def",
"fetch",
"(",
"self",
")",
":",
"params",
"=",
"values",
".",
"of",
"(",
"{",
"}",
")",
"payload",
"=",
"self",
".",
"_version",
".",
"fetch",
"(",
"'GET'",
",",
"self",
".",
"_uri",
",",
"params",
"=",
"params",
",",
")",
"return",
"Parti... | Fetch a ParticipantInstance
:returns: Fetched ParticipantInstance
:rtype: twilio.rest.api.v2010.account.conference.participant.ParticipantInstance | [
"Fetch",
"a",
"ParticipantInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/conference/participant.py#L366-L387 |
225,449 | twilio/twilio-python | twilio/rest/sync/v1/service/sync_map/sync_map_permission.py | SyncMapPermissionList.get | def get(self, identity):
"""
Constructs a SyncMapPermissionContext
:param identity: Identity of the user to whom the Sync Map Permission applies.
:returns: twilio.rest.sync.v1.service.sync_map.sync_map_permission.SyncMapPermissionContext
:rtype: twilio.rest.sync.v1.service.sync_map.sync_map_permission.SyncMapPermissionContext
"""
return SyncMapPermissionContext(
self._version,
service_sid=self._solution['service_sid'],
map_sid=self._solution['map_sid'],
identity=identity,
) | python | def get(self, identity):
return SyncMapPermissionContext(
self._version,
service_sid=self._solution['service_sid'],
map_sid=self._solution['map_sid'],
identity=identity,
) | [
"def",
"get",
"(",
"self",
",",
"identity",
")",
":",
"return",
"SyncMapPermissionContext",
"(",
"self",
".",
"_version",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_sid'",
"]",
",",
"map_sid",
"=",
"self",
".",
"_solution",
"[",
"'ma... | Constructs a SyncMapPermissionContext
:param identity: Identity of the user to whom the Sync Map Permission applies.
:returns: twilio.rest.sync.v1.service.sync_map.sync_map_permission.SyncMapPermissionContext
:rtype: twilio.rest.sync.v1.service.sync_map.sync_map_permission.SyncMapPermissionContext | [
"Constructs",
"a",
"SyncMapPermissionContext"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py#L118-L132 |
225,450 | twilio/twilio-python | twilio/rest/sync/v1/service/sync_map/sync_map_permission.py | SyncMapPermissionPage.get_instance | def get_instance(self, payload):
"""
Build an instance of SyncMapPermissionInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.sync.v1.service.sync_map.sync_map_permission.SyncMapPermissionInstance
:rtype: twilio.rest.sync.v1.service.sync_map.sync_map_permission.SyncMapPermissionInstance
"""
return SyncMapPermissionInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
map_sid=self._solution['map_sid'],
) | python | def get_instance(self, payload):
return SyncMapPermissionInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
map_sid=self._solution['map_sid'],
) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"SyncMapPermissionInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_sid'",
"]",
",",
"map_sid",
"=",
"self",
".",... | Build an instance of SyncMapPermissionInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.sync.v1.service.sync_map.sync_map_permission.SyncMapPermissionInstance
:rtype: twilio.rest.sync.v1.service.sync_map.sync_map_permission.SyncMapPermissionInstance | [
"Build",
"an",
"instance",
"of",
"SyncMapPermissionInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py#L181-L195 |
225,451 | twilio/twilio-python | twilio/rest/sync/v1/service/sync_map/sync_map_permission.py | SyncMapPermissionContext.fetch | def fetch(self):
"""
Fetch a SyncMapPermissionInstance
:returns: Fetched SyncMapPermissionInstance
:rtype: twilio.rest.sync.v1.service.sync_map.sync_map_permission.SyncMapPermissionInstance
"""
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return SyncMapPermissionInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
map_sid=self._solution['map_sid'],
identity=self._solution['identity'],
) | python | def fetch(self):
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return SyncMapPermissionInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
map_sid=self._solution['map_sid'],
identity=self._solution['identity'],
) | [
"def",
"fetch",
"(",
"self",
")",
":",
"params",
"=",
"values",
".",
"of",
"(",
"{",
"}",
")",
"payload",
"=",
"self",
".",
"_version",
".",
"fetch",
"(",
"'GET'",
",",
"self",
".",
"_uri",
",",
"params",
"=",
"params",
",",
")",
"return",
"SyncM... | Fetch a SyncMapPermissionInstance
:returns: Fetched SyncMapPermissionInstance
:rtype: twilio.rest.sync.v1.service.sync_map.sync_map_permission.SyncMapPermissionInstance | [
"Fetch",
"a",
"SyncMapPermissionInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py#L229-L250 |
225,452 | twilio/twilio-python | twilio/rest/verify/v2/service/verification.py | VerificationList.get | def get(self, sid):
"""
Constructs a VerificationContext
:param sid: The unique string that identifies the resource
:returns: twilio.rest.verify.v2.service.verification.VerificationContext
:rtype: twilio.rest.verify.v2.service.verification.VerificationContext
"""
return VerificationContext(self._version, service_sid=self._solution['service_sid'], sid=sid, ) | python | def get(self, sid):
return VerificationContext(self._version, service_sid=self._solution['service_sid'], sid=sid, ) | [
"def",
"get",
"(",
"self",
",",
"sid",
")",
":",
"return",
"VerificationContext",
"(",
"self",
".",
"_version",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_sid'",
"]",
",",
"sid",
"=",
"sid",
",",
")"
] | Constructs a VerificationContext
:param sid: The unique string that identifies the resource
:returns: twilio.rest.verify.v2.service.verification.VerificationContext
:rtype: twilio.rest.verify.v2.service.verification.VerificationContext | [
"Constructs",
"a",
"VerificationContext"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/verify/v2/service/verification.py#L74-L83 |
225,453 | twilio/twilio-python | twilio/rest/verify/v2/service/verification.py | VerificationPage.get_instance | def get_instance(self, payload):
"""
Build an instance of VerificationInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.verify.v2.service.verification.VerificationInstance
:rtype: twilio.rest.verify.v2.service.verification.VerificationInstance
"""
return VerificationInstance(self._version, payload, service_sid=self._solution['service_sid'], ) | python | def get_instance(self, payload):
return VerificationInstance(self._version, payload, service_sid=self._solution['service_sid'], ) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"VerificationInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_sid'",
"]",
",",
")"
] | Build an instance of VerificationInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.verify.v2.service.verification.VerificationInstance
:rtype: twilio.rest.verify.v2.service.verification.VerificationInstance | [
"Build",
"an",
"instance",
"of",
"VerificationInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/verify/v2/service/verification.py#L126-L135 |
225,454 | twilio/twilio-python | twilio/rest/verify/v2/service/verification.py | VerificationContext.update | def update(self, status):
"""
Update the VerificationInstance
:param VerificationInstance.Status status: The new status of the resource
:returns: Updated VerificationInstance
:rtype: twilio.rest.verify.v2.service.verification.VerificationInstance
"""
data = values.of({'Status': status, })
payload = self._version.update(
'POST',
self._uri,
data=data,
)
return VerificationInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
sid=self._solution['sid'],
) | python | def update(self, status):
data = values.of({'Status': status, })
payload = self._version.update(
'POST',
self._uri,
data=data,
)
return VerificationInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
sid=self._solution['sid'],
) | [
"def",
"update",
"(",
"self",
",",
"status",
")",
":",
"data",
"=",
"values",
".",
"of",
"(",
"{",
"'Status'",
":",
"status",
",",
"}",
")",
"payload",
"=",
"self",
".",
"_version",
".",
"update",
"(",
"'POST'",
",",
"self",
".",
"_uri",
",",
"da... | Update the VerificationInstance
:param VerificationInstance.Status status: The new status of the resource
:returns: Updated VerificationInstance
:rtype: twilio.rest.verify.v2.service.verification.VerificationInstance | [
"Update",
"the",
"VerificationInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/verify/v2/service/verification.py#L168-L190 |
225,455 | twilio/twilio-python | twilio/rest/preview/deployed_devices/fleet/certificate.py | CertificateList.get | def get(self, sid):
"""
Constructs a CertificateContext
:param sid: A string that uniquely identifies the Certificate.
:returns: twilio.rest.preview.deployed_devices.fleet.certificate.CertificateContext
:rtype: twilio.rest.preview.deployed_devices.fleet.certificate.CertificateContext
"""
return CertificateContext(self._version, fleet_sid=self._solution['fleet_sid'], sid=sid, ) | python | def get(self, sid):
return CertificateContext(self._version, fleet_sid=self._solution['fleet_sid'], sid=sid, ) | [
"def",
"get",
"(",
"self",
",",
"sid",
")",
":",
"return",
"CertificateContext",
"(",
"self",
".",
"_version",
",",
"fleet_sid",
"=",
"self",
".",
"_solution",
"[",
"'fleet_sid'",
"]",
",",
"sid",
"=",
"sid",
",",
")"
] | Constructs a CertificateContext
:param sid: A string that uniquely identifies the Certificate.
:returns: twilio.rest.preview.deployed_devices.fleet.certificate.CertificateContext
:rtype: twilio.rest.preview.deployed_devices.fleet.certificate.CertificateContext | [
"Constructs",
"a",
"CertificateContext"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/preview/deployed_devices/fleet/certificate.py#L153-L162 |
225,456 | twilio/twilio-python | twilio/rest/preview/deployed_devices/fleet/certificate.py | CertificatePage.get_instance | def get_instance(self, payload):
"""
Build an instance of CertificateInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.preview.deployed_devices.fleet.certificate.CertificateInstance
:rtype: twilio.rest.preview.deployed_devices.fleet.certificate.CertificateInstance
"""
return CertificateInstance(self._version, payload, fleet_sid=self._solution['fleet_sid'], ) | python | def get_instance(self, payload):
return CertificateInstance(self._version, payload, fleet_sid=self._solution['fleet_sid'], ) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"CertificateInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"fleet_sid",
"=",
"self",
".",
"_solution",
"[",
"'fleet_sid'",
"]",
",",
")"
] | Build an instance of CertificateInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.preview.deployed_devices.fleet.certificate.CertificateInstance
:rtype: twilio.rest.preview.deployed_devices.fleet.certificate.CertificateInstance | [
"Build",
"an",
"instance",
"of",
"CertificateInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/preview/deployed_devices/fleet/certificate.py#L206-L215 |
225,457 | twilio/twilio-python | twilio/rest/taskrouter/v1/workspace/workspace_statistics.py | WorkspaceStatisticsPage.get_instance | def get_instance(self, payload):
"""
Build an instance of WorkspaceStatisticsInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.taskrouter.v1.workspace.workspace_statistics.WorkspaceStatisticsInstance
:rtype: twilio.rest.taskrouter.v1.workspace.workspace_statistics.WorkspaceStatisticsInstance
"""
return WorkspaceStatisticsInstance(
self._version,
payload,
workspace_sid=self._solution['workspace_sid'],
) | python | def get_instance(self, payload):
return WorkspaceStatisticsInstance(
self._version,
payload,
workspace_sid=self._solution['workspace_sid'],
) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"WorkspaceStatisticsInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"workspace_sid",
"=",
"self",
".",
"_solution",
"[",
"'workspace_sid'",
"]",
",",
")"
] | Build an instance of WorkspaceStatisticsInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.taskrouter.v1.workspace.workspace_statistics.WorkspaceStatisticsInstance
:rtype: twilio.rest.taskrouter.v1.workspace.workspace_statistics.WorkspaceStatisticsInstance | [
"Build",
"an",
"instance",
"of",
"WorkspaceStatisticsInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/taskrouter/v1/workspace/workspace_statistics.py#L82-L95 |
225,458 | twilio/twilio-python | twilio/rest/sync/v1/service/sync_list/sync_list_permission.py | SyncListPermissionList.get | def get(self, identity):
"""
Constructs a SyncListPermissionContext
:param identity: Identity of the user to whom the Sync List Permission applies.
:returns: twilio.rest.sync.v1.service.sync_list.sync_list_permission.SyncListPermissionContext
:rtype: twilio.rest.sync.v1.service.sync_list.sync_list_permission.SyncListPermissionContext
"""
return SyncListPermissionContext(
self._version,
service_sid=self._solution['service_sid'],
list_sid=self._solution['list_sid'],
identity=identity,
) | python | def get(self, identity):
return SyncListPermissionContext(
self._version,
service_sid=self._solution['service_sid'],
list_sid=self._solution['list_sid'],
identity=identity,
) | [
"def",
"get",
"(",
"self",
",",
"identity",
")",
":",
"return",
"SyncListPermissionContext",
"(",
"self",
".",
"_version",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_sid'",
"]",
",",
"list_sid",
"=",
"self",
".",
"_solution",
"[",
"'... | Constructs a SyncListPermissionContext
:param identity: Identity of the user to whom the Sync List Permission applies.
:returns: twilio.rest.sync.v1.service.sync_list.sync_list_permission.SyncListPermissionContext
:rtype: twilio.rest.sync.v1.service.sync_list.sync_list_permission.SyncListPermissionContext | [
"Constructs",
"a",
"SyncListPermissionContext"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py#L118-L132 |
225,459 | twilio/twilio-python | twilio/rest/sync/v1/service/sync_list/sync_list_permission.py | SyncListPermissionPage.get_instance | def get_instance(self, payload):
"""
Build an instance of SyncListPermissionInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.sync.v1.service.sync_list.sync_list_permission.SyncListPermissionInstance
:rtype: twilio.rest.sync.v1.service.sync_list.sync_list_permission.SyncListPermissionInstance
"""
return SyncListPermissionInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
list_sid=self._solution['list_sid'],
) | python | def get_instance(self, payload):
return SyncListPermissionInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
list_sid=self._solution['list_sid'],
) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"SyncListPermissionInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_sid'",
"]",
",",
"list_sid",
"=",
"self",
".... | Build an instance of SyncListPermissionInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.sync.v1.service.sync_list.sync_list_permission.SyncListPermissionInstance
:rtype: twilio.rest.sync.v1.service.sync_list.sync_list_permission.SyncListPermissionInstance | [
"Build",
"an",
"instance",
"of",
"SyncListPermissionInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py#L181-L195 |
225,460 | twilio/twilio-python | twilio/rest/sync/v1/service/sync_list/sync_list_permission.py | SyncListPermissionContext.fetch | def fetch(self):
"""
Fetch a SyncListPermissionInstance
:returns: Fetched SyncListPermissionInstance
:rtype: twilio.rest.sync.v1.service.sync_list.sync_list_permission.SyncListPermissionInstance
"""
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return SyncListPermissionInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
list_sid=self._solution['list_sid'],
identity=self._solution['identity'],
) | python | def fetch(self):
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return SyncListPermissionInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
list_sid=self._solution['list_sid'],
identity=self._solution['identity'],
) | [
"def",
"fetch",
"(",
"self",
")",
":",
"params",
"=",
"values",
".",
"of",
"(",
"{",
"}",
")",
"payload",
"=",
"self",
".",
"_version",
".",
"fetch",
"(",
"'GET'",
",",
"self",
".",
"_uri",
",",
"params",
"=",
"params",
",",
")",
"return",
"SyncL... | Fetch a SyncListPermissionInstance
:returns: Fetched SyncListPermissionInstance
:rtype: twilio.rest.sync.v1.service.sync_list.sync_list_permission.SyncListPermissionInstance | [
"Fetch",
"a",
"SyncListPermissionInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py#L229-L250 |
225,461 | twilio/twilio-python | twilio/rest/sync/v1/service/sync_list/sync_list_permission.py | SyncListPermissionContext.update | def update(self, read, write, manage):
"""
Update the SyncListPermissionInstance
:param bool read: Read access.
:param bool write: Write access.
:param bool manage: Manage access.
:returns: Updated SyncListPermissionInstance
:rtype: twilio.rest.sync.v1.service.sync_list.sync_list_permission.SyncListPermissionInstance
"""
data = values.of({'Read': read, 'Write': write, 'Manage': manage, })
payload = self._version.update(
'POST',
self._uri,
data=data,
)
return SyncListPermissionInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
list_sid=self._solution['list_sid'],
identity=self._solution['identity'],
) | python | def update(self, read, write, manage):
data = values.of({'Read': read, 'Write': write, 'Manage': manage, })
payload = self._version.update(
'POST',
self._uri,
data=data,
)
return SyncListPermissionInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
list_sid=self._solution['list_sid'],
identity=self._solution['identity'],
) | [
"def",
"update",
"(",
"self",
",",
"read",
",",
"write",
",",
"manage",
")",
":",
"data",
"=",
"values",
".",
"of",
"(",
"{",
"'Read'",
":",
"read",
",",
"'Write'",
":",
"write",
",",
"'Manage'",
":",
"manage",
",",
"}",
")",
"payload",
"=",
"sel... | Update the SyncListPermissionInstance
:param bool read: Read access.
:param bool write: Write access.
:param bool manage: Manage access.
:returns: Updated SyncListPermissionInstance
:rtype: twilio.rest.sync.v1.service.sync_list.sync_list_permission.SyncListPermissionInstance | [
"Update",
"the",
"SyncListPermissionInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py#L261-L286 |
225,462 | twilio/twilio-python | twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py | TaskQueueList.page | def page(self, friendly_name=values.unset,
evaluate_worker_attributes=values.unset, worker_sid=values.unset,
page_token=values.unset, page_number=values.unset,
page_size=values.unset):
"""
Retrieve a single page of TaskQueueInstance records from the API.
Request is executed immediately
:param unicode friendly_name: Filter by a human readable description of a TaskQueue
:param unicode evaluate_worker_attributes: Provide a Worker attributes expression, and this will return the list of TaskQueues that would distribute tasks to a worker with these attributes.
:param unicode worker_sid: The worker_sid
:param str page_token: PageToken provided by the API
:param int page_number: Page Number, this value is simply for client state
:param int page_size: Number of records to return, defaults to 50
:returns: Page of TaskQueueInstance
:rtype: twilio.rest.taskrouter.v1.workspace.task_queue.TaskQueuePage
"""
params = values.of({
'FriendlyName': friendly_name,
'EvaluateWorkerAttributes': evaluate_worker_attributes,
'WorkerSid': worker_sid,
'PageToken': page_token,
'Page': page_number,
'PageSize': page_size,
})
response = self._version.page(
'GET',
self._uri,
params=params,
)
return TaskQueuePage(self._version, response, self._solution) | python | def page(self, friendly_name=values.unset,
evaluate_worker_attributes=values.unset, worker_sid=values.unset,
page_token=values.unset, page_number=values.unset,
page_size=values.unset):
params = values.of({
'FriendlyName': friendly_name,
'EvaluateWorkerAttributes': evaluate_worker_attributes,
'WorkerSid': worker_sid,
'PageToken': page_token,
'Page': page_number,
'PageSize': page_size,
})
response = self._version.page(
'GET',
self._uri,
params=params,
)
return TaskQueuePage(self._version, response, self._solution) | [
"def",
"page",
"(",
"self",
",",
"friendly_name",
"=",
"values",
".",
"unset",
",",
"evaluate_worker_attributes",
"=",
"values",
".",
"unset",
",",
"worker_sid",
"=",
"values",
".",
"unset",
",",
"page_token",
"=",
"values",
".",
"unset",
",",
"page_number",... | Retrieve a single page of TaskQueueInstance records from the API.
Request is executed immediately
:param unicode friendly_name: Filter by a human readable description of a TaskQueue
:param unicode evaluate_worker_attributes: Provide a Worker attributes expression, and this will return the list of TaskQueues that would distribute tasks to a worker with these attributes.
:param unicode worker_sid: The worker_sid
:param str page_token: PageToken provided by the API
:param int page_number: Page Number, this value is simply for client state
:param int page_size: Number of records to return, defaults to 50
:returns: Page of TaskQueueInstance
:rtype: twilio.rest.taskrouter.v1.workspace.task_queue.TaskQueuePage | [
"Retrieve",
"a",
"single",
"page",
"of",
"TaskQueueInstance",
"records",
"from",
"the",
"API",
".",
"Request",
"is",
"executed",
"immediately"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py#L105-L138 |
225,463 | twilio/twilio-python | twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py | TaskQueueList.create | def create(self, friendly_name, target_workers=values.unset,
max_reserved_workers=values.unset, task_order=values.unset,
reservation_activity_sid=values.unset,
assignment_activity_sid=values.unset):
"""
Create a new TaskQueueInstance
:param unicode friendly_name: Human readable description of this TaskQueue
:param unicode target_workers: A string describing the Worker selection criteria for any Tasks that enter this TaskQueue.
:param unicode max_reserved_workers: The maximum amount of workers to create reservations for the assignment of a task while in this queue.
:param TaskQueueInstance.TaskOrder task_order: TaskOrder will determine which order the Tasks will be assigned to Workers.
:param unicode reservation_activity_sid: ActivitySID to assign workers once a task is reserved for them
:param unicode assignment_activity_sid: ActivitySID to assign workers once a task is assigned for them
:returns: Newly created TaskQueueInstance
:rtype: twilio.rest.taskrouter.v1.workspace.task_queue.TaskQueueInstance
"""
data = values.of({
'FriendlyName': friendly_name,
'TargetWorkers': target_workers,
'MaxReservedWorkers': max_reserved_workers,
'TaskOrder': task_order,
'ReservationActivitySid': reservation_activity_sid,
'AssignmentActivitySid': assignment_activity_sid,
})
payload = self._version.create(
'POST',
self._uri,
data=data,
)
return TaskQueueInstance(self._version, payload, workspace_sid=self._solution['workspace_sid'], ) | python | def create(self, friendly_name, target_workers=values.unset,
max_reserved_workers=values.unset, task_order=values.unset,
reservation_activity_sid=values.unset,
assignment_activity_sid=values.unset):
data = values.of({
'FriendlyName': friendly_name,
'TargetWorkers': target_workers,
'MaxReservedWorkers': max_reserved_workers,
'TaskOrder': task_order,
'ReservationActivitySid': reservation_activity_sid,
'AssignmentActivitySid': assignment_activity_sid,
})
payload = self._version.create(
'POST',
self._uri,
data=data,
)
return TaskQueueInstance(self._version, payload, workspace_sid=self._solution['workspace_sid'], ) | [
"def",
"create",
"(",
"self",
",",
"friendly_name",
",",
"target_workers",
"=",
"values",
".",
"unset",
",",
"max_reserved_workers",
"=",
"values",
".",
"unset",
",",
"task_order",
"=",
"values",
".",
"unset",
",",
"reservation_activity_sid",
"=",
"values",
".... | Create a new TaskQueueInstance
:param unicode friendly_name: Human readable description of this TaskQueue
:param unicode target_workers: A string describing the Worker selection criteria for any Tasks that enter this TaskQueue.
:param unicode max_reserved_workers: The maximum amount of workers to create reservations for the assignment of a task while in this queue.
:param TaskQueueInstance.TaskOrder task_order: TaskOrder will determine which order the Tasks will be assigned to Workers.
:param unicode reservation_activity_sid: ActivitySID to assign workers once a task is reserved for them
:param unicode assignment_activity_sid: ActivitySID to assign workers once a task is assigned for them
:returns: Newly created TaskQueueInstance
:rtype: twilio.rest.taskrouter.v1.workspace.task_queue.TaskQueueInstance | [
"Create",
"a",
"new",
"TaskQueueInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py#L157-L189 |
225,464 | twilio/twilio-python | twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py | TaskQueueList.get | def get(self, sid):
"""
Constructs a TaskQueueContext
:param sid: The sid
:returns: twilio.rest.taskrouter.v1.workspace.task_queue.TaskQueueContext
:rtype: twilio.rest.taskrouter.v1.workspace.task_queue.TaskQueueContext
"""
return TaskQueueContext(self._version, workspace_sid=self._solution['workspace_sid'], sid=sid, ) | python | def get(self, sid):
return TaskQueueContext(self._version, workspace_sid=self._solution['workspace_sid'], sid=sid, ) | [
"def",
"get",
"(",
"self",
",",
"sid",
")",
":",
"return",
"TaskQueueContext",
"(",
"self",
".",
"_version",
",",
"workspace_sid",
"=",
"self",
".",
"_solution",
"[",
"'workspace_sid'",
"]",
",",
"sid",
"=",
"sid",
",",
")"
] | Constructs a TaskQueueContext
:param sid: The sid
:returns: twilio.rest.taskrouter.v1.workspace.task_queue.TaskQueueContext
:rtype: twilio.rest.taskrouter.v1.workspace.task_queue.TaskQueueContext | [
"Constructs",
"a",
"TaskQueueContext"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py#L206-L215 |
225,465 | twilio/twilio-python | twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py | TaskQueuePage.get_instance | def get_instance(self, payload):
"""
Build an instance of TaskQueueInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.taskrouter.v1.workspace.task_queue.TaskQueueInstance
:rtype: twilio.rest.taskrouter.v1.workspace.task_queue.TaskQueueInstance
"""
return TaskQueueInstance(self._version, payload, workspace_sid=self._solution['workspace_sid'], ) | python | def get_instance(self, payload):
return TaskQueueInstance(self._version, payload, workspace_sid=self._solution['workspace_sid'], ) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"TaskQueueInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"workspace_sid",
"=",
"self",
".",
"_solution",
"[",
"'workspace_sid'",
"]",
",",
")"
] | Build an instance of TaskQueueInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.taskrouter.v1.workspace.task_queue.TaskQueueInstance
:rtype: twilio.rest.taskrouter.v1.workspace.task_queue.TaskQueueInstance | [
"Build",
"an",
"instance",
"of",
"TaskQueueInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py#L257-L266 |
225,466 | twilio/twilio-python | twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py | TaskQueueContext.fetch | def fetch(self):
"""
Fetch a TaskQueueInstance
:returns: Fetched TaskQueueInstance
:rtype: twilio.rest.taskrouter.v1.workspace.task_queue.TaskQueueInstance
"""
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return TaskQueueInstance(
self._version,
payload,
workspace_sid=self._solution['workspace_sid'],
sid=self._solution['sid'],
) | python | def fetch(self):
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return TaskQueueInstance(
self._version,
payload,
workspace_sid=self._solution['workspace_sid'],
sid=self._solution['sid'],
) | [
"def",
"fetch",
"(",
"self",
")",
":",
"params",
"=",
"values",
".",
"of",
"(",
"{",
"}",
")",
"payload",
"=",
"self",
".",
"_version",
".",
"fetch",
"(",
"'GET'",
",",
"self",
".",
"_uri",
",",
"params",
"=",
"params",
",",
")",
"return",
"TaskQ... | Fetch a TaskQueueInstance
:returns: Fetched TaskQueueInstance
:rtype: twilio.rest.taskrouter.v1.workspace.task_queue.TaskQueueInstance | [
"Fetch",
"a",
"TaskQueueInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py#L303-L323 |
225,467 | twilio/twilio-python | twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py | TaskQueueInstance.update | def update(self, friendly_name=values.unset, target_workers=values.unset,
reservation_activity_sid=values.unset,
assignment_activity_sid=values.unset,
max_reserved_workers=values.unset, task_order=values.unset):
"""
Update the TaskQueueInstance
:param unicode friendly_name: Human readable description of this TaskQueue
:param unicode target_workers: A string describing the Worker selection criteria for any Tasks that enter this TaskQueue.
:param unicode reservation_activity_sid: ActivitySID that will be assigned to Workers when they are reserved for a task from this TaskQueue.
:param unicode assignment_activity_sid: ActivitySID that will be assigned to Workers when they are assigned a task from this TaskQueue.
:param unicode max_reserved_workers: The maximum amount of workers to create reservations for the assignment of a task while in this queue.
:param TaskQueueInstance.TaskOrder task_order: TaskOrder will determine which order the Tasks will be assigned to Workers.
:returns: Updated TaskQueueInstance
:rtype: twilio.rest.taskrouter.v1.workspace.task_queue.TaskQueueInstance
"""
return self._proxy.update(
friendly_name=friendly_name,
target_workers=target_workers,
reservation_activity_sid=reservation_activity_sid,
assignment_activity_sid=assignment_activity_sid,
max_reserved_workers=max_reserved_workers,
task_order=task_order,
) | python | def update(self, friendly_name=values.unset, target_workers=values.unset,
reservation_activity_sid=values.unset,
assignment_activity_sid=values.unset,
max_reserved_workers=values.unset, task_order=values.unset):
return self._proxy.update(
friendly_name=friendly_name,
target_workers=target_workers,
reservation_activity_sid=reservation_activity_sid,
assignment_activity_sid=assignment_activity_sid,
max_reserved_workers=max_reserved_workers,
task_order=task_order,
) | [
"def",
"update",
"(",
"self",
",",
"friendly_name",
"=",
"values",
".",
"unset",
",",
"target_workers",
"=",
"values",
".",
"unset",
",",
"reservation_activity_sid",
"=",
"values",
".",
"unset",
",",
"assignment_activity_sid",
"=",
"values",
".",
"unset",
",",... | Update the TaskQueueInstance
:param unicode friendly_name: Human readable description of this TaskQueue
:param unicode target_workers: A string describing the Worker selection criteria for any Tasks that enter this TaskQueue.
:param unicode reservation_activity_sid: ActivitySID that will be assigned to Workers when they are reserved for a task from this TaskQueue.
:param unicode assignment_activity_sid: ActivitySID that will be assigned to Workers when they are assigned a task from this TaskQueue.
:param unicode max_reserved_workers: The maximum amount of workers to create reservations for the assignment of a task while in this queue.
:param TaskQueueInstance.TaskOrder task_order: TaskOrder will determine which order the Tasks will be assigned to Workers.
:returns: Updated TaskQueueInstance
:rtype: twilio.rest.taskrouter.v1.workspace.task_queue.TaskQueueInstance | [
"Update",
"the",
"TaskQueueInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py#L617-L641 |
225,468 | twilio/twilio-python | twilio/rest/taskrouter/v1/workspace/worker/workers_statistics.py | WorkersStatisticsPage.get_instance | def get_instance(self, payload):
"""
Build an instance of WorkersStatisticsInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.taskrouter.v1.workspace.worker.workers_statistics.WorkersStatisticsInstance
:rtype: twilio.rest.taskrouter.v1.workspace.worker.workers_statistics.WorkersStatisticsInstance
"""
return WorkersStatisticsInstance(
self._version,
payload,
workspace_sid=self._solution['workspace_sid'],
) | python | def get_instance(self, payload):
return WorkersStatisticsInstance(
self._version,
payload,
workspace_sid=self._solution['workspace_sid'],
) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"WorkersStatisticsInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"workspace_sid",
"=",
"self",
".",
"_solution",
"[",
"'workspace_sid'",
"]",
",",
")"
] | Build an instance of WorkersStatisticsInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.taskrouter.v1.workspace.worker.workers_statistics.WorkersStatisticsInstance
:rtype: twilio.rest.taskrouter.v1.workspace.worker.workers_statistics.WorkersStatisticsInstance | [
"Build",
"an",
"instance",
"of",
"WorkersStatisticsInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/taskrouter/v1/workspace/worker/workers_statistics.py#L82-L95 |
225,469 | twilio/twilio-python | twilio/rest/ip_messaging/v2/service/user/user_channel.py | UserChannelList.get | def get(self, channel_sid):
"""
Constructs a UserChannelContext
:param channel_sid: The SID of the Channel that has the User Channel to fetch
:returns: twilio.rest.chat.v2.service.user.user_channel.UserChannelContext
:rtype: twilio.rest.chat.v2.service.user.user_channel.UserChannelContext
"""
return UserChannelContext(
self._version,
service_sid=self._solution['service_sid'],
user_sid=self._solution['user_sid'],
channel_sid=channel_sid,
) | python | def get(self, channel_sid):
return UserChannelContext(
self._version,
service_sid=self._solution['service_sid'],
user_sid=self._solution['user_sid'],
channel_sid=channel_sid,
) | [
"def",
"get",
"(",
"self",
",",
"channel_sid",
")",
":",
"return",
"UserChannelContext",
"(",
"self",
".",
"_version",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_sid'",
"]",
",",
"user_sid",
"=",
"self",
".",
"_solution",
"[",
"'user... | Constructs a UserChannelContext
:param channel_sid: The SID of the Channel that has the User Channel to fetch
:returns: twilio.rest.chat.v2.service.user.user_channel.UserChannelContext
:rtype: twilio.rest.chat.v2.service.user.user_channel.UserChannelContext | [
"Constructs",
"a",
"UserChannelContext"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/ip_messaging/v2/service/user/user_channel.py#L118-L132 |
225,470 | twilio/twilio-python | twilio/rest/ip_messaging/v2/service/user/user_channel.py | UserChannelPage.get_instance | def get_instance(self, payload):
"""
Build an instance of UserChannelInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.chat.v2.service.user.user_channel.UserChannelInstance
:rtype: twilio.rest.chat.v2.service.user.user_channel.UserChannelInstance
"""
return UserChannelInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
user_sid=self._solution['user_sid'],
) | python | def get_instance(self, payload):
return UserChannelInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
user_sid=self._solution['user_sid'],
) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"UserChannelInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_sid'",
"]",
",",
"user_sid",
"=",
"self",
".",
"_... | Build an instance of UserChannelInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.chat.v2.service.user.user_channel.UserChannelInstance
:rtype: twilio.rest.chat.v2.service.user.user_channel.UserChannelInstance | [
"Build",
"an",
"instance",
"of",
"UserChannelInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/ip_messaging/v2/service/user/user_channel.py#L180-L194 |
225,471 | twilio/twilio-python | twilio/rest/ip_messaging/v2/service/user/user_channel.py | UserChannelContext.fetch | def fetch(self):
"""
Fetch a UserChannelInstance
:returns: Fetched UserChannelInstance
:rtype: twilio.rest.chat.v2.service.user.user_channel.UserChannelInstance
"""
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return UserChannelInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
user_sid=self._solution['user_sid'],
channel_sid=self._solution['channel_sid'],
) | python | def fetch(self):
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return UserChannelInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
user_sid=self._solution['user_sid'],
channel_sid=self._solution['channel_sid'],
) | [
"def",
"fetch",
"(",
"self",
")",
":",
"params",
"=",
"values",
".",
"of",
"(",
"{",
"}",
")",
"payload",
"=",
"self",
".",
"_version",
".",
"fetch",
"(",
"'GET'",
",",
"self",
".",
"_uri",
",",
"params",
"=",
"params",
",",
")",
"return",
"UserC... | Fetch a UserChannelInstance
:returns: Fetched UserChannelInstance
:rtype: twilio.rest.chat.v2.service.user.user_channel.UserChannelInstance | [
"Fetch",
"a",
"UserChannelInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/ip_messaging/v2/service/user/user_channel.py#L227-L248 |
225,472 | twilio/twilio-python | twilio/rest/ip_messaging/v2/service/user/user_channel.py | UserChannelContext.update | def update(self, notification_level):
"""
Update the UserChannelInstance
:param UserChannelInstance.NotificationLevel notification_level: The push notification level to assign to the User Channel
:returns: Updated UserChannelInstance
:rtype: twilio.rest.chat.v2.service.user.user_channel.UserChannelInstance
"""
data = values.of({'NotificationLevel': notification_level, })
payload = self._version.update(
'POST',
self._uri,
data=data,
)
return UserChannelInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
user_sid=self._solution['user_sid'],
channel_sid=self._solution['channel_sid'],
) | python | def update(self, notification_level):
data = values.of({'NotificationLevel': notification_level, })
payload = self._version.update(
'POST',
self._uri,
data=data,
)
return UserChannelInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
user_sid=self._solution['user_sid'],
channel_sid=self._solution['channel_sid'],
) | [
"def",
"update",
"(",
"self",
",",
"notification_level",
")",
":",
"data",
"=",
"values",
".",
"of",
"(",
"{",
"'NotificationLevel'",
":",
"notification_level",
",",
"}",
")",
"payload",
"=",
"self",
".",
"_version",
".",
"update",
"(",
"'POST'",
",",
"s... | Update the UserChannelInstance
:param UserChannelInstance.NotificationLevel notification_level: The push notification level to assign to the User Channel
:returns: Updated UserChannelInstance
:rtype: twilio.rest.chat.v2.service.user.user_channel.UserChannelInstance | [
"Update",
"the",
"UserChannelInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/ip_messaging/v2/service/user/user_channel.py#L250-L273 |
225,473 | twilio/twilio-python | twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py | WorkerStatisticsList.get | def get(self):
"""
Constructs a WorkerStatisticsContext
:returns: twilio.rest.taskrouter.v1.workspace.worker.worker_statistics.WorkerStatisticsContext
:rtype: twilio.rest.taskrouter.v1.workspace.worker.worker_statistics.WorkerStatisticsContext
"""
return WorkerStatisticsContext(
self._version,
workspace_sid=self._solution['workspace_sid'],
worker_sid=self._solution['worker_sid'],
) | python | def get(self):
return WorkerStatisticsContext(
self._version,
workspace_sid=self._solution['workspace_sid'],
worker_sid=self._solution['worker_sid'],
) | [
"def",
"get",
"(",
"self",
")",
":",
"return",
"WorkerStatisticsContext",
"(",
"self",
".",
"_version",
",",
"workspace_sid",
"=",
"self",
".",
"_solution",
"[",
"'workspace_sid'",
"]",
",",
"worker_sid",
"=",
"self",
".",
"_solution",
"[",
"'worker_sid'",
"... | Constructs a WorkerStatisticsContext
:returns: twilio.rest.taskrouter.v1.workspace.worker.worker_statistics.WorkerStatisticsContext
:rtype: twilio.rest.taskrouter.v1.workspace.worker.worker_statistics.WorkerStatisticsContext | [
"Constructs",
"a",
"WorkerStatisticsContext"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py#L36-L47 |
225,474 | twilio/twilio-python | twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py | WorkerStatisticsPage.get_instance | def get_instance(self, payload):
"""
Build an instance of WorkerStatisticsInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.taskrouter.v1.workspace.worker.worker_statistics.WorkerStatisticsInstance
:rtype: twilio.rest.taskrouter.v1.workspace.worker.worker_statistics.WorkerStatisticsInstance
"""
return WorkerStatisticsInstance(
self._version,
payload,
workspace_sid=self._solution['workspace_sid'],
worker_sid=self._solution['worker_sid'],
) | python | def get_instance(self, payload):
return WorkerStatisticsInstance(
self._version,
payload,
workspace_sid=self._solution['workspace_sid'],
worker_sid=self._solution['worker_sid'],
) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"WorkerStatisticsInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"workspace_sid",
"=",
"self",
".",
"_solution",
"[",
"'workspace_sid'",
"]",
",",
"worker_sid",
"=",
"self",
... | Build an instance of WorkerStatisticsInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.taskrouter.v1.workspace.worker.worker_statistics.WorkerStatisticsInstance
:rtype: twilio.rest.taskrouter.v1.workspace.worker.worker_statistics.WorkerStatisticsInstance | [
"Build",
"an",
"instance",
"of",
"WorkerStatisticsInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py#L92-L106 |
225,475 | twilio/twilio-python | twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py | WorkerStatisticsInstance.fetch | def fetch(self, minutes=values.unset, start_date=values.unset,
end_date=values.unset, task_channel=values.unset):
"""
Fetch a WorkerStatisticsInstance
:param unicode minutes: Filter cumulative statistics by up to 'x' minutes in the past.
:param datetime start_date: Filter cumulative statistics by a start date.
:param datetime end_date: Filter cumulative statistics by a end date.
:param unicode task_channel: Filter cumulative statistics by TaskChannel.
:returns: Fetched WorkerStatisticsInstance
:rtype: twilio.rest.taskrouter.v1.workspace.worker.worker_statistics.WorkerStatisticsInstance
"""
return self._proxy.fetch(
minutes=minutes,
start_date=start_date,
end_date=end_date,
task_channel=task_channel,
) | python | def fetch(self, minutes=values.unset, start_date=values.unset,
end_date=values.unset, task_channel=values.unset):
return self._proxy.fetch(
minutes=minutes,
start_date=start_date,
end_date=end_date,
task_channel=task_channel,
) | [
"def",
"fetch",
"(",
"self",
",",
"minutes",
"=",
"values",
".",
"unset",
",",
"start_date",
"=",
"values",
".",
"unset",
",",
"end_date",
"=",
"values",
".",
"unset",
",",
"task_channel",
"=",
"values",
".",
"unset",
")",
":",
"return",
"self",
".",
... | Fetch a WorkerStatisticsInstance
:param unicode minutes: Filter cumulative statistics by up to 'x' minutes in the past.
:param datetime start_date: Filter cumulative statistics by a start date.
:param datetime end_date: Filter cumulative statistics by a end date.
:param unicode task_channel: Filter cumulative statistics by TaskChannel.
:returns: Fetched WorkerStatisticsInstance
:rtype: twilio.rest.taskrouter.v1.workspace.worker.worker_statistics.WorkerStatisticsInstance | [
"Fetch",
"a",
"WorkerStatisticsInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py#L264-L282 |
225,476 | twilio/twilio-python | examples/client_validation.py | example | def example():
"""
Example of using the ValidationClient for signed requests to Twilio.
This is only available to enterprise customers.
This will walkthrough creating an API Key, generating an RSA keypair, setting up a
ValidationClient with these values and making requests with the client.
"""
client = Client(ACCOUNT_SID, AUTH_TOKEN)
# Using Client Validation requires using API Keys for auth
# First create an API key using the standard account sid, auth token client
print('Creating new api key...')
api_key = client.new_keys.create(friendly_name='ClientValidationApiKey')
# Generate a new RSA Keypair
print('Generating RSA key pair...')
key_pair = rsa.generate_private_key(
public_exponent=65537,
key_size=2048,
backend=default_backend()
)
public_key = key_pair.public_key().public_bytes(Encoding.PEM, PublicFormat.SubjectPublicKeyInfo)
private_key = key_pair.private_bytes(Encoding.PEM, PrivateFormat.PKCS8, NoEncryption())
# Register the public key with Twilio
print('Registering public key with Twilio...')
credential = client.accounts.credentials.public_key.create(
public_key,
friendly_name='ClientValidationPublicKey'
)
# Create a new ValidationClient with the keys we created
validation_client = ValidationClient(
ACCOUNT_SID,
api_key.sid,
credential.sid,
private_key
)
# Create a REST Client using the validation_client
client = Client(api_key.sid, api_key.secret, ACCOUNT_SID, http_client=validation_client)
# Use the library as usual
print('Trying out client validation...')
messages = client.messages.list(limit=10)
for m in messages:
print('Message {}'.format(m.sid))
print('Client validation works!') | python | def example():
client = Client(ACCOUNT_SID, AUTH_TOKEN)
# Using Client Validation requires using API Keys for auth
# First create an API key using the standard account sid, auth token client
print('Creating new api key...')
api_key = client.new_keys.create(friendly_name='ClientValidationApiKey')
# Generate a new RSA Keypair
print('Generating RSA key pair...')
key_pair = rsa.generate_private_key(
public_exponent=65537,
key_size=2048,
backend=default_backend()
)
public_key = key_pair.public_key().public_bytes(Encoding.PEM, PublicFormat.SubjectPublicKeyInfo)
private_key = key_pair.private_bytes(Encoding.PEM, PrivateFormat.PKCS8, NoEncryption())
# Register the public key with Twilio
print('Registering public key with Twilio...')
credential = client.accounts.credentials.public_key.create(
public_key,
friendly_name='ClientValidationPublicKey'
)
# Create a new ValidationClient with the keys we created
validation_client = ValidationClient(
ACCOUNT_SID,
api_key.sid,
credential.sid,
private_key
)
# Create a REST Client using the validation_client
client = Client(api_key.sid, api_key.secret, ACCOUNT_SID, http_client=validation_client)
# Use the library as usual
print('Trying out client validation...')
messages = client.messages.list(limit=10)
for m in messages:
print('Message {}'.format(m.sid))
print('Client validation works!') | [
"def",
"example",
"(",
")",
":",
"client",
"=",
"Client",
"(",
"ACCOUNT_SID",
",",
"AUTH_TOKEN",
")",
"# Using Client Validation requires using API Keys for auth",
"# First create an API key using the standard account sid, auth token client",
"print",
"(",
"'Creating new api key...... | Example of using the ValidationClient for signed requests to Twilio.
This is only available to enterprise customers.
This will walkthrough creating an API Key, generating an RSA keypair, setting up a
ValidationClient with these values and making requests with the client. | [
"Example",
"of",
"using",
"the",
"ValidationClient",
"for",
"signed",
"requests",
"to",
"Twilio",
".",
"This",
"is",
"only",
"available",
"to",
"enterprise",
"customers",
"."
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/examples/client_validation.py#L19-L68 |
225,477 | twilio/twilio-python | twilio/rest/preview/sync/service/sync_map/sync_map_item.py | SyncMapItemList.get | def get(self, key):
"""
Constructs a SyncMapItemContext
:param key: The key
:returns: twilio.rest.preview.sync.service.sync_map.sync_map_item.SyncMapItemContext
:rtype: twilio.rest.preview.sync.service.sync_map.sync_map_item.SyncMapItemContext
"""
return SyncMapItemContext(
self._version,
service_sid=self._solution['service_sid'],
map_sid=self._solution['map_sid'],
key=key,
) | python | def get(self, key):
return SyncMapItemContext(
self._version,
service_sid=self._solution['service_sid'],
map_sid=self._solution['map_sid'],
key=key,
) | [
"def",
"get",
"(",
"self",
",",
"key",
")",
":",
"return",
"SyncMapItemContext",
"(",
"self",
".",
"_version",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_sid'",
"]",
",",
"map_sid",
"=",
"self",
".",
"_solution",
"[",
"'map_sid'",
... | Constructs a SyncMapItemContext
:param key: The key
:returns: twilio.rest.preview.sync.service.sync_map.sync_map_item.SyncMapItemContext
:rtype: twilio.rest.preview.sync.service.sync_map.sync_map_item.SyncMapItemContext | [
"Constructs",
"a",
"SyncMapItemContext"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/preview/sync/service/sync_map/sync_map_item.py#L165-L179 |
225,478 | twilio/twilio-python | twilio/rest/preview/sync/service/sync_map/sync_map_item.py | SyncMapItemPage.get_instance | def get_instance(self, payload):
"""
Build an instance of SyncMapItemInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.preview.sync.service.sync_map.sync_map_item.SyncMapItemInstance
:rtype: twilio.rest.preview.sync.service.sync_map.sync_map_item.SyncMapItemInstance
"""
return SyncMapItemInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
map_sid=self._solution['map_sid'],
) | python | def get_instance(self, payload):
return SyncMapItemInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
map_sid=self._solution['map_sid'],
) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"SyncMapItemInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_sid'",
"]",
",",
"map_sid",
"=",
"self",
".",
"_s... | Build an instance of SyncMapItemInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.preview.sync.service.sync_map.sync_map_item.SyncMapItemInstance
:rtype: twilio.rest.preview.sync.service.sync_map.sync_map_item.SyncMapItemInstance | [
"Build",
"an",
"instance",
"of",
"SyncMapItemInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/preview/sync/service/sync_map/sync_map_item.py#L229-L243 |
225,479 | twilio/twilio-python | twilio/rest/preview/sync/service/sync_map/sync_map_item.py | SyncMapItemContext.fetch | def fetch(self):
"""
Fetch a SyncMapItemInstance
:returns: Fetched SyncMapItemInstance
:rtype: twilio.rest.preview.sync.service.sync_map.sync_map_item.SyncMapItemInstance
"""
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return SyncMapItemInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
map_sid=self._solution['map_sid'],
key=self._solution['key'],
) | python | def fetch(self):
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return SyncMapItemInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
map_sid=self._solution['map_sid'],
key=self._solution['key'],
) | [
"def",
"fetch",
"(",
"self",
")",
":",
"params",
"=",
"values",
".",
"of",
"(",
"{",
"}",
")",
"payload",
"=",
"self",
".",
"_version",
".",
"fetch",
"(",
"'GET'",
",",
"self",
".",
"_uri",
",",
"params",
"=",
"params",
",",
")",
"return",
"SyncM... | Fetch a SyncMapItemInstance
:returns: Fetched SyncMapItemInstance
:rtype: twilio.rest.preview.sync.service.sync_map.sync_map_item.SyncMapItemInstance | [
"Fetch",
"a",
"SyncMapItemInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/preview/sync/service/sync_map/sync_map_item.py#L278-L299 |
225,480 | twilio/twilio-python | twilio/rest/ip_messaging/v2/service/__init__.py | ServiceContext.channels | def channels(self):
"""
Access the channels
:returns: twilio.rest.chat.v2.service.channel.ChannelList
:rtype: twilio.rest.chat.v2.service.channel.ChannelList
"""
if self._channels is None:
self._channels = ChannelList(self._version, service_sid=self._solution['sid'], )
return self._channels | python | def channels(self):
if self._channels is None:
self._channels = ChannelList(self._version, service_sid=self._solution['sid'], )
return self._channels | [
"def",
"channels",
"(",
"self",
")",
":",
"if",
"self",
".",
"_channels",
"is",
"None",
":",
"self",
".",
"_channels",
"=",
"ChannelList",
"(",
"self",
".",
"_version",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'sid'",
"]",
",",
")",
"... | Access the channels
:returns: twilio.rest.chat.v2.service.channel.ChannelList
:rtype: twilio.rest.chat.v2.service.channel.ChannelList | [
"Access",
"the",
"channels"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/ip_messaging/v2/service/__init__.py#L371-L380 |
225,481 | twilio/twilio-python | twilio/rest/ip_messaging/v2/service/__init__.py | ServiceContext.roles | def roles(self):
"""
Access the roles
:returns: twilio.rest.chat.v2.service.role.RoleList
:rtype: twilio.rest.chat.v2.service.role.RoleList
"""
if self._roles is None:
self._roles = RoleList(self._version, service_sid=self._solution['sid'], )
return self._roles | python | def roles(self):
if self._roles is None:
self._roles = RoleList(self._version, service_sid=self._solution['sid'], )
return self._roles | [
"def",
"roles",
"(",
"self",
")",
":",
"if",
"self",
".",
"_roles",
"is",
"None",
":",
"self",
".",
"_roles",
"=",
"RoleList",
"(",
"self",
".",
"_version",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'sid'",
"]",
",",
")",
"return",
"... | Access the roles
:returns: twilio.rest.chat.v2.service.role.RoleList
:rtype: twilio.rest.chat.v2.service.role.RoleList | [
"Access",
"the",
"roles"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/ip_messaging/v2/service/__init__.py#L383-L392 |
225,482 | twilio/twilio-python | twilio/rest/ip_messaging/v2/service/__init__.py | ServiceContext.users | def users(self):
"""
Access the users
:returns: twilio.rest.chat.v2.service.user.UserList
:rtype: twilio.rest.chat.v2.service.user.UserList
"""
if self._users is None:
self._users = UserList(self._version, service_sid=self._solution['sid'], )
return self._users | python | def users(self):
if self._users is None:
self._users = UserList(self._version, service_sid=self._solution['sid'], )
return self._users | [
"def",
"users",
"(",
"self",
")",
":",
"if",
"self",
".",
"_users",
"is",
"None",
":",
"self",
".",
"_users",
"=",
"UserList",
"(",
"self",
".",
"_version",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'sid'",
"]",
",",
")",
"return",
"... | Access the users
:returns: twilio.rest.chat.v2.service.user.UserList
:rtype: twilio.rest.chat.v2.service.user.UserList | [
"Access",
"the",
"users"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/ip_messaging/v2/service/__init__.py#L395-L404 |
225,483 | twilio/twilio-python | twilio/rest/ip_messaging/v2/service/__init__.py | ServiceContext.bindings | def bindings(self):
"""
Access the bindings
:returns: twilio.rest.chat.v2.service.binding.BindingList
:rtype: twilio.rest.chat.v2.service.binding.BindingList
"""
if self._bindings is None:
self._bindings = BindingList(self._version, service_sid=self._solution['sid'], )
return self._bindings | python | def bindings(self):
if self._bindings is None:
self._bindings = BindingList(self._version, service_sid=self._solution['sid'], )
return self._bindings | [
"def",
"bindings",
"(",
"self",
")",
":",
"if",
"self",
".",
"_bindings",
"is",
"None",
":",
"self",
".",
"_bindings",
"=",
"BindingList",
"(",
"self",
".",
"_version",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'sid'",
"]",
",",
")",
"... | Access the bindings
:returns: twilio.rest.chat.v2.service.binding.BindingList
:rtype: twilio.rest.chat.v2.service.binding.BindingList | [
"Access",
"the",
"bindings"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/ip_messaging/v2/service/__init__.py#L407-L416 |
225,484 | twilio/twilio-python | twilio/rest/ip_messaging/v1/service/channel/__init__.py | ChannelList.page | def page(self, type=values.unset, page_token=values.unset,
page_number=values.unset, page_size=values.unset):
"""
Retrieve a single page of ChannelInstance records from the API.
Request is executed immediately
:param ChannelInstance.ChannelType type: The type
:param str page_token: PageToken provided by the API
:param int page_number: Page Number, this value is simply for client state
:param int page_size: Number of records to return, defaults to 50
:returns: Page of ChannelInstance
:rtype: twilio.rest.chat.v1.service.channel.ChannelPage
"""
params = values.of({
'Type': serialize.map(type, lambda e: e),
'PageToken': page_token,
'Page': page_number,
'PageSize': page_size,
})
response = self._version.page(
'GET',
self._uri,
params=params,
)
return ChannelPage(self._version, response, self._solution) | python | def page(self, type=values.unset, page_token=values.unset,
page_number=values.unset, page_size=values.unset):
params = values.of({
'Type': serialize.map(type, lambda e: e),
'PageToken': page_token,
'Page': page_number,
'PageSize': page_size,
})
response = self._version.page(
'GET',
self._uri,
params=params,
)
return ChannelPage(self._version, response, self._solution) | [
"def",
"page",
"(",
"self",
",",
"type",
"=",
"values",
".",
"unset",
",",
"page_token",
"=",
"values",
".",
"unset",
",",
"page_number",
"=",
"values",
".",
"unset",
",",
"page_size",
"=",
"values",
".",
"unset",
")",
":",
"params",
"=",
"values",
"... | Retrieve a single page of ChannelInstance records from the API.
Request is executed immediately
:param ChannelInstance.ChannelType type: The type
:param str page_token: PageToken provided by the API
:param int page_number: Page Number, this value is simply for client state
:param int page_size: Number of records to return, defaults to 50
:returns: Page of ChannelInstance
:rtype: twilio.rest.chat.v1.service.channel.ChannelPage | [
"Retrieve",
"a",
"single",
"page",
"of",
"ChannelInstance",
"records",
"from",
"the",
"API",
".",
"Request",
"is",
"executed",
"immediately"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/ip_messaging/v1/service/channel/__init__.py#L111-L138 |
225,485 | twilio/twilio-python | twilio/rest/ip_messaging/v1/service/channel/__init__.py | ChannelList.get | def get(self, sid):
"""
Constructs a ChannelContext
:param sid: The sid
:returns: twilio.rest.chat.v1.service.channel.ChannelContext
:rtype: twilio.rest.chat.v1.service.channel.ChannelContext
"""
return ChannelContext(self._version, service_sid=self._solution['service_sid'], sid=sid, ) | python | def get(self, sid):
return ChannelContext(self._version, service_sid=self._solution['service_sid'], sid=sid, ) | [
"def",
"get",
"(",
"self",
",",
"sid",
")",
":",
"return",
"ChannelContext",
"(",
"self",
".",
"_version",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_sid'",
"]",
",",
"sid",
"=",
"sid",
",",
")"
] | Constructs a ChannelContext
:param sid: The sid
:returns: twilio.rest.chat.v1.service.channel.ChannelContext
:rtype: twilio.rest.chat.v1.service.channel.ChannelContext | [
"Constructs",
"a",
"ChannelContext"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/ip_messaging/v1/service/channel/__init__.py#L157-L166 |
225,486 | twilio/twilio-python | twilio/rest/ip_messaging/v1/service/channel/__init__.py | ChannelPage.get_instance | def get_instance(self, payload):
"""
Build an instance of ChannelInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.chat.v1.service.channel.ChannelInstance
:rtype: twilio.rest.chat.v1.service.channel.ChannelInstance
"""
return ChannelInstance(self._version, payload, service_sid=self._solution['service_sid'], ) | python | def get_instance(self, payload):
return ChannelInstance(self._version, payload, service_sid=self._solution['service_sid'], ) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"ChannelInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_sid'",
"]",
",",
")"
] | Build an instance of ChannelInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.chat.v1.service.channel.ChannelInstance
:rtype: twilio.rest.chat.v1.service.channel.ChannelInstance | [
"Build",
"an",
"instance",
"of",
"ChannelInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/ip_messaging/v1/service/channel/__init__.py#L208-L217 |
225,487 | twilio/twilio-python | twilio/rest/ip_messaging/v1/service/channel/__init__.py | ChannelContext.update | def update(self, friendly_name=values.unset, unique_name=values.unset,
attributes=values.unset):
"""
Update the ChannelInstance
:param unicode friendly_name: A human-readable name for the Channel.
:param unicode unique_name: A unique, addressable name for the Channel.
:param unicode attributes: An optional metadata field you can use to store any data you wish.
:returns: Updated ChannelInstance
:rtype: twilio.rest.chat.v1.service.channel.ChannelInstance
"""
data = values.of({
'FriendlyName': friendly_name,
'UniqueName': unique_name,
'Attributes': attributes,
})
payload = self._version.update(
'POST',
self._uri,
data=data,
)
return ChannelInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
sid=self._solution['sid'],
) | python | def update(self, friendly_name=values.unset, unique_name=values.unset,
attributes=values.unset):
data = values.of({
'FriendlyName': friendly_name,
'UniqueName': unique_name,
'Attributes': attributes,
})
payload = self._version.update(
'POST',
self._uri,
data=data,
)
return ChannelInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
sid=self._solution['sid'],
) | [
"def",
"update",
"(",
"self",
",",
"friendly_name",
"=",
"values",
".",
"unset",
",",
"unique_name",
"=",
"values",
".",
"unset",
",",
"attributes",
"=",
"values",
".",
"unset",
")",
":",
"data",
"=",
"values",
".",
"of",
"(",
"{",
"'FriendlyName'",
":... | Update the ChannelInstance
:param unicode friendly_name: A human-readable name for the Channel.
:param unicode unique_name: A unique, addressable name for the Channel.
:param unicode attributes: An optional metadata field you can use to store any data you wish.
:returns: Updated ChannelInstance
:rtype: twilio.rest.chat.v1.service.channel.ChannelInstance | [
"Update",
"the",
"ChannelInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/ip_messaging/v1/service/channel/__init__.py#L285-L314 |
225,488 | twilio/twilio-python | twilio/rest/ip_messaging/v1/service/channel/__init__.py | ChannelContext.invites | def invites(self):
"""
Access the invites
:returns: twilio.rest.chat.v1.service.channel.invite.InviteList
:rtype: twilio.rest.chat.v1.service.channel.invite.InviteList
"""
if self._invites is None:
self._invites = InviteList(
self._version,
service_sid=self._solution['service_sid'],
channel_sid=self._solution['sid'],
)
return self._invites | python | def invites(self):
if self._invites is None:
self._invites = InviteList(
self._version,
service_sid=self._solution['service_sid'],
channel_sid=self._solution['sid'],
)
return self._invites | [
"def",
"invites",
"(",
"self",
")",
":",
"if",
"self",
".",
"_invites",
"is",
"None",
":",
"self",
".",
"_invites",
"=",
"InviteList",
"(",
"self",
".",
"_version",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_sid'",
"]",
",",
"cha... | Access the invites
:returns: twilio.rest.chat.v1.service.channel.invite.InviteList
:rtype: twilio.rest.chat.v1.service.channel.invite.InviteList | [
"Access",
"the",
"invites"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/ip_messaging/v1/service/channel/__init__.py#L349-L362 |
225,489 | twilio/twilio-python | twilio/rest/api/v2010/account/application.py | ApplicationList.create | def create(self, friendly_name, api_version=values.unset,
voice_url=values.unset, voice_method=values.unset,
voice_fallback_url=values.unset, voice_fallback_method=values.unset,
status_callback=values.unset, status_callback_method=values.unset,
voice_caller_id_lookup=values.unset, sms_url=values.unset,
sms_method=values.unset, sms_fallback_url=values.unset,
sms_fallback_method=values.unset, sms_status_callback=values.unset,
message_status_callback=values.unset):
"""
Create a new ApplicationInstance
:param unicode friendly_name: A string to describe the new resource
:param unicode api_version: The API version to use to start a new TwiML session
:param unicode voice_url: The URL to call when the phone number receives a call
:param unicode voice_method: The HTTP method to use with the voice_url
:param unicode voice_fallback_url: The URL to call when a TwiML error occurs
:param unicode voice_fallback_method: The HTTP method to use with voice_fallback_url
:param unicode status_callback: The URL to send status information to your application
:param unicode status_callback_method: The HTTP method to use to call status_callback
:param bool voice_caller_id_lookup: Whether to lookup the caller's name
:param unicode sms_url: The URL to call when the phone number receives an incoming SMS message
:param unicode sms_method: The HTTP method to use with sms_url
:param unicode sms_fallback_url: The URL to call when an error occurs while retrieving or executing the TwiML
:param unicode sms_fallback_method: The HTTP method to use with sms_fallback_url
:param unicode sms_status_callback: The URL to send status information to your application
:param unicode message_status_callback: The URL to send message status information to your application
:returns: Newly created ApplicationInstance
:rtype: twilio.rest.api.v2010.account.application.ApplicationInstance
"""
data = values.of({
'FriendlyName': friendly_name,
'ApiVersion': api_version,
'VoiceUrl': voice_url,
'VoiceMethod': voice_method,
'VoiceFallbackUrl': voice_fallback_url,
'VoiceFallbackMethod': voice_fallback_method,
'StatusCallback': status_callback,
'StatusCallbackMethod': status_callback_method,
'VoiceCallerIdLookup': voice_caller_id_lookup,
'SmsUrl': sms_url,
'SmsMethod': sms_method,
'SmsFallbackUrl': sms_fallback_url,
'SmsFallbackMethod': sms_fallback_method,
'SmsStatusCallback': sms_status_callback,
'MessageStatusCallback': message_status_callback,
})
payload = self._version.create(
'POST',
self._uri,
data=data,
)
return ApplicationInstance(self._version, payload, account_sid=self._solution['account_sid'], ) | python | def create(self, friendly_name, api_version=values.unset,
voice_url=values.unset, voice_method=values.unset,
voice_fallback_url=values.unset, voice_fallback_method=values.unset,
status_callback=values.unset, status_callback_method=values.unset,
voice_caller_id_lookup=values.unset, sms_url=values.unset,
sms_method=values.unset, sms_fallback_url=values.unset,
sms_fallback_method=values.unset, sms_status_callback=values.unset,
message_status_callback=values.unset):
data = values.of({
'FriendlyName': friendly_name,
'ApiVersion': api_version,
'VoiceUrl': voice_url,
'VoiceMethod': voice_method,
'VoiceFallbackUrl': voice_fallback_url,
'VoiceFallbackMethod': voice_fallback_method,
'StatusCallback': status_callback,
'StatusCallbackMethod': status_callback_method,
'VoiceCallerIdLookup': voice_caller_id_lookup,
'SmsUrl': sms_url,
'SmsMethod': sms_method,
'SmsFallbackUrl': sms_fallback_url,
'SmsFallbackMethod': sms_fallback_method,
'SmsStatusCallback': sms_status_callback,
'MessageStatusCallback': message_status_callback,
})
payload = self._version.create(
'POST',
self._uri,
data=data,
)
return ApplicationInstance(self._version, payload, account_sid=self._solution['account_sid'], ) | [
"def",
"create",
"(",
"self",
",",
"friendly_name",
",",
"api_version",
"=",
"values",
".",
"unset",
",",
"voice_url",
"=",
"values",
".",
"unset",
",",
"voice_method",
"=",
"values",
".",
"unset",
",",
"voice_fallback_url",
"=",
"values",
".",
"unset",
",... | Create a new ApplicationInstance
:param unicode friendly_name: A string to describe the new resource
:param unicode api_version: The API version to use to start a new TwiML session
:param unicode voice_url: The URL to call when the phone number receives a call
:param unicode voice_method: The HTTP method to use with the voice_url
:param unicode voice_fallback_url: The URL to call when a TwiML error occurs
:param unicode voice_fallback_method: The HTTP method to use with voice_fallback_url
:param unicode status_callback: The URL to send status information to your application
:param unicode status_callback_method: The HTTP method to use to call status_callback
:param bool voice_caller_id_lookup: Whether to lookup the caller's name
:param unicode sms_url: The URL to call when the phone number receives an incoming SMS message
:param unicode sms_method: The HTTP method to use with sms_url
:param unicode sms_fallback_url: The URL to call when an error occurs while retrieving or executing the TwiML
:param unicode sms_fallback_method: The HTTP method to use with sms_fallback_url
:param unicode sms_status_callback: The URL to send status information to your application
:param unicode message_status_callback: The URL to send message status information to your application
:returns: Newly created ApplicationInstance
:rtype: twilio.rest.api.v2010.account.application.ApplicationInstance | [
"Create",
"a",
"new",
"ApplicationInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/application.py#L36-L90 |
225,490 | twilio/twilio-python | twilio/rest/api/v2010/account/application.py | ApplicationList.get | def get(self, sid):
"""
Constructs a ApplicationContext
:param sid: The unique string that identifies the resource
:returns: twilio.rest.api.v2010.account.application.ApplicationContext
:rtype: twilio.rest.api.v2010.account.application.ApplicationContext
"""
return ApplicationContext(self._version, account_sid=self._solution['account_sid'], sid=sid, ) | python | def get(self, sid):
return ApplicationContext(self._version, account_sid=self._solution['account_sid'], sid=sid, ) | [
"def",
"get",
"(",
"self",
",",
"sid",
")",
":",
"return",
"ApplicationContext",
"(",
"self",
".",
"_version",
",",
"account_sid",
"=",
"self",
".",
"_solution",
"[",
"'account_sid'",
"]",
",",
"sid",
"=",
"sid",
",",
")"
] | Constructs a ApplicationContext
:param sid: The unique string that identifies the resource
:returns: twilio.rest.api.v2010.account.application.ApplicationContext
:rtype: twilio.rest.api.v2010.account.application.ApplicationContext | [
"Constructs",
"a",
"ApplicationContext"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/application.py#L181-L190 |
225,491 | twilio/twilio-python | twilio/rest/api/v2010/account/application.py | ApplicationPage.get_instance | def get_instance(self, payload):
"""
Build an instance of ApplicationInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.api.v2010.account.application.ApplicationInstance
:rtype: twilio.rest.api.v2010.account.application.ApplicationInstance
"""
return ApplicationInstance(self._version, payload, account_sid=self._solution['account_sid'], ) | python | def get_instance(self, payload):
return ApplicationInstance(self._version, payload, account_sid=self._solution['account_sid'], ) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"ApplicationInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"account_sid",
"=",
"self",
".",
"_solution",
"[",
"'account_sid'",
"]",
",",
")"
] | Build an instance of ApplicationInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.api.v2010.account.application.ApplicationInstance
:rtype: twilio.rest.api.v2010.account.application.ApplicationInstance | [
"Build",
"an",
"instance",
"of",
"ApplicationInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/application.py#L232-L241 |
225,492 | twilio/twilio-python | twilio/rest/api/v2010/account/application.py | ApplicationInstance.update | def update(self, friendly_name=values.unset, api_version=values.unset,
voice_url=values.unset, voice_method=values.unset,
voice_fallback_url=values.unset, voice_fallback_method=values.unset,
status_callback=values.unset, status_callback_method=values.unset,
voice_caller_id_lookup=values.unset, sms_url=values.unset,
sms_method=values.unset, sms_fallback_url=values.unset,
sms_fallback_method=values.unset, sms_status_callback=values.unset,
message_status_callback=values.unset):
"""
Update the ApplicationInstance
:param unicode friendly_name: A string to describe the resource
:param unicode api_version: The API version to use to start a new TwiML session
:param unicode voice_url: The URL to call when the phone number receives a call
:param unicode voice_method: The HTTP method to use with the voice_url
:param unicode voice_fallback_url: The URL to call when a TwiML error occurs
:param unicode voice_fallback_method: The HTTP method to use with voice_fallback_url
:param unicode status_callback: The URL to send status information to your application
:param unicode status_callback_method: The HTTP method to use to call status_callback
:param bool voice_caller_id_lookup: Whether to lookup the caller's name
:param unicode sms_url: The URL to call when the phone number receives an incoming SMS message
:param unicode sms_method: The HTTP method to use with sms_url
:param unicode sms_fallback_url: The URL to call when an error occurs while retrieving or executing the TwiML
:param unicode sms_fallback_method: The HTTP method to use with sms_fallback_url
:param unicode sms_status_callback: The URL to send status information to your application
:param unicode message_status_callback: The URL to send message status information to your application
:returns: Updated ApplicationInstance
:rtype: twilio.rest.api.v2010.account.application.ApplicationInstance
"""
return self._proxy.update(
friendly_name=friendly_name,
api_version=api_version,
voice_url=voice_url,
voice_method=voice_method,
voice_fallback_url=voice_fallback_url,
voice_fallback_method=voice_fallback_method,
status_callback=status_callback,
status_callback_method=status_callback_method,
voice_caller_id_lookup=voice_caller_id_lookup,
sms_url=sms_url,
sms_method=sms_method,
sms_fallback_url=sms_fallback_url,
sms_fallback_method=sms_fallback_method,
sms_status_callback=sms_status_callback,
message_status_callback=message_status_callback,
) | python | def update(self, friendly_name=values.unset, api_version=values.unset,
voice_url=values.unset, voice_method=values.unset,
voice_fallback_url=values.unset, voice_fallback_method=values.unset,
status_callback=values.unset, status_callback_method=values.unset,
voice_caller_id_lookup=values.unset, sms_url=values.unset,
sms_method=values.unset, sms_fallback_url=values.unset,
sms_fallback_method=values.unset, sms_status_callback=values.unset,
message_status_callback=values.unset):
return self._proxy.update(
friendly_name=friendly_name,
api_version=api_version,
voice_url=voice_url,
voice_method=voice_method,
voice_fallback_url=voice_fallback_url,
voice_fallback_method=voice_fallback_method,
status_callback=status_callback,
status_callback_method=status_callback_method,
voice_caller_id_lookup=voice_caller_id_lookup,
sms_url=sms_url,
sms_method=sms_method,
sms_fallback_url=sms_fallback_url,
sms_fallback_method=sms_fallback_method,
sms_status_callback=sms_status_callback,
message_status_callback=message_status_callback,
) | [
"def",
"update",
"(",
"self",
",",
"friendly_name",
"=",
"values",
".",
"unset",
",",
"api_version",
"=",
"values",
".",
"unset",
",",
"voice_url",
"=",
"values",
".",
"unset",
",",
"voice_method",
"=",
"values",
".",
"unset",
",",
"voice_fallback_url",
"=... | Update the ApplicationInstance
:param unicode friendly_name: A string to describe the resource
:param unicode api_version: The API version to use to start a new TwiML session
:param unicode voice_url: The URL to call when the phone number receives a call
:param unicode voice_method: The HTTP method to use with the voice_url
:param unicode voice_fallback_url: The URL to call when a TwiML error occurs
:param unicode voice_fallback_method: The HTTP method to use with voice_fallback_url
:param unicode status_callback: The URL to send status information to your application
:param unicode status_callback_method: The HTTP method to use to call status_callback
:param bool voice_caller_id_lookup: Whether to lookup the caller's name
:param unicode sms_url: The URL to call when the phone number receives an incoming SMS message
:param unicode sms_method: The HTTP method to use with sms_url
:param unicode sms_fallback_url: The URL to call when an error occurs while retrieving or executing the TwiML
:param unicode sms_fallback_method: The HTTP method to use with sms_fallback_url
:param unicode sms_status_callback: The URL to send status information to your application
:param unicode message_status_callback: The URL to send message status information to your application
:returns: Updated ApplicationInstance
:rtype: twilio.rest.api.v2010.account.application.ApplicationInstance | [
"Update",
"the",
"ApplicationInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/api/v2010/account/application.py#L611-L657 |
225,493 | twilio/twilio-python | twilio/rest/pricing/v1/voice/__init__.py | VoiceList.numbers | def numbers(self):
"""
Access the numbers
:returns: twilio.rest.pricing.v1.voice.number.NumberList
:rtype: twilio.rest.pricing.v1.voice.number.NumberList
"""
if self._numbers is None:
self._numbers = NumberList(self._version, )
return self._numbers | python | def numbers(self):
if self._numbers is None:
self._numbers = NumberList(self._version, )
return self._numbers | [
"def",
"numbers",
"(",
"self",
")",
":",
"if",
"self",
".",
"_numbers",
"is",
"None",
":",
"self",
".",
"_numbers",
"=",
"NumberList",
"(",
"self",
".",
"_version",
",",
")",
"return",
"self",
".",
"_numbers"
] | Access the numbers
:returns: twilio.rest.pricing.v1.voice.number.NumberList
:rtype: twilio.rest.pricing.v1.voice.number.NumberList | [
"Access",
"the",
"numbers"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/pricing/v1/voice/__init__.py#L38-L47 |
225,494 | twilio/twilio-python | twilio/rest/proxy/v1/service/short_code.py | ShortCodeList.create | def create(self, sid):
"""
Create a new ShortCodeInstance
:param unicode sid: The SID of a Twilio ShortCode resource
:returns: Newly created ShortCodeInstance
:rtype: twilio.rest.proxy.v1.service.short_code.ShortCodeInstance
"""
data = values.of({'Sid': sid, })
payload = self._version.create(
'POST',
self._uri,
data=data,
)
return ShortCodeInstance(self._version, payload, service_sid=self._solution['service_sid'], ) | python | def create(self, sid):
data = values.of({'Sid': sid, })
payload = self._version.create(
'POST',
self._uri,
data=data,
)
return ShortCodeInstance(self._version, payload, service_sid=self._solution['service_sid'], ) | [
"def",
"create",
"(",
"self",
",",
"sid",
")",
":",
"data",
"=",
"values",
".",
"of",
"(",
"{",
"'Sid'",
":",
"sid",
",",
"}",
")",
"payload",
"=",
"self",
".",
"_version",
".",
"create",
"(",
"'POST'",
",",
"self",
".",
"_uri",
",",
"data",
"=... | Create a new ShortCodeInstance
:param unicode sid: The SID of a Twilio ShortCode resource
:returns: Newly created ShortCodeInstance
:rtype: twilio.rest.proxy.v1.service.short_code.ShortCodeInstance | [
"Create",
"a",
"new",
"ShortCodeInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/proxy/v1/service/short_code.py#L37-L54 |
225,495 | twilio/twilio-python | twilio/rest/preview/bulk_exports/export/__init__.py | ExportContext.fetch | def fetch(self):
"""
Fetch a ExportInstance
:returns: Fetched ExportInstance
:rtype: twilio.rest.preview.bulk_exports.export.ExportInstance
"""
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return ExportInstance(self._version, payload, resource_type=self._solution['resource_type'], ) | python | def fetch(self):
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
params=params,
)
return ExportInstance(self._version, payload, resource_type=self._solution['resource_type'], ) | [
"def",
"fetch",
"(",
"self",
")",
":",
"params",
"=",
"values",
".",
"of",
"(",
"{",
"}",
")",
"payload",
"=",
"self",
".",
"_version",
".",
"fetch",
"(",
"'GET'",
",",
"self",
".",
"_uri",
",",
"params",
"=",
"params",
",",
")",
"return",
"Expor... | Fetch a ExportInstance
:returns: Fetched ExportInstance
:rtype: twilio.rest.preview.bulk_exports.export.ExportInstance | [
"Fetch",
"a",
"ExportInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/preview/bulk_exports/export/__init__.py#L133-L148 |
225,496 | twilio/twilio-python | twilio/rest/preview/bulk_exports/export/__init__.py | ExportContext.days | def days(self):
"""
Access the days
:returns: twilio.rest.preview.bulk_exports.export.day.DayList
:rtype: twilio.rest.preview.bulk_exports.export.day.DayList
"""
if self._days is None:
self._days = DayList(self._version, resource_type=self._solution['resource_type'], )
return self._days | python | def days(self):
if self._days is None:
self._days = DayList(self._version, resource_type=self._solution['resource_type'], )
return self._days | [
"def",
"days",
"(",
"self",
")",
":",
"if",
"self",
".",
"_days",
"is",
"None",
":",
"self",
".",
"_days",
"=",
"DayList",
"(",
"self",
".",
"_version",
",",
"resource_type",
"=",
"self",
".",
"_solution",
"[",
"'resource_type'",
"]",
",",
")",
"retu... | Access the days
:returns: twilio.rest.preview.bulk_exports.export.day.DayList
:rtype: twilio.rest.preview.bulk_exports.export.day.DayList | [
"Access",
"the",
"days"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/preview/bulk_exports/export/__init__.py#L151-L160 |
225,497 | twilio/twilio-python | twilio/rest/proxy/v1/service/session/participant/message_interaction.py | MessageInteractionList.create | def create(self, body=values.unset, media_url=values.unset):
"""
Create a new MessageInteractionInstance
:param unicode body: Message body
:param unicode media_url: Reserved
:returns: Newly created MessageInteractionInstance
:rtype: twilio.rest.proxy.v1.service.session.participant.message_interaction.MessageInteractionInstance
"""
data = values.of({'Body': body, 'MediaUrl': serialize.map(media_url, lambda e: e), })
payload = self._version.create(
'POST',
self._uri,
data=data,
)
return MessageInteractionInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
session_sid=self._solution['session_sid'],
participant_sid=self._solution['participant_sid'],
) | python | def create(self, body=values.unset, media_url=values.unset):
data = values.of({'Body': body, 'MediaUrl': serialize.map(media_url, lambda e: e), })
payload = self._version.create(
'POST',
self._uri,
data=data,
)
return MessageInteractionInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
session_sid=self._solution['session_sid'],
participant_sid=self._solution['participant_sid'],
) | [
"def",
"create",
"(",
"self",
",",
"body",
"=",
"values",
".",
"unset",
",",
"media_url",
"=",
"values",
".",
"unset",
")",
":",
"data",
"=",
"values",
".",
"of",
"(",
"{",
"'Body'",
":",
"body",
",",
"'MediaUrl'",
":",
"serialize",
".",
"map",
"("... | Create a new MessageInteractionInstance
:param unicode body: Message body
:param unicode media_url: Reserved
:returns: Newly created MessageInteractionInstance
:rtype: twilio.rest.proxy.v1.service.session.participant.message_interaction.MessageInteractionInstance | [
"Create",
"a",
"new",
"MessageInteractionInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/proxy/v1/service/session/participant/message_interaction.py#L44-L68 |
225,498 | twilio/twilio-python | twilio/rest/proxy/v1/service/session/participant/message_interaction.py | MessageInteractionPage.get_instance | def get_instance(self, payload):
"""
Build an instance of MessageInteractionInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.proxy.v1.service.session.participant.message_interaction.MessageInteractionInstance
:rtype: twilio.rest.proxy.v1.service.session.participant.message_interaction.MessageInteractionInstance
"""
return MessageInteractionInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
session_sid=self._solution['session_sid'],
participant_sid=self._solution['participant_sid'],
) | python | def get_instance(self, payload):
return MessageInteractionInstance(
self._version,
payload,
service_sid=self._solution['service_sid'],
session_sid=self._solution['session_sid'],
participant_sid=self._solution['participant_sid'],
) | [
"def",
"get_instance",
"(",
"self",
",",
"payload",
")",
":",
"return",
"MessageInteractionInstance",
"(",
"self",
".",
"_version",
",",
"payload",
",",
"service_sid",
"=",
"self",
".",
"_solution",
"[",
"'service_sid'",
"]",
",",
"session_sid",
"=",
"self",
... | Build an instance of MessageInteractionInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.proxy.v1.service.session.participant.message_interaction.MessageInteractionInstance
:rtype: twilio.rest.proxy.v1.service.session.participant.message_interaction.MessageInteractionInstance | [
"Build",
"an",
"instance",
"of",
"MessageInteractionInstance"
] | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/proxy/v1/service/session/participant/message_interaction.py#L217-L232 |
225,499 | twilio/twilio-python | twilio/rest/preview/wireless/sim/__init__.py | SimList.stream | def stream(self, status=values.unset, iccid=values.unset,
rate_plan=values.unset, e_id=values.unset,
sim_registration_code=values.unset, limit=None, page_size=None):
"""
Streams SimInstance records from the API as a generator stream.
This operation lazily loads records as efficiently as possible until the limit
is reached.
The results are returned as a generator, so this operation is memory efficient.
:param unicode status: The status
:param unicode iccid: The iccid
:param unicode rate_plan: The rate_plan
:param unicode e_id: The e_id
:param unicode sim_registration_code: The sim_registration_code
:param int limit: Upper limit for the number of records to return. stream()
guarantees to never return more than limit. Default is no limit
:param int page_size: Number of records to fetch per request, when not set will use
the default value of 50 records. If no page_size is defined
but a limit is defined, stream() will attempt to read the
limit with the most efficient page size, i.e. min(limit, 1000)
:returns: Generator that will yield up to limit results
:rtype: list[twilio.rest.preview.wireless.sim.SimInstance]
"""
limits = self._version.read_limits(limit, page_size)
page = self.page(
status=status,
iccid=iccid,
rate_plan=rate_plan,
e_id=e_id,
sim_registration_code=sim_registration_code,
page_size=limits['page_size'],
)
return self._version.stream(page, limits['limit'], limits['page_limit']) | python | def stream(self, status=values.unset, iccid=values.unset,
rate_plan=values.unset, e_id=values.unset,
sim_registration_code=values.unset, limit=None, page_size=None):
limits = self._version.read_limits(limit, page_size)
page = self.page(
status=status,
iccid=iccid,
rate_plan=rate_plan,
e_id=e_id,
sim_registration_code=sim_registration_code,
page_size=limits['page_size'],
)
return self._version.stream(page, limits['limit'], limits['page_limit']) | [
"def",
"stream",
"(",
"self",
",",
"status",
"=",
"values",
".",
"unset",
",",
"iccid",
"=",
"values",
".",
"unset",
",",
"rate_plan",
"=",
"values",
".",
"unset",
",",
"e_id",
"=",
"values",
".",
"unset",
",",
"sim_registration_code",
"=",
"values",
"... | Streams SimInstance records from the API as a generator stream.
This operation lazily loads records as efficiently as possible until the limit
is reached.
The results are returned as a generator, so this operation is memory efficient.
:param unicode status: The status
:param unicode iccid: The iccid
:param unicode rate_plan: The rate_plan
:param unicode e_id: The e_id
:param unicode sim_registration_code: The sim_registration_code
:param int limit: Upper limit for the number of records to return. stream()
guarantees to never return more than limit. Default is no limit
:param int page_size: Number of records to fetch per request, when not set will use
the default value of 50 records. If no page_size is defined
but a limit is defined, stream() will attempt to read the
limit with the most efficient page size, i.e. min(limit, 1000)
:returns: Generator that will yield up to limit results
:rtype: list[twilio.rest.preview.wireless.sim.SimInstance] | [
"Streams",
"SimInstance",
"records",
"from",
"the",
"API",
"as",
"a",
"generator",
"stream",
".",
"This",
"operation",
"lazily",
"loads",
"records",
"as",
"efficiently",
"as",
"possible",
"until",
"the",
"limit",
"is",
"reached",
".",
"The",
"results",
"are",
... | c867895f55dcc29f522e6e8b8868d0d18483132f | https://github.com/twilio/twilio-python/blob/c867895f55dcc29f522e6e8b8868d0d18483132f/twilio/rest/preview/wireless/sim/__init__.py#L38-L73 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.