| GET,OPTIONS | /v1/Material/{MaterialID}/Projects |
|---|
import 'package:servicestack/servicestack.dart';
class Location implements IConvertible
{
String? Id;
String? ClientId;
String? Name;
String? Address1;
String? Address2;
String? City;
String? State;
String? Zip;
String? Phone;
String? Fax;
String? URL;
String? Email;
String? TimeZone;
bool? Active;
DateTime? EntDate;
DateTime? ModDate;
String? LocationImage;
Location({this.Id,this.ClientId,this.Name,this.Address1,this.Address2,this.City,this.State,this.Zip,this.Phone,this.Fax,this.URL,this.Email,this.TimeZone,this.Active,this.EntDate,this.ModDate,this.LocationImage});
Location.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
ClientId = json['ClientId'];
Name = json['Name'];
Address1 = json['Address1'];
Address2 = json['Address2'];
City = json['City'];
State = json['State'];
Zip = json['Zip'];
Phone = json['Phone'];
Fax = json['Fax'];
URL = json['URL'];
Email = json['Email'];
TimeZone = json['TimeZone'];
Active = json['Active'];
EntDate = JsonConverters.fromJson(json['EntDate'],'DateTime',context!);
ModDate = JsonConverters.fromJson(json['ModDate'],'DateTime',context!);
LocationImage = json['LocationImage'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'ClientId': ClientId,
'Name': Name,
'Address1': Address1,
'Address2': Address2,
'City': City,
'State': State,
'Zip': Zip,
'Phone': Phone,
'Fax': Fax,
'URL': URL,
'Email': Email,
'TimeZone': TimeZone,
'Active': Active,
'EntDate': JsonConverters.toJson(EntDate,'DateTime',context!),
'ModDate': JsonConverters.toJson(ModDate,'DateTime',context!),
'LocationImage': LocationImage
};
getTypeName() => "Location";
TypeContext? context = _ctx;
}
class Project implements IConvertible
{
int? ProjectID;
String? ProjectUID;
String? ProjectName;
String? ImageURL;
String? ImageKey;
String? ClientName;
String? ClientPhone;
String? ClientEmail;
bool? NotifyCustomerOnVisitCompletion;
int? ClientContactID;
int? ProjectManagerID;
String? ProjectManagerName;
DateTime? StartDate;
DateTime? EndDate;
DateTime? ActualStartDate;
DateTime? ActualEndDate;
int? JobCount;
int? CrewMemberCount;
String? CrewAvatarsJson;
String? CrewNamesSearch;
int? EquipmentCount;
int? MaterialCount;
int? ProjectStatusID;
String? ProjectStatusDescription;
double? Budget;
double? CostToDate;
String? ProjectLocation;
String? ProjectType;
String? ProjectSponsor;
String? CreatedBy;
DateTime? CreatedAt;
DateTime? UpdatedAt;
String? ProjectDescription;
String? Scope;
int? StatusId;
String? BranchId;
String? BranchName;
Location? Location;
Project({this.ProjectID,this.ProjectUID,this.ProjectName,this.ImageURL,this.ImageKey,this.ClientName,this.ClientPhone,this.ClientEmail,this.NotifyCustomerOnVisitCompletion,this.ClientContactID,this.ProjectManagerID,this.ProjectManagerName,this.StartDate,this.EndDate,this.ActualStartDate,this.ActualEndDate,this.JobCount,this.CrewMemberCount,this.CrewAvatarsJson,this.CrewNamesSearch,this.EquipmentCount,this.MaterialCount,this.ProjectStatusID,this.ProjectStatusDescription,this.Budget,this.CostToDate,this.ProjectLocation,this.ProjectType,this.ProjectSponsor,this.CreatedBy,this.CreatedAt,this.UpdatedAt,this.ProjectDescription,this.Scope,this.StatusId,this.BranchId,this.BranchName,this.Location});
Project.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ProjectID = json['ProjectID'];
ProjectUID = json['ProjectUID'];
ProjectName = json['ProjectName'];
ImageURL = json['ImageURL'];
ImageKey = json['ImageKey'];
ClientName = json['ClientName'];
ClientPhone = json['ClientPhone'];
ClientEmail = json['ClientEmail'];
NotifyCustomerOnVisitCompletion = json['NotifyCustomerOnVisitCompletion'];
ClientContactID = json['ClientContactID'];
ProjectManagerID = json['ProjectManagerID'];
ProjectManagerName = json['ProjectManagerName'];
StartDate = JsonConverters.fromJson(json['StartDate'],'DateTime',context!);
EndDate = JsonConverters.fromJson(json['EndDate'],'DateTime',context!);
ActualStartDate = JsonConverters.fromJson(json['ActualStartDate'],'DateTime',context!);
ActualEndDate = JsonConverters.fromJson(json['ActualEndDate'],'DateTime',context!);
JobCount = json['JobCount'];
CrewMemberCount = json['CrewMemberCount'];
CrewAvatarsJson = json['CrewAvatarsJson'];
CrewNamesSearch = json['CrewNamesSearch'];
EquipmentCount = json['EquipmentCount'];
MaterialCount = json['MaterialCount'];
ProjectStatusID = json['ProjectStatusID'];
ProjectStatusDescription = json['ProjectStatusDescription'];
Budget = JsonConverters.toDouble(json['Budget']);
CostToDate = JsonConverters.toDouble(json['CostToDate']);
ProjectLocation = json['ProjectLocation'];
ProjectType = json['ProjectType'];
ProjectSponsor = json['ProjectSponsor'];
CreatedBy = json['CreatedBy'];
CreatedAt = JsonConverters.fromJson(json['CreatedAt'],'DateTime',context!);
UpdatedAt = JsonConverters.fromJson(json['UpdatedAt'],'DateTime',context!);
ProjectDescription = json['ProjectDescription'];
Scope = json['Scope'];
StatusId = json['StatusId'];
BranchId = json['BranchId'];
BranchName = json['BranchName'];
Location = JsonConverters.fromJson(json['Location'],'Location',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ProjectID': ProjectID,
'ProjectUID': ProjectUID,
'ProjectName': ProjectName,
'ImageURL': ImageURL,
'ImageKey': ImageKey,
'ClientName': ClientName,
'ClientPhone': ClientPhone,
'ClientEmail': ClientEmail,
'NotifyCustomerOnVisitCompletion': NotifyCustomerOnVisitCompletion,
'ClientContactID': ClientContactID,
'ProjectManagerID': ProjectManagerID,
'ProjectManagerName': ProjectManagerName,
'StartDate': JsonConverters.toJson(StartDate,'DateTime',context!),
'EndDate': JsonConverters.toJson(EndDate,'DateTime',context!),
'ActualStartDate': JsonConverters.toJson(ActualStartDate,'DateTime',context!),
'ActualEndDate': JsonConverters.toJson(ActualEndDate,'DateTime',context!),
'JobCount': JobCount,
'CrewMemberCount': CrewMemberCount,
'CrewAvatarsJson': CrewAvatarsJson,
'CrewNamesSearch': CrewNamesSearch,
'EquipmentCount': EquipmentCount,
'MaterialCount': MaterialCount,
'ProjectStatusID': ProjectStatusID,
'ProjectStatusDescription': ProjectStatusDescription,
'Budget': Budget,
'CostToDate': CostToDate,
'ProjectLocation': ProjectLocation,
'ProjectType': ProjectType,
'ProjectSponsor': ProjectSponsor,
'CreatedBy': CreatedBy,
'CreatedAt': JsonConverters.toJson(CreatedAt,'DateTime',context!),
'UpdatedAt': JsonConverters.toJson(UpdatedAt,'DateTime',context!),
'ProjectDescription': ProjectDescription,
'Scope': Scope,
'StatusId': StatusId,
'BranchId': BranchId,
'BranchName': BranchName,
'Location': JsonConverters.toJson(Location,'Location',context!)
};
getTypeName() => "Project";
TypeContext? context = _ctx;
}
class MaterialProjectResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
List<Project>? Projects = [];
MaterialProjectResponse({this.ResponseStatus,this.Projects});
MaterialProjectResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
Projects = JsonConverters.fromJson(json['Projects'],'List<Project>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'Projects': JsonConverters.toJson(Projects,'List<Project>',context!)
};
getTypeName() => "MaterialProjectResponse";
TypeContext? context = _ctx;
}
class MaterialProjectRequest implements IConvertible
{
int? MaterialID;
MaterialProjectRequest({this.MaterialID});
MaterialProjectRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
MaterialID = json['MaterialID'];
return this;
}
Map<String, dynamic> toJson() => {
'MaterialID': MaterialID
};
getTypeName() => "MaterialProjectRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'Location': TypeInfo(TypeOf.Class, create:() => Location()),
'Project': TypeInfo(TypeOf.Class, create:() => Project()),
'MaterialProjectResponse': TypeInfo(TypeOf.Class, create:() => MaterialProjectResponse()),
'List<Project>': TypeInfo(TypeOf.Class, create:() => <Project>[]),
'MaterialProjectRequest': TypeInfo(TypeOf.Class, create:() => MaterialProjectRequest()),
});
Dart MaterialProjectRequest 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.
GET /v1/Material/{MaterialID}/Projects HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<MaterialProjectResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Projects>
<Project>
<ActualEndDate>0001-01-01T00:00:00</ActualEndDate>
<ActualStartDate>0001-01-01T00:00:00</ActualStartDate>
<BranchId>00000000-0000-0000-0000-000000000000</BranchId>
<BranchName>String</BranchName>
<Budget>0</Budget>
<ClientContactID>0</ClientContactID>
<ClientEmail>String</ClientEmail>
<ClientName>String</ClientName>
<ClientPhone>String</ClientPhone>
<CostToDate>0</CostToDate>
<CreatedAt>0001-01-01T00:00:00</CreatedAt>
<CreatedBy>String</CreatedBy>
<CrewAvatarsJson>String</CrewAvatarsJson>
<CrewMemberCount>0</CrewMemberCount>
<CrewNamesSearch>String</CrewNamesSearch>
<EndDate>0001-01-01T00:00:00</EndDate>
<EquipmentCount>0</EquipmentCount>
<ImageKey>String</ImageKey>
<ImageURL>String</ImageURL>
<JobCount>0</JobCount>
<Location>
<Active>false</Active>
<Address1>String</Address1>
<Address2>String</Address2>
<City>String</City>
<ClientId>00000000-0000-0000-0000-000000000000</ClientId>
<Email>String</Email>
<EntDate>0001-01-01T00:00:00</EntDate>
<Fax>String</Fax>
<Id>00000000-0000-0000-0000-000000000000</Id>
<LocationImage>String</LocationImage>
<ModDate>0001-01-01T00:00:00</ModDate>
<Name>String</Name>
<Phone>String</Phone>
<State>String</State>
<TimeZone>String</TimeZone>
<URL>String</URL>
<Zip>String</Zip>
</Location>
<MaterialCount>0</MaterialCount>
<NotifyCustomerOnVisitCompletion>false</NotifyCustomerOnVisitCompletion>
<ProjectDescription>String</ProjectDescription>
<ProjectID>0</ProjectID>
<ProjectLocation>String</ProjectLocation>
<ProjectManagerID>0</ProjectManagerID>
<ProjectManagerName>String</ProjectManagerName>
<ProjectName>String</ProjectName>
<ProjectSponsor>String</ProjectSponsor>
<ProjectStatusDescription>String</ProjectStatusDescription>
<ProjectStatusID>0</ProjectStatusID>
<ProjectType>String</ProjectType>
<ProjectUID>00000000-0000-0000-0000-000000000000</ProjectUID>
<Scope>String</Scope>
<StartDate>0001-01-01T00:00:00</StartDate>
<StatusId>0</StatusId>
<UpdatedAt>0001-01-01T00:00:00</UpdatedAt>
</Project>
</Projects>
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
</MaterialProjectResponse>