Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
PUT | /resourcetypes/{Id}/updateresourcepriority | Update resource(s) priority within the ResourceType | Updates resource(s) priority in the ResourceType for the currently logged in user, only administrators are allowed to update ResourceTypes. |
---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
@ValidateRequest(Validator="IsAuthenticated")
public static class UpdateResourcePriority
{
/**
* The company id
*/
@ApiMember(Description="The company id", IsRequired=true)
public UUID CompanyId = null;
/**
* The ResourceType id
*/
@ApiMember(Description="The ResourceType id", IsRequired=true, ParameterType="path")
public Integer Id = null;
/**
* The resources to have their priorities to be updated
*/
@ApiMember(Description="The resources to have their priorities to be updated ")
public ArrayList<UpdateResourceTypeResource> Resources = null;
public UUID getCompanyId() { return CompanyId; }
public UpdateResourcePriority setCompanyId(UUID value) { this.CompanyId = value; return this; }
public Integer getId() { return Id; }
public UpdateResourcePriority setId(Integer value) { this.Id = value; return this; }
public ArrayList<UpdateResourceTypeResource> getResources() { return Resources; }
public UpdateResourcePriority setResources(ArrayList<UpdateResourceTypeResource> value) { this.Resources = value; return this; }
}
public static class UpdateResourceTypeResource
{
/**
* The resource id
*/
@ApiMember(Description="The resource id")
public Integer Id = null;
/**
* The priority of the resource
*/
@ApiMember(Description="The priority of the resource")
public Integer Priority = null;
public Integer getId() { return Id; }
public UpdateResourceTypeResource setId(Integer value) { this.Id = value; return this; }
public Integer getPriority() { return Priority; }
public UpdateResourceTypeResource setPriority(Integer value) { this.Priority = value; return this; }
}
public static class ResourceTypeQueryResponse
{
/**
* The resourcetype id
*/
@ApiMember(Description="The resourcetype id")
public Integer Id = null;
/**
* The resourcetype name
*/
@ApiMember(Description="The resourcetype name")
public String Name = null;
/**
* The resourcetype description
*/
@ApiMember(Description="The resourcetype description")
public String Description = null;
/**
* 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.")
public ArrayList<ResourceTypeResource> Resources = null;
/**
* If resourcetype is active or not
*/
@ApiMember(Description="If resourcetype is active or not")
public Boolean Active = null;
/**
* Then date when the resource was created
*/
@ApiMember(Description="Then date when the resource was created")
public Date Created = null;
/**
* Then date when the resource was updated
*/
@ApiMember(Description="Then date when the resource was updated")
public Date Updated = null;
public Integer getId() { return Id; }
public ResourceTypeQueryResponse setId(Integer value) { this.Id = value; return this; }
public String getName() { return Name; }
public ResourceTypeQueryResponse setName(String value) { this.Name = value; return this; }
public String getDescription() { return Description; }
public ResourceTypeQueryResponse setDescription(String value) { this.Description = value; return this; }
public ArrayList<ResourceTypeResource> getResources() { return Resources; }
public ResourceTypeQueryResponse setResources(ArrayList<ResourceTypeResource> value) { this.Resources = value; return this; }
public Boolean isActive() { return Active; }
public ResourceTypeQueryResponse setActive(Boolean value) { this.Active = value; return this; }
public Date getCreated() { return Created; }
public ResourceTypeQueryResponse setCreated(Date value) { this.Created = value; return this; }
public Date getUpdated() { return Updated; }
public ResourceTypeQueryResponse setUpdated(Date value) { this.Updated = value; return this; }
}
public static class ResourceTypeResource
{
/**
* The resource id
*/
@ApiMember(Description="The resource id")
public Integer Id = null;
/**
* The resource name
*/
@ApiMember(Description="The resource name")
public String Name = null;
/**
* The resource status
*/
@ApiMember(Description="The resource status")
public Boolean Active = null;
/**
* The resource description
*/
@ApiMember(Description="The resource description")
public String Description = null;
/**
* The resource email
*/
@ApiMember(Description="The resource email")
public String Email = null;
/**
* The resource phone
*/
@ApiMember(Description="The resource phone")
public String Phone = null;
/**
* The resource color
*/
@ApiMember(Description="The resource color")
public String Color = null;
/**
* The resource image
*/
@ApiMember(Description="The resource image")
public Uri ImageUrl = null;
/**
* The priority of the resource
*/
@ApiMember(Description="The priority of the resource")
public Integer Priority = null;
/**
* If the resource want to receive email notifications
*/
@ApiMember(Description="If the resource want to receive email notifications")
public Boolean EmailNotification = null;
/**
* If the resource want to receive sms notifications
*/
@ApiMember(Description="If the resource want to receive sms notifications")
public Boolean SMSNotification = null;
/**
* If the resource want to receive email reminders
*/
@ApiMember(Description="If the resource want to receive email reminders")
public Boolean EmailReminder = null;
/**
* If the resource want to receive sms reminders
*/
@ApiMember(Description="If the resource want to receive sms reminders")
public Boolean SMSReminder = null;
public Integer getId() { return Id; }
public ResourceTypeResource setId(Integer value) { this.Id = value; return this; }
public String getName() { return Name; }
public ResourceTypeResource setName(String value) { this.Name = value; return this; }
public Boolean isActive() { return Active; }
public ResourceTypeResource setActive(Boolean value) { this.Active = value; return this; }
public String getDescription() { return Description; }
public ResourceTypeResource setDescription(String value) { this.Description = value; return this; }
public String getEmail() { return Email; }
public ResourceTypeResource setEmail(String value) { this.Email = value; return this; }
public String getPhone() { return Phone; }
public ResourceTypeResource setPhone(String value) { this.Phone = value; return this; }
public String getColor() { return Color; }
public ResourceTypeResource setColor(String value) { this.Color = value; return this; }
public Uri getImageUrl() { return ImageUrl; }
public ResourceTypeResource setImageUrl(Uri value) { this.ImageUrl = value; return this; }
public Integer getPriority() { return Priority; }
public ResourceTypeResource setPriority(Integer value) { this.Priority = value; return this; }
public Boolean isEmailNotification() { return EmailNotification; }
public ResourceTypeResource setEmailNotification(Boolean value) { this.EmailNotification = value; return this; }
public Boolean isSmsNotification() { return SMSNotification; }
public ResourceTypeResource setSmsNotification(Boolean value) { this.SMSNotification = value; return this; }
public Boolean isEmailReminder() { return EmailReminder; }
public ResourceTypeResource setEmailReminder(Boolean value) { this.EmailReminder = value; return this; }
public Boolean isSmsReminder() { return SMSReminder; }
public ResourceTypeResource setSmsReminder(Boolean value) { this.SMSReminder = value; return this; }
}
}
Java UpdateResourcePriority DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=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}