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 .xml suffix or ?format=xml
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: application/xml
Content-Type: application/xml
Content-Length: length
<CreateClassScheduleRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api.Scheduling.Model">
<ApiKey xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</ApiKey>
<ChainId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</ChainId>
<StoreId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</StoreId>
<AlternateClassName xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</AlternateClassName>
<ClassDateTime xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0001-01-01T00:00:00</ClassDateTime>
<ClassId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</ClassId>
<TrainerId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</TrainerId>
</CreateClassScheduleRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <CreateClassScheduleResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Web.Api.Scheduling.Model"> <Message xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">String</Message> <Success xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">false</Success> <ClassScheduleId xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">0</ClassScheduleId> </CreateClassScheduleResponse>