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. |
---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using BokaMera.API.ServiceModel.Dtos;
namespace BokaMera.API.ServiceModel.Dtos
{
public partial class AddCompanyUserRolesResponse
{
public virtual Guid RoleId { get; set; }
}
public partial class CompanyUserQueryResponse
{
public CompanyUserQueryResponse()
{
Roles = new List<CompanyUserRolesQueryResponse>{};
}
public virtual Guid Id { get; set; }
public virtual Guid CompanyId { get; set; }
public virtual string Firstname { get; set; }
public virtual string Lastname { get; set; }
public virtual string Email { get; set; }
public virtual string Phone { get; set; }
public virtual string WorkerId { get; set; }
public virtual int? ResourceId { get; set; }
///<summary>
///The resource information connected to the administrator.
///</summary>
[ApiMember(Description="The resource information connected to the administrator.")]
public virtual CompanyUserResource Resource { get; set; }
///<summary>
///The roles that are connected to the administrator.
///</summary>
[ApiMember(Description="The roles that are connected to the administrator.")]
public virtual List<CompanyUserRolesQueryResponse> Roles { get; set; }
public virtual bool Active { get; set; }
public virtual DateTime Created { get; set; }
public virtual DateTime Updated { get; set; }
}
public partial class CompanyUserResource
{
///<summary>
///The resource id
///</summary>
[ApiMember(Description="The resource id")]
public virtual int Id { get; set; }
///<summary>
///The resource name
///</summary>
[ApiMember(Description="The resource name")]
public virtual string Name { get; set; }
///<summary>
///The resource status
///</summary>
[ApiMember(Description="The resource status")]
public virtual bool Active { get; set; }
///<summary>
///The resource description
///</summary>
[ApiMember(Description="The resource description")]
public virtual string Description { get; set; }
///<summary>
///The resource email
///</summary>
[ApiMember(Description="The resource email")]
public virtual string Email { get; set; }
///<summary>
///The resource phone
///</summary>
[ApiMember(Description="The resource phone")]
public virtual string Phone { get; set; }
///<summary>
///The resource color
///</summary>
[ApiMember(Description="The resource color")]
public virtual string Color { get; set; }
///<summary>
///The resource image
///</summary>
[ApiMember(Description="The resource image")]
public virtual Uri ImageUrl { get; set; }
///<summary>
///If the resource want to receive email notifications
///</summary>
[ApiMember(Description="If the resource want to receive email notifications")]
public virtual bool EmailNotification { get; set; }
///<summary>
///If the resource want to receive sms notifications
///</summary>
[ApiMember(Description="If the resource want to receive sms notifications")]
public virtual bool SMSNotification { get; set; }
///<summary>
///If the resource want to receive email reminders
///</summary>
[ApiMember(Description="If the resource want to receive email reminders")]
public virtual bool EmailReminder { get; set; }
///<summary>
///If the resource want to receive sms reminders
///</summary>
[ApiMember(Description="If the resource want to receive sms reminders")]
public virtual bool SMSReminder { get; set; }
}
public partial class CompanyUserRolesQueryResponse
{
public virtual Guid RoleId { get; set; }
public virtual string Name { get; set; }
public virtual string Description { get; set; }
}
[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("IsAuthenticated")]
public partial class UpdateCompanyUser
: ICompany
{
public UpdateCompanyUser()
{
Roles = new List<AddCompanyUserRolesResponse>{};
}
///<summary>
///Enter the company and id for the application user, if blank company id and you are an admin, your company id will be used.
///</summary>
[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 virtual Guid? CompanyId { get; set; }
///<summary>
///Enter the user id for the administrator.
///</summary>
[ApiMember(Description="Enter the user id for the administrator.", IsRequired=true, ParameterType="path")]
public virtual Guid Id { get; set; }
[ApiMember]
public virtual string Firstname { get; set; }
[ApiMember]
public virtual string Lastname { get; set; }
[ApiMember]
public virtual string Phone { get; set; }
[ApiMember]
public virtual string Email { get; set; }
[ApiMember]
public virtual int? ResourceId { get; set; }
[ApiMember]
public virtual List<AddCompanyUserRolesResponse> Roles { get; set; }
[ApiMember]
public virtual int? WorkerId { get; set; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
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/csv
Content-Type: text/csv
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/csv 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}