<back to all web services

GetProjectsCount

The following routes are available for this service:
GET/RestApi/translations/projects/count
import 'package:servicestack/servicestack.dart';

class CountProxy implements IConvertible
{
    int? TotalCount;

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

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

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

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

enum ProjectStatus
{
    NotStarted,
    Started,
    Completed,
}

class GetProjectsCount implements IProjectsFilter, IConvertible
{
    int? Skip;
    int? Take;
    String? OrderExpression;
    String? SearchText;
    List<String>? Service;
    ProjectStatus? ProjectStatus;
    String? ActualSourceLanguage;
    bool? WithoutSourceLanguage;

    GetProjectsCount({this.Skip,this.Take,this.OrderExpression,this.SearchText,this.Service,this.ProjectStatus,this.ActualSourceLanguage,this.WithoutSourceLanguage});
    GetProjectsCount.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Skip = json['Skip'];
        Take = json['Take'];
        OrderExpression = json['OrderExpression'];
        SearchText = json['SearchText'];
        Service = JsonConverters.fromJson(json['Service'],'List<String>',context!);
        ProjectStatus = JsonConverters.fromJson(json['ProjectStatus'],'ProjectStatus',context!);
        ActualSourceLanguage = json['ActualSourceLanguage'];
        WithoutSourceLanguage = json['WithoutSourceLanguage'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Skip': Skip,
        'Take': Take,
        'OrderExpression': OrderExpression,
        'SearchText': SearchText,
        'Service': JsonConverters.toJson(Service,'List<String>',context!),
        'ProjectStatus': JsonConverters.toJson(ProjectStatus,'ProjectStatus',context!),
        'ActualSourceLanguage': ActualSourceLanguage,
        'WithoutSourceLanguage': WithoutSourceLanguage
    };

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

TypeContext _ctx = TypeContext(library: 'www.imglobal.com', types: <String, TypeInfo> {
    'CountProxy': TypeInfo(TypeOf.Class, create:() => CountProxy()),
    'ProjectStatus': TypeInfo(TypeOf.Enum, enumValues:ProjectStatus.values),
    'GetProjectsCount': TypeInfo(TypeOf.Class, create:() => GetProjectsCount()),
});

Dart GetProjectsCount 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 /RestApi/translations/projects/count HTTP/1.1 
Host: www.imglobal.com 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"TotalCount":0}