Trendsic Platform Service

<back to all web services

JobMaterialRequest

The following routes are available for this service:
PUT,OPTIONS/v1/Job/material
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class CalendarEvent implements IConvertible
{
    int? CalendarEventId;
    String? CalendarId;
    DateTime? EventStart;
    DateTime? EventEnd;
    String? Location;
    String? Summary;
    String? Description;
    int? EventTypeId;
    bool? Recurrence;
    String? RecurrenceFrequency;
    String? RecurrenceBy;
    String? RecurrenceByValue;
    DateTime? RecurrenceUntil;
    String? CreatedBy;
    String? CreatedByName;
    DateTime? DateCreated;
    String? ModifiedBy;
    DateTime? DateModified;
    bool? Deleted;
    String? TimeZone;
    int? Offset;
    DateTime? TextReminderSentDate;
    bool? Confirmed;
    String? ConfirmationTextId;
    String? FirstTextReminderId;
    String? SecondTextReminderId;
    String? LocationUID;
    DateTime? AgentReminderSentDate;
    int? ContactId;
    bool? IsPrivate;
    int? ProjectID;
    int? JobID;
    DateTime? ProjectStartDate;
    DateTime? ProjectEndDate;
    DateTime? MaxCrewEndDate;
    DateTime? MaxEquipmentEndDate;
    String? CheckInId;
    bool? AllDay;
    String? JobName;
    String? JobStatusName;
    int? JobStatusId;
    String? ProjectName;
    int? ResourceId;
    String? ResourceName;
    DateTime? Original_EventStart;
    bool? Original_Recurrence;
    String? Original_RecurrenceFrequency;
    String? Original_RecurrenceBy;
    String? Original_RecurrenceByValue;
    DateTime? Original_RecurrenceUntil;
    String? Checksum;

    CalendarEvent({this.CalendarEventId,this.CalendarId,this.EventStart,this.EventEnd,this.Location,this.Summary,this.Description,this.EventTypeId,this.Recurrence,this.RecurrenceFrequency,this.RecurrenceBy,this.RecurrenceByValue,this.RecurrenceUntil,this.CreatedBy,this.CreatedByName,this.DateCreated,this.ModifiedBy,this.DateModified,this.Deleted,this.TimeZone,this.Offset,this.TextReminderSentDate,this.Confirmed,this.ConfirmationTextId,this.FirstTextReminderId,this.SecondTextReminderId,this.LocationUID,this.AgentReminderSentDate,this.ContactId,this.IsPrivate,this.ProjectID,this.JobID,this.ProjectStartDate,this.ProjectEndDate,this.MaxCrewEndDate,this.MaxEquipmentEndDate,this.CheckInId,this.AllDay,this.JobName,this.JobStatusName,this.JobStatusId,this.ProjectName,this.ResourceId,this.ResourceName,this.Original_EventStart,this.Original_Recurrence,this.Original_RecurrenceFrequency,this.Original_RecurrenceBy,this.Original_RecurrenceByValue,this.Original_RecurrenceUntil,this.Checksum});
    CalendarEvent.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CalendarEventId = json['CalendarEventId'];
        CalendarId = json['CalendarId'];
        EventStart = JsonConverters.fromJson(json['EventStart'],'DateTime',context!);
        EventEnd = JsonConverters.fromJson(json['EventEnd'],'DateTime',context!);
        Location = json['Location'];
        Summary = json['Summary'];
        Description = json['Description'];
        EventTypeId = json['EventTypeId'];
        Recurrence = json['Recurrence'];
        RecurrenceFrequency = json['RecurrenceFrequency'];
        RecurrenceBy = json['RecurrenceBy'];
        RecurrenceByValue = json['RecurrenceByValue'];
        RecurrenceUntil = JsonConverters.fromJson(json['RecurrenceUntil'],'DateTime',context!);
        CreatedBy = json['CreatedBy'];
        CreatedByName = json['CreatedByName'];
        DateCreated = JsonConverters.fromJson(json['DateCreated'],'DateTime',context!);
        ModifiedBy = json['ModifiedBy'];
        DateModified = JsonConverters.fromJson(json['DateModified'],'DateTime',context!);
        Deleted = json['Deleted'];
        TimeZone = json['TimeZone'];
        Offset = json['Offset'];
        TextReminderSentDate = JsonConverters.fromJson(json['TextReminderSentDate'],'DateTime',context!);
        Confirmed = json['Confirmed'];
        ConfirmationTextId = json['ConfirmationTextId'];
        FirstTextReminderId = json['FirstTextReminderId'];
        SecondTextReminderId = json['SecondTextReminderId'];
        LocationUID = json['LocationUID'];
        AgentReminderSentDate = JsonConverters.fromJson(json['AgentReminderSentDate'],'DateTime',context!);
        ContactId = json['ContactId'];
        IsPrivate = json['IsPrivate'];
        ProjectID = json['ProjectID'];
        JobID = json['JobID'];
        ProjectStartDate = JsonConverters.fromJson(json['ProjectStartDate'],'DateTime',context!);
        ProjectEndDate = JsonConverters.fromJson(json['ProjectEndDate'],'DateTime',context!);
        MaxCrewEndDate = JsonConverters.fromJson(json['MaxCrewEndDate'],'DateTime',context!);
        MaxEquipmentEndDate = JsonConverters.fromJson(json['MaxEquipmentEndDate'],'DateTime',context!);
        CheckInId = json['CheckInId'];
        AllDay = json['AllDay'];
        JobName = json['JobName'];
        JobStatusName = json['JobStatusName'];
        JobStatusId = json['JobStatusId'];
        ProjectName = json['ProjectName'];
        ResourceId = json['ResourceId'];
        ResourceName = json['ResourceName'];
        Original_EventStart = JsonConverters.fromJson(json['Original_EventStart'],'DateTime',context!);
        Original_Recurrence = json['Original_Recurrence'];
        Original_RecurrenceFrequency = json['Original_RecurrenceFrequency'];
        Original_RecurrenceBy = json['Original_RecurrenceBy'];
        Original_RecurrenceByValue = json['Original_RecurrenceByValue'];
        Original_RecurrenceUntil = JsonConverters.fromJson(json['Original_RecurrenceUntil'],'DateTime',context!);
        Checksum = json['Checksum'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CalendarEventId': CalendarEventId,
        'CalendarId': CalendarId,
        'EventStart': JsonConverters.toJson(EventStart,'DateTime',context!),
        'EventEnd': JsonConverters.toJson(EventEnd,'DateTime',context!),
        'Location': Location,
        'Summary': Summary,
        'Description': Description,
        'EventTypeId': EventTypeId,
        'Recurrence': Recurrence,
        'RecurrenceFrequency': RecurrenceFrequency,
        'RecurrenceBy': RecurrenceBy,
        'RecurrenceByValue': RecurrenceByValue,
        'RecurrenceUntil': JsonConverters.toJson(RecurrenceUntil,'DateTime',context!),
        'CreatedBy': CreatedBy,
        'CreatedByName': CreatedByName,
        'DateCreated': JsonConverters.toJson(DateCreated,'DateTime',context!),
        'ModifiedBy': ModifiedBy,
        'DateModified': JsonConverters.toJson(DateModified,'DateTime',context!),
        'Deleted': Deleted,
        'TimeZone': TimeZone,
        'Offset': Offset,
        'TextReminderSentDate': JsonConverters.toJson(TextReminderSentDate,'DateTime',context!),
        'Confirmed': Confirmed,
        'ConfirmationTextId': ConfirmationTextId,
        'FirstTextReminderId': FirstTextReminderId,
        'SecondTextReminderId': SecondTextReminderId,
        'LocationUID': LocationUID,
        'AgentReminderSentDate': JsonConverters.toJson(AgentReminderSentDate,'DateTime',context!),
        'ContactId': ContactId,
        'IsPrivate': IsPrivate,
        'ProjectID': ProjectID,
        'JobID': JobID,
        'ProjectStartDate': JsonConverters.toJson(ProjectStartDate,'DateTime',context!),
        'ProjectEndDate': JsonConverters.toJson(ProjectEndDate,'DateTime',context!),
        'MaxCrewEndDate': JsonConverters.toJson(MaxCrewEndDate,'DateTime',context!),
        'MaxEquipmentEndDate': JsonConverters.toJson(MaxEquipmentEndDate,'DateTime',context!),
        'CheckInId': CheckInId,
        'AllDay': AllDay,
        'JobName': JobName,
        'JobStatusName': JobStatusName,
        'JobStatusId': JobStatusId,
        'ProjectName': ProjectName,
        'ResourceId': ResourceId,
        'ResourceName': ResourceName,
        'Original_EventStart': JsonConverters.toJson(Original_EventStart,'DateTime',context!),
        'Original_Recurrence': Original_Recurrence,
        'Original_RecurrenceFrequency': Original_RecurrenceFrequency,
        'Original_RecurrenceBy': Original_RecurrenceBy,
        'Original_RecurrenceByValue': Original_RecurrenceByValue,
        'Original_RecurrenceUntil': JsonConverters.toJson(Original_RecurrenceUntil,'DateTime',context!),
        'Checksum': Checksum
    };

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

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 Job implements IConvertible
{
    int? JobID;
    String? JobName;
    String? Description;
    int? JobTypeID;
    DateTime? ExpectedStartDate;
    DateTime? ActualStartDate;
    DateTime? ExpectedCompletionDate;
    DateTime? ActualEndDate;
    bool? Active;
    String? CreatedByUID;
    int? ProjectID;
    int? StatusId;
    bool? AdvancedScheduling;
    bool? ShowTimes;
    List<CalendarEvent>? Schedule = [];
    bool? HasScheduledWorkers;
    bool? HasScheduledPlaceholders;
    String? ClientApprovalStatus;
    double? InternalCost;
    double? CostToClient;
    Location? Location;
    int? ProjectLocationID;
    int? ProjectLocationAreaID;
    String? ProjectLocationName;
    String? ProjectLocationAddress1;
    String? ProjectLocationAddress2;
    String? ProjectLocationCity;
    String? ProjectLocationState;
    String? ProjectLocationZip;
    String? ProjectLocationAreaName;

    Job({this.JobID,this.JobName,this.Description,this.JobTypeID,this.ExpectedStartDate,this.ActualStartDate,this.ExpectedCompletionDate,this.ActualEndDate,this.Active,this.CreatedByUID,this.ProjectID,this.StatusId,this.AdvancedScheduling,this.ShowTimes,this.Schedule,this.HasScheduledWorkers,this.HasScheduledPlaceholders,this.ClientApprovalStatus,this.InternalCost,this.CostToClient,this.Location,this.ProjectLocationID,this.ProjectLocationAreaID,this.ProjectLocationName,this.ProjectLocationAddress1,this.ProjectLocationAddress2,this.ProjectLocationCity,this.ProjectLocationState,this.ProjectLocationZip,this.ProjectLocationAreaName});
    Job.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        JobID = json['JobID'];
        JobName = json['JobName'];
        Description = json['Description'];
        JobTypeID = json['JobTypeID'];
        ExpectedStartDate = JsonConverters.fromJson(json['ExpectedStartDate'],'DateTime',context!);
        ActualStartDate = JsonConverters.fromJson(json['ActualStartDate'],'DateTime',context!);
        ExpectedCompletionDate = JsonConverters.fromJson(json['ExpectedCompletionDate'],'DateTime',context!);
        ActualEndDate = JsonConverters.fromJson(json['ActualEndDate'],'DateTime',context!);
        Active = json['Active'];
        CreatedByUID = json['CreatedByUID'];
        ProjectID = json['ProjectID'];
        StatusId = json['StatusId'];
        AdvancedScheduling = json['AdvancedScheduling'];
        ShowTimes = json['ShowTimes'];
        Schedule = JsonConverters.fromJson(json['Schedule'],'List<CalendarEvent>',context!);
        HasScheduledWorkers = json['HasScheduledWorkers'];
        HasScheduledPlaceholders = json['HasScheduledPlaceholders'];
        ClientApprovalStatus = json['ClientApprovalStatus'];
        InternalCost = JsonConverters.toDouble(json['InternalCost']);
        CostToClient = JsonConverters.toDouble(json['CostToClient']);
        Location = JsonConverters.fromJson(json['Location'],'Location',context!);
        ProjectLocationID = json['ProjectLocationID'];
        ProjectLocationAreaID = json['ProjectLocationAreaID'];
        ProjectLocationName = json['ProjectLocationName'];
        ProjectLocationAddress1 = json['ProjectLocationAddress1'];
        ProjectLocationAddress2 = json['ProjectLocationAddress2'];
        ProjectLocationCity = json['ProjectLocationCity'];
        ProjectLocationState = json['ProjectLocationState'];
        ProjectLocationZip = json['ProjectLocationZip'];
        ProjectLocationAreaName = json['ProjectLocationAreaName'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'JobID': JobID,
        'JobName': JobName,
        'Description': Description,
        'JobTypeID': JobTypeID,
        'ExpectedStartDate': JsonConverters.toJson(ExpectedStartDate,'DateTime',context!),
        'ActualStartDate': JsonConverters.toJson(ActualStartDate,'DateTime',context!),
        'ExpectedCompletionDate': JsonConverters.toJson(ExpectedCompletionDate,'DateTime',context!),
        'ActualEndDate': JsonConverters.toJson(ActualEndDate,'DateTime',context!),
        'Active': Active,
        'CreatedByUID': CreatedByUID,
        'ProjectID': ProjectID,
        'StatusId': StatusId,
        'AdvancedScheduling': AdvancedScheduling,
        'ShowTimes': ShowTimes,
        'Schedule': JsonConverters.toJson(Schedule,'List<CalendarEvent>',context!),
        'HasScheduledWorkers': HasScheduledWorkers,
        'HasScheduledPlaceholders': HasScheduledPlaceholders,
        'ClientApprovalStatus': ClientApprovalStatus,
        'InternalCost': InternalCost,
        'CostToClient': CostToClient,
        'Location': JsonConverters.toJson(Location,'Location',context!),
        'ProjectLocationID': ProjectLocationID,
        'ProjectLocationAreaID': ProjectLocationAreaID,
        'ProjectLocationName': ProjectLocationName,
        'ProjectLocationAddress1': ProjectLocationAddress1,
        'ProjectLocationAddress2': ProjectLocationAddress2,
        'ProjectLocationCity': ProjectLocationCity,
        'ProjectLocationState': ProjectLocationState,
        'ProjectLocationZip': ProjectLocationZip,
        'ProjectLocationAreaName': ProjectLocationAreaName
    };

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

class JobResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    List<Job>? Job = [];
    bool? RequiresConfirm;

    JobResponse({this.ResponseStatus,this.Job,this.RequiresConfirm});
    JobResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class JobMaterialRequest implements IConvertible
{
    int? ProjectID;
    int? JobID;
    int? MaterialID;
    int? AddRemove;
    int? StatusId;
    int? Quantity;

    JobMaterialRequest({this.ProjectID,this.JobID,this.MaterialID,this.AddRemove,this.StatusId,this.Quantity});
    JobMaterialRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ProjectID = json['ProjectID'];
        JobID = json['JobID'];
        MaterialID = json['MaterialID'];
        AddRemove = json['AddRemove'];
        StatusId = json['StatusId'];
        Quantity = json['Quantity'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ProjectID': ProjectID,
        'JobID': JobID,
        'MaterialID': MaterialID,
        'AddRemove': AddRemove,
        'StatusId': StatusId,
        'Quantity': Quantity
    };

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'CalendarEvent': TypeInfo(TypeOf.Class, create:() => CalendarEvent()),
    'Location': TypeInfo(TypeOf.Class, create:() => Location()),
    'Job': TypeInfo(TypeOf.Class, create:() => Job()),
    'List<CalendarEvent>': TypeInfo(TypeOf.Class, create:() => <CalendarEvent>[]),
    'JobResponse': TypeInfo(TypeOf.Class, create:() => JobResponse()),
    'List<Job>': TypeInfo(TypeOf.Class, create:() => <Job>[]),
    'JobMaterialRequest': TypeInfo(TypeOf.Class, create:() => JobMaterialRequest()),
});

Dart JobMaterialRequest 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.

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

{
	ProjectID: 0,
	JobID: 0,
	MaterialID: 0,
	AddRemove: 0,
	StatusId: 0,
	Quantity: 0
}
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
		}
	},
	Job: 
	[
		{
			JobID: 0,
			JobName: String,
			Description: String,
			JobTypeID: 0,
			ExpectedStartDate: 0001-01-01,
			ActualStartDate: 0001-01-01,
			ExpectedCompletionDate: 0001-01-01,
			ActualEndDate: 0001-01-01,
			Active: False,
			CreatedByUID: 00000000000000000000000000000000,
			ProjectID: 0,
			StatusId: 0,
			AdvancedScheduling: False,
			ShowTimes: False,
			Schedule: 
			[
				{
					CalendarEventId: 0,
					CalendarId: 00000000000000000000000000000000,
					EventStart: 0001-01-01,
					EventEnd: 0001-01-01,
					Location: String,
					Summary: String,
					Description: String,
					EventTypeId: 0,
					Recurrence: False,
					RecurrenceFrequency: String,
					RecurrenceBy: String,
					RecurrenceByValue: String,
					RecurrenceUntil: 0001-01-01,
					CreatedBy: String,
					CreatedByName: String,
					DateCreated: 0001-01-01,
					ModifiedBy: String,
					DateModified: 0001-01-01,
					Deleted: False,
					TimeZone: String,
					Offset: 0,
					TextReminderSentDate: 0001-01-01,
					Confirmed: False,
					ConfirmationTextId: String,
					FirstTextReminderId: String,
					SecondTextReminderId: String,
					LocationUID: 00000000000000000000000000000000,
					AgentReminderSentDate: 0001-01-01,
					ContactId: 0,
					IsPrivate: False,
					ProjectID: 0,
					JobID: 0,
					ProjectStartDate: 0001-01-01,
					ProjectEndDate: 0001-01-01,
					MaxCrewEndDate: 0001-01-01,
					MaxEquipmentEndDate: 0001-01-01,
					CheckInId: 00000000000000000000000000000000,
					AllDay: False,
					JobName: String,
					JobStatusName: String,
					JobStatusId: 0,
					ProjectName: String,
					ResourceId: 0,
					ResourceName: String,
					Original_EventStart: 0001-01-01,
					Original_Recurrence: False,
					Original_RecurrenceFrequency: String,
					Original_RecurrenceBy: String,
					Original_RecurrenceByValue: String,
					Original_RecurrenceUntil: 0001-01-01,
					Checksum: String
				}
			],
			HasScheduledWorkers: False,
			HasScheduledPlaceholders: False,
			ClientApprovalStatus: String,
			InternalCost: 0,
			CostToClient: 0,
			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
			},
			ProjectLocationID: 0,
			ProjectLocationAreaID: 0,
			ProjectLocationName: String,
			ProjectLocationAddress1: String,
			ProjectLocationAddress2: String,
			ProjectLocationCity: String,
			ProjectLocationState: String,
			ProjectLocationZip: String,
			ProjectLocationAreaName: String
		}
	],
	RequiresConfirm: False
}