Pecuario.Backend

<back to all web services

GetAnimalCategories

The following routes are available for this service:
GET/api/v1/utils/animal-categories
import 'package:servicestack/servicestack.dart';

class Status implements IConvertible
{
    String? message;
    int? statusCode;

    Status({this.message,this.statusCode});
    Status.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class BaseResponse implements IConvertible
{
    Status? status;

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

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

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

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

class AnimalCategory implements IConvertible
{
    int? id;
    // @required()
    // @StringLength(50)
    String? name;

    String? alias;
    int? order;
    bool? enabled;

    AnimalCategory({this.id,this.name,this.alias,this.order,this.enabled});
    AnimalCategory.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'id': id,
        'name': name,
        'alias': alias,
        'order': order,
        'enabled': enabled
    };

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

class GetAnimalCategoriesResponse extends BaseResponse implements IConvertible
{
    List<AnimalCategory>? animalCategories;

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

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

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

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

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

    Map<String, dynamic> toJson() => {};
    getTypeName() => "GetAnimalCategories";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'pecuario_backend.develsystems.com', types: <String, TypeInfo> {
    'Status': TypeInfo(TypeOf.Class, create:() => Status()),
    'BaseResponse': TypeInfo(TypeOf.Class, create:() => BaseResponse()),
    'AnimalCategory': TypeInfo(TypeOf.Class, create:() => AnimalCategory()),
    'GetAnimalCategoriesResponse': TypeInfo(TypeOf.Class, create:() => GetAnimalCategoriesResponse()),
    'List<AnimalCategory>': TypeInfo(TypeOf.Class, create:() => <AnimalCategory>[]),
    'GetAnimalCategories': TypeInfo(TypeOf.Class, create:() => GetAnimalCategories()),
});

Dart GetAnimalCategories 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 /api/v1/utils/animal-categories HTTP/1.1 
Host: pecuario-backend.develsystems.com 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"animalCategories":[{"id":0,"name":"String","alias":"String","order":0,"enabled":false}]}