Package pamfax :: Package processors
[hide private]
[frames] | no frames]

Package processors

source code

The classes defined in this module should correspond 1-to-1 to the specifications in the PamFax API docs. See the link below for more info:

https://sandbox-apifrontend.pamfax.biz/summary/processors/

Users should not need to instantiate this class in applications using PamFax. Instead, just call the action directly on the PamFax object, and it will be delegated to the correct processor automatically.

Classes [hide private]
  Common
Class encapsulating common actions for the PamFax API
  FaxHistory
Class encapsulating actions related to fax history for this account
  FaxJob
Class encapsulating a specific fax job
  NumberInfo
Class encapsulating information for a given fax number
  OnlineStorage
Class encapsulating actions related to online storage
  Session
Class encapsulating a PamFax session
  Shopping
Class encapsulating shopping options available through PamFax
  UserInfo
Class encapsulating user info
Functions [hide private]
 
_get_url(base_url, action, api_credentials, **kwargs)
Construct the URL that corresponds to a given action.
source code
 
_get_and_check_response(http)
Wait for the HTTP response and throw an exception if the return status is not OK.
source code
 
_get(http, url, body='')
Gets the specified url and returns the response.
source code
 
_post(http, url, body, headers={})
Posts to the specified url and returns the response.
source code
 
_encode_multipart_formdata(fields, files)
Encode multipart form data per mime spec and return (content_type, body)
source code
Variables [hide private]
  IP_ADDR = '192.168.1.3'
  USER_AGENT = 'dynaptico-pamfax'
  ORIGIN = 'script'
  CONTENT_TYPE = 'content-type'
  CONTENT_TYPE_JSON = 'application/json'
  __package__ = 'pamfax.processors'
Function Details [hide private]

_get_url(base_url, action, api_credentials, **kwargs)

source code 

Construct the URL that corresponds to a given action. All kwargs whose value is None are filtered out.

Arguments: base_url -- The base of the URL corresponding to the PamFax processor name action -- The PamFax method to append to the base URL api_credentials -- The API credentials including user token extracted from /Session/VerifyUser

Keyword arguments: **kwargs -- optional HTTP parameters to send to the PamFax URL

_get_and_check_response(http)

source code 

Wait for the HTTP response and throw an exception if the return status is not OK. Return either a dict based on the HTTP response in JSON, or if the response is not in JSON format, return a tuple containing the data in the body and the content type.

_encode_multipart_formdata(fields, files)

source code 

Encode multipart form data per mime spec and return (content_type, body)

Arguments: fields -- A sequence of (name, value) elements for regular form fields. files -- A sequence of (name, filename, value) elements for data to be uploaded as files