Field Squared API Services

<back to all web services

InventoryTransferRequest

The following routes are available for this service:
PUT/{Workspace}/v2/InventoryTransfer
import 'package:servicestack/servicestack.dart';

class InventoryTransaction implements IConvertible
{
    String? ItemTypeId;
    int? Qty;
    List<String>? Items;
    List<String>? SerialNumbers;
    bool? UseSerialNumbers;

    InventoryTransaction({this.ItemTypeId,this.Qty,this.Items,this.SerialNumbers,this.UseSerialNumbers});
    InventoryTransaction.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ItemTypeId = json['ItemTypeId'];
        Qty = json['Qty'];
        Items = JsonConverters.fromJson(json['Items'],'List<String>',context!);
        SerialNumbers = JsonConverters.fromJson(json['SerialNumbers'],'List<String>',context!);
        UseSerialNumbers = json['UseSerialNumbers'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ItemTypeId': ItemTypeId,
        'Qty': Qty,
        'Items': JsonConverters.toJson(Items,'List<String>',context!),
        'SerialNumbers': JsonConverters.toJson(SerialNumbers,'List<String>',context!),
        'UseSerialNumbers': UseSerialNumbers
    };

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

class InventoryTransferRequest implements IConvertible
{
    String? ObjectId;
    String? Workspace;
    String? Created;
    String? FromAsset;
    String? FromTask;
    String? ToAsset;
    String? ToTask;
    String? SubmittedBy;
    String? ApprovedBy;
    bool? Approved;
    String? Description;
    List<InventoryTransaction>? Transactions;

    InventoryTransferRequest({this.ObjectId,this.Workspace,this.Created,this.FromAsset,this.FromTask,this.ToAsset,this.ToTask,this.SubmittedBy,this.ApprovedBy,this.Approved,this.Description,this.Transactions});
    InventoryTransferRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ObjectId = json['ObjectId'];
        Workspace = json['Workspace'];
        Created = json['Created'];
        FromAsset = json['FromAsset'];
        FromTask = json['FromTask'];
        ToAsset = json['ToAsset'];
        ToTask = json['ToTask'];
        SubmittedBy = json['SubmittedBy'];
        ApprovedBy = json['ApprovedBy'];
        Approved = json['Approved'];
        Description = json['Description'];
        Transactions = JsonConverters.fromJson(json['Transactions'],'List<InventoryTransaction>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ObjectId': ObjectId,
        'Workspace': Workspace,
        'Created': Created,
        'FromAsset': FromAsset,
        'FromTask': FromTask,
        'ToAsset': ToAsset,
        'ToTask': ToTask,
        'SubmittedBy': SubmittedBy,
        'ApprovedBy': ApprovedBy,
        'Approved': Approved,
        'Description': Description,
        'Transactions': JsonConverters.toJson(Transactions,'List<InventoryTransaction>',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'dev.fieldsquared.com', types: <String, TypeInfo> {
    'InventoryTransaction': TypeInfo(TypeOf.Class, create:() => InventoryTransaction()),
    'InventoryTransferRequest': TypeInfo(TypeOf.Class, create:() => InventoryTransferRequest()),
    'List<InventoryTransaction>': TypeInfo(TypeOf.Class, create:() => <InventoryTransaction>[]),
});

Dart InventoryTransferRequest DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

PUT /{Workspace}/v2/InventoryTransfer HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"ObjectId":"String","Workspace":"String","Created":"String","FromAsset":"String","FromTask":"String","ToAsset":"String","ToTask":"String","SubmittedBy":"String","ApprovedBy":"String","Approved":false,"Description":"String","Transactions":[{"ItemTypeId":"String","Qty":0,"Items":["String"],"SerialNumbers":["String"],"UseSerialNumbers":false}]}