Trendsic Platform Service

<back to all web services

PmJobRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/pm/job/{JobID}
import 'package:servicestack/servicestack.dart';

class PmJobCrew implements IConvertible
{
    int? ContactID;
    String? Name;
    double? Rate;
    double? BudgetedHours;
    bool? IsOpen;

    PmJobCrew({this.ContactID,this.Name,this.Rate,this.BudgetedHours,this.IsOpen});
    PmJobCrew.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ContactID = json['ContactID'];
        Name = json['Name'];
        Rate = JsonConverters.toDouble(json['Rate']);
        BudgetedHours = JsonConverters.toDouble(json['BudgetedHours']);
        IsOpen = json['IsOpen'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ContactID': ContactID,
        'Name': Name,
        'Rate': Rate,
        'BudgetedHours': BudgetedHours,
        'IsOpen': IsOpen
    };

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

class PmJobResource implements IConvertible
{
    int? Id;
    String? Name;
    double? Amount;
    int? Qty;
    String? Unit;

    PmJobResource({this.Id,this.Name,this.Amount,this.Qty,this.Unit});
    PmJobResource.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Name = json['Name'];
        Amount = JsonConverters.toDouble(json['Amount']);
        Qty = json['Qty'];
        Unit = json['Unit'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Name': Name,
        'Amount': Amount,
        'Qty': Qty,
        'Unit': Unit
    };

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

class PmJob implements IConvertible
{
    int? JobID;
    String? Name;
    String? Description;
    String? Status;
    String? StartDate;
    String? EndDate;
    int? CrewCount;
    double? BudgetedHours;
    int? EquipmentCount;
    int? MaterialCount;
    double? CrewCost;
    double? EquipCost;
    double? MatCost;
    double? Cost;
    bool? NoCrew;
    bool? EquipConflict;
    bool? MaterialGap;
    int? ReadyPct;
    String? Priority;
    List<String>? Tags = [];
    List<PmJobCrew>? Crew = [];
    List<PmJobResource>? Equipment = [];
    List<PmJobResource>? Materials = [];

    PmJob({this.JobID,this.Name,this.Description,this.Status,this.StartDate,this.EndDate,this.CrewCount,this.BudgetedHours,this.EquipmentCount,this.MaterialCount,this.CrewCost,this.EquipCost,this.MatCost,this.Cost,this.NoCrew,this.EquipConflict,this.MaterialGap,this.ReadyPct,this.Priority,this.Tags,this.Crew,this.Equipment,this.Materials});
    PmJob.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        JobID = json['JobID'];
        Name = json['Name'];
        Description = json['Description'];
        Status = json['Status'];
        StartDate = json['StartDate'];
        EndDate = json['EndDate'];
        CrewCount = json['CrewCount'];
        BudgetedHours = JsonConverters.toDouble(json['BudgetedHours']);
        EquipmentCount = json['EquipmentCount'];
        MaterialCount = json['MaterialCount'];
        CrewCost = JsonConverters.toDouble(json['CrewCost']);
        EquipCost = JsonConverters.toDouble(json['EquipCost']);
        MatCost = JsonConverters.toDouble(json['MatCost']);
        Cost = JsonConverters.toDouble(json['Cost']);
        NoCrew = json['NoCrew'];
        EquipConflict = json['EquipConflict'];
        MaterialGap = json['MaterialGap'];
        ReadyPct = json['ReadyPct'];
        Priority = json['Priority'];
        Tags = JsonConverters.fromJson(json['Tags'],'List<String>',context!);
        Crew = JsonConverters.fromJson(json['Crew'],'List<PmJobCrew>',context!);
        Equipment = JsonConverters.fromJson(json['Equipment'],'List<PmJobResource>',context!);
        Materials = JsonConverters.fromJson(json['Materials'],'List<PmJobResource>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'JobID': JobID,
        'Name': Name,
        'Description': Description,
        'Status': Status,
        'StartDate': StartDate,
        'EndDate': EndDate,
        'CrewCount': CrewCount,
        'BudgetedHours': BudgetedHours,
        'EquipmentCount': EquipmentCount,
        'MaterialCount': MaterialCount,
        'CrewCost': CrewCost,
        'EquipCost': EquipCost,
        'MatCost': MatCost,
        'Cost': Cost,
        'NoCrew': NoCrew,
        'EquipConflict': EquipConflict,
        'MaterialGap': MaterialGap,
        'ReadyPct': ReadyPct,
        'Priority': Priority,
        'Tags': JsonConverters.toJson(Tags,'List<String>',context!),
        'Crew': JsonConverters.toJson(Crew,'List<PmJobCrew>',context!),
        'Equipment': JsonConverters.toJson(Equipment,'List<PmJobResource>',context!),
        'Materials': JsonConverters.toJson(Materials,'List<PmJobResource>',context!)
    };

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

class PmJobResponse implements IConvertible
{
    PmJob? Job;
    ResponseStatus? ResponseStatus;

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

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

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

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

class PmJobRequest implements IConvertible
{
    int? JobID;

    PmJobRequest({this.JobID});
    PmJobRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'JobID': JobID
    };

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'PmJobCrew': TypeInfo(TypeOf.Class, create:() => PmJobCrew()),
    'PmJobResource': TypeInfo(TypeOf.Class, create:() => PmJobResource()),
    'PmJob': TypeInfo(TypeOf.Class, create:() => PmJob()),
    'List<PmJobCrew>': TypeInfo(TypeOf.Class, create:() => <PmJobCrew>[]),
    'List<PmJobResource>': TypeInfo(TypeOf.Class, create:() => <PmJobResource>[]),
    'PmJobResponse': TypeInfo(TypeOf.Class, create:() => PmJobResponse()),
    'PmJobRequest': TypeInfo(TypeOf.Class, create:() => PmJobRequest()),
});

Dart PmJobRequest DTOs

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

HTTP + XML

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

GET /v1/pm/job/{JobID} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<PmJobResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Job>
    <BudgetedHours>0</BudgetedHours>
    <Cost>0</Cost>
    <Crew>
      <PmJobCrew>
        <BudgetedHours>0</BudgetedHours>
        <ContactID>0</ContactID>
        <IsOpen>false</IsOpen>
        <Name>String</Name>
        <Rate>0</Rate>
      </PmJobCrew>
    </Crew>
    <CrewCost>0</CrewCost>
    <CrewCount>0</CrewCount>
    <Description>String</Description>
    <EndDate>String</EndDate>
    <EquipConflict>false</EquipConflict>
    <EquipCost>0</EquipCost>
    <Equipment>
      <PmJobResource>
        <Amount>0</Amount>
        <Id>0</Id>
        <Name>String</Name>
        <Qty>0</Qty>
        <Unit>String</Unit>
      </PmJobResource>
    </Equipment>
    <EquipmentCount>0</EquipmentCount>
    <JobID>0</JobID>
    <MatCost>0</MatCost>
    <MaterialCount>0</MaterialCount>
    <MaterialGap>false</MaterialGap>
    <Materials>
      <PmJobResource>
        <Amount>0</Amount>
        <Id>0</Id>
        <Name>String</Name>
        <Qty>0</Qty>
        <Unit>String</Unit>
      </PmJobResource>
    </Materials>
    <Name>String</Name>
    <NoCrew>false</NoCrew>
    <Priority>String</Priority>
    <ReadyPct>0</ReadyPct>
    <StartDate>String</StartDate>
    <Status>String</Status>
    <Tags xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </Tags>
  </Job>
  <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>
</PmJobResponse>