BokaMera.API.Host

<back to all web services

UpdateResourceType

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
PUT/resourcetypes/{Id}Update existing resourcetypeUpdates an existing resourcetype if you are authorized to do so.
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;
}

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ValidateRequest(Validator="IsAuthenticated")
class UpdateResourceType 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;

    /**
    * Id of the resourcetype
    */
    // @ApiMember(Description="Id of the resourcetype", IsRequired=true, ParameterType="path")
    int? Id;

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

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

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

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

    UpdateResourceType({this.CompanyId,this.Id,this.Resources,this.Name,this.Description,this.Active});
    UpdateResourceType.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!);
        Name = json['Name'];
        Description = json['Description'];
        Active = json['Active'];
        return this;
    }

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

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

TypeContext _ctx = TypeContext(library: 'testapi.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()),
    'UpdateResourceType': TypeInfo(TypeOf.Class, create:() => UpdateResourceType()),
    'List<UpdateResourceTypeResource>': TypeInfo(TypeOf.Class, create:() => <UpdateResourceTypeResource>[]),
});

Dart UpdateResourceType 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 /resourcetypes/{Id} HTTP/1.1 
Host: testapi.bokamera.se 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","Id":0,"Resources":[{"Id":0,"Priority":0}],"Name":"String","Description":"String","Active":false}
HTTP/1.1 200 OK
Content-Type: application/json
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}