Field Squared API Services

<back to all web services

WorkspaceOptions

The following routes are available for this service:
GET/{Workspace}/WorkspaceOptions/
import 'package:servicestack/servicestack.dart';

class TimeZone implements IConvertible
{
    String? Name;
    String? Id;
    String? IanaId;
    String? Abbreviation;

    TimeZone({this.Name,this.Id,this.IanaId,this.Abbreviation});
    TimeZone.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class Country implements IConvertible
{
    String? Name;
    String? Id;

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

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

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

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

class UserTypeOption implements IConvertible
{
    String? Name;
    String? Id;

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

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

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

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

class WorkspaceOptions implements IConvertible
{
    String? Workspace;
    List<TimeZone>? TimeZones;
    List<Country>? Countries;
    List<UserTypeOption>? UserTypes;

    WorkspaceOptions({this.Workspace,this.TimeZones,this.Countries,this.UserTypes});
    WorkspaceOptions.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Workspace = json['Workspace'];
        TimeZones = JsonConverters.fromJson(json['TimeZones'],'List<TimeZone>',context!);
        Countries = JsonConverters.fromJson(json['Countries'],'List<Country>',context!);
        UserTypes = JsonConverters.fromJson(json['UserTypes'],'List<UserTypeOption>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Workspace': Workspace,
        'TimeZones': JsonConverters.toJson(TimeZones,'List<TimeZone>',context!),
        'Countries': JsonConverters.toJson(Countries,'List<Country>',context!),
        'UserTypes': JsonConverters.toJson(UserTypes,'List<UserTypeOption>',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'dev.fieldsquared.com', types: <String, TypeInfo> {
    'TimeZone': TypeInfo(TypeOf.Class, create:() => TimeZone()),
    'Country': TypeInfo(TypeOf.Class, create:() => Country()),
    'UserTypeOption': TypeInfo(TypeOf.Class, create:() => UserTypeOption()),
    'WorkspaceOptions': TypeInfo(TypeOf.Class, create:() => WorkspaceOptions()),
    'List<TimeZone>': TypeInfo(TypeOf.Class, create:() => <TimeZone>[]),
    'List<Country>': TypeInfo(TypeOf.Class, create:() => <Country>[]),
    'List<UserTypeOption>': TypeInfo(TypeOf.Class, create:() => <UserTypeOption>[]),
});

Dart WorkspaceOptions 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 /{Workspace}/WorkspaceOptions/ HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: text/csv