Evo Voice

<back to all web services

ListSessions

Retrieve a list of sessions

Requires Authentication
The following routes are available for this service:
GET/sessions
import 'package:servicestack/servicestack.dart';

enum SortOrders
{
    Ascend,
    Descend,
}

abstract class ListRequest<T> implements IGet
{
    /**
    * The page of data to retrieve
    */
    // @ApiMember(Description="The page of data to retrieve")
    int? page;

    /**
    * If you want all objects to be returned. This should be used with care
    */
    // @ApiMember(Description="If you want all objects to be returned. This should be used with care")
    bool? all;

    /**
    * The number per page to retrieve
    */
    // @ApiMember(Description="The number per page to retrieve")
    int? countPerPage;

    /**
    * Specific IDs
    */
    // @ApiMember(Description="Specific IDs")
    List<String>? specificIds;

    /**
    * Specify a sort field
    */
    // @ApiMember(Description="Specify a sort field")
    String? sortField;

    /**
    * Specify a sort order
    */
    // @ApiMember(Description="Specify a sort order")
    SortOrders? sortOrder;

    /**
    * Disables total / page counts - improves performance. Returns only data. If there is no more data, Items will be empty array
    */
    // @ApiMember(Description="Disables total / page counts - improves performance. Returns only data. If there is no more data, Items will be empty array")
    bool? simplifiedPaging;

    ListRequest({this.page,this.all,this.countPerPage,this.specificIds,this.sortField,this.sortOrder,this.simplifiedPaging});
    ListRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        page = json['page'];
        all = json['all'];
        countPerPage = json['countPerPage'];
        specificIds = JsonConverters.fromJson(json['specificIds'],'List<String>',context!);
        sortField = json['sortField'];
        sortOrder = JsonConverters.fromJson(json['sortOrder'],'SortOrders',context!);
        simplifiedPaging = json['simplifiedPaging'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'page': page,
        'all': all,
        'countPerPage': countPerPage,
        'specificIds': JsonConverters.toJson(specificIds,'List<String>',context!),
        'sortField': sortField,
        'sortOrder': JsonConverters.toJson(sortOrder,'SortOrders',context!),
        'simplifiedPaging': simplifiedPaging
    };

    getTypeName() => "ListRequest<$T>";
    TypeContext? context = _ctx;
}

abstract class EntityInfo
{
    /**
    * The ID of the object
    */
    // @ApiMember(Description="The ID of the object")
    String? id;

    /**
    * The date the object was created
    */
    // @ApiMember(Description="The date the object was created")
    String? dateCreated;

    /**
    * The date the object was last modified
    */
    // @ApiMember(Description="The date the object was last modified")
    String? dateLastModified;

    /**
    * The user that created this object
    */
    // @ApiMember(Description="The user that created this object")
    String? createdBy;

    /**
    * The user that last modified this object
    */
    // @ApiMember(Description="The user that last modified this object")
    String? lastModifiedBy;

    EntityInfo({this.id,this.dateCreated,this.dateLastModified,this.createdBy,this.lastModifiedBy});
    EntityInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        dateCreated = json['dateCreated'];
        dateLastModified = json['dateLastModified'];
        createdBy = json['createdBy'];
        lastModifiedBy = json['lastModifiedBy'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'dateCreated': dateCreated,
        'dateLastModified': dateLastModified,
        'createdBy': createdBy,
        'lastModifiedBy': lastModifiedBy
    };

    getTypeName() => "EntityInfo";
    TypeContext? context = _ctx;
}

enum SessionDialState
{
    None,
    Active,
}

enum SessionCallState
{
    Disconnected,
    Ringing,
    Connected,
    Hold,
    Passive,
}

enum SessionQueueStates
{
    None,
    Queued,
    Ringing,
    Connected,
    Hold,
    Disconnected,
}

class CustomerBreadcrumb implements IConvertible
{
    String? id;
    String? name;

    CustomerBreadcrumb({this.id,this.name});
    CustomerBreadcrumb.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        name = json['name'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'name': name
    };

    getTypeName() => "CustomerBreadcrumb";
    TypeContext? context = _ctx;
}

enum FlowChannels
{
    Voice,
    Chat,
    Fax,
}

enum SessionHoldReasons
{
    None,
    Transferring,
}

class SessionLogInfo implements IConvertible
{
    String? date;
    String? message;

    SessionLogInfo({this.date,this.message});
    SessionLogInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        date = json['date'];
        message = json['message'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'date': date,
        'message': message
    };

    getTypeName() => "SessionLogInfo";
    TypeContext? context = _ctx;
}

enum SessionMemberCallState
{
    None,
    Ringing,
    Connected,
    Hold,
}

enum SessionMemberRoles
{
    None,
    Caller,
    Agent,
    Transfer,
}

class SessionMemberInfo implements IConvertible
{
    String? identity;
    String? endpointId;
    String? displayName;
    bool? isOriginalMember;
    String? avatarUrl;
    Map<String,String?>? applicationData;
    SessionMemberCallState? callState;
    SessionMemberRoles? role;
    String? callSid;
    bool? muted;

    SessionMemberInfo({this.identity,this.endpointId,this.displayName,this.isOriginalMember,this.avatarUrl,this.applicationData,this.callState,this.role,this.callSid,this.muted});
    SessionMemberInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        identity = json['identity'];
        endpointId = json['endpointId'];
        displayName = json['displayName'];
        isOriginalMember = json['isOriginalMember'];
        avatarUrl = json['avatarUrl'];
        applicationData = JsonConverters.toStringMap(json['applicationData']);
        callState = JsonConverters.fromJson(json['callState'],'SessionMemberCallState',context!);
        role = JsonConverters.fromJson(json['role'],'SessionMemberRoles',context!);
        callSid = json['callSid'];
        muted = json['muted'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'identity': identity,
        'endpointId': endpointId,
        'displayName': displayName,
        'isOriginalMember': isOriginalMember,
        'avatarUrl': avatarUrl,
        'applicationData': applicationData,
        'callState': JsonConverters.toJson(callState,'SessionMemberCallState',context!),
        'role': JsonConverters.toJson(role,'SessionMemberRoles',context!),
        'callSid': callSid,
        'muted': muted
    };

    getTypeName() => "SessionMemberInfo";
    TypeContext? context = _ctx;
}

enum SessionDirections
{
    Incoming,
    Outgoing,
}

class SessionInfo extends EntityInfo implements IConvertible
{
    /**
    * The state of the session
    */
    // @ApiMember(Description="The state of the session")
    SessionDialState? dialState;

    /**
    * The call state of the session
    */
    // @ApiMember(Description="The call state of the session")
    SessionCallState? callState;

    /**
    * The queue state of the session
    */
    // @ApiMember(Description="The queue state of the session")
    SessionQueueStates? queueState;

    /**
    * The ID of the account associated with the flow
    */
    // @ApiMember(Description="The ID of the account associated with the flow")
    String? accountId;

    /**
    * The name of the account associated with the session
    */
    // @ApiMember(Description="The name of the account associated with the session")
    String? accountName;

    /**
    * The ID of the customer this session is associated with
    */
    // @ApiMember(Description="The ID of the customer this session is associated with")
    String? customerId;

    /**
    * The customer breadcrumb this session is associated with
    */
    // @ApiMember(Description="The customer breadcrumb this session is associated with")
    List<CustomerBreadcrumb>? customerBreadcrumb;

    /**
    * The name of the customer this session is associated with
    */
    // @ApiMember(Description="The name of the customer this session is associated with")
    String? customerName;

    /**
    * The ID of the endpoint associated with this session
    */
    // @ApiMember(Description="The ID of the endpoint associated with this session")
    String? endpointId;

    /**
    * The name of the endpoint associated with this session
    */
    // @ApiMember(Description="The name of the endpoint associated with this session")
    String? endpointName;

    /**
    * The date the call completed
    */
    // @ApiMember(Description="The date the call completed")
    String? dateCompleted;

    /**
    * The destination of the session (e.g. what was entered into the Dial box)
    */
    // @ApiMember(Description="The destination of the session (e.g. what was entered into the Dial box)")
    String? destination;

    /**
    * The to address if any
    */
    // @ApiMember(Description="The to address if any")
    String? toAddress;

    /**
    * The from address if any
    */
    // @ApiMember(Description="The from address if any")
    String? fromAddress;

    /**
    * The from name if any
    */
    // @ApiMember(Description="The from name if any")
    String? fromName;

    /**
    * Answered by name (if any)
    */
    // @ApiMember(Description="Answered by name (if any)")
    String? answeredByName;

    /**
    * The ID of the queue member assigned to this call
    */
    // @ApiMember(Description="The ID of the queue member assigned to this call")
    String? queueMemberId;

    /**
    * The flow channel
    */
    // @ApiMember(Description="The flow channel")
    FlowChannels? channel;

    /**
    * Has the session ended
    */
    // @ApiMember(Description="Has the session ended")
    bool? ended;

    /**
    * The outcome of the call
    */
    // @ApiMember(Description="The outcome of the call")
    String? outcome;

    /**
    * The twilio Call SID of this session
    */
    // @ApiMember(Description="The twilio Call SID of this session")
    String? callSid;

    /**
    * Any console data for this session
    */
    // @ApiMember(Description="Any console data for this session")
    String? consoleData;

    /**
    * The name of the hold queue for this call
    */
    // @ApiMember(Description="The name of the hold queue for this call")
    String? holdQueueName;

    /**
    * The user ID who put this call on hold
    */
    // @ApiMember(Description="The user ID who put this call on hold")
    String? heldByUserId;

    /**
    * The reason for the hold
    */
    // @ApiMember(Description="The reason for the hold")
    SessionHoldReasons? holdReason;

    /**
    * The SID of the conference if in a conference call
    */
    // @ApiMember(Description="The SID of the conference if in a conference call")
    String? conferenceSid;

    /**
    * The display name for this session
    */
    // @ApiMember(Description="The display name for this session")
    String? displayName;

    /**
    * The log entries for this session
    */
    // @ApiMember(Description="The log entries for this session")
    List<SessionLogInfo>? log;

    /**
    * The members of this session
    */
    // @ApiMember(Description="The members of this session")
    List<SessionMemberInfo>? members;

    /**
    * The callback number (typically used for SIP to User calls)
    */
    // @ApiMember(Description="The callback number (typically used for SIP to User calls)")
    String? callbackNumber;

    /**
    * The ID of the endpoint that answered
    */
    // @ApiMember(Description="The ID of the endpoint that answered")
    String? answeredById;

    /**
    * Is this session incoming or outgoing?
    */
    // @ApiMember(Description="Is this session incoming or outgoing?")
    SessionDirections? direction;

    /**
    * The phone number that this session is coming from (used with SMS chats)
    */
    // @ApiMember(Description="The phone number that this session is coming from (used with SMS chats)")
    String? fromPhoneNumber;

    /**
    * The Call SID of the most recently added conference participant
    */
    // @ApiMember(Description="The Call SID of the most recently added conference participant")
    String? mostRecentParticipantCallSid;

    /**
    * Was this session missed?
    */
    // @ApiMember(Description="Was this session missed?")
    bool? wasMissed;

    /**
    * The ring queue that the call is currently in
    */
    // @ApiMember(Description="The ring queue that the call is currently in")
    String? ringQueueId;

    SessionInfo({this.dialState,this.callState,this.queueState,this.accountId,this.accountName,this.customerId,this.customerBreadcrumb,this.customerName,this.endpointId,this.endpointName,this.dateCompleted,this.destination,this.toAddress,this.fromAddress,this.fromName,this.answeredByName,this.queueMemberId,this.channel,this.ended,this.outcome,this.callSid,this.consoleData,this.holdQueueName,this.heldByUserId,this.holdReason,this.conferenceSid,this.displayName,this.log,this.members,this.callbackNumber,this.answeredById,this.direction,this.fromPhoneNumber,this.mostRecentParticipantCallSid,this.wasMissed,this.ringQueueId});
    SessionInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        dialState = JsonConverters.fromJson(json['dialState'],'SessionDialState',context!);
        callState = JsonConverters.fromJson(json['callState'],'SessionCallState',context!);
        queueState = JsonConverters.fromJson(json['queueState'],'SessionQueueStates',context!);
        accountId = json['accountId'];
        accountName = json['accountName'];
        customerId = json['customerId'];
        customerBreadcrumb = JsonConverters.fromJson(json['customerBreadcrumb'],'List<CustomerBreadcrumb>',context!);
        customerName = json['customerName'];
        endpointId = json['endpointId'];
        endpointName = json['endpointName'];
        dateCompleted = json['dateCompleted'];
        destination = json['destination'];
        toAddress = json['toAddress'];
        fromAddress = json['fromAddress'];
        fromName = json['fromName'];
        answeredByName = json['answeredByName'];
        queueMemberId = json['queueMemberId'];
        channel = JsonConverters.fromJson(json['channel'],'FlowChannels',context!);
        ended = json['ended'];
        outcome = json['outcome'];
        callSid = json['callSid'];
        consoleData = json['consoleData'];
        holdQueueName = json['holdQueueName'];
        heldByUserId = json['heldByUserId'];
        holdReason = JsonConverters.fromJson(json['holdReason'],'SessionHoldReasons',context!);
        conferenceSid = json['conferenceSid'];
        displayName = json['displayName'];
        log = JsonConverters.fromJson(json['log'],'List<SessionLogInfo>',context!);
        members = JsonConverters.fromJson(json['members'],'List<SessionMemberInfo>',context!);
        callbackNumber = json['callbackNumber'];
        answeredById = json['answeredById'];
        direction = JsonConverters.fromJson(json['direction'],'SessionDirections',context!);
        fromPhoneNumber = json['fromPhoneNumber'];
        mostRecentParticipantCallSid = json['mostRecentParticipantCallSid'];
        wasMissed = json['wasMissed'];
        ringQueueId = json['ringQueueId'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'dialState': JsonConverters.toJson(dialState,'SessionDialState',context!),
        'callState': JsonConverters.toJson(callState,'SessionCallState',context!),
        'queueState': JsonConverters.toJson(queueState,'SessionQueueStates',context!),
        'accountId': accountId,
        'accountName': accountName,
        'customerId': customerId,
        'customerBreadcrumb': JsonConverters.toJson(customerBreadcrumb,'List<CustomerBreadcrumb>',context!),
        'customerName': customerName,
        'endpointId': endpointId,
        'endpointName': endpointName,
        'dateCompleted': dateCompleted,
        'destination': destination,
        'toAddress': toAddress,
        'fromAddress': fromAddress,
        'fromName': fromName,
        'answeredByName': answeredByName,
        'queueMemberId': queueMemberId,
        'channel': JsonConverters.toJson(channel,'FlowChannels',context!),
        'ended': ended,
        'outcome': outcome,
        'callSid': callSid,
        'consoleData': consoleData,
        'holdQueueName': holdQueueName,
        'heldByUserId': heldByUserId,
        'holdReason': JsonConverters.toJson(holdReason,'SessionHoldReasons',context!),
        'conferenceSid': conferenceSid,
        'displayName': displayName,
        'log': JsonConverters.toJson(log,'List<SessionLogInfo>',context!),
        'members': JsonConverters.toJson(members,'List<SessionMemberInfo>',context!),
        'callbackNumber': callbackNumber,
        'answeredById': answeredById,
        'direction': JsonConverters.toJson(direction,'SessionDirections',context!),
        'fromPhoneNumber': fromPhoneNumber,
        'mostRecentParticipantCallSid': mostRecentParticipantCallSid,
        'wasMissed': wasMissed,
        'ringQueueId': ringQueueId
    });

    getTypeName() => "SessionInfo";
    TypeContext? context = _ctx;
}

/**
* Retrieve a list of sessions
*/
// @Api(Description="Retrieve a list of sessions")
class ListSessions extends ListRequest<SessionInfo> implements IConvertible
{
    /**
    * The account IDs for the sessions to retrieve
    */
    // @ApiMember(Description="The account IDs for the sessions to retrieve")
    List<String>? accountIds;

    /**
    * Whether to search live or archived sessions
    */
    // @ApiMember(Description="Whether to search live or archived sessions")
    bool? searchArchive;

    /**
    * The start date to retrieve usage records for (YYYY-MM-DD)
    */
    // @ApiMember(Description="The start date to retrieve usage records for (YYYY-MM-DD)")
    String? startDate;

    /**
    * The end date to retrieve usage records for (YYYY-MM-DD)
    */
    // @ApiMember(Description="The end date to retrieve usage records for (YYYY-MM-DD)")
    String? endDate;

    /**
    * The IDs of the customers whose sessions you want to retrieve
    */
    // @ApiMember(Description="The IDs of the customers whose sessions you want to retrieve")
    List<String>? customerIds;

    /**
    * The IDs of the endpoints whose sessions you want to retrieve
    */
    // @ApiMember(Description="The IDs of the endpoints whose sessions you want to retrieve")
    List<String>? endpointIds;

    /**
    * Filter by the from  (this is a contains search)
    */
    // @ApiMember(Description="Filter by the from  (this is a contains search)")
    String? from;

    /**
    * Filter by the to  (this is a contains search)
    */
    // @ApiMember(Description="Filter by the to  (this is a contains search)")
    String? to;

    /**
    * Filter by text in the log
    */
    // @ApiMember(Description="Filter by text in the log")
    String? log;

    /**
    * Filter by parent session ID
    */
    // @ApiMember(Description="Filter by parent session ID")
    String? parentSessionId;

    ListSessions({this.accountIds,this.searchArchive,this.startDate,this.endDate,this.customerIds,this.endpointIds,this.from,this.to,this.log,this.parentSessionId});
    ListSessions.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        accountIds = JsonConverters.fromJson(json['accountIds'],'List<String>',context!);
        searchArchive = json['searchArchive'];
        startDate = json['startDate'];
        endDate = json['endDate'];
        customerIds = JsonConverters.fromJson(json['customerIds'],'List<String>',context!);
        endpointIds = JsonConverters.fromJson(json['endpointIds'],'List<String>',context!);
        from = json['from'];
        to = json['to'];
        log = json['log'];
        parentSessionId = json['parentSessionId'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'accountIds': JsonConverters.toJson(accountIds,'List<String>',context!),
        'searchArchive': searchArchive,
        'startDate': startDate,
        'endDate': endDate,
        'customerIds': JsonConverters.toJson(customerIds,'List<String>',context!),
        'endpointIds': JsonConverters.toJson(endpointIds,'List<String>',context!),
        'from': from,
        'to': to,
        'log': log,
        'parentSessionId': parentSessionId
    });

    getTypeName() => "ListSessions";
    TypeContext? context = _ctx;
}

class BillingItem implements IConvertible
{
    double? baseCost;
    double? rawUnitMultiplier;
    double? unitCost;
    int? allowance;

    BillingItem({this.baseCost,this.rawUnitMultiplier,this.unitCost,this.allowance});
    BillingItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        baseCost = JsonConverters.toDouble(json['baseCost']);
        rawUnitMultiplier = JsonConverters.toDouble(json['rawUnitMultiplier']);
        unitCost = JsonConverters.toDouble(json['unitCost']);
        allowance = json['allowance'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'baseCost': baseCost,
        'rawUnitMultiplier': rawUnitMultiplier,
        'unitCost': unitCost,
        'allowance': allowance
    };

    getTypeName() => "BillingItem";
    TypeContext? context = _ctx;
}

class BillingSettings implements IConvertible
{
    BillingItem? base;
    BillingItem? localNumbers;
    BillingItem? tollFreeNumbers;
    BillingItem? inboundVoiceCalls;
    BillingItem? outboundVoiceCalls;
    BillingItem? inboundFaxes;
    BillingItem? outboundFaxes;
    BillingItem? inboundSmsMessages;
    BillingItem? outboundSmsMessages;

    BillingSettings({this.base,this.localNumbers,this.tollFreeNumbers,this.inboundVoiceCalls,this.outboundVoiceCalls,this.inboundFaxes,this.outboundFaxes,this.inboundSmsMessages,this.outboundSmsMessages});
    BillingSettings.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        base = JsonConverters.fromJson(json['base'],'BillingItem',context!);
        localNumbers = JsonConverters.fromJson(json['localNumbers'],'BillingItem',context!);
        tollFreeNumbers = JsonConverters.fromJson(json['tollFreeNumbers'],'BillingItem',context!);
        inboundVoiceCalls = JsonConverters.fromJson(json['inboundVoiceCalls'],'BillingItem',context!);
        outboundVoiceCalls = JsonConverters.fromJson(json['outboundVoiceCalls'],'BillingItem',context!);
        inboundFaxes = JsonConverters.fromJson(json['inboundFaxes'],'BillingItem',context!);
        outboundFaxes = JsonConverters.fromJson(json['outboundFaxes'],'BillingItem',context!);
        inboundSmsMessages = JsonConverters.fromJson(json['inboundSmsMessages'],'BillingItem',context!);
        outboundSmsMessages = JsonConverters.fromJson(json['outboundSmsMessages'],'BillingItem',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'base': JsonConverters.toJson(base,'BillingItem',context!),
        'localNumbers': JsonConverters.toJson(localNumbers,'BillingItem',context!),
        'tollFreeNumbers': JsonConverters.toJson(tollFreeNumbers,'BillingItem',context!),
        'inboundVoiceCalls': JsonConverters.toJson(inboundVoiceCalls,'BillingItem',context!),
        'outboundVoiceCalls': JsonConverters.toJson(outboundVoiceCalls,'BillingItem',context!),
        'inboundFaxes': JsonConverters.toJson(inboundFaxes,'BillingItem',context!),
        'outboundFaxes': JsonConverters.toJson(outboundFaxes,'BillingItem',context!),
        'inboundSmsMessages': JsonConverters.toJson(inboundSmsMessages,'BillingItem',context!),
        'outboundSmsMessages': JsonConverters.toJson(outboundSmsMessages,'BillingItem',context!)
    };

    getTypeName() => "BillingSettings";
    TypeContext? context = _ctx;
}

class AccountInfo extends EntityInfo implements IConvertible
{
    /**
    * The name of this account
    */
    // @ApiMember(Description="The name of this account")
    String? name;

    /**
    * The ID of this account's parent
    */
    // @ApiMember(Description="The ID of this account's parent")
    String? parentAccountId;

    /**
    * The twilio account SID
    */
    // @ApiMember(Description="The twilio account SID")
    String? twilioAccountSid;

    /**
    * The ancestors of this account. Useful for breadcrumbs
    */
    // @ApiMember(Description="The ancestors of this account. Useful for breadcrumbs")
    List<String>? ancestorIds;

    /**
    * The max number of phone numbers this account can have
    */
    // @ApiMember(Description="The max number of phone numbers this account can have")
    int? maxPhoneNumbers;

    /**
    * This account is BYOA
    */
    // @ApiMember(Description="This account is BYOA")
    bool? isBYOA;

    /**
    * TrustHub Profile Sid
    */
    // @ApiMember(Description="TrustHub Profile Sid")
    String? trustHubProfileSid;

    /**
    * The ID of the logo file
    */
    // @ApiMember(Description="The ID of the logo file")
    String? logoId;

    /**
    * The URI of the logo file
    */
    // @ApiMember(Description="The URI of the logo file")
    String? logoUri;

    /**
    * The billing settings for this account
    */
    // @ApiMember(Description="The billing settings for this account")
    BillingSettings? billingSettings;

    AccountInfo({this.name,this.parentAccountId,this.twilioAccountSid,this.ancestorIds,this.maxPhoneNumbers,this.isBYOA,this.trustHubProfileSid,this.logoId,this.logoUri,this.billingSettings});
    AccountInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        name = json['name'];
        parentAccountId = json['parentAccountId'];
        twilioAccountSid = json['twilioAccountSid'];
        ancestorIds = JsonConverters.fromJson(json['ancestorIds'],'List<String>',context!);
        maxPhoneNumbers = json['maxPhoneNumbers'];
        isBYOA = json['isBYOA'];
        trustHubProfileSid = json['trustHubProfileSid'];
        logoId = json['logoId'];
        logoUri = json['logoUri'];
        billingSettings = JsonConverters.fromJson(json['billingSettings'],'BillingSettings',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'name': name,
        'parentAccountId': parentAccountId,
        'twilioAccountSid': twilioAccountSid,
        'ancestorIds': JsonConverters.toJson(ancestorIds,'List<String>',context!),
        'maxPhoneNumbers': maxPhoneNumbers,
        'isBYOA': isBYOA,
        'trustHubProfileSid': trustHubProfileSid,
        'logoId': logoId,
        'logoUri': logoUri,
        'billingSettings': JsonConverters.toJson(billingSettings,'BillingSettings',context!)
    });

    getTypeName() => "AccountInfo";
    TypeContext? context = _ctx;
}

class ListResponse<AccountInfo> implements IConvertible
{
    /**
    * The items
    */
    // @ApiMember(Description="The items")
    List<AccountInfo>? items;

    /**
    * The total number of items
    */
    // @ApiMember(Description="The total number of items")
    int? totalCount;

    /**
    * The total number of pages
    */
    // @ApiMember(Description="The total number of pages")
    int? totalPages;

    /**
    * Are there more pages of items? Used with simplified paging
    */
    // @ApiMember(Description="Are there more pages of items? Used with simplified paging")
    bool? hasMorePages;

    ListResponse({this.items,this.totalCount,this.totalPages,this.hasMorePages});
    ListResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        items = JsonConverters.fromJson(json['items'],'List<${runtimeGenericTypeDefs(this,[0]).join(",")}>',context!);
        totalCount = json['totalCount'];
        totalPages = json['totalPages'];
        hasMorePages = json['hasMorePages'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'items': JsonConverters.toJson(items,'List<AccountInfo>',context!),
        'totalCount': totalCount,
        'totalPages': totalPages,
        'hasMorePages': hasMorePages
    };

    getTypeName() => "ListResponse<$AccountInfo>";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'evovoice.io', types: <String, TypeInfo> {
    'SortOrders': TypeInfo(TypeOf.Enum, enumValues:SortOrders.values),
    'ListRequest<T>': TypeInfo(TypeOf.AbstractClass),
    'EntityInfo': TypeInfo(TypeOf.AbstractClass),
    'SessionDialState': TypeInfo(TypeOf.Enum, enumValues:SessionDialState.values),
    'SessionCallState': TypeInfo(TypeOf.Enum, enumValues:SessionCallState.values),
    'SessionQueueStates': TypeInfo(TypeOf.Enum, enumValues:SessionQueueStates.values),
    'CustomerBreadcrumb': TypeInfo(TypeOf.Class, create:() => CustomerBreadcrumb()),
    'FlowChannels': TypeInfo(TypeOf.Enum, enumValues:FlowChannels.values),
    'SessionHoldReasons': TypeInfo(TypeOf.Enum, enumValues:SessionHoldReasons.values),
    'SessionLogInfo': TypeInfo(TypeOf.Class, create:() => SessionLogInfo()),
    'SessionMemberCallState': TypeInfo(TypeOf.Enum, enumValues:SessionMemberCallState.values),
    'SessionMemberRoles': TypeInfo(TypeOf.Enum, enumValues:SessionMemberRoles.values),
    'SessionMemberInfo': TypeInfo(TypeOf.Class, create:() => SessionMemberInfo()),
    'SessionDirections': TypeInfo(TypeOf.Enum, enumValues:SessionDirections.values),
    'SessionInfo': TypeInfo(TypeOf.Class, create:() => SessionInfo()),
    'List<CustomerBreadcrumb>': TypeInfo(TypeOf.Class, create:() => <CustomerBreadcrumb>[]),
    'List<SessionLogInfo>': TypeInfo(TypeOf.Class, create:() => <SessionLogInfo>[]),
    'List<SessionMemberInfo>': TypeInfo(TypeOf.Class, create:() => <SessionMemberInfo>[]),
    'ListSessions': TypeInfo(TypeOf.Class, create:() => ListSessions()),
    'BillingItem': TypeInfo(TypeOf.Class, create:() => BillingItem()),
    'BillingSettings': TypeInfo(TypeOf.Class, create:() => BillingSettings()),
    'AccountInfo': TypeInfo(TypeOf.Class, create:() => AccountInfo()),
    'ListResponse<AccountInfo>': TypeInfo(TypeOf.Class, create:() => ListResponse<AccountInfo>()),
});

Dart ListSessions DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /sessions HTTP/1.1 
Host: evovoice.io 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"items":[{"dialState":"None","callState":"Disconnected","queueState":"None","accountId":"String","accountName":"String","customerId":"String","customerBreadcrumb":[{"id":"String","name":"String"}],"customerName":"String","endpointId":"String","endpointName":"String","dateCompleted":"String","destination":"String","toAddress":"String","fromAddress":"String","fromName":"String","answeredByName":"String","queueMemberId":"String","channel":"Voice","ended":false,"outcome":"String","callSid":"String","consoleData":"String","holdQueueName":"String","heldByUserId":"String","holdReason":"None","conferenceSid":"String","displayName":"String","log":[{"date":"String","message":"String"}],"members":[{"identity":"String","endpointId":"String","displayName":"String","isOriginalMember":false,"avatarUrl":"String","applicationData":{"String":"String"},"callState":"None","role":"None","callSid":"String","muted":false}],"callbackNumber":"String","answeredById":"String","direction":"Incoming","fromPhoneNumber":"String","mostRecentParticipantCallSid":"String","wasMissed":false,"ringQueueId":"String","id":"String","dateCreated":"String","dateLastModified":"String","createdBy":"String","lastModifiedBy":"String"}],"totalCount":0,"totalPages":0,"hasMorePages":false}