BokaMera.API.Host

<back to all web services

WidgetConfigurationQuery

Requires Authentication
The following routes are available for this service:
GET/widget/configurationList or get widget configurationsReturns widget configurations. If slug is provided, returns a single configuration matching that slug. Otherwise returns all configurations for the company.
import 'package:servicestack/servicestack.dart';

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ValidateRequest(Validator="IsAuthenticated")
class WidgetConfigurationQuery implements ICompany, IConvertible
{
    /**
    * The company id, if empty will use the company id for the user you are logged in with.
    */
    // @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
    String? CompanyId;

    /**
    * Optional slug to fetch a single configuration (e.g., 'hairsalon-001'). If provided, ignores other filter parameters.
    */
    // @ApiMember(Description="Optional slug to fetch a single configuration (e.g., 'hairsalon-001'). If provided, ignores other filter parameters.")
    String? Slug;

    /**
    * Filter by schema version.
    */
    // @ApiMember(Description="Filter by schema version.")
    int? SchemaVersion;

    /**
    * Number of records to skip
    */
    // @ApiMember(Description="Number of records to skip")
    int? Skip;

    /**
    * Number of records to take
    */
    // @ApiMember(Description="Number of records to take")
    int? Take;

    /**
    * Sort field
    */
    // @ApiMember(Description="Sort field")
    String OrderBy = "";

    WidgetConfigurationQuery({this.CompanyId,this.Slug,this.SchemaVersion,this.Skip,this.Take,this.OrderBy});
    WidgetConfigurationQuery.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CompanyId = json['CompanyId'];
        Slug = json['Slug'];
        SchemaVersion = json['SchemaVersion'];
        Skip = json['Skip'];
        Take = json['Take'];
        OrderBy = json['OrderBy'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CompanyId': CompanyId,
        'Slug': Slug,
        'SchemaVersion': SchemaVersion,
        'Skip': Skip,
        'Take': Take,
        'OrderBy': OrderBy
    };

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

class AccessKeyTypeResponse implements IConvertible
{
    int Id = 0;
    String KeyType = "";
    String Description = "";

    AccessKeyTypeResponse({this.Id,this.KeyType,this.Description});
    AccessKeyTypeResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

// @DataContract
class QueryResponse<T> implements IConvertible
{
    // @DataMember(Order=1)
    int Offset = 0;

    // @DataMember(Order=2)
    int Total = 0;

    // @DataMember(Order=3)
    List<AccessKeyTypeResponse> Results = [];

    // @DataMember(Order=4)
    Map<String,String?>? Meta;

    // @DataMember(Order=5)
    ResponseStatus? ResponseStatus;

    QueryResponse({this.Offset,this.Total,this.Results,this.Meta,this.ResponseStatus});
    QueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Offset = json['Offset'];
        Total = json['Total'];
        Results = JsonConverters.fromJson(json['Results'],'List<AccessKeyTypeResponse>',context!);
        Meta = JsonConverters.toStringMap(json['Meta']);
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Offset': Offset,
        'Total': Total,
        'Results': JsonConverters.toJson(Results,'List<AccessKeyTypeResponse>',context!),
        'Meta': Meta,
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

    getTypeName() => "QueryResponse<$T>";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'testapi.bokamera.se', types: <String, TypeInfo> {
    'WidgetConfigurationQuery': TypeInfo(TypeOf.Class, create:() => WidgetConfigurationQuery()),
    'AccessKeyTypeResponse': TypeInfo(TypeOf.Class, create:() => AccessKeyTypeResponse()),
    'List<AccessKeyTypeResponse>': TypeInfo(TypeOf.Class, create:() => <AccessKeyTypeResponse>[]),
});

Dart WidgetConfigurationQuery DTOs

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

HTTP + OTHER

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

GET /widget/configuration HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Offset":0,"Total":0,"Results":[{"Id":"String","Name":"String","Slug":"String","Description":"String","Configuration":"String","SchemaVersion":0,"UpdatedDate":"0001-01-01T00:00:00.0000000+00:00","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}],"Meta":{"String":"String"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}