Mds.Api

<back to all web services

DiagramSingle

Requires Authentication
Requires any of the roles:dealer-api-mds, dealer-api-nop
The following routes are available for this service:
All Verbs/diagram-single/{DiagramId}
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class Coordinate implements IConvertible
{
    int? x1;
    int? y1;
    int? x2;
    int? y2;

    Coordinate({this.x1,this.y1,this.x2,this.y2});
    Coordinate.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        x1 = json['x1'];
        y1 = json['y1'];
        x2 = json['x2'];
        y2 = json['y2'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'x1': x1,
        'y1': y1,
        'x2': x2,
        'y2': y2
    };

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

class MyobStockItemMapping implements IConvertible
{
    int? StockItemId;
    int? Id;
    int? Number;
    String? InventoryId;
    int? GroupId;
    String? Name;
    double? RetailPrice;
    double? DealerPrice;
    double? TradePrice;
    double? RetailPriceNz;
    double? TradePriceNz;
    double? DealerPriceNz;
    String? SalesUom;
    String? StockingIndicator;
    String? Color;
    String? ColorCode;
    String? NoteText;
    List<Coordinate>? Coordinates;
    int? PartQuantity;
    int? AvaiableQuantity;
    bool? ShowAvailabilityPopUp;
    bool? IsFd;

    MyobStockItemMapping({this.StockItemId,this.Id,this.Number,this.InventoryId,this.GroupId,this.Name,this.RetailPrice,this.DealerPrice,this.TradePrice,this.RetailPriceNz,this.TradePriceNz,this.DealerPriceNz,this.SalesUom,this.StockingIndicator,this.Color,this.ColorCode,this.NoteText,this.Coordinates,this.PartQuantity,this.AvaiableQuantity,this.ShowAvailabilityPopUp,this.IsFd});
    MyobStockItemMapping.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        StockItemId = json['StockItemId'];
        Id = json['Id'];
        Number = json['Number'];
        InventoryId = json['InventoryId'];
        GroupId = json['GroupId'];
        Name = json['Name'];
        RetailPrice = JsonConverters.toDouble(json['RetailPrice']);
        DealerPrice = JsonConverters.toDouble(json['DealerPrice']);
        TradePrice = JsonConverters.toDouble(json['TradePrice']);
        RetailPriceNz = JsonConverters.toDouble(json['RetailPriceNz']);
        TradePriceNz = JsonConverters.toDouble(json['TradePriceNz']);
        DealerPriceNz = JsonConverters.toDouble(json['DealerPriceNz']);
        SalesUom = json['SalesUom'];
        StockingIndicator = json['StockingIndicator'];
        Color = json['Color'];
        ColorCode = json['ColorCode'];
        NoteText = json['NoteText'];
        Coordinates = JsonConverters.fromJson(json['Coordinates'],'List<Coordinate>',context!);
        PartQuantity = json['PartQuantity'];
        AvaiableQuantity = json['AvaiableQuantity'];
        ShowAvailabilityPopUp = json['ShowAvailabilityPopUp'];
        IsFd = json['IsFd'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'StockItemId': StockItemId,
        'Id': Id,
        'Number': Number,
        'InventoryId': InventoryId,
        'GroupId': GroupId,
        'Name': Name,
        'RetailPrice': RetailPrice,
        'DealerPrice': DealerPrice,
        'TradePrice': TradePrice,
        'RetailPriceNz': RetailPriceNz,
        'TradePriceNz': TradePriceNz,
        'DealerPriceNz': DealerPriceNz,
        'SalesUom': SalesUom,
        'StockingIndicator': StockingIndicator,
        'Color': Color,
        'ColorCode': ColorCode,
        'NoteText': NoteText,
        'Coordinates': JsonConverters.toJson(Coordinates,'List<Coordinate>',context!),
        'PartQuantity': PartQuantity,
        'AvaiableQuantity': AvaiableQuantity,
        'ShowAvailabilityPopUp': ShowAvailabilityPopUp,
        'IsFd': IsFd
    };

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

class DiagramSingleResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    List<MyobStockItemMapping>? Parts;

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

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

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

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

class DiagramSingle implements IConvertible
{
    int? DiagramId;

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

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

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

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

TypeContext _ctx = TypeContext(library: 'mds_api.mojomotorcycles.com.au', types: <String, TypeInfo> {
    'Coordinate': TypeInfo(TypeOf.Class, create:() => Coordinate()),
    'MyobStockItemMapping': TypeInfo(TypeOf.Class, create:() => MyobStockItemMapping()),
    'List<Coordinate>': TypeInfo(TypeOf.Class, create:() => <Coordinate>[]),
    'DiagramSingleResponse': TypeInfo(TypeOf.Class, create:() => DiagramSingleResponse()),
    'List<MyobStockItemMapping>': TypeInfo(TypeOf.Class, create:() => <MyobStockItemMapping>[]),
    'DiagramSingle': TypeInfo(TypeOf.Class, create:() => DiagramSingle()),
});

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

POST /diagram-single/{DiagramId} HTTP/1.1 
Host: mds-api.mojomotorcycles.com.au 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<DiagramSingle xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Mds.Api.ServiceModel">
  <DiagramId>0</DiagramId>
</DiagramSingle>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<DiagramSingleResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Mds.Api.ServiceModel">
  <Parts xmlns:d2p1="http://schemas.datacontract.org/2004/07/Tiptopweb.MojoPortal.Shared.Poco">
    <d2p1:MyobStockItemMapping>
      <d2p1:AvaiableQuantity>0</d2p1:AvaiableQuantity>
      <d2p1:Color>String</d2p1:Color>
      <d2p1:ColorCode>String</d2p1:ColorCode>
      <d2p1:Coordinates>
        <d2p1:Coordinate>
          <d2p1:x1>0</d2p1:x1>
          <d2p1:x2>0</d2p1:x2>
          <d2p1:y1>0</d2p1:y1>
          <d2p1:y2>0</d2p1:y2>
        </d2p1:Coordinate>
      </d2p1:Coordinates>
      <d2p1:DealerPrice>0</d2p1:DealerPrice>
      <d2p1:DealerPriceNz>0</d2p1:DealerPriceNz>
      <d2p1:GroupId>0</d2p1:GroupId>
      <d2p1:Id>0</d2p1:Id>
      <d2p1:InventoryId>String</d2p1:InventoryId>
      <d2p1:IsFd>false</d2p1:IsFd>
      <d2p1:Name>String</d2p1:Name>
      <d2p1:NoteText>String</d2p1:NoteText>
      <d2p1:Number>0</d2p1:Number>
      <d2p1:PartQuantity>0</d2p1:PartQuantity>
      <d2p1:RetailPrice>0</d2p1:RetailPrice>
      <d2p1:RetailPriceNz>0</d2p1:RetailPriceNz>
      <d2p1:SalesUom>String</d2p1:SalesUom>
      <d2p1:ShowAvailabilityPopUp>false</d2p1:ShowAvailabilityPopUp>
      <d2p1:StockItemId>0</d2p1:StockItemId>
      <d2p1:StockingIndicator>String</d2p1:StockingIndicator>
      <d2p1:TradePrice>0</d2p1:TradePrice>
      <d2p1:TradePriceNz>0</d2p1:TradePriceNz>
    </d2p1:MyobStockItemMapping>
  </Parts>
  <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>
</DiagramSingleResponse>