Evo Voice

<back to all web services

GetInheritedSchedule

Get the inherited schedule for this customer

Requires Authentication
Requires any of the roles:SystemAdministrator, Manager, Customer
The following routes are available for this service:
GET/customers/{customerId}/inherited-schedule
GET/endpoints/{endpointId}/inherited-schedule
import 'package:servicestack/servicestack.dart';

enum SimpleSchedulingRuleTypes
{
    Always,
    CustomerState,
    Time,
}

class Value implements IConvertible
{
    bool? boolValue;
    String? stringValue;
    double? numberValue;
    List<Struct>? listValue;
    Struct? structValue;

    Value({this.boolValue,this.stringValue,this.numberValue,this.listValue,this.structValue});
    Value.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        boolValue = json['boolValue'];
        stringValue = json['stringValue'];
        numberValue = JsonConverters.toDouble(json['numberValue']);
        listValue = JsonConverters.fromJson(json['listValue'],'List<Struct>',context!);
        structValue = JsonConverters.fromJson(json['structValue'],'Struct',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'boolValue': boolValue,
        'stringValue': stringValue,
        'numberValue': numberValue,
        'listValue': JsonConverters.toJson(listValue,'List<Struct>',context!),
        'structValue': JsonConverters.toJson(structValue,'Struct',context!)
    };

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

class Struct extends Map<String,Value?> implements IConvertible
{
    Struct();
    Struct.fromJson(Map<String, dynamic> json) : super.fromJson(json);
    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson();
    getTypeName() => "Struct";
    TypeContext? context = _ctx;
}

class ScheduleDay implements IConvertible
{
    int? offset;
    DayOfWeek? dayOfWeek;

    ScheduleDay({this.offset,this.dayOfWeek});
    ScheduleDay.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        offset = json['offset'];
        dayOfWeek = JsonConverters.fromJson(json['dayOfWeek'],'DayOfWeek',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'offset': offset,
        'dayOfWeek': JsonConverters.toJson(dayOfWeek,'DayOfWeek',context!)
    };

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

enum SchedulingRuleFrequency
{
    None,
    Secondly,
    Minutely,
    Hourly,
    Daily,
    Weekly,
    Monthly,
    Yearly,
}

class SchedulingRule implements IConvertible
{
    String? id;
    String? name;
    int? priority;
    String? state;
    String? source;
    String? condition;
    SimpleSchedulingRuleTypes? simpleRuleType;
    String? customerState;
    String? flowId;
    Struct? flowParams;
    bool? isAllDay;
    String? startDate;
    String? startTime;
    String? endTime;
    List<int>? bySetPosition;
    List<int>? byMonth;
    List<int>? byWeekNo;
    List<int>? byYearDay;
    List<int>? byMonthDay;
    List<ScheduleDay>? byDay;
    List<int>? byHour;
    List<int>? byMinute;
    int? interval;
    int? count;
    String? untilDate;
    SchedulingRuleFrequency? frequency;

    SchedulingRule({this.id,this.name,this.priority,this.state,this.source,this.condition,this.simpleRuleType,this.customerState,this.flowId,this.flowParams,this.isAllDay,this.startDate,this.startTime,this.endTime,this.bySetPosition,this.byMonth,this.byWeekNo,this.byYearDay,this.byMonthDay,this.byDay,this.byHour,this.byMinute,this.interval,this.count,this.untilDate,this.frequency});
    SchedulingRule.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        name = json['name'];
        priority = json['priority'];
        state = json['state'];
        source = json['source'];
        condition = json['condition'];
        simpleRuleType = JsonConverters.fromJson(json['simpleRuleType'],'SimpleSchedulingRuleTypes',context!);
        customerState = json['customerState'];
        flowId = json['flowId'];
        flowParams = JsonConverters.fromJson(json['flowParams'],'Struct',context!);
        isAllDay = json['isAllDay'];
        startDate = json['startDate'];
        startTime = json['startTime'];
        endTime = json['endTime'];
        bySetPosition = JsonConverters.fromJson(json['bySetPosition'],'List<int>',context!);
        byMonth = JsonConverters.fromJson(json['byMonth'],'List<int>',context!);
        byWeekNo = JsonConverters.fromJson(json['byWeekNo'],'List<int>',context!);
        byYearDay = JsonConverters.fromJson(json['byYearDay'],'List<int>',context!);
        byMonthDay = JsonConverters.fromJson(json['byMonthDay'],'List<int>',context!);
        byDay = JsonConverters.fromJson(json['byDay'],'List<ScheduleDay>',context!);
        byHour = JsonConverters.fromJson(json['byHour'],'List<int>',context!);
        byMinute = JsonConverters.fromJson(json['byMinute'],'List<int>',context!);
        interval = json['interval'];
        count = json['count'];
        untilDate = json['untilDate'];
        frequency = JsonConverters.fromJson(json['frequency'],'SchedulingRuleFrequency',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'name': name,
        'priority': priority,
        'state': state,
        'source': source,
        'condition': condition,
        'simpleRuleType': JsonConverters.toJson(simpleRuleType,'SimpleSchedulingRuleTypes',context!),
        'customerState': customerState,
        'flowId': flowId,
        'flowParams': JsonConverters.toJson(flowParams,'Struct',context!),
        'isAllDay': isAllDay,
        'startDate': startDate,
        'startTime': startTime,
        'endTime': endTime,
        'bySetPosition': JsonConverters.toJson(bySetPosition,'List<int>',context!),
        'byMonth': JsonConverters.toJson(byMonth,'List<int>',context!),
        'byWeekNo': JsonConverters.toJson(byWeekNo,'List<int>',context!),
        'byYearDay': JsonConverters.toJson(byYearDay,'List<int>',context!),
        'byMonthDay': JsonConverters.toJson(byMonthDay,'List<int>',context!),
        'byDay': JsonConverters.toJson(byDay,'List<ScheduleDay>',context!),
        'byHour': JsonConverters.toJson(byHour,'List<int>',context!),
        'byMinute': JsonConverters.toJson(byMinute,'List<int>',context!),
        'interval': interval,
        'count': count,
        'untilDate': untilDate,
        'frequency': JsonConverters.toJson(frequency,'SchedulingRuleFrequency',context!)
    };

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

class Schedule implements IConvertible
{
    String? timeZoneId;
    bool? inherit;
    bool? forceClosed;
    List<SchedulingRule>? rules;
    String? defaultState;

    Schedule({this.timeZoneId,this.inherit,this.forceClosed,this.rules,this.defaultState});
    Schedule.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        timeZoneId = json['timeZoneId'];
        inherit = json['inherit'];
        forceClosed = json['forceClosed'];
        rules = JsonConverters.fromJson(json['rules'],'List<SchedulingRule>',context!);
        defaultState = json['defaultState'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'timeZoneId': timeZoneId,
        'inherit': inherit,
        'forceClosed': forceClosed,
        'rules': JsonConverters.toJson(rules,'List<SchedulingRule>',context!),
        'defaultState': defaultState
    };

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

/**
* Get the inherited schedule for this customer
*/
// @Api(Description="Get the inherited schedule for this customer")
class GetInheritedSchedule implements IConvertible
{
    /**
    * The customer ID whose inherited schedule you want to retrieve
    */
    // @ApiMember(Description="The customer ID whose inherited schedule you want to retrieve")
    String? customerId;

    /**
    * The endpoint ID whose inherited schedule you want to retrieve (use this OR customer id
    */
    // @ApiMember(Description="The endpoint ID whose inherited schedule you want to retrieve (use this OR customer id")
    String? endpointId;

    GetInheritedSchedule({this.customerId,this.endpointId});
    GetInheritedSchedule.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'customerId': customerId,
        'endpointId': endpointId
    };

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

TypeContext _ctx = TypeContext(library: 'evovoice.io', types: <String, TypeInfo> {
    'SimpleSchedulingRuleTypes': TypeInfo(TypeOf.Enum, enumValues:SimpleSchedulingRuleTypes.values),
    'Value': TypeInfo(TypeOf.Class, create:() => Value()),
    'List<Struct>': TypeInfo(TypeOf.Class, create:() => <Struct>[]),
    'Struct': TypeInfo(TypeOf.Class, create:() => Struct()),
    'ScheduleDay': TypeInfo(TypeOf.Class, create:() => ScheduleDay()),
    'DayOfWeek': TypeInfo(TypeOf.Class, create:() => DayOfWeek()),
    'SchedulingRuleFrequency': TypeInfo(TypeOf.Enum, enumValues:SchedulingRuleFrequency.values),
    'SchedulingRule': TypeInfo(TypeOf.Class, create:() => SchedulingRule()),
    'List<ScheduleDay>': TypeInfo(TypeOf.Class, create:() => <ScheduleDay>[]),
    'Schedule': TypeInfo(TypeOf.Class, create:() => Schedule()),
    'List<SchedulingRule>': TypeInfo(TypeOf.Class, create:() => <SchedulingRule>[]),
    'GetInheritedSchedule': TypeInfo(TypeOf.Class, create:() => GetInheritedSchedule()),
});

Dart GetInheritedSchedule DTOs

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

HTTP + XML

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

GET /customers/{customerId}/inherited-schedule HTTP/1.1 
Host: evovoice.io 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<Schedule xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Scheduling">
  <DefaultState>String</DefaultState>
  <ForceClosed>false</ForceClosed>
  <Inherit>false</Inherit>
  <Rules>
    <SchedulingRule>
      <ByDay>
        <ScheduleDay>
          <DayOfWeek>Sunday</DayOfWeek>
          <Offset>0</Offset>
        </ScheduleDay>
      </ByDay>
      <ByHour xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:int>0</d4p1:int>
      </ByHour>
      <ByMinute xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:int>0</d4p1:int>
      </ByMinute>
      <ByMonth xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:int>0</d4p1:int>
      </ByMonth>
      <ByMonthDay xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:int>0</d4p1:int>
      </ByMonthDay>
      <BySetPosition xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:int>0</d4p1:int>
      </BySetPosition>
      <ByWeekNo xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:int>0</d4p1:int>
      </ByWeekNo>
      <ByYearDay xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:int>0</d4p1:int>
      </ByYearDay>
      <Condition>String</Condition>
      <Count>0</Count>
      <CustomerState>String</CustomerState>
      <EndTime>String</EndTime>
      <FlowId>String</FlowId>
      <FlowParams xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:KeyValueOfstringValue8Ahp2kgT>
          <d4p1:Key>String</d4p1:Key>
          <d4p1:Value xmlns:d6p1="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">
            <d6p1:BoolValue>false</d6p1:BoolValue>
            <d6p1:ListValue>
              <d4p1:ArrayOfKeyValueOfstringValue8Ahp2kgT>
                <d4p1:KeyValueOfstringValue8Ahp2kgT>
                  <d4p1:Key>String</d4p1:Key>
                  <d4p1:Value>
                    <d6p1:BoolValue>false</d6p1:BoolValue>
                    <d6p1:ListValue>
                      <d4p1:ArrayOfKeyValueOfstringValue8Ahp2kgT>
                        <d4p1:KeyValueOfstringValue8Ahp2kgT>
                          <d4p1:Key>String</d4p1:Key>
                          <d4p1:Value>
                            <d6p1:BoolValue>false</d6p1:BoolValue>
                            <d6p1:ListValue>
                              <d4p1:ArrayOfKeyValueOfstringValue8Ahp2kgT i:nil="true" />
                            </d6p1:ListValue>
                            <d6p1:NumberValue>0</d6p1:NumberValue>
                            <d6p1:StringValue>String</d6p1:StringValue>
                            <d6p1:StructValue i:nil="true" />
                          </d4p1:Value>
                        </d4p1:KeyValueOfstringValue8Ahp2kgT>
                      </d4p1:ArrayOfKeyValueOfstringValue8Ahp2kgT>
                    </d6p1:ListValue>
                    <d6p1:NumberValue>0</d6p1:NumberValue>
                    <d6p1:StringValue>String</d6p1:StringValue>
                    <d6p1:StructValue>
                      <d4p1:KeyValueOfstringValue8Ahp2kgT>
                        <d4p1:Key>String</d4p1:Key>
                        <d4p1:Value>
                          <d6p1:BoolValue>false</d6p1:BoolValue>
                          <d6p1:ListValue>
                            <d4p1:ArrayOfKeyValueOfstringValue8Ahp2kgT i:nil="true" />
                          </d6p1:ListValue>
                          <d6p1:NumberValue>0</d6p1:NumberValue>
                          <d6p1:StringValue>String</d6p1:StringValue>
                          <d6p1:StructValue i:nil="true" />
                        </d4p1:Value>
                      </d4p1:KeyValueOfstringValue8Ahp2kgT>
                    </d6p1:StructValue>
                  </d4p1:Value>
                </d4p1:KeyValueOfstringValue8Ahp2kgT>
              </d4p1:ArrayOfKeyValueOfstringValue8Ahp2kgT>
            </d6p1:ListValue>
            <d6p1:NumberValue>0</d6p1:NumberValue>
            <d6p1:StringValue>String</d6p1:StringValue>
            <d6p1:StructValue>
              <d4p1:KeyValueOfstringValue8Ahp2kgT>
                <d4p1:Key>String</d4p1:Key>
                <d4p1:Value>
                  <d6p1:BoolValue>false</d6p1:BoolValue>
                  <d6p1:ListValue>
                    <d4p1:ArrayOfKeyValueOfstringValue8Ahp2kgT>
                      <d4p1:KeyValueOfstringValue8Ahp2kgT>
                        <d4p1:Key>String</d4p1:Key>
                        <d4p1:Value>
                          <d6p1:BoolValue>false</d6p1:BoolValue>
                          <d6p1:ListValue>
                            <d4p1:ArrayOfKeyValueOfstringValue8Ahp2kgT i:nil="true" />
                          </d6p1:ListValue>
                          <d6p1:NumberValue>0</d6p1:NumberValue>
                          <d6p1:StringValue>String</d6p1:StringValue>
                          <d6p1:StructValue i:nil="true" />
                        </d4p1:Value>
                      </d4p1:KeyValueOfstringValue8Ahp2kgT>
                    </d4p1:ArrayOfKeyValueOfstringValue8Ahp2kgT>
                  </d6p1:ListValue>
                  <d6p1:NumberValue>0</d6p1:NumberValue>
                  <d6p1:StringValue>String</d6p1:StringValue>
                  <d6p1:StructValue>
                    <d4p1:KeyValueOfstringValue8Ahp2kgT>
                      <d4p1:Key>String</d4p1:Key>
                      <d4p1:Value>
                        <d6p1:BoolValue>false</d6p1:BoolValue>
                        <d6p1:ListValue>
                          <d4p1:ArrayOfKeyValueOfstringValue8Ahp2kgT i:nil="true" />
                        </d6p1:ListValue>
                        <d6p1:NumberValue>0</d6p1:NumberValue>
                        <d6p1:StringValue>String</d6p1:StringValue>
                        <d6p1:StructValue i:nil="true" />
                      </d4p1:Value>
                    </d4p1:KeyValueOfstringValue8Ahp2kgT>
                  </d6p1:StructValue>
                </d4p1:Value>
              </d4p1:KeyValueOfstringValue8Ahp2kgT>
            </d6p1:StructValue>
          </d4p1:Value>
        </d4p1:KeyValueOfstringValue8Ahp2kgT>
      </FlowParams>
      <Frequency>None</Frequency>
      <Id>String</Id>
      <Interval>0</Interval>
      <IsAllDay>false</IsAllDay>
      <Name>String</Name>
      <Priority>0</Priority>
      <SimpleRuleType>Always</SimpleRuleType>
      <Source>String</Source>
      <StartDate>String</StartDate>
      <StartTime>String</StartTime>
      <State>String</State>
      <UntilDate>String</UntilDate>
    </SchedulingRule>
  </Rules>
  <TimeZoneId>String</TimeZoneId>
</Schedule>