Requires any of the roles: | SystemAdministrator, Manager, Customer |
POST | /customers/{customerId}/test-schedule | ||
---|---|---|---|
POST | /endpoints/{endpointId}/test-schedule |
import java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*
/**
* Test the customer's schedule
*/
@Api(Description="Test the customer's schedule")
open class TestSchedule
{
/**
* The ID of the customer whose schedule you want to test
*/
@ApiMember(Description="The ID of the customer whose schedule you want to test")
open var customerId:String? = null
/**
* The ID of the endpoint whose schedule you want to test.
*/
@ApiMember(Description="The ID of the endpoint whose schedule you want to test.")
open var endpointId:String? = null
/**
* The schedule to use (leave null to use the current saved schedule)
*/
@ApiMember(Description="The schedule to use (leave null to use the current saved schedule)")
open var schedule:Schedule? = null
/**
* The ISO string of the date and time you want to test
*/
@ApiMember(Description="The ISO string of the date and time you want to test")
open var dateTime:String? = null
}
open class Schedule
{
open var timeZoneId:String? = null
open var inherit:Boolean? = null
open var forceClosed:Boolean? = null
open var rules:ArrayList<SchedulingRule>? = null
open var defaultState:String? = null
}
open class SchedulingRule
{
open var id:String? = null
open var name:String? = null
open var priority:Int? = null
open var state:String? = null
open var source:String? = null
open var condition:String? = null
open var simpleRuleType:SimpleSchedulingRuleTypes? = null
open var customerState:String? = null
open var flowId:String? = null
open var flowParams:Struct? = null
open var isAllDay:Boolean? = null
open var startDate:String? = null
open var startTime:String? = null
open var endTime:String? = null
open var bySetPosition:ArrayList<Int>? = null
open var byMonth:ArrayList<Int>? = null
open var byWeekNo:ArrayList<Int>? = null
open var byYearDay:ArrayList<Int>? = null
open var byMonthDay:ArrayList<Int>? = null
open var byDay:ArrayList<ScheduleDay>? = null
open var byHour:ArrayList<Int>? = null
open var byMinute:ArrayList<Int>? = null
open var interval:Int? = null
open var count:Int? = null
open var untilDate:String? = null
open var frequency:SchedulingRuleFrequency? = null
}
enum class SimpleSchedulingRuleTypes
{
Always,
CustomerState,
Time,
}
open class Struct : HashMap<String,Value>()
{
}
open class Value
{
open var boolValue:Boolean? = null
open var stringValue:String? = null
open var numberValue:Double? = null
open var listValue:ArrayList<Struct>? = null
open var structValue:Struct? = null
}
open class ScheduleDay
{
open var offset:Int? = null
open var dayOfWeek:DayOfWeek? = null
}
enum class SchedulingRuleFrequency
{
None,
Secondly,
Minutely,
Hourly,
Daily,
Weekly,
Monthly,
Yearly,
}
open class TestScheduleResponse
{
open var stateName:String? = null
open var timeZoneId:String? = null
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
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/csv
Content-Type: text/csv
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/csv Content-Length: length {"stateName":"String","timeZoneId":"String"}