OSZZ API

<back to all web services

Search2

The following routes are available for this service:
GET, POST/2/search
import 'package:servicestack/servicestack.dart';

// @DataContract
class Search2Response implements IResponse, IConvertible
{
    // @DataMember
    ResponseStatus? responseStatus;

    // @DataMember
    List<PriceListModel>? result;

    Search2Response({this.responseStatus,this.result});
    Search2Response.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

// @DataContract
class Search2 implements IConvertible
{
    // @DataMember
    String? q;

    // @DataMember
    String? tokenId;

    Search2({this.q,this.tokenId});
    Search2.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

// @DataContract
class PriceListModel extends PriceListModel implements IConvertible
{
    // @DataMember
    bool? isOriginal;

    // @DataMember
    int? groupId;

    PriceListModel({this.isOriginal,this.groupId});
    PriceListModel.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        isOriginal = json['isOriginal'];
        groupId = json['groupId'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'isOriginal': isOriginal,
        'groupId': groupId
    });

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

// @DataContract
class PriceListModel implements IConvertible
{
    // @DataMember
    String? productId;

    // @DataMember
    String? manufacturerTitle;

    // @DataMember
    String? productNumber;

    // @DataMember
    String? productTitle;

    // @DataMember
    String? priceListId;

    // @DataMember
    String? code;

    // @DataMember
    String? delivery;

    // @DataMember
    String? location;

    // @DataMember
    int? expectedDeliveryDays;

    // @DataMember
    int? guaranteedDeliveryDays;

    // @DataMember
    int? quantity;

    // @DataMember
    int? pack;

    // @DataMember
    double? price;

    // @DataMember
    bool? useSchedule;

    // @DataMember
    DateTime? orderDate;

    // @DataMember
    DateTime? deliveryDate;

    // @DataMember
    double? deliveryChance;

    PriceListModel({this.productId,this.manufacturerTitle,this.productNumber,this.productTitle,this.priceListId,this.code,this.delivery,this.location,this.expectedDeliveryDays,this.guaranteedDeliveryDays,this.quantity,this.pack,this.price,this.useSchedule,this.orderDate,this.deliveryDate,this.deliveryChance});
    PriceListModel.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        productId = json['productId'];
        manufacturerTitle = json['manufacturerTitle'];
        productNumber = json['productNumber'];
        productTitle = json['productTitle'];
        priceListId = json['priceListId'];
        code = json['code'];
        delivery = json['delivery'];
        location = json['location'];
        expectedDeliveryDays = json['expectedDeliveryDays'];
        guaranteedDeliveryDays = json['guaranteedDeliveryDays'];
        quantity = json['quantity'];
        pack = json['pack'];
        price = JsonConverters.toDouble(json['price']);
        useSchedule = json['useSchedule'];
        orderDate = JsonConverters.fromJson(json['orderDate'],'DateTime',context!);
        deliveryDate = JsonConverters.fromJson(json['deliveryDate'],'DateTime',context!);
        deliveryChance = JsonConverters.toDouble(json['deliveryChance']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'productId': productId,
        'manufacturerTitle': manufacturerTitle,
        'productNumber': productNumber,
        'productTitle': productTitle,
        'priceListId': priceListId,
        'code': code,
        'delivery': delivery,
        'location': location,
        'expectedDeliveryDays': expectedDeliveryDays,
        'guaranteedDeliveryDays': guaranteedDeliveryDays,
        'quantity': quantity,
        'pack': pack,
        'price': price,
        'useSchedule': useSchedule,
        'orderDate': JsonConverters.toJson(orderDate,'DateTime',context!),
        'deliveryDate': JsonConverters.toJson(deliveryDate,'DateTime',context!),
        'deliveryChance': deliveryChance
    };

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

TypeContext _ctx = TypeContext(library: 'api.oszz.ru', types: <String, TypeInfo> {
    'Search2Response': TypeInfo(TypeOf.Class, create:() => Search2Response()),
    'List<PriceListModel>': TypeInfo(TypeOf.Class, create:() => <PriceListModel>[]),
    'PriceListModel': TypeInfo(TypeOf.Class, create:() => PriceListModel()),
    'Search2': TypeInfo(TypeOf.Class, create:() => Search2()),
});

Dart Search2 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 /2/search HTTP/1.1 
Host: api.oszz.ru 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<Search2 xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
  <Q>String</Q>
  <TokenId>00000000-0000-0000-0000-000000000000</TokenId>
</Search2>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<Search2Response xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
  <ResponseStatus>
    <ErrorCode>String</ErrorCode>
    <Message>String</Message>
    <StackTrace>String</StackTrace>
    <Errors>
      <ResponseError>
        <ErrorCode>String</ErrorCode>
        <FieldName>String</FieldName>
        <Message>String</Message>
        <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>
        </Meta>
      </ResponseError>
    </Errors>
    <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>
    </Meta>
  </ResponseStatus>
  <Result xmlns:d2p1="http://schemas.datacontract.org/2004/07/Oszz.Api.Models.v2">
    <d2p1:PriceListModel>
      <Code>String</Code>
      <Delivery>String</Delivery>
      <DeliveryChance>0</DeliveryChance>
      <DeliveryDate>0001-01-01T00:00:00</DeliveryDate>
      <ExpectedDeliveryDays>0</ExpectedDeliveryDays>
      <GuaranteedDeliveryDays>0</GuaranteedDeliveryDays>
      <Location>String</Location>
      <ManufacturerTitle>String</ManufacturerTitle>
      <OrderDate>0001-01-01T00:00:00</OrderDate>
      <Pack>0</Pack>
      <Price>0</Price>
      <PriceListId>00000000-0000-0000-0000-000000000000</PriceListId>
      <ProductId>00000000-0000-0000-0000-000000000000</ProductId>
      <ProductNumber>String</ProductNumber>
      <ProductTitle>String</ProductTitle>
      <Quantity>0</Quantity>
      <UseSchedule>false</UseSchedule>
      <d2p1:GroupId>0</d2p1:GroupId>
      <d2p1:IsOriginal>false</d2p1:IsOriginal>
    </d2p1:PriceListModel>
  </Result>
</Search2Response>