Trendsic Platform Service

<back to all web services

ProjectRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/Project/GetSingle/{ProjectUID}
GET,POST,PUT,DELETE,OPTIONS/v1/Project
GET,POST,PUT,DELETE,OPTIONS/v1/Project/{ProjectID}
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 ProjectResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    List<Project>? Project = [];

    ProjectResponse({this.ResponseStatus,this.Project});
    ProjectResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        Project = JsonConverters.fromJson(json['Project'],'List<Project>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
        'Project': JsonConverters.toJson(Project,'List<Project>',context!)
    };

    getTypeName() => "ProjectResponse";
    TypeContext? context = _ctx;
}

class ProjectRequest implements IConvertible
{
    String? ProjectUID;
    int? ProjectID;
    List<Project>? Project = [];

    ProjectRequest({this.ProjectUID,this.ProjectID,this.Project});
    ProjectRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ProjectUID = json['ProjectUID'];
        ProjectID = json['ProjectID'];
        Project = JsonConverters.fromJson(json['Project'],'List<Project>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ProjectUID': ProjectUID,
        'ProjectID': ProjectID,
        'Project': JsonConverters.toJson(Project,'List<Project>',context!)
    };

    getTypeName() => "ProjectRequest";
    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()),
    'ProjectResponse': TypeInfo(TypeOf.Class, create:() => ProjectResponse()),
    'List<Project>': TypeInfo(TypeOf.Class, create:() => <Project>[]),
    'ProjectRequest': TypeInfo(TypeOf.Class, create:() => ProjectRequest()),
});

Dart ProjectRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/Project HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	ProjectUID: 00000000000000000000000000000000,
	ProjectID: 0,
	Project: 
	[
		{
			ProjectID: 0,
			ProjectUID: 00000000000000000000000000000000,
			ProjectName: String,
			ImageURL: String,
			ImageKey: String,
			ClientName: String,
			ClientPhone: String,
			ClientEmail: String,
			NotifyCustomerOnVisitCompletion: False,
			ClientContactID: 0,
			ProjectManagerID: 0,
			ProjectManagerName: String,
			StartDate: 0001-01-01,
			EndDate: 0001-01-01,
			ActualStartDate: 0001-01-01,
			ActualEndDate: 0001-01-01,
			JobCount: 0,
			CrewMemberCount: 0,
			CrewAvatarsJson: String,
			CrewNamesSearch: String,
			EquipmentCount: 0,
			MaterialCount: 0,
			ProjectStatusID: 0,
			ProjectStatusDescription: String,
			Budget: 0,
			CostToDate: 0,
			ProjectLocation: String,
			ProjectType: String,
			ProjectSponsor: String,
			CreatedBy: String,
			CreatedAt: 0001-01-01,
			UpdatedAt: 0001-01-01,
			ProjectDescription: String,
			Scope: String,
			StatusId: 0,
			BranchId: 00000000000000000000000000000000,
			BranchName: String,
			Location: 
			{
				Id: 00000000000000000000000000000000,
				ClientId: 00000000000000000000000000000000,
				Name: String,
				Address1: String,
				Address2: String,
				City: String,
				State: String,
				Zip: String,
				Phone: String,
				Fax: String,
				URL: String,
				Email: String,
				TimeZone: String,
				Active: False,
				EntDate: 0001-01-01,
				ModDate: 0001-01-01,
				LocationImage: String
			}
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	Project: 
	[
		{
			ProjectID: 0,
			ProjectUID: 00000000000000000000000000000000,
			ProjectName: String,
			ImageURL: String,
			ImageKey: String,
			ClientName: String,
			ClientPhone: String,
			ClientEmail: String,
			NotifyCustomerOnVisitCompletion: False,
			ClientContactID: 0,
			ProjectManagerID: 0,
			ProjectManagerName: String,
			StartDate: 0001-01-01,
			EndDate: 0001-01-01,
			ActualStartDate: 0001-01-01,
			ActualEndDate: 0001-01-01,
			JobCount: 0,
			CrewMemberCount: 0,
			CrewAvatarsJson: String,
			CrewNamesSearch: String,
			EquipmentCount: 0,
			MaterialCount: 0,
			ProjectStatusID: 0,
			ProjectStatusDescription: String,
			Budget: 0,
			CostToDate: 0,
			ProjectLocation: String,
			ProjectType: String,
			ProjectSponsor: String,
			CreatedBy: String,
			CreatedAt: 0001-01-01,
			UpdatedAt: 0001-01-01,
			ProjectDescription: String,
			Scope: String,
			StatusId: 0,
			BranchId: 00000000000000000000000000000000,
			BranchName: String,
			Location: 
			{
				Id: 00000000000000000000000000000000,
				ClientId: 00000000000000000000000000000000,
				Name: String,
				Address1: String,
				Address2: String,
				City: String,
				State: String,
				Zip: String,
				Phone: String,
				Fax: String,
				URL: String,
				Email: String,
				TimeZone: String,
				Active: False,
				EntDate: 0001-01-01,
				ModDate: 0001-01-01,
				LocationImage: String
			}
		}
	]
}