twilio.rest.chat.v2.service.user package

Submodules

twilio.rest.chat.v2.service.user.user_binding module

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

(_)/(_)(_|/| |(/_ v1.0.0 / /
class twilio.rest.chat.v2.service.user.user_binding.UserBindingContext(version, service_sid, user_sid, sid)[source]

Bases: twilio.base.instance_context.InstanceContext

delete()[source]

Deletes the UserBindingInstance

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

Fetch the UserBindingInstance

Returns:The fetched UserBindingInstance
Return type:twilio.rest.chat.v2.service.user.user_binding.UserBindingInstance
class twilio.rest.chat.v2.service.user.user_binding.UserBindingInstance(version, payload, service_sid, user_sid, sid=None)[source]

Bases: twilio.base.instance_resource.InstanceResource

class BindingType[source]

Bases: object

APN = 'apn'
FCM = 'fcm'
GCM = 'gcm'
account_sid
Returns:The SID of the Account that created the resource
Return type:unicode
binding_type
Returns:The push technology to use for the binding
Return type:UserBindingInstance.BindingType
credential_sid
Returns:The SID of the Credential for the binding
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 UserBindingInstance

Returns:True if delete succeeds, False otherwise
Return type:bool
endpoint
Returns:The unique endpoint identifier for the User Binding
Return type:unicode
fetch()[source]

Fetch the UserBindingInstance

Returns:The fetched UserBindingInstance
Return type:twilio.rest.chat.v2.service.user.user_binding.UserBindingInstance
identity
Returns:The string that identifies the resource’s User
Return type:unicode
message_types
Returns:The Programmable Chat message types the binding is subscribed to
Return type:list[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 User Binding resource
Return type:unicode
user_sid
Returns:The SID of the User with the binding
Return type:unicode
class twilio.rest.chat.v2.service.user.user_binding.UserBindingList(version, service_sid, user_sid)[source]

Bases: twilio.base.list_resource.ListResource

get(sid)[source]

Constructs a UserBindingContext

Parameters:sid – The SID of the User Binding resource to fetch
Returns:twilio.rest.chat.v2.service.user.user_binding.UserBindingContext
Return type:twilio.rest.chat.v2.service.user.user_binding.UserBindingContext
get_page(target_url)[source]

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

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

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

Parameters:
  • binding_type (list[UserBindingInstance.BindingType]) – The push technology used by the User Binding 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.user.user_binding.UserBindingInstance]

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

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

Parameters:
  • binding_type (list[UserBindingInstance.BindingType]) – The push technology used by the User Binding 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 UserBindingInstance

Return type:

twilio.rest.chat.v2.service.user.user_binding.UserBindingPage

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

Streams UserBindingInstance 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:
  • binding_type (list[UserBindingInstance.BindingType]) – The push technology used by the User Binding 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.user.user_binding.UserBindingInstance]

class twilio.rest.chat.v2.service.user.user_binding.UserBindingPage(version, response, solution)[source]

Bases: twilio.base.page.Page

get_instance(payload)[source]

Build an instance of UserBindingInstance

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

twilio.rest.chat.v2.service.user.user_channel module

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

(_)/(_)(_|/| |(/_ v1.0.0 / /
class twilio.rest.chat.v2.service.user.user_channel.UserChannelContext(version, service_sid, user_sid, channel_sid)[source]

Bases: twilio.base.instance_context.InstanceContext

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

Deletes the UserChannelInstance

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

Fetch the UserChannelInstance

Returns:The fetched UserChannelInstance
Return type:twilio.rest.chat.v2.service.user.user_channel.UserChannelInstance
update(notification_level=<object object>, last_consumed_message_index=<object object>, last_consumption_timestamp=<object object>)[source]

Update the UserChannelInstance

Parameters:
  • notification_level (UserChannelInstance.NotificationLevel) – The push notification level to assign to the User Channel
  • last_consumed_message_index (unicode) – The index of the last Message that the Member has read within the Channel
  • last_consumption_timestamp (datetime) – The ISO 8601 based timestamp string that represents the datetime of the last Message read event for the Member within the Channel
Returns:

The updated UserChannelInstance

Return type:

twilio.rest.chat.v2.service.user.user_channel.UserChannelInstance

class twilio.rest.chat.v2.service.user.user_channel.UserChannelInstance(version, payload, service_sid, user_sid, channel_sid=None)[source]

Bases: twilio.base.instance_resource.InstanceResource

class ChannelStatus[source]

Bases: object

INVITED = 'invited'
JOINED = 'joined'
NOT_PARTICIPATING = 'not_participating'
class NotificationLevel[source]

Bases: object

DEFAULT = 'default'
MUTED = 'muted'
class WebhookEnabledType[source]

Bases: object

FALSE = 'false'
TRUE = 'true'
account_sid
Returns:The SID of the Account that created the resource
Return type:unicode
channel_sid
Returns:The SID of the Channel the resource belongs to
Return type:unicode
delete(x_twilio_webhook_enabled=<object object>)[source]

Deletes the UserChannelInstance

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

Fetch the UserChannelInstance

Returns:The fetched UserChannelInstance
Return type:twilio.rest.chat.v2.service.user.user_channel.UserChannelInstance
last_consumed_message_index
Returns:The index of the last Message in the Channel the Member has read
Return type:unicode
Returns:Absolute URLs to access the Members, Messages , Invites and, if it exists, the last Message for the Channel
Return type:unicode
member_sid
Returns:The SID of the User as a Member in the Channel
Return type:unicode
notification_level
Returns:The push notification level of the User for the Channel
Return type:UserChannelInstance.NotificationLevel
service_sid
Returns:The SID of the Service that the resource is associated with
Return type:unicode
status
Returns:The status of the User on the Channel
Return type:UserChannelInstance.ChannelStatus
unread_messages_count
Returns:The number of unread Messages in the Channel for the User
Return type:unicode
update(notification_level=<object object>, last_consumed_message_index=<object object>, last_consumption_timestamp=<object object>)[source]

Update the UserChannelInstance

Parameters:
  • notification_level (UserChannelInstance.NotificationLevel) – The push notification level to assign to the User Channel
  • last_consumed_message_index (unicode) – The index of the last Message that the Member has read within the Channel
  • last_consumption_timestamp (datetime) – The ISO 8601 based timestamp string that represents the datetime of the last Message read event for the Member within the Channel
Returns:

The updated UserChannelInstance

Return type:

twilio.rest.chat.v2.service.user.user_channel.UserChannelInstance

url
Returns:The absolute URL of the resource
Return type:unicode
user_sid
Returns:The SID of the User the User Channel belongs to
Return type:unicode
class twilio.rest.chat.v2.service.user.user_channel.UserChannelList(version, service_sid, user_sid)[source]

Bases: twilio.base.list_resource.ListResource

get(channel_sid)[source]

Constructs a UserChannelContext

Parameters:channel_sid – The SID of the Channel that has the User Channel to fetch
Returns:twilio.rest.chat.v2.service.user.user_channel.UserChannelContext
Return type:twilio.rest.chat.v2.service.user.user_channel.UserChannelContext
get_page(target_url)[source]

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

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

Lists UserChannelInstance 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.user.user_channel.UserChannelInstance]

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

Retrieve a single page of UserChannelInstance 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 UserChannelInstance

Return type:

twilio.rest.chat.v2.service.user.user_channel.UserChannelPage

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

Streams UserChannelInstance 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.user.user_channel.UserChannelInstance]

class twilio.rest.chat.v2.service.user.user_channel.UserChannelPage(version, response, solution)[source]

Bases: twilio.base.page.Page

get_instance(payload)[source]

Build an instance of UserChannelInstance

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

Module contents

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

(_)/(_)(_|/| |(/_ v1.0.0 / /
class twilio.rest.chat.v2.service.user.UserContext(version, service_sid, sid)[source]

Bases: twilio.base.instance_context.InstanceContext

delete()[source]

Deletes the UserInstance

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

Fetch the UserInstance

Returns:The fetched UserInstance
Return type:twilio.rest.chat.v2.service.user.UserInstance
update(role_sid=<object object>, attributes=<object object>, friendly_name=<object object>, x_twilio_webhook_enabled=<object object>)[source]

Update the UserInstance

Parameters:
  • role_sid (unicode) – The SID id of the Role assigned to this user
  • attributes (unicode) – A valid JSON string that contains application-specific data
  • friendly_name (unicode) – A string to describe the resource
  • x_twilio_webhook_enabled (UserInstance.WebhookEnabledType) – The X-Twilio-Webhook-Enabled HTTP request header
Returns:

The updated UserInstance

Return type:

twilio.rest.chat.v2.service.user.UserInstance

user_bindings

Access the user_bindings

Returns:twilio.rest.chat.v2.service.user.user_binding.UserBindingList
Return type:twilio.rest.chat.v2.service.user.user_binding.UserBindingList
user_channels

Access the user_channels

Returns:twilio.rest.chat.v2.service.user.user_channel.UserChannelList
Return type:twilio.rest.chat.v2.service.user.user_channel.UserChannelList
class twilio.rest.chat.v2.service.user.UserInstance(version, payload, service_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
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 UserInstance

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

Fetch the UserInstance

Returns:The fetched UserInstance
Return type:twilio.rest.chat.v2.service.user.UserInstance
friendly_name
Returns:The string that you assigned to describe the resource
Return type:unicode
identity
Returns:The string that identifies the resource’s User
Return type:unicode
is_notifiable
Returns:Whether the User has a potentially valid Push Notification registration for the Service instance
Return type:bool
is_online
Returns:Whether the User is actively connected to the Service instance and online
Return type:bool
joined_channels_count
Returns:The number of Channels the User is a Member of
Return type:unicode
Returns:The absolute URLs of the Channel and Binding resources related to the user
Return type:unicode
role_sid
Returns:The SID of the Role assigned to the user
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>, attributes=<object object>, friendly_name=<object object>, x_twilio_webhook_enabled=<object object>)[source]

Update the UserInstance

Parameters:
  • role_sid (unicode) – The SID id of the Role assigned to this user
  • attributes (unicode) – A valid JSON string that contains application-specific data
  • friendly_name (unicode) – A string to describe the resource
  • x_twilio_webhook_enabled (UserInstance.WebhookEnabledType) – The X-Twilio-Webhook-Enabled HTTP request header
Returns:

The updated UserInstance

Return type:

twilio.rest.chat.v2.service.user.UserInstance

url
Returns:The absolute URL of the User resource
Return type:unicode
user_bindings

Access the user_bindings

Returns:twilio.rest.chat.v2.service.user.user_binding.UserBindingList
Return type:twilio.rest.chat.v2.service.user.user_binding.UserBindingList
user_channels

Access the user_channels

Returns:twilio.rest.chat.v2.service.user.user_channel.UserChannelList
Return type:twilio.rest.chat.v2.service.user.user_channel.UserChannelList
class twilio.rest.chat.v2.service.user.UserList(version, service_sid)[source]

Bases: twilio.base.list_resource.ListResource

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

Create the UserInstance

Parameters:
  • identity (unicode) – The identity value that identifies the new resource’s User
  • role_sid (unicode) – The SID of the Role assigned to this user
  • attributes (unicode) – A valid JSON string that contains application-specific data
  • friendly_name (unicode) – A string to describe the new resource
  • x_twilio_webhook_enabled (UserInstance.WebhookEnabledType) – The X-Twilio-Webhook-Enabled HTTP request header
Returns:

The created UserInstance

Return type:

twilio.rest.chat.v2.service.user.UserInstance

get(sid)[source]

Constructs a UserContext

Parameters:sid – The SID of the User resource to fetch
Returns:twilio.rest.chat.v2.service.user.UserContext
Return type:twilio.rest.chat.v2.service.user.UserContext
get_page(target_url)[source]

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

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

Lists UserInstance 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.user.UserInstance]

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

Retrieve a single page of UserInstance 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 UserInstance

Return type:

twilio.rest.chat.v2.service.user.UserPage

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

Streams UserInstance 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.user.UserInstance]

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

Bases: twilio.base.page.Page

get_instance(payload)[source]

Build an instance of UserInstance

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