twilio.rest.sync.v1.service.document package

Submodules

twilio.rest.sync.v1.service.document.document_permission module

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

(_)/(_)(_|/| |(/_ v1.0.0 / /
class twilio.rest.sync.v1.service.document.document_permission.DocumentPermissionContext(version, service_sid, document_sid, identity)[source]

Bases: twilio.base.instance_context.InstanceContext

delete()[source]

Deletes the DocumentPermissionInstance

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

Fetch the DocumentPermissionInstance

Returns:The fetched DocumentPermissionInstance
Return type:twilio.rest.sync.v1.service.document.document_permission.DocumentPermissionInstance
update(read, write, manage)[source]

Update the DocumentPermissionInstance

Parameters:
  • read (bool) – Read access
  • write (bool) – Write access
  • manage (bool) – Manage access
Returns:

The updated DocumentPermissionInstance

Return type:

twilio.rest.sync.v1.service.document.document_permission.DocumentPermissionInstance

class twilio.rest.sync.v1.service.document.document_permission.DocumentPermissionInstance(version, payload, service_sid, document_sid, identity=None)[source]

Bases: twilio.base.instance_resource.InstanceResource

account_sid
Returns:The SID of the Account that created the resource
Return type:unicode
delete()[source]

Deletes the DocumentPermissionInstance

Returns:True if delete succeeds, False otherwise
Return type:bool
document_sid
Returns:The Sync Document SID
Return type:unicode
fetch()[source]

Fetch the DocumentPermissionInstance

Returns:The fetched DocumentPermissionInstance
Return type:twilio.rest.sync.v1.service.document.document_permission.DocumentPermissionInstance
identity
Returns:The identity of the user to whom the Sync Document Permission applies
Return type:unicode
manage
Returns:Manage access
Return type:bool
read
Returns:Read access
Return type:bool
service_sid
Returns:The SID of the Sync Service that the resource is associated with
Return type:unicode
update(read, write, manage)[source]

Update the DocumentPermissionInstance

Parameters:
  • read (bool) – Read access
  • write (bool) – Write access
  • manage (bool) – Manage access
Returns:

The updated DocumentPermissionInstance

Return type:

twilio.rest.sync.v1.service.document.document_permission.DocumentPermissionInstance

url
Returns:The absolute URL of the Sync Document Permission resource
Return type:unicode
write
Returns:Write access
Return type:bool
class twilio.rest.sync.v1.service.document.document_permission.DocumentPermissionList(version, service_sid, document_sid)[source]

Bases: twilio.base.list_resource.ListResource

get(identity)[source]

Constructs a DocumentPermissionContext

Parameters:identity – The application-defined string that uniquely identifies the User’s Document Permission resource to fetch
Returns:twilio.rest.sync.v1.service.document.document_permission.DocumentPermissionContext
Return type:twilio.rest.sync.v1.service.document.document_permission.DocumentPermissionContext
get_page(target_url)[source]

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

Parameters:target_url (str) – API-generated URL for the requested results page
Returns:Page of DocumentPermissionInstance
Return type:twilio.rest.sync.v1.service.document.document_permission.DocumentPermissionPage
list(limit=None, page_size=None)[source]

Lists DocumentPermissionInstance 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.sync.v1.service.document.document_permission.DocumentPermissionInstance]

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

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

Return type:

twilio.rest.sync.v1.service.document.document_permission.DocumentPermissionPage

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

Streams DocumentPermissionInstance 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.sync.v1.service.document.document_permission.DocumentPermissionInstance]

class twilio.rest.sync.v1.service.document.document_permission.DocumentPermissionPage(version, response, solution)[source]

Bases: twilio.base.page.Page

get_instance(payload)[source]

Build an instance of DocumentPermissionInstance

Parameters:payload (dict) – Payload response from the API
Returns:twilio.rest.sync.v1.service.document.document_permission.DocumentPermissionInstance
Return type:twilio.rest.sync.v1.service.document.document_permission.DocumentPermissionInstance

Module contents

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

(_)/(_)(_|/| |(/_ v1.0.0 / /
class twilio.rest.sync.v1.service.document.DocumentContext(version, service_sid, sid)[source]

Bases: twilio.base.instance_context.InstanceContext

delete()[source]

Deletes the DocumentInstance

Returns:True if delete succeeds, False otherwise
Return type:bool
document_permissions

Access the document_permissions

Returns:twilio.rest.sync.v1.service.document.document_permission.DocumentPermissionList
Return type:twilio.rest.sync.v1.service.document.document_permission.DocumentPermissionList
fetch()[source]

Fetch the DocumentInstance

Returns:The fetched DocumentInstance
Return type:twilio.rest.sync.v1.service.document.DocumentInstance
update(data=<object object>, ttl=<object object>, if_match=<object object>)[source]

Update the DocumentInstance

Parameters:
  • data (dict) – A JSON string that represents an arbitrary, schema-less object that the Sync Document stores
  • ttl (unicode) – How long, in seconds, before the Document resource expires and is deleted
  • if_match (unicode) – The If-Match HTTP request header
Returns:

The updated DocumentInstance

Return type:

twilio.rest.sync.v1.service.document.DocumentInstance

class twilio.rest.sync.v1.service.document.DocumentInstance(version, payload, service_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
created_by
Returns:The identity of the Sync Document’s creator
Return type:unicode
data
Returns:An arbitrary, schema-less object that the Sync Document stores
Return type:dict
date_created
Returns:The ISO 8601 date and time in GMT when the resource was created
Return type:datetime
date_expires
Returns:The ISO 8601 date and time in GMT when the Sync Document expires
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 DocumentInstance

Returns:True if delete succeeds, False otherwise
Return type:bool
document_permissions

Access the document_permissions

Returns:twilio.rest.sync.v1.service.document.document_permission.DocumentPermissionList
Return type:twilio.rest.sync.v1.service.document.document_permission.DocumentPermissionList
fetch()[source]

Fetch the DocumentInstance

Returns:The fetched DocumentInstance
Return type:twilio.rest.sync.v1.service.document.DocumentInstance
Returns:The URLs of resources related to the Sync Document
Return type:unicode
revision
Returns:The current revision of the Sync Document, represented by a string identifier
Return type:unicode
service_sid
Returns:The SID of the Sync Service that the resource is associated with
Return type:unicode
sid
Returns:The unique string that identifies the resource
Return type:unicode
unique_name
Returns:An application-defined string that uniquely identifies the resource
Return type:unicode
update(data=<object object>, ttl=<object object>, if_match=<object object>)[source]

Update the DocumentInstance

Parameters:
  • data (dict) – A JSON string that represents an arbitrary, schema-less object that the Sync Document stores
  • ttl (unicode) – How long, in seconds, before the Document resource expires and is deleted
  • if_match (unicode) – The If-Match HTTP request header
Returns:

The updated DocumentInstance

Return type:

twilio.rest.sync.v1.service.document.DocumentInstance

url
Returns:The absolute URL of the Document resource
Return type:unicode
class twilio.rest.sync.v1.service.document.DocumentList(version, service_sid)[source]

Bases: twilio.base.list_resource.ListResource

create(unique_name=<object object>, data=<object object>, ttl=<object object>)[source]

Create the DocumentInstance

Parameters:
  • unique_name (unicode) – An application-defined string that uniquely identifies the Sync Document
  • data (dict) – A JSON string that represents an arbitrary, schema-less object that the Sync Document stores
  • ttl (unicode) – How long, in seconds, before the Sync Document expires and is deleted
Returns:

The created DocumentInstance

Return type:

twilio.rest.sync.v1.service.document.DocumentInstance

get(sid)[source]

Constructs a DocumentContext

Parameters:sid – The SID of the Document resource to fetch
Returns:twilio.rest.sync.v1.service.document.DocumentContext
Return type:twilio.rest.sync.v1.service.document.DocumentContext
get_page(target_url)[source]

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

Parameters:target_url (str) – API-generated URL for the requested results page
Returns:Page of DocumentInstance
Return type:twilio.rest.sync.v1.service.document.DocumentPage
list(limit=None, page_size=None)[source]

Lists DocumentInstance 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.sync.v1.service.document.DocumentInstance]

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

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

Return type:

twilio.rest.sync.v1.service.document.DocumentPage

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

Streams DocumentInstance 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.sync.v1.service.document.DocumentInstance]

class twilio.rest.sync.v1.service.document.DocumentPage(version, response, solution)[source]

Bases: twilio.base.page.Page

get_instance(payload)[source]

Build an instance of DocumentInstance

Parameters:payload (dict) – Payload response from the API
Returns:twilio.rest.sync.v1.service.document.DocumentInstance
Return type:twilio.rest.sync.v1.service.document.DocumentInstance