Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
PUT | /administrators/{Id} | Update administrator on your company | If you want to update a administrator to your company. |
---|
import Foundation
import ServiceStack
// @ApiResponse(Description="Returned if there is a validation error on the input parameters", StatusCode=400)
// @ApiResponse(Description="Returned if the current user is not allowed to perform the action", StatusCode=401)
// @ValidateRequest(Validator="IsAuthenticated")
public class UpdateCompanyUser : ICompany, Codable
{
/**
* Enter the company and id for the application user, if blank company id and you are an admin, your company id will be used.
*/
// @ApiMember(Description="Enter the company and id for the application user, if blank company id and you are an admin, your company id will be used.", ParameterType="query")
public var companyId:String?
/**
* Enter the user id for the administrator.
*/
// @ApiMember(Description="Enter the user id for the administrator.", IsRequired=true, ParameterType="path")
public var id:String
// @ApiMember()
public var firstname:String
// @ApiMember()
public var lastname:String
// @ApiMember()
public var phone:String
// @ApiMember()
public var email:String
// @ApiMember()
public var resourceId:Int?
// @ApiMember()
public var roles:[AddCompanyUserRolesResponse] = []
// @ApiMember()
public var workerId:Int?
required public init(){}
}
public class AddCompanyUserRolesResponse : Codable
{
public var roleId:String
required public init(){}
}
public class CompanyUserQueryResponse : Codable
{
public var id:String
public var companyId:String
public var firstname:String
public var lastname:String
public var email:String
public var phone:String
public var workerId:String
public var resourceId:Int?
/**
* The resource information connected to the administrator.
*/
// @ApiMember(Description="The resource information connected to the administrator.")
public var resource:CompanyUserResource
/**
* The roles that are connected to the administrator.
*/
// @ApiMember(Description="The roles that are connected to the administrator.")
public var roles:[CompanyUserRolesQueryResponse] = []
public var active:Bool
public var created:Date
public var updated:Date
required public init(){}
}
public class CompanyUserResource : Codable
{
/**
* The resource id
*/
// @ApiMember(Description="The resource id")
public var id:Int
/**
* The resource name
*/
// @ApiMember(Description="The resource name")
public var name:String
/**
* The resource status
*/
// @ApiMember(Description="The resource status")
public var active:Bool
/**
* The resource description
*/
// @ApiMember(Description="The resource description")
public var Description:String
/**
* The resource email
*/
// @ApiMember(Description="The resource email")
public var email:String
/**
* The resource phone
*/
// @ApiMember(Description="The resource phone")
public var phone:String
/**
* The resource color
*/
// @ApiMember(Description="The resource color")
public var color:String
/**
* The resource image
*/
// @ApiMember(Description="The resource image")
public var imageUrl:Uri
/**
* If the resource want to receive email notifications
*/
// @ApiMember(Description="If the resource want to receive email notifications")
public var emailNotification:Bool
/**
* If the resource want to receive sms notifications
*/
// @ApiMember(Description="If the resource want to receive sms notifications")
public var smsNotification:Bool
/**
* If the resource want to receive email reminders
*/
// @ApiMember(Description="If the resource want to receive email reminders")
public var emailReminder:Bool
/**
* If the resource want to receive sms reminders
*/
// @ApiMember(Description="If the resource want to receive sms reminders")
public var smsReminder:Bool
required public init(){}
}
public class CompanyUserRolesQueryResponse : Codable
{
public var roleId:String
public var name:String
public var Description:String
required public init(){}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /administrators/{Id} HTTP/1.1
Host: api.bokamera.se
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
CompanyId: 00000000-0000-0000-0000-000000000000,
Firstname: String,
Lastname: String,
Phone: String,
Email: String,
ResourceId: 0,
Roles:
[
{
}
],
WorkerId: 0
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Firstname: String, Lastname: String, Email: String, Phone: String, WorkerId: String, ResourceId: 0, Resource: { Id: 0, Name: String, Active: False, Description: String, Email: String, Phone: String, Color: String, EmailNotification: False, SMSNotification: False, EmailReminder: False, SMSReminder: False }, Roles: [ { Name: String, Description: String } ], Active: False }