POST | /api/schedules/{RequestId}/cancel |
---|
import 'package:servicestack/servicestack.dart';
class ScheduleResponse implements IConvertible
{
String? ReferenceId;
String? CommunicationId;
bool? Success;
String? Message;
String? Payload;
ScheduleResponse({this.ReferenceId,this.CommunicationId,this.Success,this.Message,this.Payload});
ScheduleResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ReferenceId = json['ReferenceId'];
CommunicationId = json['CommunicationId'];
Success = json['Success'];
Message = json['Message'];
Payload = json['Payload'];
return this;
}
Map<String, dynamic> toJson() => {
'ReferenceId': ReferenceId,
'CommunicationId': CommunicationId,
'Success': Success,
'Message': Message,
'Payload': Payload
};
getTypeName() => "ScheduleResponse";
TypeContext? context = _ctx;
}
// @DataContract
class ObjectReference implements IConvertible
{
// @DataMember(Name="RmsTableContextId")
String? RmsTableContextId;
// @DataMember(Name="AlternateKey")
String? AlternateKey;
// @DataMember(Name="DataSourceInstanceId")
String? DataSourceInstanceId;
ObjectReference({this.RmsTableContextId,this.AlternateKey,this.DataSourceInstanceId});
ObjectReference.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
RmsTableContextId = json['RmsTableContextId'];
AlternateKey = json['AlternateKey'];
DataSourceInstanceId = json['DataSourceInstanceId'];
return this;
}
Map<String, dynamic> toJson() => {
'RmsTableContextId': RmsTableContextId,
'AlternateKey': AlternateKey,
'DataSourceInstanceId': DataSourceInstanceId
};
getTypeName() => "ObjectReference";
TypeContext? context = _ctx;
}
// @DataContract
class ContactInfo implements IConvertible
{
// @DataMember(Name="Id")
String? Id;
// @DataMember(Name="Name")
String? Name;
// @DataMember(Name="Email")
String? Email;
// @DataMember(Name="Phone")
String? Phone;
// @DataMember(Name="ContactReference")
ObjectReference? ContactReference;
ContactInfo({this.Id,this.Name,this.Email,this.Phone,this.ContactReference});
ContactInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Name = json['Name'];
Email = json['Email'];
Phone = json['Phone'];
ContactReference = JsonConverters.fromJson(json['ContactReference'],'ObjectReference',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Name': Name,
'Email': Email,
'Phone': Phone,
'ContactReference': JsonConverters.toJson(ContactReference,'ObjectReference',context!)
};
getTypeName() => "ContactInfo";
TypeContext? context = _ctx;
}
// @DataContract
class ProjectInfo implements IConvertible
{
// @DataMember(Name="Id")
String? Id;
// @DataMember(Name="Name")
String? Name;
// @DataMember(Name="Reference")
String? Reference;
// @DataMember(Name="Description")
String? Description;
// @DataMember(Name="Address")
String? Address;
// @DataMember(Name="HouseType")
String? HouseType;
// @DataMember(Name="Elevation")
String? Elevation;
// @DataMember(Name="CustomerName")
String? CustomerName;
// @DataMember(Name="Supervisor")
ContactInfo? Supervisor;
// @DataMember(Name="ProjectReference")
ObjectReference? ProjectReference;
ProjectInfo({this.Id,this.Name,this.Reference,this.Description,this.Address,this.HouseType,this.Elevation,this.CustomerName,this.Supervisor,this.ProjectReference});
ProjectInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Name = json['Name'];
Reference = json['Reference'];
Description = json['Description'];
Address = json['Address'];
HouseType = json['HouseType'];
Elevation = json['Elevation'];
CustomerName = json['CustomerName'];
Supervisor = JsonConverters.fromJson(json['Supervisor'],'ContactInfo',context!);
ProjectReference = JsonConverters.fromJson(json['ProjectReference'],'ObjectReference',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Name': Name,
'Reference': Reference,
'Description': Description,
'Address': Address,
'HouseType': HouseType,
'Elevation': Elevation,
'CustomerName': CustomerName,
'Supervisor': JsonConverters.toJson(Supervisor,'ContactInfo',context!),
'ProjectReference': JsonConverters.toJson(ProjectReference,'ObjectReference',context!)
};
getTypeName() => "ProjectInfo";
TypeContext? context = _ctx;
}
// @DataContract
class PurchaseOrderInfo implements IConvertible
{
// @DataMember(Name="Id")
String? Id;
// @DataMember(Name="Reference")
String? Reference;
// @DataMember(Name="Description")
String? Description;
// @DataMember(Name="PurchaseOrderReference")
ObjectReference? PurchaseOrderReference;
PurchaseOrderInfo({this.Id,this.Reference,this.Description,this.PurchaseOrderReference});
PurchaseOrderInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Reference = json['Reference'];
Description = json['Description'];
PurchaseOrderReference = JsonConverters.fromJson(json['PurchaseOrderReference'],'ObjectReference',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Reference': Reference,
'Description': Description,
'PurchaseOrderReference': JsonConverters.toJson(PurchaseOrderReference,'ObjectReference',context!)
};
getTypeName() => "PurchaseOrderInfo";
TypeContext? context = _ctx;
}
// @DataContract
class ActivityReference implements IConvertible
{
/**
* Name/details of the activity
*/
// @DataMember(Name="name")
// @ApiMember(Description="Name/details of the activity", IsRequired=true, Name="Name")
String? name;
// @DataMember(Name="notes")
String? notes;
ActivityReference({this.name,this.notes});
ActivityReference.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
name = json['Name'];
notes = json['Notes'];
return this;
}
Map<String, dynamic> toJson() => {
'name': name,
'notes': notes
};
getTypeName() => "ActivityReference";
TypeContext? context = _ctx;
}
// @DataContract
class ScheduleParams implements IConvertible
{
// @DataMember(Name="Name")
String? Name;
// @DataMember(Name="Value")
String? Value;
ScheduleParams({this.Name,this.Value});
ScheduleParams.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Name = json['Name'];
Value = json['Value'];
return this;
}
Map<String, dynamic> toJson() => {
'Name': Name,
'Value': Value
};
getTypeName() => "ScheduleParams";
TypeContext? context = _ctx;
}
enum AttachmentType
{
Url,
FileStream,
}
class EmailAttachment implements IConvertible
{
String? FileName;
String? ContentType;
String? Path;
String? Url;
int? Length;
Uint8List? FileStream;
String? StreamContent;
AttachmentType? AttachmentType;
bool? ProcessedAndUploadedAsBlob;
EmailAttachment({this.FileName,this.ContentType,this.Path,this.Url,this.Length,this.FileStream,this.StreamContent,this.AttachmentType,this.ProcessedAndUploadedAsBlob});
EmailAttachment.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
FileName = json['FileName'];
ContentType = json['ContentType'];
Path = json['Path'];
Url = json['Url'];
Length = json['Length'];
FileStream = JsonConverters.fromJson(json['FileStream'],'Uint8List',context!);
StreamContent = json['StreamContent'];
AttachmentType = JsonConverters.fromJson(json['AttachmentType'],'AttachmentType',context!);
ProcessedAndUploadedAsBlob = json['ProcessedAndUploadedAsBlob'];
return this;
}
Map<String, dynamic> toJson() => {
'FileName': FileName,
'ContentType': ContentType,
'Path': Path,
'Url': Url,
'Length': Length,
'FileStream': JsonConverters.toJson(FileStream,'Uint8List',context!),
'StreamContent': StreamContent,
'AttachmentType': JsonConverters.toJson(AttachmentType,'AttachmentType',context!),
'ProcessedAndUploadedAsBlob': ProcessedAndUploadedAsBlob
};
getTypeName() => "EmailAttachment";
TypeContext? context = _ctx;
}
/**
* Creates or Reschedules a SupplierConnect schedule. This will return the id of the schedule request created and the communication id of the notification sent.
*/
// @Api(Description="Creates or Reschedules a SupplierConnect schedule. This will return the id of the schedule request created and the communication id of the notification sent.")
// @DataContract
class CancelScheduleRequest implements IConvertible
{
/**
* Id of the schedule request to be recreated
*/
// @DataMember(Name="RequestId")
// @ApiMember(Description="Id of the schedule request to be recreated", IsRequired=true, Name="RequestId")
String? RequestId;
/**
* Date/Time of the activity
*/
// @DataMember(Name="ScheduleDateTime")
// @ApiMember(Description="Date/Time of the activity", IsRequired=true, Name="ScheduleDateTime")
// @Required()
DateTime? ScheduleDateTime;
// @DataMember(Name="Requester")
ContactInfo? Requester;
// @DataMember(Name="Supplier")
ContactInfo? Supplier;
// @DataMember(Name="Project")
ProjectInfo? Project;
// @DataMember(Name="PurchaseOrder")
PurchaseOrderInfo? PurchaseOrder;
// @DataMember(Name="Activity")
ActivityReference? Activity;
// @DataMember(Name="Params")
List<ScheduleParams>? Params;
// @DataMember(Name="Attachments")
List<EmailAttachment>? Attachments;
CancelScheduleRequest({this.RequestId,this.ScheduleDateTime,this.Requester,this.Supplier,this.Project,this.PurchaseOrder,this.Activity,this.Params,this.Attachments});
CancelScheduleRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
RequestId = json['RequestId'];
ScheduleDateTime = JsonConverters.fromJson(json['ScheduleDateTime'],'DateTime',context!);
Requester = JsonConverters.fromJson(json['Requester'],'ContactInfo',context!);
Supplier = JsonConverters.fromJson(json['Supplier'],'ContactInfo',context!);
Project = JsonConverters.fromJson(json['Project'],'ProjectInfo',context!);
PurchaseOrder = JsonConverters.fromJson(json['PurchaseOrder'],'PurchaseOrderInfo',context!);
Activity = JsonConverters.fromJson(json['Activity'],'ActivityReference',context!);
Params = JsonConverters.fromJson(json['Params'],'List<ScheduleParams>',context!);
Attachments = JsonConverters.fromJson(json['Attachments'],'List<EmailAttachment>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'RequestId': RequestId,
'ScheduleDateTime': JsonConverters.toJson(ScheduleDateTime,'DateTime',context!),
'Requester': JsonConverters.toJson(Requester,'ContactInfo',context!),
'Supplier': JsonConverters.toJson(Supplier,'ContactInfo',context!),
'Project': JsonConverters.toJson(Project,'ProjectInfo',context!),
'PurchaseOrder': JsonConverters.toJson(PurchaseOrder,'PurchaseOrderInfo',context!),
'Activity': JsonConverters.toJson(Activity,'ActivityReference',context!),
'Params': JsonConverters.toJson(Params,'List<ScheduleParams>',context!),
'Attachments': JsonConverters.toJson(Attachments,'List<EmailAttachment>',context!)
};
getTypeName() => "CancelScheduleRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'production_eros_gateway_api_supplierconnect.azurewebsites.net', types: <String, TypeInfo> {
'ScheduleResponse': TypeInfo(TypeOf.Class, create:() => ScheduleResponse()),
'ObjectReference': TypeInfo(TypeOf.Class, create:() => ObjectReference()),
'ContactInfo': TypeInfo(TypeOf.Class, create:() => ContactInfo()),
'ProjectInfo': TypeInfo(TypeOf.Class, create:() => ProjectInfo()),
'PurchaseOrderInfo': TypeInfo(TypeOf.Class, create:() => PurchaseOrderInfo()),
'ActivityReference': TypeInfo(TypeOf.Class, create:() => ActivityReference()),
'ScheduleParams': TypeInfo(TypeOf.Class, create:() => ScheduleParams()),
'AttachmentType': TypeInfo(TypeOf.Enum, enumValues:AttachmentType.values),
'EmailAttachment': TypeInfo(TypeOf.Class, create:() => EmailAttachment()),
'Uint8List': TypeInfo(TypeOf.Class, create:() => Uint8List(0)),
'CancelScheduleRequest': TypeInfo(TypeOf.Class, create:() => CancelScheduleRequest()),
'List<ScheduleParams>': TypeInfo(TypeOf.Class, create:() => <ScheduleParams>[]),
'List<EmailAttachment>': TypeInfo(TypeOf.Class, create:() => <EmailAttachment>[]),
});
Dart CancelScheduleRequest DTOs
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 /api/schedules/{RequestId}/cancel HTTP/1.1
Host: production-eros-gateway-api-supplierconnect.azurewebsites.net
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
ScheduleDateTime: 0001-01-01,
Requester:
{
Name: String,
Email: String,
Phone: String,
ContactReference:
{
AlternateKey: String
}
},
Supplier:
{
Name: String,
Email: String,
Phone: String,
ContactReference:
{
AlternateKey: String
}
},
Project:
{
Name: String,
Reference: String,
Description: String,
Address: String,
HouseType: String,
Elevation: String,
CustomerName: String,
Supervisor:
{
Name: String,
Email: String,
Phone: String,
ContactReference:
{
AlternateKey: String
}
},
ProjectReference:
{
AlternateKey: String
}
},
PurchaseOrder:
{
Reference: String,
Description: String,
PurchaseOrderReference:
{
AlternateKey: String
}
},
Activity:
{
name: String,
notes: String
},
Params:
[
{
Name: String,
Value: String
}
],
Attachments:
[
{
FileName: String,
ContentType: String,
Path: String,
Url: String,
Length: 0,
StreamContent: String,
AttachmentType: Url,
ProcessedAndUploadedAsBlob: False
}
]
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Success: False, Message: String, Payload: String }