BokaMera.API.Host

<back to all web services

ReorderHomepageImages

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
PUT/homepage/images/orderReorder homepage imagesSet the display order of homepage images for the current company. The position of each id in the list becomes its SortOrder (0-based).
import 'package:servicestack/servicestack.dart';

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ApiResponse(Description="You have too low privilegies to call this service", StatusCode=403)
// @ValidateRequest(Validator="IsAuthenticated")
class ReorderHomepageImages implements ICompany, IConvertible
{
    /**
    * Enter the company id, if blank and you are an admin, your company id will be used.
    */
    // @ApiMember(Description="Enter the company id, if blank and you are an admin, your company id will be used.", IsRequired=true)
    String CompanyId = "";

    /**
    * The homepage image ids in the desired display order (position = SortOrder).
    */
    // @ApiMember(Description="The homepage image ids in the desired display order (position = SortOrder).", IsRequired=true)
    List<int> Ids = [];

    ReorderHomepageImages({this.CompanyId,this.Ids});
    ReorderHomepageImages.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

    getTypeName() => "ReorderHomepageImages";
    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: 'api.bookmore.com', types: <String, TypeInfo> {
    'ReorderHomepageImages': TypeInfo(TypeOf.Class, create:() => ReorderHomepageImages()),
    'AccessKeyTypeResponse': TypeInfo(TypeOf.Class, create:() => AccessKeyTypeResponse()),
    'List<AccessKeyTypeResponse>': TypeInfo(TypeOf.Class, create:() => <AccessKeyTypeResponse>[]),
});

Dart ReorderHomepageImages 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.

PUT /homepage/images/order HTTP/1.1 
Host: api.bookmore.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","Ids":[0]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"Offset":0,"Total":0,"Results":[{"Id":0,"Title":"String","Description":"String","SortOrder":0}],"Meta":{"String":"String"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}