Requires any of the roles: | SystemAdministrator, Manager, Customer |
POST | /customers/{customerId}/test-schedule | ||
---|---|---|---|
POST | /endpoints/{endpointId}/test-schedule |
namespace Voice.Api.Customers
open System
open System.IO
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations
type SimpleSchedulingRuleTypes =
| Always = 0
| CustomerState = 1
| Time = 2
[<AllowNullLiteral>]
type Value() =
member val BoolValue:Nullable<Boolean> = new Nullable<Boolean>() with get,set
member val StringValue:String = null with get,set
member val NumberValue:Nullable<Double> = new Nullable<Double>() with get,set
member val ListValue:ResizeArray<Struct> = null with get,set
member val StructValue:Struct = null with get,set
[<AllowNullLiteral>]
type Struct() =
inherit Dictionary<String, Value>()
[<AllowNullLiteral>]
type ScheduleDay() =
member val Offset:Int32 = new Int32() with get,set
member val DayOfWeek:DayOfWeek = new DayOfWeek() with get,set
type SchedulingRuleFrequency =
| None = 0
| Secondly = 1
| Minutely = 2
| Hourly = 3
| Daily = 4
| Weekly = 5
| Monthly = 6
| Yearly = 7
[<AllowNullLiteral>]
type SchedulingRule() =
member val Id:String = null with get,set
member val Name:String = null with get,set
member val Priority:Int32 = new Int32() with get,set
member val State:String = null with get,set
member val Source:String = null with get,set
member val Condition:String = null with get,set
member val SimpleRuleType:SimpleSchedulingRuleTypes = new SimpleSchedulingRuleTypes() with get,set
member val CustomerState:String = null with get,set
member val FlowId:String = null with get,set
member val FlowParams:Struct = null with get,set
member val IsAllDay:Boolean = new Boolean() with get,set
member val StartDate:String = null with get,set
member val StartTime:String = null with get,set
member val EndTime:String = null with get,set
member val BySetPosition:ResizeArray<Int32> = null with get,set
member val ByMonth:ResizeArray<Int32> = null with get,set
member val ByWeekNo:ResizeArray<Int32> = null with get,set
member val ByYearDay:ResizeArray<Int32> = null with get,set
member val ByMonthDay:ResizeArray<Int32> = null with get,set
member val ByDay:ResizeArray<ScheduleDay> = null with get,set
member val ByHour:ResizeArray<Int32> = null with get,set
member val ByMinute:ResizeArray<Int32> = null with get,set
member val Interval:Int32 = new Int32() with get,set
member val Count:Int32 = new Int32() with get,set
member val UntilDate:String = null with get,set
member val Frequency:SchedulingRuleFrequency = new SchedulingRuleFrequency() with get,set
[<AllowNullLiteral>]
type Schedule() =
member val TimeZoneId:String = null with get,set
member val Inherit:Boolean = new Boolean() with get,set
member val ForceClosed:Boolean = new Boolean() with get,set
member val Rules:ResizeArray<SchedulingRule> = null with get,set
member val DefaultState:String = null with get,set
///<summary>
///Test the customer's schedule
///</summary>
[<Api(Description="Test the customer's schedule")>]
[<AllowNullLiteral>]
type TestSchedule() =
///<summary>
///The ID of the customer whose schedule you want to test
///</summary>
[<ApiMember(Description="The ID of the customer whose schedule you want to test")>]
member val CustomerId:String = null with get,set
///<summary>
///The ID of the endpoint whose schedule you want to test.
///</summary>
[<ApiMember(Description="The ID of the endpoint whose schedule you want to test.")>]
member val EndpointId:String = null with get,set
///<summary>
///The schedule to use (leave null to use the current saved schedule)
///</summary>
[<ApiMember(Description="The schedule to use (leave null to use the current saved schedule)")>]
member val Schedule:Schedule = null with get,set
///<summary>
///The ISO string of the date and time you want to test
///</summary>
[<ApiMember(Description="The ISO string of the date and time you want to test")>]
member val DateTime:String = null with get,set
[<AllowNullLiteral>]
type TestScheduleResponse() =
member val StateName:String = null with get,set
member val TimeZoneId:String = null with get,set
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /customers/{customerId}/test-schedule HTTP/1.1
Host: team.evovoice.io
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
customerId: String,
endpointId: String,
schedule:
{
timeZoneId: String,
inherit: False,
forceClosed: False,
rules:
[
{
id: String,
name: String,
priority: 0,
state: String,
source: String,
condition: String,
simpleRuleType: Always,
customerState: String,
flowId: String,
isAllDay: False,
startDate: String,
startTime: String,
endTime: String,
bySetPosition:
[
0
],
byMonth:
[
0
],
byWeekNo:
[
0
],
byYearDay:
[
0
],
byMonthDay:
[
0
],
byDay:
[
{
offset: 0,
dayOfWeek: Sunday
}
],
byHour:
[
0
],
byMinute:
[
0
],
interval: 0,
count: 0,
untilDate: String,
frequency: None
}
],
defaultState: String
},
dateTime: String
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { stateName: String, timeZoneId: String }