Package passtools :: Module pt_template :: Class Template
[hide private]
[frames] | no frames]

Class Template

source code

object --+
         |
        Template

Instance Methods [hide private]
 
__init__(self, template_id=None)
Init, optionally populate, new pt_template.Template instance If template_id is supplied, will retrieve complete instance, otherwise just create new empty instance.
source code
 
id(self) source code
 
__str__(self)
str(x)
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Methods [hide private]
 
get(cls, template_id)
Retrieve full-form template specified by template_id
source code
 
list(cls, **kwargs)
Retrieve list of existing templates created by owner of API-key Optional parameters are translated into query-modifiers
source code
 
delete(cls, template_id)
delete existing template
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, template_id=None)
(Constructor)

source code 

Init, optionally populate, new pt_template.Template instance If template_id is supplied, will retrieve complete instance, otherwise just create new empty instance.

API call used is v1/template (GET)

Parameters:
  • template_id (int) - ID of the desired template [Optional]
Returns:
None
Overrides: object.__init__

id(self)

source code 
Decorators:
  • @property

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

get(cls, template_id)
Class Method

source code 

Retrieve full-form template specified by template_id

API call used is v1/template/<template_id> (GET)

Parameters:
  • template_id (int) - ID of the template to retrieve
Returns:
json form of template full-form description

list(cls, **kwargs)
Class Method

source code 

Retrieve list of existing templates created by owner of API-key Optional parameters are translated into query-modifiers

Note that list() returns header-only form of templates. Use get() to retrieve full template.

API call used is v1/template/headers (GET)

Parameters:
  • pageSize (int) - Maximum length of list to return [Optional; Default = 10]
  • page (int) - 1-based index of page into list, based on page_size [Optional; Default = 1]
  • order (string) - Name of field on which to sort list [Optional; From (ID, Name, Created, Updated)]
  • direction (string) - Direction which to sort list [Optional; From (ASC, DESC); Default = DESC]
Returns:
json form of list of template header descriptions

delete(cls, template_id)
Class Method

source code 

delete existing template

API call used is v1/template/<template_id> (DELETE)

Parameters:
  • template_id (int) - ID of the template to delete
Returns:
json form of response data