twilio.rest.chat.v2.service.channel package

Submodules

twilio.rest.chat.v2.service.channel.invite module

This code was generated by / _ _ _| _ _

(_)/(_)(_|/| |(/_ v1.0.0 / /

System Message: WARNING/2 (/twilio/repos/twilio-python/twilio/rest/chat/v2/service/channel/invite.py:docstring of twilio.rest.chat.v2.service.channel.invite, line 3); backlink

Inline substitution_reference start-string without end-string.
class twilio.rest.chat.v2.service.channel.invite.InviteContext(version, service_sid, channel_sid, sid)[source]

Bases: twilio.base.instance_context.InstanceContext

delete()[source]

Deletes the InviteInstance

Returns:True if delete succeeds, False otherwise
Return type:bool
fetch()[source]

Fetch the InviteInstance

Returns:The fetched InviteInstance
Return type:twilio.rest.chat.v2.service.channel.invite.InviteInstance
class twilio.rest.chat.v2.service.channel.invite.InviteInstance(version, payload, service_sid, channel_sid, sid=None)[source]

Bases: twilio.base.instance_resource.InstanceResource

account_sid
Returns:The SID of the Account that created the resource
Return type:unicode
channel_sid
Returns:The SID of the Channel the new resource belongs to
Return type:unicode
created_by
Returns:The identity of the User that created the invite
Return type:unicode
date_created
Returns:The ISO 8601 date and time in GMT when the resource was created
Return type:datetime
date_updated
Returns:The ISO 8601 date and time in GMT when the resource was last updated
Return type:datetime
delete()[source]

Deletes the InviteInstance

Returns:True if delete succeeds, False otherwise
Return type:bool
fetch()[source]

Fetch the InviteInstance

Returns:The fetched InviteInstance
Return type:twilio.rest.chat.v2.service.channel.invite.InviteInstance
identity
Returns:The string that identifies the resource’s User
Return type:unicode
role_sid
Returns:The SID of the Role assigned to the member
Return type:unicode
service_sid
Returns:The SID of the Service that the resource is associated with
Return type:unicode
sid
Returns:The unique string that identifies the resource
Return type:unicode
url
Returns:The absolute URL of the Invite resource
Return type:unicode
class twilio.rest.chat.v2.service.channel.invite.InviteList(version, service_sid, channel_sid)[source]

Bases: twilio.base.list_resource.ListResource

create(identity, role_sid=<object object>)[source]

Create the InviteInstance

Parameters:
  • identity (unicode) – The identity value that identifies the new resource’s User
  • role_sid (unicode) – The Role assigned to the new member
Returns:

The created InviteInstance

Return type:

twilio.rest.chat.v2.service.channel.invite.InviteInstance

get(sid)[source]

Constructs a InviteContext

Parameters:sid – The SID of the Invite resource to fetch
Returns:twilio.rest.chat.v2.service.channel.invite.InviteContext
Return type:twilio.rest.chat.v2.service.channel.invite.InviteContext
get_page(target_url)[source]

Retrieve a specific page of InviteInstance records from the API. Request is executed immediately

Parameters:target_url (str) – API-generated URL for the requested results page
Returns:Page of InviteInstance
Return type:twilio.rest.chat.v2.service.channel.invite.InvitePage
list(identity=<object object>, limit=None, page_size=None)[source]

Lists InviteInstance records from the API as a list. Unlike stream(), this operation is eager and will load limit records into memory before returning.

Parameters:
  • identity (list[unicode]) – The identity value of the resources to read
  • limit (int) – Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit
  • page_size (int) – 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, list() 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

Return type:

list[twilio.rest.chat.v2.service.channel.invite.InviteInstance]

page(identity=<object object>, page_token=<object object>, page_number=<object object>, page_size=<object object>)[source]

Retrieve a single page of InviteInstance records from the API. Request is executed immediately

Parameters:
  • identity (list[unicode]) – The identity value of the resources to read
  • page_token (str) – PageToken provided by the API
  • page_number (int) – Page Number, this value is simply for client state
  • page_size (int) – Number of records to return, defaults to 50
Returns:

Page of InviteInstance

Return type:

twilio.rest.chat.v2.service.channel.invite.InvitePage

stream(identity=<object object>, limit=None, page_size=None)[source]

Streams InviteInstance 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.

Parameters:
  • identity (list[unicode]) – The identity value of the resources to read
  • limit (int) – Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit
  • page_size (int) – 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

Return type:

list[twilio.rest.chat.v2.service.channel.invite.InviteInstance]

class twilio.rest.chat.v2.service.channel.invite.InvitePage(version, response, solution)[source]

Bases: twilio.base.page.Page

get_instance(payload)[source]

Build an instance of InviteInstance

Parameters:payload (dict) – Payload response from the API
Returns:twilio.rest.chat.v2.service.channel.invite.InviteInstance
Return type:twilio.rest.chat.v2.service.channel.invite.InviteInstance

twilio.rest.chat.v2.service.channel.member module

This code was generated by / _ _ _| _ _

(_)/(_)(_|/| |(/_ v1.0.0 / /

System Message: WARNING/2 (/twilio/repos/twilio-python/twilio/rest/chat/v2/service/channel/member.py:docstring of twilio.rest.chat.v2.service.channel.member, line 3); backlink

Inline substitution_reference start-string without end-string.
class twilio.rest.chat.v2.service.channel.member.MemberContext(version, service_sid, channel_sid, sid)[source]

Bases: twilio.base.instance_context.InstanceContext

delete(x_twilio_webhook_enabled=<object object>)[source]

Deletes the MemberInstance

Parameters:x_twilio_webhook_enabled (MemberInstance.WebhookEnabledType) – The X-Twilio-Webhook-Enabled HTTP request header
Returns:True if delete succeeds, False otherwise
Return type:bool
fetch()[source]

Fetch the MemberInstance

Returns:The fetched MemberInstance
Return type:twilio.rest.chat.v2.service.channel.member.MemberInstance
update(role_sid=<object object>, last_consumed_message_index=<object object>, last_consumption_timestamp=<object object>, date_created=<object object>, date_updated=<object object>, attributes=<object object>, x_twilio_webhook_enabled=<object object>)[source]

Update the MemberInstance

Parameters:
  • role_sid (unicode) – The SID of the Role to assign to the member
  • last_consumed_message_index (unicode) – The index of the last consumed Message for the Channel for the Member
  • last_consumption_timestamp (datetime) – The ISO 8601 based timestamp string representing the datetime of the last Message read event for the Member within the Channel
  • date_created (datetime) – The ISO 8601 date and time in GMT when the resource was created
  • date_updated (datetime) – The ISO 8601 date and time in GMT when the resource was updated
  • attributes (unicode) – A valid JSON string that contains application-specific data
  • x_twilio_webhook_enabled (MemberInstance.WebhookEnabledType) – The X-Twilio-Webhook-Enabled HTTP request header
Returns:

The updated MemberInstance

Return type:

twilio.rest.chat.v2.service.channel.member.MemberInstance

class twilio.rest.chat.v2.service.channel.member.MemberInstance(version, payload, service_sid, channel_sid, sid=None)[source]

Bases: twilio.base.instance_resource.InstanceResource

class WebhookEnabledType[source]

Bases: object

FALSE = 'false'
TRUE = 'true'
account_sid
Returns:The SID of the Account that created the resource
Return type:unicode
attributes
Returns:The JSON string that stores application-specific data
Return type:unicode
channel_sid
Returns:The SID of the Channel for the member
Return type:unicode
date_created
Returns:The ISO 8601 date and time in GMT when the resource was created
Return type:datetime
date_updated
Returns:The ISO 8601 date and time in GMT when the resource was last updated
Return type:datetime
delete(x_twilio_webhook_enabled=<object object>)[source]

Deletes the MemberInstance

Parameters:x_twilio_webhook_enabled (MemberInstance.WebhookEnabledType) – The X-Twilio-Webhook-Enabled HTTP request header
Returns:True if delete succeeds, False otherwise
Return type:bool
fetch()[source]

Fetch the MemberInstance

Returns:The fetched MemberInstance
Return type:twilio.rest.chat.v2.service.channel.member.MemberInstance
identity
Returns:The string that identifies the resource’s User
Return type:unicode
last_consumed_message_index
Returns:The index of the last Message that the Member has read within the Channel
Return type:unicode
last_consumption_timestamp
Returns:The ISO 8601 based timestamp string that represents the datetime of the last Message read event for the Member within the Channel
Return type:datetime
role_sid
Returns:The SID of the Role assigned to the member
Return type:unicode
service_sid
Returns:The SID of the Service that the resource is associated with
Return type:unicode
sid
Returns:The unique string that identifies the resource
Return type:unicode
update(role_sid=<object object>, last_consumed_message_index=<object object>, last_consumption_timestamp=<object object>, date_created=<object object>, date_updated=<object object>, attributes=<object object>, x_twilio_webhook_enabled=<object object>)[source]

Update the MemberInstance

Parameters:
  • role_sid (unicode) – The SID of the Role to assign to the member
  • last_consumed_message_index (unicode) – The index of the last consumed Message for the Channel for the Member
  • last_consumption_timestamp (datetime) – The ISO 8601 based timestamp string representing the datetime of the last Message read event for the Member within the Channel
  • date_created (datetime) – The ISO 8601 date and time in GMT when the resource was created
  • date_updated (datetime) – The ISO 8601 date and time in GMT when the resource was updated
  • attributes (unicode) – A valid JSON string that contains application-specific data
  • x_twilio_webhook_enabled (MemberInstance.WebhookEnabledType) – The X-Twilio-Webhook-Enabled HTTP request header
Returns:

The updated MemberInstance

Return type:

twilio.rest.chat.v2.service.channel.member.MemberInstance

url
Returns:The absolute URL of the Member resource
Return type:unicode
class twilio.rest.chat.v2.service.channel.member.MemberList(version, service_sid, channel_sid)[source]

Bases: twilio.base.list_resource.ListResource

create(identity, role_sid=<object object>, last_consumed_message_index=<object object>, last_consumption_timestamp=<object object>, date_created=<object object>, date_updated=<object object>, attributes=<object object>, x_twilio_webhook_enabled=<object object>)[source]

Create the MemberInstance

Parameters:
  • identity (unicode) – The identity value that identifies the new resource’s User
  • role_sid (unicode) – The SID of the Role to assign to the member
  • last_consumed_message_index (unicode) – The index of the last Message in the Channel the Member has read
  • last_consumption_timestamp (datetime) – The ISO 8601 based timestamp string representing the datetime of the last Message read event for the member within the Channel
  • date_created (datetime) – The ISO 8601 date and time in GMT when the resource was created
  • date_updated (datetime) – The ISO 8601 date and time in GMT when the resource was updated
  • attributes (unicode) – A valid JSON string that contains application-specific data
  • x_twilio_webhook_enabled (MemberInstance.WebhookEnabledType) – The X-Twilio-Webhook-Enabled HTTP request header
Returns:

The created MemberInstance

Return type:

twilio.rest.chat.v2.service.channel.member.MemberInstance

get(sid)[source]

Constructs a MemberContext

Parameters:sid – The SID of the Member resource to fetch
Returns:twilio.rest.chat.v2.service.channel.member.MemberContext
Return type:twilio.rest.chat.v2.service.channel.member.MemberContext
get_page(target_url)[source]

Retrieve a specific page of MemberInstance records from the API. Request is executed immediately

Parameters:target_url (str) – API-generated URL for the requested results page
Returns:Page of MemberInstance
Return type:twilio.rest.chat.v2.service.channel.member.MemberPage
list(identity=<object object>, limit=None, page_size=None)[source]

Lists MemberInstance records from the API as a list. Unlike stream(), this operation is eager and will load limit records into memory before returning.

Parameters:
  • identity (list[unicode]) – The identity value of the resources to read
  • limit (int) – Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit
  • page_size (int) – 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, list() 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

Return type:

list[twilio.rest.chat.v2.service.channel.member.MemberInstance]

page(identity=<object object>, page_token=<object object>, page_number=<object object>, page_size=<object object>)[source]

Retrieve a single page of MemberInstance records from the API. Request is executed immediately

Parameters:
  • identity (list[unicode]) – The identity value of the resources to read
  • page_token (str) – PageToken provided by the API
  • page_number (int) – Page Number, this value is simply for client state
  • page_size (int) – Number of records to return, defaults to 50
Returns:

Page of MemberInstance

Return type:

twilio.rest.chat.v2.service.channel.member.MemberPage

stream(identity=<object object>, limit=None, page_size=None)[source]

Streams MemberInstance 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.

Parameters:
  • identity (list[unicode]) – The identity value of the resources to read
  • limit (int) – Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit
  • page_size (int) – 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

Return type:

list[twilio.rest.chat.v2.service.channel.member.MemberInstance]

class twilio.rest.chat.v2.service.channel.member.MemberPage(version, response, solution)[source]

Bases: twilio.base.page.Page

get_instance(payload)[source]

Build an instance of MemberInstance

Parameters:payload (dict) – Payload response from the API
Returns:twilio.rest.chat.v2.service.channel.member.MemberInstance
Return type:twilio.rest.chat.v2.service.channel.member.MemberInstance

twilio.rest.chat.v2.service.channel.message module

This code was generated by / _ _ _| _ _

(_)/(_)(_|/| |(/_ v1.0.0 / /

System Message: WARNING/2 (/twilio/repos/twilio-python/twilio/rest/chat/v2/service/channel/message.py:docstring of twilio.rest.chat.v2.service.channel.message, line 3); backlink

Inline substitution_reference start-string without end-string.
class twilio.rest.chat.v2.service.channel.message.MessageContext(version, service_sid, channel_sid, sid)[source]

Bases: twilio.base.instance_context.InstanceContext

delete(x_twilio_webhook_enabled=<object object>)[source]

Deletes the MessageInstance

Parameters:x_twilio_webhook_enabled (MessageInstance.WebhookEnabledType) – The X-Twilio-Webhook-Enabled HTTP request header
Returns:True if delete succeeds, False otherwise
Return type:bool
fetch()[source]

Fetch the MessageInstance

Returns:The fetched MessageInstance
Return type:twilio.rest.chat.v2.service.channel.message.MessageInstance
update(body=<object object>, attributes=<object object>, date_created=<object object>, date_updated=<object object>, last_updated_by=<object object>, from_=<object object>, x_twilio_webhook_enabled=<object object>)[source]

Update the MessageInstance

Parameters:
  • body (unicode) – The message to send to the channel
  • attributes (unicode) – A valid JSON string that contains application-specific data
  • date_created (datetime) – The ISO 8601 date and time in GMT when the resource was created
  • date_updated (datetime) – The ISO 8601 date and time in GMT when the resource was updated
  • last_updated_by (unicode) – The Identity of the User who last updated the Message, if applicable
  • from (unicode) – The Identity of the message’s author
  • x_twilio_webhook_enabled (MessageInstance.WebhookEnabledType) – The X-Twilio-Webhook-Enabled HTTP request header
Returns:

The updated MessageInstance

Return type:

twilio.rest.chat.v2.service.channel.message.MessageInstance

class twilio.rest.chat.v2.service.channel.message.MessageInstance(version, payload, service_sid, channel_sid, sid=None)[source]

Bases: twilio.base.instance_resource.InstanceResource

class OrderType[source]

Bases: object

ASC = 'asc'
DESC = 'desc'
class WebhookEnabledType[source]

Bases: object

FALSE = 'false'
TRUE = 'true'
account_sid
Returns:The SID of the Account that created the resource
Return type:unicode
attributes
Returns:The JSON string that stores application-specific data
Return type:unicode
body
Returns:The content of the message
Return type:unicode
channel_sid
Returns:The SID of the Channel the Message resource belongs to
Return type:unicode
date_created
Returns:The RFC 2822 date and time in GMT when the resource was created
Return type:datetime
date_updated
Returns:The RFC 2822 date and time in GMT when the resource was last updated
Return type:datetime
delete(x_twilio_webhook_enabled=<object object>)[source]

Deletes the MessageInstance

Parameters:x_twilio_webhook_enabled (MessageInstance.WebhookEnabledType) – The X-Twilio-Webhook-Enabled HTTP request header
Returns:True if delete succeeds, False otherwise
Return type:bool
fetch()[source]

Fetch the MessageInstance

Returns:The fetched MessageInstance
Return type:twilio.rest.chat.v2.service.channel.message.MessageInstance
from_
Returns:The Identity of the message’s author
Return type:unicode
index
Returns:The index of the message within the Channel
Return type:unicode
last_updated_by
Returns:The Identity of the User who last updated the Message
Return type:unicode
media
Returns:A Media object that describes the Message’s media if attached; otherwise, null
Return type:dict
service_sid
Returns:The SID of the Service that the resource is associated with
Return type:unicode
sid
Returns:The unique string that identifies the resource
Return type:unicode
to
Returns:The SID of the Channel that the message was sent to
Return type:unicode
type
Returns:The Message type
Return type:unicode
update(body=<object object>, attributes=<object object>, date_created=<object object>, date_updated=<object object>, last_updated_by=<object object>, from_=<object object>, x_twilio_webhook_enabled=<object object>)[source]

Update the MessageInstance

Parameters:
  • body (unicode) – The message to send to the channel
  • attributes (unicode) – A valid JSON string that contains application-specific data
  • date_created (datetime) – The ISO 8601 date and time in GMT when the resource was created
  • date_updated (datetime) – The ISO 8601 date and time in GMT when the resource was updated
  • last_updated_by (unicode) – The Identity of the User who last updated the Message, if applicable
  • from (unicode) – The Identity of the message’s author
  • x_twilio_webhook_enabled (MessageInstance.WebhookEnabledType) – The X-Twilio-Webhook-Enabled HTTP request header
Returns:

The updated MessageInstance

Return type:

twilio.rest.chat.v2.service.channel.message.MessageInstance

url
Returns:The absolute URL of the Message resource
Return type:unicode
was_edited
Returns:Whether the message has been edited since it was created
Return type:bool
class twilio.rest.chat.v2.service.channel.message.MessageList(version, service_sid, channel_sid)[source]

Bases: twilio.base.list_resource.ListResource

create(from_=<object object>, attributes=<object object>, date_created=<object object>, date_updated=<object object>, last_updated_by=<object object>, body=<object object>, media_sid=<object object>, x_twilio_webhook_enabled=<object object>)[source]

Create the MessageInstance

Parameters:
  • from (unicode) – The Identity of the new message’s author
  • attributes (unicode) – A valid JSON string that contains application-specific data
  • date_created (datetime) – The ISO 8601 date and time in GMT when the resource was created
  • date_updated (datetime) – The ISO 8601 date and time in GMT when the resource was updated
  • last_updated_by (unicode) – The Identity of the User who last updated the Message
  • body (unicode) – The message to send to the channel
  • media_sid (unicode) – The Media Sid to be attached to the new Message
  • x_twilio_webhook_enabled (MessageInstance.WebhookEnabledType) – The X-Twilio-Webhook-Enabled HTTP request header
Returns:

The created MessageInstance

Return type:

twilio.rest.chat.v2.service.channel.message.MessageInstance

get(sid)[source]

Constructs a MessageContext

Parameters:sid – The SID of the Message resource to fetch
Returns:twilio.rest.chat.v2.service.channel.message.MessageContext
Return type:twilio.rest.chat.v2.service.channel.message.MessageContext
get_page(target_url)[source]

Retrieve a specific page of MessageInstance records from the API. Request is executed immediately

Parameters:target_url (str) – API-generated URL for the requested results page
Returns:Page of MessageInstance
Return type:twilio.rest.chat.v2.service.channel.message.MessagePage
list(order=<object object>, limit=None, page_size=None)[source]

Lists MessageInstance records from the API as a list. Unlike stream(), this operation is eager and will load limit records into memory before returning.

Parameters:
  • order (MessageInstance.OrderType) – The sort order of the returned messages
  • limit (int) – Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit
  • page_size (int) – 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, list() 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

Return type:

list[twilio.rest.chat.v2.service.channel.message.MessageInstance]

page(order=<object object>, page_token=<object object>, page_number=<object object>, page_size=<object object>)[source]

Retrieve a single page of MessageInstance records from the API. Request is executed immediately

Parameters:
  • order (MessageInstance.OrderType) – The sort order of the returned messages
  • page_token (str) – PageToken provided by the API
  • page_number (int) – Page Number, this value is simply for client state
  • page_size (int) – Number of records to return, defaults to 50
Returns:

Page of MessageInstance

Return type:

twilio.rest.chat.v2.service.channel.message.MessagePage

stream(order=<object object>, limit=None, page_size=None)[source]

Streams MessageInstance 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.

Parameters:
  • order (MessageInstance.OrderType) – The sort order of the returned messages
  • limit (int) – Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit
  • page_size (int) – 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

Return type:

list[twilio.rest.chat.v2.service.channel.message.MessageInstance]

class twilio.rest.chat.v2.service.channel.message.MessagePage(version, response, solution)[source]

Bases: twilio.base.page.Page

get_instance(payload)[source]

Build an instance of MessageInstance

Parameters:payload (dict) – Payload response from the API
Returns:twilio.rest.chat.v2.service.channel.message.MessageInstance
Return type:twilio.rest.chat.v2.service.channel.message.MessageInstance

twilio.rest.chat.v2.service.channel.webhook module

This code was generated by / _ _ _| _ _

(_)/(_)(_|/| |(/_ v1.0.0 / /

System Message: WARNING/2 (/twilio/repos/twilio-python/twilio/rest/chat/v2/service/channel/webhook.py:docstring of twilio.rest.chat.v2.service.channel.webhook, line 3); backlink

Inline substitution_reference start-string without end-string.
class twilio.rest.chat.v2.service.channel.webhook.WebhookContext(version, service_sid, channel_sid, sid)[source]

Bases: twilio.base.instance_context.InstanceContext

delete()[source]

Deletes the WebhookInstance

Returns:True if delete succeeds, False otherwise
Return type:bool
fetch()[source]

Fetch the WebhookInstance

Returns:The fetched WebhookInstance
Return type:twilio.rest.chat.v2.service.channel.webhook.WebhookInstance
update(configuration_url=<object object>, configuration_method=<object object>, configuration_filters=<object object>, configuration_triggers=<object object>, configuration_flow_sid=<object object>, configuration_retry_count=<object object>)[source]

Update the WebhookInstance

Parameters:
  • configuration_url (unicode) – The URL of the webhook to call
  • configuration_method (WebhookInstance.Method) – The HTTP method used to call configuration.url
  • configuration_filters (list[unicode]) – The events that cause us to call the Channel Webhook
  • configuration_triggers (list[unicode]) – A string that will cause us to call the webhook when it is found in a message body
  • configuration_flow_sid (unicode) – The SID of the Studio Flow to call when an event occurs
  • configuration_retry_count (unicode) – The number of times to retry the webhook if the first attempt fails
Returns:

The updated WebhookInstance

Return type:

twilio.rest.chat.v2.service.channel.webhook.WebhookInstance

class twilio.rest.chat.v2.service.channel.webhook.WebhookInstance(version, payload, service_sid, channel_sid, sid=None)[source]

Bases: twilio.base.instance_resource.InstanceResource

class Method[source]

Bases: object

GET = 'GET'
POST = 'POST'
class Type[source]

Bases: object

STUDIO = 'studio'
TRIGGER = 'trigger'
WEBHOOK = 'webhook'
account_sid
Returns:The SID of the Account that created the resource
Return type:unicode
channel_sid
Returns:The SID of the Channel the Channel Webhook resource belongs to
Return type:unicode
configuration
Returns:The JSON string that describes the configuration object for the channel webhook
Return type:dict
date_created
Returns:The ISO 8601 date and time in GMT when the resource was created
Return type:datetime
date_updated
Returns:The ISO 8601 date and time in GMT when the resource was last updated
Return type:datetime
delete()[source]

Deletes the WebhookInstance

Returns:True if delete succeeds, False otherwise
Return type:bool
fetch()[source]

Fetch the WebhookInstance

Returns:The fetched WebhookInstance
Return type:twilio.rest.chat.v2.service.channel.webhook.WebhookInstance
service_sid
Returns:The SID of the Service that the Channel Webhook resource is associated with
Return type:unicode
sid
Returns:The unique string that identifies the resource
Return type:unicode
type
Returns:The type of webhook
Return type:unicode
update(configuration_url=<object object>, configuration_method=<object object>, configuration_filters=<object object>, configuration_triggers=<object object>, configuration_flow_sid=<object object>, configuration_retry_count=<object object>)[source]

Update the WebhookInstance

Parameters:
  • configuration_url (unicode) – The URL of the webhook to call
  • configuration_method (WebhookInstance.Method) – The HTTP method used to call configuration.url
  • configuration_filters (list[unicode]) – The events that cause us to call the Channel Webhook
  • configuration_triggers (list[unicode]) – A string that will cause us to call the webhook when it is found in a message body
  • configuration_flow_sid (unicode) – The SID of the Studio Flow to call when an event occurs
  • configuration_retry_count (unicode) – The number of times to retry the webhook if the first attempt fails
Returns:

The updated WebhookInstance

Return type:

twilio.rest.chat.v2.service.channel.webhook.WebhookInstance

url
Returns:The absolute URL of the Channel Webhook resource
Return type:unicode
class twilio.rest.chat.v2.service.channel.webhook.WebhookList(version, service_sid, channel_sid)[source]

Bases: twilio.base.list_resource.ListResource

create(type, configuration_url=<object object>, configuration_method=<object object>, configuration_filters=<object object>, configuration_triggers=<object object>, configuration_flow_sid=<object object>, configuration_retry_count=<object object>)[source]

Create the WebhookInstance

Parameters:
  • type (WebhookInstance.Type) – The type of webhook
  • configuration_url (unicode) – The URL of the webhook to call
  • configuration_method (WebhookInstance.Method) – The HTTP method used to call configuration.url
  • configuration_filters (list[unicode]) – The events that cause us to call the Channel Webhook
  • configuration_triggers (list[unicode]) – A string that will cause us to call the webhook when it is found in a message body
  • configuration_flow_sid (unicode) – The SID of the Studio Flow to call when an event occurs
  • configuration_retry_count (unicode) – The number of times to retry the webhook if the first attempt fails
Returns:

The created WebhookInstance

Return type:

twilio.rest.chat.v2.service.channel.webhook.WebhookInstance

get(sid)[source]

Constructs a WebhookContext

Parameters:sid – The SID of the Channel Webhook resource to fetch
Returns:twilio.rest.chat.v2.service.channel.webhook.WebhookContext
Return type:twilio.rest.chat.v2.service.channel.webhook.WebhookContext
get_page(target_url)[source]

Retrieve a specific page of WebhookInstance records from the API. Request is executed immediately

Parameters:target_url (str) – API-generated URL for the requested results page
Returns:Page of WebhookInstance
Return type:twilio.rest.chat.v2.service.channel.webhook.WebhookPage
list(limit=None, page_size=None)[source]

Lists WebhookInstance records from the API as a list. Unlike stream(), this operation is eager and will load limit records into memory before returning.

Parameters:
  • limit (int) – Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit
  • page_size (int) – 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, list() 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

Return type:

list[twilio.rest.chat.v2.service.channel.webhook.WebhookInstance]

page(page_token=<object object>, page_number=<object object>, page_size=<object object>)[source]

Retrieve a single page of WebhookInstance records from the API. Request is executed immediately

Parameters:
  • page_token (str) – PageToken provided by the API
  • page_number (int) – Page Number, this value is simply for client state
  • page_size (int) – Number of records to return, defaults to 50
Returns:

Page of WebhookInstance

Return type:

twilio.rest.chat.v2.service.channel.webhook.WebhookPage

stream(limit=None, page_size=None)[source]

Streams WebhookInstance 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.

Parameters:
  • limit (int) – Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit
  • page_size (int) – 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

Return type:

list[twilio.rest.chat.v2.service.channel.webhook.WebhookInstance]

class twilio.rest.chat.v2.service.channel.webhook.WebhookPage(version, response, solution)[source]

Bases: twilio.base.page.Page

get_instance(payload)[source]

Build an instance of WebhookInstance

Parameters:payload (dict) – Payload response from the API
Returns:twilio.rest.chat.v2.service.channel.webhook.WebhookInstance
Return type:twilio.rest.chat.v2.service.channel.webhook.WebhookInstance

Module contents

This code was generated by / _ _ _| _ _

(_)/(_)(_|/| |(/_ v1.0.0 / /

System Message: WARNING/2 (/twilio/repos/twilio-python/twilio/rest/chat/v2/service/channel/__init__.py:docstring of twilio.rest.chat.v2.service.channel, line 3); backlink

Inline substitution_reference start-string without end-string.
class twilio.rest.chat.v2.service.channel.ChannelContext(version, service_sid, sid)[source]

Bases: twilio.base.instance_context.InstanceContext

delete(x_twilio_webhook_enabled=<object object>)[source]

Deletes the ChannelInstance

Parameters:x_twilio_webhook_enabled (ChannelInstance.WebhookEnabledType) – The X-Twilio-Webhook-Enabled HTTP request header
Returns:True if delete succeeds, False otherwise
Return type:bool
fetch()[source]

Fetch the ChannelInstance

Returns:The fetched ChannelInstance
Return type:twilio.rest.chat.v2.service.channel.ChannelInstance
invites

Access the invites

Returns:twilio.rest.chat.v2.service.channel.invite.InviteList
Return type:twilio.rest.chat.v2.service.channel.invite.InviteList
members

Access the members

Returns:twilio.rest.chat.v2.service.channel.member.MemberList
Return type:twilio.rest.chat.v2.service.channel.member.MemberList
messages

Access the messages

Returns:twilio.rest.chat.v2.service.channel.message.MessageList
Return type:twilio.rest.chat.v2.service.channel.message.MessageList
update(friendly_name=<object object>, unique_name=<object object>, attributes=<object object>, date_created=<object object>, date_updated=<object object>, created_by=<object object>, x_twilio_webhook_enabled=<object object>)[source]

Update the ChannelInstance

Parameters:
  • friendly_name (unicode) – A string to describe the resource
  • unique_name (unicode) – An application-defined string that uniquely identifies the resource
  • attributes (unicode) – A valid JSON string that contains application-specific data
  • date_created (datetime) – The ISO 8601 date and time in GMT when the resource was created
  • date_updated (datetime) – The ISO 8601 date and time in GMT when the resource was updated
  • created_by (unicode) – The identity of the User that created the Channel
  • x_twilio_webhook_enabled (ChannelInstance.WebhookEnabledType) – The X-Twilio-Webhook-Enabled HTTP request header
Returns:

The updated ChannelInstance

Return type:

twilio.rest.chat.v2.service.channel.ChannelInstance

webhooks

Access the webhooks

Returns:twilio.rest.chat.v2.service.channel.webhook.WebhookList
Return type:twilio.rest.chat.v2.service.channel.webhook.WebhookList
class twilio.rest.chat.v2.service.channel.ChannelInstance(version, payload, service_sid, sid=None)[source]

Bases: twilio.base.instance_resource.InstanceResource

class ChannelType[source]

Bases: object

PRIVATE = 'private'
PUBLIC = 'public'
class WebhookEnabledType[source]

Bases: object

FALSE = 'false'
TRUE = 'true'
account_sid
Returns:The SID of the Account that created the resource
Return type:unicode
attributes
Returns:The JSON string that stores application-specific data
Return type:unicode
created_by
Returns:The identity of the User that created the channel
Return type:unicode
date_created
Returns:The ISO 8601 date and time in GMT when the resource was created
Return type:datetime
date_updated
Returns:The ISO 8601 date and time in GMT when the resource was last updated
Return type:datetime
delete(x_twilio_webhook_enabled=<object object>)[source]

Deletes the ChannelInstance

Parameters:x_twilio_webhook_enabled (ChannelInstance.WebhookEnabledType) – The X-Twilio-Webhook-Enabled HTTP request header
Returns:True if delete succeeds, False otherwise
Return type:bool
fetch()[source]

Fetch the ChannelInstance

Returns:The fetched ChannelInstance
Return type:twilio.rest.chat.v2.service.channel.ChannelInstance
friendly_name
Returns:The string that you assigned to describe the resource
Return type:unicode
invites

Access the invites

Returns:twilio.rest.chat.v2.service.channel.invite.InviteList
Return type:twilio.rest.chat.v2.service.channel.invite.InviteList
Returns:Absolute URLs to access the Members, Messages , Invites and, if it exists, the last Message for the Channel
Return type:unicode
members

Access the members

Returns:twilio.rest.chat.v2.service.channel.member.MemberList
Return type:twilio.rest.chat.v2.service.channel.member.MemberList
members_count
Returns:The number of Members in the Channel
Return type:unicode
messages

Access the messages

Returns:twilio.rest.chat.v2.service.channel.message.MessageList
Return type:twilio.rest.chat.v2.service.channel.message.MessageList
messages_count
Returns:The number of Messages that have been passed in the Channel
Return type:unicode
service_sid
Returns:The SID of the Service that the resource is associated with
Return type:unicode
sid
Returns:The unique string that identifies the resource
Return type:unicode
type
Returns:The visibility of the channel. Can be: public or private
Return type:ChannelInstance.ChannelType
unique_name
Returns:An application-defined string that uniquely identifies the resource
Return type:unicode
update(friendly_name=<object object>, unique_name=<object object>, attributes=<object object>, date_created=<object object>, date_updated=<object object>, created_by=<object object>, x_twilio_webhook_enabled=<object object>)[source]

Update the ChannelInstance

Parameters:
  • friendly_name (unicode) – A string to describe the resource
  • unique_name (unicode) – An application-defined string that uniquely identifies the resource
  • attributes (unicode) – A valid JSON string that contains application-specific data
  • date_created (datetime) – The ISO 8601 date and time in GMT when the resource was created
  • date_updated (datetime) – The ISO 8601 date and time in GMT when the resource was updated
  • created_by (unicode) – The identity of the User that created the Channel
  • x_twilio_webhook_enabled (ChannelInstance.WebhookEnabledType) – The X-Twilio-Webhook-Enabled HTTP request header
Returns:

The updated ChannelInstance

Return type:

twilio.rest.chat.v2.service.channel.ChannelInstance

url
Returns:The absolute URL of the Channel resource
Return type:unicode
webhooks

Access the webhooks

Returns:twilio.rest.chat.v2.service.channel.webhook.WebhookList
Return type:twilio.rest.chat.v2.service.channel.webhook.WebhookList
class twilio.rest.chat.v2.service.channel.ChannelList(version, service_sid)[source]

Bases: twilio.base.list_resource.ListResource

create(friendly_name=<object object>, unique_name=<object object>, attributes=<object object>, type=<object object>, date_created=<object object>, date_updated=<object object>, created_by=<object object>, x_twilio_webhook_enabled=<object object>)[source]

Create the ChannelInstance

Parameters:
  • friendly_name (unicode) – A string to describe the new resource
  • unique_name (unicode) – An application-defined string that uniquely identifies the Channel resource
  • attributes (unicode) – A valid JSON string that contains application-specific data
  • type (ChannelInstance.ChannelType) – The visibility of the channel
  • date_created (datetime) – The ISO 8601 date and time in GMT when the resource was created
  • date_updated (datetime) – The ISO 8601 date and time in GMT when the resource was updated
  • created_by (unicode) – The identity of the User that created the Channel
  • x_twilio_webhook_enabled (ChannelInstance.WebhookEnabledType) – The X-Twilio-Webhook-Enabled HTTP request header
Returns:

The created ChannelInstance

Return type:

twilio.rest.chat.v2.service.channel.ChannelInstance

get(sid)[source]

Constructs a ChannelContext

Parameters:sid – The SID of the resource
Returns:twilio.rest.chat.v2.service.channel.ChannelContext
Return type:twilio.rest.chat.v2.service.channel.ChannelContext
get_page(target_url)[source]

Retrieve a specific page of ChannelInstance records from the API. Request is executed immediately

Parameters:target_url (str) – API-generated URL for the requested results page
Returns:Page of ChannelInstance
Return type:twilio.rest.chat.v2.service.channel.ChannelPage
list(type=<object object>, limit=None, page_size=None)[source]

Lists ChannelInstance records from the API as a list. Unlike stream(), this operation is eager and will load limit records into memory before returning.

Parameters:
  • type (list[ChannelInstance.ChannelType]) – The visibility of the channel to read
  • limit (int) – Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit
  • page_size (int) – 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, list() 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

Return type:

list[twilio.rest.chat.v2.service.channel.ChannelInstance]

page(type=<object object>, page_token=<object object>, page_number=<object object>, page_size=<object object>)[source]

Retrieve a single page of ChannelInstance records from the API. Request is executed immediately

Parameters:
  • type (list[ChannelInstance.ChannelType]) – The visibility of the channel to read
  • page_token (str) – PageToken provided by the API
  • page_number (int) – Page Number, this value is simply for client state
  • page_size (int) – Number of records to return, defaults to 50
Returns:

Page of ChannelInstance

Return type:

twilio.rest.chat.v2.service.channel.ChannelPage

stream(type=<object object>, limit=None, page_size=None)[source]

Streams ChannelInstance 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.

Parameters:
  • type (list[ChannelInstance.ChannelType]) – The visibility of the channel to read
  • limit (int) – Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit
  • page_size (int) – 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

Return type:

list[twilio.rest.chat.v2.service.channel.ChannelInstance]

class twilio.rest.chat.v2.service.channel.ChannelPage(version, response, solution)[source]

Bases: twilio.base.page.Page

get_instance(payload)[source]

Build an instance of ChannelInstance

Parameters:payload (dict) – Payload response from the API
Returns:twilio.rest.chat.v2.service.channel.ChannelInstance
Return type:twilio.rest.chat.v2.service.channel.ChannelInstance