Trendsic Platform Service

<back to all web services

districtSearchRequest

The following routes are available for this service:
GET,OPTIONS/v1/districtSearch/{districtName}
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class OrganizationDropdown implements IConvertible
{
    String? ID;
    String? Name;

    OrganizationDropdown({this.ID,this.Name});
    OrganizationDropdown.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class districtSearchResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    List<OrganizationDropdown>? districts = [];

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

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

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

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

class districtSearchRequest implements IConvertible
{
    String? districtName;

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

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

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

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

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

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

GET /v1/districtSearch/{districtName} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"districts":[{"ID":"String","Name":"String"}]}