five9 package

Submodules

five9.environment module

class five9.environment.Api[source]

Bases: object

This is a set of decorators for model validators.

static model(method)[source]

Use this to decorate methods that expect a model.

static recordset(method)[source]

Use this to decorate methods that expect a record set.

class five9.environment.Environment(five9, model=None, records=None)[source]

Bases: object

Represents a container for models with a back-reference to Five9.

create(*args, **kwargs)[source]
delete(*args, **kwargs)[source]
new(*args, **kwargs)[source]
read(*args, **kwargs)[source]
search(*args, **kwargs)[source]
write(*args, **kwargs)[source]

five9.exceptions module

exception five9.exceptions.Five9Exception[source]

Bases: exceptions.Exception

Base Five9 Exceptions.

exception five9.exceptions.ValidationError[source]

Bases: five9.exceptions.Five9Exception

Indicated an error validating user supplied data.

five9.five9 module

class five9.five9.Five9(username, password)[source]

Bases: object

WSDL_CONFIGURATION = 'https://api.five9.com/wsadmin/v9_5/AdminWebService?wsdl&user=%s'
WSDL_SUPERVISOR = 'https://api.five9.com/wssupervisor/v9_5/SupervisorWebService?wsdl&user=%s'
configuration

Return an authenticated connection for use, open new if required.

Returns:New or existing session with the Five9 Admin Web Services API.
Return type:AdminWebService
classmethod create_criteria(query)[source]

Return a criteria from a dictionary containing a query.

Query should be a dictionary, keyed by field name. If the value is a list, it will be divided into multiple criteria as required.

static create_mapping(record, keys)[source]

Create a field mapping for use in API updates and creates.

Parameters:
  • record (BaseModel) – Record that should be mapped.
  • keys (list[str]) – Fields that should be mapped as keys.
Returns:

Dictionary with keys:

  • field_mappings: Field mappings as required by API.
  • data: Ordered data dictionary for input record.

Return type:

dict

force_logout_session = True
static parse_response(fields, records)[source]

Parse an API response into usable objects.

Parameters:
  • fields (list[str]) –

    List of strings indicating the fields that are represented in the records, in the order presented in the records.:

    [
    
    ’number1’, ‘number2’, ‘number3’, ‘first_name’, ‘last_name’, ‘company’, ‘street’, ‘city’, ‘state’, ‘zip’,

    ]

  • records (list[dict]) –

    A really crappy data structure representing records as returned by Five9:

    [
        {
            'values': {
                'data': [
                    '8881234567',
                    None,
                    None,
                    'Dave',
                    'Lasley',
                    'LasLabs Inc',
                    None,
                    'Las Vegas',
                    'NV',
                    '89123',
                ]
            }
        }
    ]
    
Returns:

List of parsed records.

Return type:

list[dict]

rolling_period = 'Minutes30'
shift_start_hour = 8
statistics_range = 'CurrentWeek'
supervisor

Return an authenticated connection for use, open new if required.

Returns:New or existing session with the Five9 Statistics API.
Return type:SupervisorWebService
time_zone_offset = -7

Module contents

class five9.Five9(username, password)[source]

Bases: object

WSDL_CONFIGURATION = 'https://api.five9.com/wsadmin/v9_5/AdminWebService?wsdl&user=%s'
WSDL_SUPERVISOR = 'https://api.five9.com/wssupervisor/v9_5/SupervisorWebService?wsdl&user=%s'
configuration

Return an authenticated connection for use, open new if required.

Returns:New or existing session with the Five9 Admin Web Services API.
Return type:AdminWebService
classmethod create_criteria(query)[source]

Return a criteria from a dictionary containing a query.

Query should be a dictionary, keyed by field name. If the value is a list, it will be divided into multiple criteria as required.

static create_mapping(record, keys)[source]

Create a field mapping for use in API updates and creates.

Parameters:
  • record (BaseModel) – Record that should be mapped.
  • keys (list[str]) – Fields that should be mapped as keys.
Returns:

Dictionary with keys:

  • field_mappings: Field mappings as required by API.
  • data: Ordered data dictionary for input record.

Return type:

dict

force_logout_session = True
static parse_response(fields, records)[source]

Parse an API response into usable objects.

Parameters:
  • fields (list[str]) –

    List of strings indicating the fields that are represented in the records, in the order presented in the records.:

    [
    
    ’number1’, ‘number2’, ‘number3’, ‘first_name’, ‘last_name’, ‘company’, ‘street’, ‘city’, ‘state’, ‘zip’,

    ]

  • records (list[dict]) –

    A really crappy data structure representing records as returned by Five9:

    [
        {
            'values': {
                'data': [
                    '8881234567',
                    None,
                    None,
                    'Dave',
                    'Lasley',
                    'LasLabs Inc',
                    None,
                    'Las Vegas',
                    'NV',
                    '89123',
                ]
            }
        }
    ]
    
Returns:

List of parsed records.

Return type:

list[dict]

rolling_period = 'Minutes30'
shift_start_hour = 8
statistics_range = 'CurrentWeek'
supervisor

Return an authenticated connection for use, open new if required.

Returns:New or existing session with the Five9 Statistics API.
Return type:SupervisorWebService
time_zone_offset = -7