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 Foundation
import ServiceStack

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

    /**
    * 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")
    public var endpointId:String?

    required public init(){}
}

public class Schedule : Codable
{
    public var timeZoneId:String?
    public var inherit:Bool?
    public var forceClosed:Bool?
    public var rules:[SchedulingRule] = []
    public var defaultState:String?

    required public init(){}
}

public class SchedulingRule : Codable
{
    public var id:String?
    public var name:String?
    public var priority:Int?
    public var state:String?
    public var source:String?
    public var condition:String?
    public var simpleRuleType:SimpleSchedulingRuleTypes?
    public var customerState:String?
    public var flowId:String?
    public var flowParams:Struct?
    public var isAllDay:Bool?
    public var startDate:String?
    public var startTime:String?
    public var endTime:String?
    public var bySetPosition:[Int] = []
    public var byMonth:[Int] = []
    public var byWeekNo:[Int] = []
    public var byYearDay:[Int] = []
    public var byMonthDay:[Int] = []
    public var byDay:[ScheduleDay] = []
    public var byHour:[Int] = []
    public var byMinute:[Int] = []
    public var interval:Int?
    public var count:Int?
    public var untilDate:String?
    public var frequency:SchedulingRuleFrequency?

    required public init(){}
}

public enum SimpleSchedulingRuleTypes : String, Codable
{
    case Always
    case CustomerState
    case Time
}

public class Struct : List<String:Value>
{
    required public init(){ super.init() }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
    }
}

public class Value : Codable
{
    public var boolValue:Bool?
    public var stringValue:String?
    public var numberValue:Double?
    public var listValue:[Struct] = []
    public var structValue:Struct?

    required public init(){}
}

public class ScheduleDay : Codable
{
    public var offset:Int?
    public var dayOfWeek:DayOfWeek?

    required public init(){}
}

public enum SchedulingRuleFrequency : String, Codable
{
    case None
    case Secondly
    case Minutely
    case Hourly
    case Daily
    case Weekly
    case Monthly
    case Yearly
}


Swift 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>