| Requires any of the roles: | Agent, Administrator |
| POST,OPTIONS | /v1/Rfp/{RfpDocumentUID}/Approve |
|---|
import 'package:servicestack/servicestack.dart';
class TaskDiff implements IConvertible
{
String? TaskName;
List<String>? PositionsAdded = [];
List<String>? PositionsRemoved = [];
List<String>? PositionsStaffed = [];
List<int>? EquipmentAdded = [];
List<int>? EquipmentRemoved = [];
List<int>? MaterialsAdded = [];
List<int>? MaterialsRemoved = [];
bool? HasChanges;
TaskDiff({this.TaskName,this.PositionsAdded,this.PositionsRemoved,this.PositionsStaffed,this.EquipmentAdded,this.EquipmentRemoved,this.MaterialsAdded,this.MaterialsRemoved,this.HasChanges});
TaskDiff.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
TaskName = json['TaskName'];
PositionsAdded = JsonConverters.fromJson(json['PositionsAdded'],'List<String>',context!);
PositionsRemoved = JsonConverters.fromJson(json['PositionsRemoved'],'List<String>',context!);
PositionsStaffed = JsonConverters.fromJson(json['PositionsStaffed'],'List<String>',context!);
EquipmentAdded = JsonConverters.fromJson(json['EquipmentAdded'],'List<int>',context!);
EquipmentRemoved = JsonConverters.fromJson(json['EquipmentRemoved'],'List<int>',context!);
MaterialsAdded = JsonConverters.fromJson(json['MaterialsAdded'],'List<int>',context!);
MaterialsRemoved = JsonConverters.fromJson(json['MaterialsRemoved'],'List<int>',context!);
HasChanges = json['HasChanges'];
return this;
}
Map<String, dynamic> toJson() => {
'TaskName': TaskName,
'PositionsAdded': JsonConverters.toJson(PositionsAdded,'List<String>',context!),
'PositionsRemoved': JsonConverters.toJson(PositionsRemoved,'List<String>',context!),
'PositionsStaffed': JsonConverters.toJson(PositionsStaffed,'List<String>',context!),
'EquipmentAdded': JsonConverters.toJson(EquipmentAdded,'List<int>',context!),
'EquipmentRemoved': JsonConverters.toJson(EquipmentRemoved,'List<int>',context!),
'MaterialsAdded': JsonConverters.toJson(MaterialsAdded,'List<int>',context!),
'MaterialsRemoved': JsonConverters.toJson(MaterialsRemoved,'List<int>',context!),
'HasChanges': HasChanges
};
getTypeName() => "TaskDiff";
TypeContext? context = _ctx;
}
class ProposalDiff implements IConvertible
{
List<String>? TasksAdded = [];
List<String>? TasksRemoved = [];
List<TaskDiff>? Tasks = [];
bool? HasChanges;
ProposalDiff({this.TasksAdded,this.TasksRemoved,this.Tasks,this.HasChanges});
ProposalDiff.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
TasksAdded = JsonConverters.fromJson(json['TasksAdded'],'List<String>',context!);
TasksRemoved = JsonConverters.fromJson(json['TasksRemoved'],'List<String>',context!);
Tasks = JsonConverters.fromJson(json['Tasks'],'List<TaskDiff>',context!);
HasChanges = json['HasChanges'];
return this;
}
Map<String, dynamic> toJson() => {
'TasksAdded': JsonConverters.toJson(TasksAdded,'List<String>',context!),
'TasksRemoved': JsonConverters.toJson(TasksRemoved,'List<String>',context!),
'Tasks': JsonConverters.toJson(Tasks,'List<TaskDiff>',context!),
'HasChanges': HasChanges
};
getTypeName() => "ProposalDiff";
TypeContext? context = _ctx;
}
class RfpApproveResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
int? RfpDocumentID;
int? ProjectID;
String? ProjectUID;
int? RfpApprovalID;
List<int>? JobIDs = [];
int? OpenPositionCount;
ProposalDiff? Diff;
RfpApproveResponse({this.ResponseStatus,this.RfpDocumentID,this.ProjectID,this.ProjectUID,this.RfpApprovalID,this.JobIDs,this.OpenPositionCount,this.Diff});
RfpApproveResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
RfpDocumentID = json['RfpDocumentID'];
ProjectID = json['ProjectID'];
ProjectUID = json['ProjectUID'];
RfpApprovalID = json['RfpApprovalID'];
JobIDs = JsonConverters.fromJson(json['JobIDs'],'List<int>',context!);
OpenPositionCount = json['OpenPositionCount'];
Diff = JsonConverters.fromJson(json['Diff'],'ProposalDiff',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'RfpDocumentID': RfpDocumentID,
'ProjectID': ProjectID,
'ProjectUID': ProjectUID,
'RfpApprovalID': RfpApprovalID,
'JobIDs': JsonConverters.toJson(JobIDs,'List<int>',context!),
'OpenPositionCount': OpenPositionCount,
'Diff': JsonConverters.toJson(Diff,'ProposalDiff',context!)
};
getTypeName() => "RfpApproveResponse";
TypeContext? context = _ctx;
}
class ResourcedPosition implements IConvertible
{
String? PositionTag;
double? Hours;
int? Headcount;
String? SourceReference;
String? Notes;
bool? IsInCatalog;
int? ContactID;
ResourcedPosition({this.PositionTag,this.Hours,this.Headcount,this.SourceReference,this.Notes,this.IsInCatalog,this.ContactID});
ResourcedPosition.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
PositionTag = json['PositionTag'];
Hours = JsonConverters.toDouble(json['Hours']);
Headcount = json['Headcount'];
SourceReference = json['SourceReference'];
Notes = json['Notes'];
IsInCatalog = json['IsInCatalog'];
ContactID = json['ContactID'];
return this;
}
Map<String, dynamic> toJson() => {
'PositionTag': PositionTag,
'Hours': Hours,
'Headcount': Headcount,
'SourceReference': SourceReference,
'Notes': Notes,
'IsInCatalog': IsInCatalog,
'ContactID': ContactID
};
getTypeName() => "ResourcedPosition";
TypeContext? context = _ctx;
}
class ResourcedEquipment implements IConvertible
{
int? EquipmentID;
String? EquipmentName;
String? MakeModel;
double? Quantity;
double? DurationDays;
String? SourceReference;
String? Notes;
bool? IsInCatalog;
int? SuggestedEquipmentID;
String? SuggestedEquipmentName;
ResourcedEquipment({this.EquipmentID,this.EquipmentName,this.MakeModel,this.Quantity,this.DurationDays,this.SourceReference,this.Notes,this.IsInCatalog,this.SuggestedEquipmentID,this.SuggestedEquipmentName});
ResourcedEquipment.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
EquipmentID = json['EquipmentID'];
EquipmentName = json['EquipmentName'];
MakeModel = json['MakeModel'];
Quantity = JsonConverters.toDouble(json['Quantity']);
DurationDays = JsonConverters.toDouble(json['DurationDays']);
SourceReference = json['SourceReference'];
Notes = json['Notes'];
IsInCatalog = json['IsInCatalog'];
SuggestedEquipmentID = json['SuggestedEquipmentID'];
SuggestedEquipmentName = json['SuggestedEquipmentName'];
return this;
}
Map<String, dynamic> toJson() => {
'EquipmentID': EquipmentID,
'EquipmentName': EquipmentName,
'MakeModel': MakeModel,
'Quantity': Quantity,
'DurationDays': DurationDays,
'SourceReference': SourceReference,
'Notes': Notes,
'IsInCatalog': IsInCatalog,
'SuggestedEquipmentID': SuggestedEquipmentID,
'SuggestedEquipmentName': SuggestedEquipmentName
};
getTypeName() => "ResourcedEquipment";
TypeContext? context = _ctx;
}
class ResourcedMaterial implements IConvertible
{
int? MaterialID;
String? MaterialName;
String? MakeModel;
double? Quantity;
String? Unit;
String? SourceReference;
String? Notes;
bool? IsInCatalog;
int? SuggestedMaterialID;
String? SuggestedMaterialName;
ResourcedMaterial({this.MaterialID,this.MaterialName,this.MakeModel,this.Quantity,this.Unit,this.SourceReference,this.Notes,this.IsInCatalog,this.SuggestedMaterialID,this.SuggestedMaterialName});
ResourcedMaterial.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
MaterialID = json['MaterialID'];
MaterialName = json['MaterialName'];
MakeModel = json['MakeModel'];
Quantity = JsonConverters.toDouble(json['Quantity']);
Unit = json['Unit'];
SourceReference = json['SourceReference'];
Notes = json['Notes'];
IsInCatalog = json['IsInCatalog'];
SuggestedMaterialID = json['SuggestedMaterialID'];
SuggestedMaterialName = json['SuggestedMaterialName'];
return this;
}
Map<String, dynamic> toJson() => {
'MaterialID': MaterialID,
'MaterialName': MaterialName,
'MakeModel': MakeModel,
'Quantity': Quantity,
'Unit': Unit,
'SourceReference': SourceReference,
'Notes': Notes,
'IsInCatalog': IsInCatalog,
'SuggestedMaterialID': SuggestedMaterialID,
'SuggestedMaterialName': SuggestedMaterialName
};
getTypeName() => "ResourcedMaterial";
TypeContext? context = _ctx;
}
class TaskResourcing implements IConvertible
{
List<ResourcedPosition>? Positions = [];
List<ResourcedEquipment>? Equipment = [];
List<ResourcedMaterial>? Materials = [];
TaskResourcing({this.Positions,this.Equipment,this.Materials});
TaskResourcing.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Positions = JsonConverters.fromJson(json['Positions'],'List<ResourcedPosition>',context!);
Equipment = JsonConverters.fromJson(json['Equipment'],'List<ResourcedEquipment>',context!);
Materials = JsonConverters.fromJson(json['Materials'],'List<ResourcedMaterial>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Positions': JsonConverters.toJson(Positions,'List<ResourcedPosition>',context!),
'Equipment': JsonConverters.toJson(Equipment,'List<ResourcedEquipment>',context!),
'Materials': JsonConverters.toJson(Materials,'List<ResourcedMaterial>',context!)
};
getTypeName() => "TaskResourcing";
TypeContext? context = _ctx;
}
class ProposedTask implements IConvertible
{
int? Seq;
String? Name;
String? Category;
double? Quantity;
String? Unit;
String? SourceItemNumber;
String? SourceReference;
String? Notes;
TaskResourcing? Resourcing;
double? DurationDays;
List<int>? DependsOn = [];
DateTime? EstimatedStartDate;
DateTime? EstimatedEndDate;
ProposedTask({this.Seq,this.Name,this.Category,this.Quantity,this.Unit,this.SourceItemNumber,this.SourceReference,this.Notes,this.Resourcing,this.DurationDays,this.DependsOn,this.EstimatedStartDate,this.EstimatedEndDate});
ProposedTask.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Seq = json['Seq'];
Name = json['Name'];
Category = json['Category'];
Quantity = JsonConverters.toDouble(json['Quantity']);
Unit = json['Unit'];
SourceItemNumber = json['SourceItemNumber'];
SourceReference = json['SourceReference'];
Notes = json['Notes'];
Resourcing = JsonConverters.fromJson(json['Resourcing'],'TaskResourcing',context!);
DurationDays = JsonConverters.toDouble(json['DurationDays']);
DependsOn = JsonConverters.fromJson(json['DependsOn'],'List<int>',context!);
EstimatedStartDate = JsonConverters.fromJson(json['EstimatedStartDate'],'DateTime',context!);
EstimatedEndDate = JsonConverters.fromJson(json['EstimatedEndDate'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Seq': Seq,
'Name': Name,
'Category': Category,
'Quantity': Quantity,
'Unit': Unit,
'SourceItemNumber': SourceItemNumber,
'SourceReference': SourceReference,
'Notes': Notes,
'Resourcing': JsonConverters.toJson(Resourcing,'TaskResourcing',context!),
'DurationDays': DurationDays,
'DependsOn': JsonConverters.toJson(DependsOn,'List<int>',context!),
'EstimatedStartDate': JsonConverters.toJson(EstimatedStartDate,'DateTime',context!),
'EstimatedEndDate': JsonConverters.toJson(EstimatedEndDate,'DateTime',context!)
};
getTypeName() => "ProposedTask";
TypeContext? context = _ctx;
}
class ProjectProposal implements IConvertible
{
int? RfpDocumentID;
String? ProjectName;
String? ClientName;
String? ProjectType;
String? ProjectLocation;
String? Scope;
String? ProjectDescription;
int? ContractDurationDays;
String? BidDueDate;
DateTime? EstimatedStartDate;
DateTime? EstimatedEndDate;
List<ProposedTask>? Tasks = [];
ProjectProposal({this.RfpDocumentID,this.ProjectName,this.ClientName,this.ProjectType,this.ProjectLocation,this.Scope,this.ProjectDescription,this.ContractDurationDays,this.BidDueDate,this.EstimatedStartDate,this.EstimatedEndDate,this.Tasks});
ProjectProposal.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
RfpDocumentID = json['RfpDocumentID'];
ProjectName = json['ProjectName'];
ClientName = json['ClientName'];
ProjectType = json['ProjectType'];
ProjectLocation = json['ProjectLocation'];
Scope = json['Scope'];
ProjectDescription = json['ProjectDescription'];
ContractDurationDays = json['ContractDurationDays'];
BidDueDate = json['BidDueDate'];
EstimatedStartDate = JsonConverters.fromJson(json['EstimatedStartDate'],'DateTime',context!);
EstimatedEndDate = JsonConverters.fromJson(json['EstimatedEndDate'],'DateTime',context!);
Tasks = JsonConverters.fromJson(json['Tasks'],'List<ProposedTask>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'RfpDocumentID': RfpDocumentID,
'ProjectName': ProjectName,
'ClientName': ClientName,
'ProjectType': ProjectType,
'ProjectLocation': ProjectLocation,
'Scope': Scope,
'ProjectDescription': ProjectDescription,
'ContractDurationDays': ContractDurationDays,
'BidDueDate': BidDueDate,
'EstimatedStartDate': JsonConverters.toJson(EstimatedStartDate,'DateTime',context!),
'EstimatedEndDate': JsonConverters.toJson(EstimatedEndDate,'DateTime',context!),
'Tasks': JsonConverters.toJson(Tasks,'List<ProposedTask>',context!)
};
getTypeName() => "ProjectProposal";
TypeContext? context = _ctx;
}
class RfpApproveRequest implements IConvertible
{
String? RfpDocumentUID;
ProjectProposal? Proposal;
RfpApproveRequest({this.RfpDocumentUID,this.Proposal});
RfpApproveRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
RfpDocumentUID = json['RfpDocumentUID'];
Proposal = JsonConverters.fromJson(json['Proposal'],'ProjectProposal',context!);
return this;
}
Map<String, dynamic> toJson() => {
'RfpDocumentUID': RfpDocumentUID,
'Proposal': JsonConverters.toJson(Proposal,'ProjectProposal',context!)
};
getTypeName() => "RfpApproveRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'TaskDiff': TypeInfo(TypeOf.Class, create:() => TaskDiff()),
'ProposalDiff': TypeInfo(TypeOf.Class, create:() => ProposalDiff()),
'List<TaskDiff>': TypeInfo(TypeOf.Class, create:() => <TaskDiff>[]),
'RfpApproveResponse': TypeInfo(TypeOf.Class, create:() => RfpApproveResponse()),
'ResourcedPosition': TypeInfo(TypeOf.Class, create:() => ResourcedPosition()),
'ResourcedEquipment': TypeInfo(TypeOf.Class, create:() => ResourcedEquipment()),
'ResourcedMaterial': TypeInfo(TypeOf.Class, create:() => ResourcedMaterial()),
'TaskResourcing': TypeInfo(TypeOf.Class, create:() => TaskResourcing()),
'List<ResourcedPosition>': TypeInfo(TypeOf.Class, create:() => <ResourcedPosition>[]),
'List<ResourcedEquipment>': TypeInfo(TypeOf.Class, create:() => <ResourcedEquipment>[]),
'List<ResourcedMaterial>': TypeInfo(TypeOf.Class, create:() => <ResourcedMaterial>[]),
'ProposedTask': TypeInfo(TypeOf.Class, create:() => ProposedTask()),
'ProjectProposal': TypeInfo(TypeOf.Class, create:() => ProjectProposal()),
'List<ProposedTask>': TypeInfo(TypeOf.Class, create:() => <ProposedTask>[]),
'RfpApproveRequest': TypeInfo(TypeOf.Class, create:() => RfpApproveRequest()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/Rfp/{RfpDocumentUID}/Approve HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"RfpDocumentUID":"00000000000000000000000000000000","Proposal":{"RfpDocumentID":0,"ProjectName":"String","ClientName":"String","ProjectType":"String","ProjectLocation":"String","Scope":"String","ProjectDescription":"String","ContractDurationDays":0,"BidDueDate":"String","EstimatedStartDate":"0001-01-01T00:00:00.0000000","EstimatedEndDate":"0001-01-01T00:00:00.0000000","Tasks":[{"Seq":0,"Name":"String","Category":"String","Quantity":0,"Unit":"String","SourceItemNumber":"String","SourceReference":"String","Notes":"String","Resourcing":{"Positions":[{"PositionTag":"String","Hours":0,"Headcount":0,"SourceReference":"String","Notes":"String","IsInCatalog":false,"ContactID":0}],"Equipment":[{"EquipmentID":0,"EquipmentName":"String","MakeModel":"String","Quantity":0,"DurationDays":0,"SourceReference":"String","Notes":"String","IsInCatalog":false,"SuggestedEquipmentID":0,"SuggestedEquipmentName":"String"}],"Materials":[{"MaterialID":0,"MaterialName":"String","MakeModel":"String","Quantity":0,"Unit":"String","SourceReference":"String","Notes":"String","IsInCatalog":false,"SuggestedMaterialID":0,"SuggestedMaterialName":"String"}]},"DurationDays":0,"DependsOn":[0],"EstimatedStartDate":"0001-01-01T00:00:00.0000000","EstimatedEndDate":"0001-01-01T00:00:00.0000000"}]}}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"RfpDocumentID":0,"ProjectID":0,"ProjectUID":"00000000000000000000000000000000","RfpApprovalID":0,"JobIDs":[0],"OpenPositionCount":0,"Diff":{"TasksAdded":["String"],"TasksRemoved":["String"],"Tasks":[{"TaskName":"String","PositionsAdded":["String"],"PositionsRemoved":["String"],"PositionsStaffed":["String"],"EquipmentAdded":[0],"EquipmentRemoved":[0],"MaterialsAdded":[0],"MaterialsRemoved":[0],"HasChanges":true}],"HasChanges":true}}