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.
"use strict";
export class ResourceTypeResource {
    /** @param {{Id?:number,Name?:string,Active?:boolean,Description?:string,Email?:string,Phone?:string,Color?:string,ImageUrl?:string,Priority?:number,EmailNotification?:boolean,SMSNotification?:boolean,EmailReminder?:boolean,SMSReminder?:boolean}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {number}
     * @description The resource id */
    Id;
    /**
     * @type {string}
     * @description The resource name */
    Name;
    /**
     * @type {boolean}
     * @description The resource status */
    Active;
    /**
     * @type {string}
     * @description The resource description */
    Description;
    /**
     * @type {string}
     * @description The resource email */
    Email;
    /**
     * @type {string}
     * @description The resource phone */
    Phone;
    /**
     * @type {string}
     * @description The resource color */
    Color;
    /**
     * @type {string}
     * @description The resource image */
    ImageUrl;
    /**
     * @type {number}
     * @description The priority of the resource */
    Priority;
    /**
     * @type {boolean}
     * @description If the resource want to receive email notifications */
    EmailNotification;
    /**
     * @type {boolean}
     * @description If the resource want to receive sms notifications */
    SMSNotification;
    /**
     * @type {boolean}
     * @description If the resource want to receive email reminders */
    EmailReminder;
    /**
     * @type {boolean}
     * @description If the resource want to receive sms reminders */
    SMSReminder;
}
export class ResourceTypeQueryResponse {
    /** @param {{Id?:number,Name?:string,Description?:string,Resources?:ResourceTypeResource[],Active?:boolean,Created?:string,Updated?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {number}
     * @description The resourcetype id */
    Id;
    /**
     * @type {string}
     * @description The resourcetype name */
    Name;
    /**
     * @type {string}
     * @description The resourcetype description */
    Description;
    /**
     * @type {ResourceTypeResource[]}
     * @description The resources in the resourcetype. Only shows active resources if not admin. */
    Resources;
    /**
     * @type {boolean}
     * @description If resourcetype is active or not */
    Active;
    /**
     * @type {string}
     * @description Then date when the resource was created */
    Created;
    /**
     * @type {string}
     * @description Then date when the resource was updated */
    Updated;
}
export class UpdateResourceTypeResource {
    /** @param {{Id?:number,Priority?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {number}
     * @description The resource id */
    Id;
    /**
     * @type {number}
     * @description The priority of the resource */
    Priority;
}
export class UpdateResourceType {
    /** @param {{CompanyId?:string,Id?:number,Resources?:UpdateResourceTypeResource[],Name?:string,Description?:string,Active?:boolean}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {?string}
     * @description The company id, if empty will use the company id for the user you are logged in with. */
    CompanyId;
    /**
     * @type {number}
     * @description Id of the resourcetype */
    Id;
    /**
     * @type {UpdateResourceTypeResource[]}
     * @description The resources to be added */
    Resources;
    /**
     * @type {string}
     * @description The resourcetype name */
    Name;
    /**
     * @type {string}
     * @description The resourcetype description */
    Description;
    /**
     * @type {boolean}
     * @description If resourcetype is active or not */
    Active;
}

JavaScript UpdateResourceType DTOs

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

HTTP + XML

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/xml
Content-Type: application/xml
Content-Length: length

<UpdateResourceType xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <Active>false</Active>
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <Description>String</Description>
  <Id>0</Id>
  <Name>String</Name>
  <Resources>
    <UpdateResourceTypeResource>
      <Id>0</Id>
      <Priority>0</Priority>
    </UpdateResourceTypeResource>
  </Resources>
</UpdateResourceType>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ResourceTypeQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <Active>false</Active>
  <Created>0001-01-01T00:00:00</Created>
  <Description>String</Description>
  <Id>0</Id>
  <Name>String</Name>
  <Resources>
    <ResourceTypeResource>
      <Active>false</Active>
      <Color>String</Color>
      <Description>String</Description>
      <Email>String</Email>
      <EmailNotification>false</EmailNotification>
      <EmailReminder>false</EmailReminder>
      <Id>0</Id>
      <ImageUrl i:nil="true" />
      <Name>String</Name>
      <Phone>String</Phone>
      <Priority>0</Priority>
      <SMSNotification>false</SMSNotification>
      <SMSReminder>false</SMSReminder>
    </ResourceTypeResource>
  </Resources>
  <Updated>0001-01-01T00:00:00</Updated>
</ResourceTypeQueryResponse>