ASH.ResourceLibrary.WebApi

<back to all web services

FilterRequest

Requires Authentication
The following routes are available for this service:
GET/filtersGets the list of available filters
import 'package:servicestack/servicestack.dart';

class BasicResourceLibraryRequest implements IConvertible
{
    int? resourceLibraryMemberId;

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

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

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

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

class FilterRequest extends BasicResourceLibraryRequest implements IConvertible
{
    FilterRequest();
    FilterRequest.fromJson(Map<String, dynamic> json) : super.fromJson(json);
    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson();
    getTypeName() => "FilterRequest";
    TypeContext? context = _ctx;
}

class Filter implements IConvertible
{
    String? id;
    String? name;
    String? category;
    int? bitwiseId;

    Filter({this.id,this.name,this.category,this.bitwiseId});
    Filter.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        name = json['name'];
        category = json['category'];
        bitwiseId = json['bitwiseId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'name': name,
        'category': category,
        'bitwiseId': bitwiseId
    };

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

class FilterResponse implements IConvertible
{
    List<Filter>? filters;

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

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

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

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

TypeContext _ctx = TypeContext(library: 'resourcelibrary.api.ashcompanies.com', types: <String, TypeInfo> {
    'BasicResourceLibraryRequest': TypeInfo(TypeOf.Class, create:() => BasicResourceLibraryRequest()),
    'FilterRequest': TypeInfo(TypeOf.Class, create:() => FilterRequest()),
    'Filter': TypeInfo(TypeOf.Class, create:() => Filter()),
    'FilterResponse': TypeInfo(TypeOf.Class, create:() => FilterResponse()),
    'List<Filter>': TypeInfo(TypeOf.Class, create:() => <Filter>[]),
});

Dart FilterRequest DTOs

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

HTTP + CSV

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

GET /filters HTTP/1.1 
Host: resourcelibrary.api.ashcompanies.com 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"filters":null}