Mds.Api

<back to all web services

Diagram

Requires Authentication
Requires the role:dealer-api-mds
The following routes are available for this service:
All Verbs/diagram/{Guid}
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class DiagramImageDetail implements IConvertible
{
    String? Url;
    int? Width;
    int? Height;

    DiagramImageDetail({this.Url,this.Width,this.Height});
    DiagramImageDetail.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'Url': Url,
        'Width': Width,
        'Height': Height
    };

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

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 DiagramPartDetail implements IConvertible
{
    int? Number;
    String? PartName;
    String? PartId;
    String? ImageUrl;
    List<Coordinate>? Coordinates;

    DiagramPartDetail({this.Number,this.PartName,this.PartId,this.ImageUrl,this.Coordinates});
    DiagramPartDetail.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Number = json['Number'];
        PartName = json['PartName'];
        PartId = json['PartId'];
        ImageUrl = json['ImageUrl'];
        Coordinates = JsonConverters.fromJson(json['Coordinates'],'List<Coordinate>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Number': Number,
        'PartName': PartName,
        'PartId': PartId,
        'ImageUrl': ImageUrl,
        'Coordinates': JsonConverters.toJson(Coordinates,'List<Coordinate>',context!)
    };

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

class DiagramResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    String? Name;
    String? Guid;
    DateTime? DateLastUpdate;
    DiagramImageDetail? Image;
    List<DiagramPartDetail>? Parts;

    DiagramResponse({this.ResponseStatus,this.Name,this.Guid,this.DateLastUpdate,this.Image,this.Parts});
    DiagramResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        Name = json['Name'];
        Guid = json['Guid'];
        DateLastUpdate = JsonConverters.fromJson(json['DateLastUpdate'],'DateTime',context!);
        Image = JsonConverters.fromJson(json['Image'],'DiagramImageDetail',context!);
        Parts = JsonConverters.fromJson(json['Parts'],'List<DiagramPartDetail>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
        'Name': Name,
        'Guid': Guid,
        'DateLastUpdate': JsonConverters.toJson(DateLastUpdate,'DateTime',context!),
        'Image': JsonConverters.toJson(Image,'DiagramImageDetail',context!),
        'Parts': JsonConverters.toJson(Parts,'List<DiagramPartDetail>',context!)
    };

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

class Diagram implements IConvertible
{
    String? Guid;

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

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

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

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

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

Dart Diagram DTOs

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

HTTP + OTHER

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

POST /diagram/{Guid} HTTP/1.1 
Host: mds-api.mojomotorcycles.com.au 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"Guid":"00000000000000000000000000000000"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Name":"String","Guid":"00000000000000000000000000000000","DateLastUpdate":"\/Date(-62135596800000-0000)\/","Image":{"Url":"String","Width":0,"Height":0},"Parts":[{"Number":0,"PartName":"String","PartId":"String","ImageUrl":"String","Coordinates":[{"x1":0,"y1":0,"x2":0,"y2":0}]}]}