Trendsic Platform Service

<back to all web services

SalesPackageRequest

The following routes are available for this service:
GET/v1/SalesPackage
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class SalesPackage implements IConvertible
{
    int? ID;
    String? PackageName;
    String? HashingPower;
    int? ControllerType;
    int? ControllerQuantity;
    int? MinerType;
    int? MinerQuantity;
    double? Price;
    String? Description;
    String? ImageURL;
    String? SpecialSaleText;
    double? ShipPrice;
    double? DiscountPrice;

    SalesPackage({this.ID,this.PackageName,this.HashingPower,this.ControllerType,this.ControllerQuantity,this.MinerType,this.MinerQuantity,this.Price,this.Description,this.ImageURL,this.SpecialSaleText,this.ShipPrice,this.DiscountPrice});
    SalesPackage.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ID = json['ID'];
        PackageName = json['PackageName'];
        HashingPower = json['HashingPower'];
        ControllerType = json['ControllerType'];
        ControllerQuantity = json['ControllerQuantity'];
        MinerType = json['MinerType'];
        MinerQuantity = json['MinerQuantity'];
        Price = JsonConverters.toDouble(json['Price']);
        Description = json['Description'];
        ImageURL = json['ImageURL'];
        SpecialSaleText = json['SpecialSaleText'];
        ShipPrice = JsonConverters.toDouble(json['ShipPrice']);
        DiscountPrice = JsonConverters.toDouble(json['DiscountPrice']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ID': ID,
        'PackageName': PackageName,
        'HashingPower': HashingPower,
        'ControllerType': ControllerType,
        'ControllerQuantity': ControllerQuantity,
        'MinerType': MinerType,
        'MinerQuantity': MinerQuantity,
        'Price': Price,
        'Description': Description,
        'ImageURL': ImageURL,
        'SpecialSaleText': SpecialSaleText,
        'ShipPrice': ShipPrice,
        'DiscountPrice': DiscountPrice
    };

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

class SalesPackageResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    List<SalesPackage>? SalesPackage = [];

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

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

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

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

class SalesPackageRequest implements IConvertible
{
    List<SalesPackage>? SalesPackage = [];

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

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

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

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'SalesPackage': TypeInfo(TypeOf.Class, create:() => SalesPackage()),
    'SalesPackageResponse': TypeInfo(TypeOf.Class, create:() => SalesPackageResponse()),
    'List<SalesPackage>': TypeInfo(TypeOf.Class, create:() => <SalesPackage>[]),
    'SalesPackageRequest': TypeInfo(TypeOf.Class, create:() => SalesPackageRequest()),
});

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

GET /v1/SalesPackage HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsonl
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"}},"SalesPackage":[{"ID":0,"PackageName":"String","HashingPower":"String","ControllerType":0,"ControllerQuantity":0,"MinerType":0,"MinerQuantity":0,"Price":0,"Description":"String","ImageURL":"String","SpecialSaleText":"String","ShipPrice":0,"DiscountPrice":0}]}