POST | /scheduling/class-schedule | Create a Class Schedule |
---|
import 'package:servicestack/servicestack.dart';
class ApiDtoBase implements IConvertible
{
String? ApiKey;
int? StoreId;
int? ChainId;
ApiDtoBase({this.ApiKey,this.StoreId,this.ChainId});
ApiDtoBase.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ApiKey = json['ApiKey'];
StoreId = json['StoreId'];
ChainId = json['ChainId'];
return this;
}
Map<String, dynamic> toJson() => {
'ApiKey': ApiKey,
'StoreId': StoreId,
'ChainId': ChainId
};
getTypeName() => "ApiDtoBase";
TypeContext? context = _ctx;
}
class CreateClassScheduleRequestDto extends ApiDtoBase implements IConvertible
{
int? ClassId;
DateTime? ClassDateTime;
int? TrainerId;
String? AlternateClassName;
CreateClassScheduleRequestDto({this.ClassId,this.ClassDateTime,this.TrainerId,this.AlternateClassName});
CreateClassScheduleRequestDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
ClassId = json['ClassId'];
ClassDateTime = JsonConverters.fromJson(json['ClassDateTime'],'DateTime',context!);
TrainerId = json['TrainerId'];
AlternateClassName = json['AlternateClassName'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'ClassId': ClassId,
'ClassDateTime': JsonConverters.toJson(ClassDateTime,'DateTime',context!),
'TrainerId': TrainerId,
'AlternateClassName': AlternateClassName
});
getTypeName() => "CreateClassScheduleRequestDto";
TypeContext? context = _ctx;
}
enum RestrictedResourceType
{
Store,
Chain,
User,
Undefined,
}
class CreateClassScheduleRequest extends CreateClassScheduleRequestDto implements IRestrictedApiRequest, IConvertible
{
/**
* Api Key - grants access to resources
*/
// @ApiMember(DataType="string", Description="Api Key - grants access to resources", IsRequired=true, Name="ApiKey", ParameterType="query")
String? ApiKey;
/**
* Store ID
*/
// @ApiMember(DataType="integer", Description="Store ID", IsRequired=true, Name="StoreId", ParameterType="query")
int? StoreId;
/**
* Class ID
*/
// @ApiMember(DataType="integer", Description="Class ID", IsRequired=true, Name="ClassId", ParameterType="query")
int? ClassId;
/**
* Date and Time for Class
*/
// @ApiMember(DataType="date-time", Description="Date and Time for Class", IsRequired=true, Name="ClassDateTime", ParameterType="query")
DateTime? ClassDateTime;
/**
* Trainer ID
*/
// @ApiMember(DataType="integer", Description="Trainer ID", Name="TrainerId", ParameterType="query")
int? TrainerId;
/**
* Alternate Class Name
*/
// @ApiMember(DataType="string", Description="Alternate Class Name", Name="AlternateClassName", ParameterType="query")
String? AlternateClassName;
int? RestrictedId;
RestrictedResourceType? RestrictedResourceType;
CreateClassScheduleRequest({this.ApiKey,this.StoreId,this.ClassId,this.ClassDateTime,this.TrainerId,this.AlternateClassName,this.RestrictedId,this.RestrictedResourceType});
CreateClassScheduleRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
ApiKey = json['ApiKey'];
StoreId = json['StoreId'];
ClassId = json['ClassId'];
ClassDateTime = JsonConverters.fromJson(json['ClassDateTime'],'DateTime',context!);
TrainerId = json['TrainerId'];
AlternateClassName = json['AlternateClassName'];
RestrictedId = json['RestrictedId'];
RestrictedResourceType = JsonConverters.fromJson(json['RestrictedResourceType'],'RestrictedResourceType',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'ApiKey': ApiKey,
'StoreId': StoreId,
'ClassId': ClassId,
'ClassDateTime': JsonConverters.toJson(ClassDateTime,'DateTime',context!),
'TrainerId': TrainerId,
'AlternateClassName': AlternateClassName,
'RestrictedId': RestrictedId,
'RestrictedResourceType': JsonConverters.toJson(RestrictedResourceType,'RestrictedResourceType',context!)
});
getTypeName() => "CreateClassScheduleRequest";
TypeContext? context = _ctx;
}
class ApiResponseBase implements IConvertible
{
bool? Success;
String? Message;
ApiResponseBase({this.Success,this.Message});
ApiResponseBase.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Success = json['Success'];
Message = json['Message'];
return this;
}
Map<String, dynamic> toJson() => {
'Success': Success,
'Message': Message
};
getTypeName() => "ApiResponseBase";
TypeContext? context = _ctx;
}
class CreateClassScheduleResponseDto extends ApiResponseBase implements IConvertible
{
int? ClassScheduleId;
CreateClassScheduleResponseDto({this.ClassScheduleId});
CreateClassScheduleResponseDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
ClassScheduleId = json['ClassScheduleId'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'ClassScheduleId': ClassScheduleId
});
getTypeName() => "CreateClassScheduleResponseDto";
TypeContext? context = _ctx;
}
class CreateClassScheduleResponse extends CreateClassScheduleResponseDto implements IConvertible
{
bool? Success;
int? ClassScheduleId;
String? Message;
CreateClassScheduleResponse({this.Success,this.ClassScheduleId,this.Message});
CreateClassScheduleResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
Success = json['Success'];
ClassScheduleId = json['ClassScheduleId'];
Message = json['Message'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'Success': Success,
'ClassScheduleId': ClassScheduleId,
'Message': Message
});
getTypeName() => "CreateClassScheduleResponse";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'clubready.com', types: <String, TypeInfo> {
'ApiDtoBase': TypeInfo(TypeOf.Class, create:() => ApiDtoBase()),
'CreateClassScheduleRequestDto': TypeInfo(TypeOf.Class, create:() => CreateClassScheduleRequestDto()),
'RestrictedResourceType': TypeInfo(TypeOf.Enum, enumValues:RestrictedResourceType.values),
'CreateClassScheduleRequest': TypeInfo(TypeOf.Class, create:() => CreateClassScheduleRequest()),
'ApiResponseBase': TypeInfo(TypeOf.Class, create:() => ApiResponseBase()),
'CreateClassScheduleResponseDto': TypeInfo(TypeOf.Class, create:() => CreateClassScheduleResponseDto()),
'CreateClassScheduleResponse': TypeInfo(TypeOf.Class, create:() => CreateClassScheduleResponse()),
});
Dart CreateClassScheduleRequest 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.
POST /scheduling/class-schedule HTTP/1.1
Host: clubready.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"ApiKey":"String","StoreId":0,"ClassId":0,"ClassDateTime":"0001-01-01T00:00:00.0000000","TrainerId":0,"AlternateClassName":"String","RestrictedId":0,"RestrictedResourceType":"Store","ChainId":0}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"Success":false,"ClassScheduleId":0,"Message":"String"}