BokaMera.API.Host

<back to all web services

UpdateResourcePriority

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
PUT/resourcetypes/{Id}/updateresourcepriorityUpdate resource(s) priority within the ResourceTypeUpdates resource(s) priority in the ResourceType for the currently logged in user, only administrators are allowed to update ResourceTypes.
import 'package:servicestack/servicestack.dart';

class ResourceTypeResource implements IConvertible
{
    /**
    * The resource id
    */
    // @ApiMember(Description="The resource id")
    int? Id;

    /**
    * The resource name
    */
    // @ApiMember(Description="The resource name")
    String? Name;

    /**
    * The resource status
    */
    // @ApiMember(Description="The resource status")
    bool? Active;

    /**
    * The resource description
    */
    // @ApiMember(Description="The resource description")
    String? Description;

    /**
    * The resource email
    */
    // @ApiMember(Description="The resource email")
    String? Email;

    /**
    * The resource phone
    */
    // @ApiMember(Description="The resource phone")
    String? Phone;

    /**
    * The resource color
    */
    // @ApiMember(Description="The resource color")
    String? Color;

    /**
    * The resource image
    */
    // @ApiMember(Description="The resource image")
    Uri? ImageUrl;

    /**
    * The priority of the resource
    */
    // @ApiMember(Description="The priority of the resource")
    int? Priority;

    /**
    * If the resource want to receive email notifications
    */
    // @ApiMember(Description="If the resource want to receive email notifications")
    bool? EmailNotification;

    /**
    * If the resource want to receive sms notifications
    */
    // @ApiMember(Description="If the resource want to receive sms notifications")
    bool? SMSNotification;

    /**
    * If the resource want to receive email reminders
    */
    // @ApiMember(Description="If the resource want to receive email reminders")
    bool? EmailReminder;

    /**
    * If the resource want to receive sms reminders
    */
    // @ApiMember(Description="If the resource want to receive sms reminders")
    bool? SMSReminder;

    ResourceTypeResource({this.Id,this.Name,this.Active,this.Description,this.Email,this.Phone,this.Color,this.ImageUrl,this.Priority,this.EmailNotification,this.SMSNotification,this.EmailReminder,this.SMSReminder});
    ResourceTypeResource.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Name = json['Name'];
        Active = json['Active'];
        Description = json['Description'];
        Email = json['Email'];
        Phone = json['Phone'];
        Color = json['Color'];
        ImageUrl = JsonConverters.fromJson(json['ImageUrl'],'Uri',context!);
        Priority = json['Priority'];
        EmailNotification = json['EmailNotification'];
        SMSNotification = json['SMSNotification'];
        EmailReminder = json['EmailReminder'];
        SMSReminder = json['SMSReminder'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Name': Name,
        'Active': Active,
        'Description': Description,
        'Email': Email,
        'Phone': Phone,
        'Color': Color,
        'ImageUrl': JsonConverters.toJson(ImageUrl,'Uri',context!),
        'Priority': Priority,
        'EmailNotification': EmailNotification,
        'SMSNotification': SMSNotification,
        'EmailReminder': EmailReminder,
        'SMSReminder': SMSReminder
    };

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

class ResourceTypeQueryResponse implements IConvertible
{
    /**
    * The resourcetype id
    */
    // @ApiMember(Description="The resourcetype id")
    int? Id;

    /**
    * The resourcetype name
    */
    // @ApiMember(Description="The resourcetype name")
    String? Name;

    /**
    * The resourcetype description
    */
    // @ApiMember(Description="The resourcetype description")
    String? Description;

    /**
    * The resources in the resourcetype. Only shows active resources if not admin.
    */
    // @ApiMember(Description="The resources in the resourcetype. Only shows active resources if not admin.")
    List<ResourceTypeResource>? Resources;

    /**
    * If resourcetype is active or not
    */
    // @ApiMember(Description="If resourcetype is active or not")
    bool? Active;

    /**
    * Then date when the resource was created
    */
    // @ApiMember(Description="Then date when the resource was created")
    DateTime? Created;

    /**
    * Then date when the resource was updated
    */
    // @ApiMember(Description="Then date when the resource was updated")
    DateTime? Updated;

    ResourceTypeQueryResponse({this.Id,this.Name,this.Description,this.Resources,this.Active,this.Created,this.Updated});
    ResourceTypeQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        Name = json['Name'];
        Description = json['Description'];
        Resources = JsonConverters.fromJson(json['Resources'],'List<ResourceTypeResource>',context!);
        Active = json['Active'];
        Created = JsonConverters.fromJson(json['Created'],'DateTime',context!);
        Updated = JsonConverters.fromJson(json['Updated'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'Name': Name,
        'Description': Description,
        'Resources': JsonConverters.toJson(Resources,'List<ResourceTypeResource>',context!),
        'Active': Active,
        'Created': JsonConverters.toJson(Created,'DateTime',context!),
        'Updated': JsonConverters.toJson(Updated,'DateTime',context!)
    };

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

class UpdateResourceTypeResource implements IConvertible
{
    /**
    * The resource id
    */
    // @ApiMember(Description="The resource id")
    int? Id;

    /**
    * The priority of the resource
    */
    // @ApiMember(Description="The priority of the resource")
    int? Priority;

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

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

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

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

// @ValidateRequest(Validator="IsAuthenticated")
class UpdateResourcePriority implements IConvertible
{
    /**
    * The company id
    */
    // @ApiMember(Description="The company id", IsRequired=true)
    String? CompanyId;

    /**
    * The ResourceType id
    */
    // @ApiMember(Description="The ResourceType id", IsRequired=true, ParameterType="path")
    int? Id;

    /**
    * The resources to have their priorities to be updated 
    */
    // @ApiMember(Description="The resources to have their priorities to be updated ")
    List<UpdateResourceTypeResource>? Resources;

    UpdateResourcePriority({this.CompanyId,this.Id,this.Resources});
    UpdateResourcePriority.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
    'ResourceTypeResource': TypeInfo(TypeOf.Class, create:() => ResourceTypeResource()),
    'Uri': TypeInfo(TypeOf.Class, create:() => Uri()),
    'ResourceTypeQueryResponse': TypeInfo(TypeOf.Class, create:() => ResourceTypeQueryResponse()),
    'List<ResourceTypeResource>': TypeInfo(TypeOf.Class, create:() => <ResourceTypeResource>[]),
    'UpdateResourceTypeResource': TypeInfo(TypeOf.Class, create:() => UpdateResourceTypeResource()),
    'UpdateResourcePriority': TypeInfo(TypeOf.Class, create:() => UpdateResourcePriority()),
    'List<UpdateResourceTypeResource>': TypeInfo(TypeOf.Class, create:() => <UpdateResourceTypeResource>[]),
});

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

PUT /resourcetypes/{Id}/updateresourcepriority HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"Id":0,"Resources":[{"Id":0,"Priority":0}]}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Id":0,"Name":"String","Description":"String","Resources":[{"Id":0,"Name":"String","Active":false,"Description":"String","Email":"String","Phone":"String","Color":"String","Priority":0,"EmailNotification":false,"SMSNotification":false,"EmailReminder":false,"SMSReminder":false}],"Active":false}