Requires any of the roles: | SystemAdministrator, Manager, Customer |
GET | /customers/{customerId}/inherited-schedule | ||
---|---|---|---|
GET | /endpoints/{endpointId}/inherited-schedule |
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
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: 'team.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 .csv suffix or ?format=csv
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: team.evovoice.io Accept: text/csv
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"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"}