Requires the role: | superadmin |
PUT | /superadmin/administrators/{Id} | Update administrator on your company | If you want to update a administrator to your company. |
---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BokaMera.API.ServiceModel.Dtos
Namespace Global
Namespace BokaMera.API.ServiceModel.Dtos
Public Partial Class AddCompanyUserRolesResponse
Public Overridable Property RoleId As Guid
End Class
Public Partial Class CompanyUserQueryResponse
Public Sub New()
Roles = New List(Of CompanyUserRolesQueryResponse)
End Sub
Public Overridable Property Id As Guid
Public Overridable Property CompanyId As Guid
Public Overridable Property Firstname As String
Public Overridable Property Lastname As String
Public Overridable Property Email As String
Public Overridable Property Phone As String
Public Overridable Property WorkerId As String
Public Overridable Property ResourceId As Nullable(Of Integer)
'''<Summary>
'''The resource information connected to the administrator.
'''</Summary>
<ApiMember(Description:="The resource information connected to the administrator.")>
Public Overridable Property Resource As CompanyUserResource
'''<Summary>
'''The roles that are connected to the administrator.
'''</Summary>
<ApiMember(Description:="The roles that are connected to the administrator.")>
Public Overridable Property Roles As List(Of CompanyUserRolesQueryResponse)
Public Overridable Property Active As Boolean
Public Overridable Property Created As Date
Public Overridable Property Updated As Date
End Class
Public Partial Class CompanyUserResource
'''<Summary>
'''The resource id
'''</Summary>
<ApiMember(Description:="The resource id")>
Public Overridable Property Id As Integer
'''<Summary>
'''The resource name
'''</Summary>
<ApiMember(Description:="The resource name")>
Public Overridable Property Name As String
'''<Summary>
'''The resource status
'''</Summary>
<ApiMember(Description:="The resource status")>
Public Overridable Property Active As Boolean
'''<Summary>
'''The resource description
'''</Summary>
<ApiMember(Description:="The resource description")>
Public Overridable Property Description As String
'''<Summary>
'''The resource email
'''</Summary>
<ApiMember(Description:="The resource email")>
Public Overridable Property Email As String
'''<Summary>
'''The resource phone
'''</Summary>
<ApiMember(Description:="The resource phone")>
Public Overridable Property Phone As String
'''<Summary>
'''The resource color
'''</Summary>
<ApiMember(Description:="The resource color")>
Public Overridable Property Color As String
'''<Summary>
'''The resource image
'''</Summary>
<ApiMember(Description:="The resource image")>
Public Overridable Property ImageUrl As Uri
'''<Summary>
'''If the resource want to receive email notifications
'''</Summary>
<ApiMember(Description:="If the resource want to receive email notifications")>
Public Overridable Property EmailNotification As Boolean
'''<Summary>
'''If the resource want to receive sms notifications
'''</Summary>
<ApiMember(Description:="If the resource want to receive sms notifications")>
Public Overridable Property SMSNotification As Boolean
'''<Summary>
'''If the resource want to receive email reminders
'''</Summary>
<ApiMember(Description:="If the resource want to receive email reminders")>
Public Overridable Property EmailReminder As Boolean
'''<Summary>
'''If the resource want to receive sms reminders
'''</Summary>
<ApiMember(Description:="If the resource want to receive sms reminders")>
Public Overridable Property SMSReminder As Boolean
End Class
Public Partial Class CompanyUserRolesQueryResponse
Public Overridable Property RoleId As Guid
Public Overridable Property Name As String
Public Overridable Property Description As String
End Class
<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)>
Public Partial Class SuperAdminUpdateCompanyUser
Implements ICompany
Public Sub New()
Roles = New List(Of AddCompanyUserRolesResponse)
End Sub
'''<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 Overridable Property CompanyId As Nullable(Of Guid)
'''<Summary>
'''Enter the user id for the administrator.
'''</Summary>
<ApiMember(Description:="Enter the user id for the administrator.", IsRequired:=true, ParameterType:="path")>
Public Overridable Property Id As Guid
<ApiMember>
Public Overridable Property Firstname As String
<ApiMember>
Public Overridable Property Lastname As String
<ApiMember>
Public Overridable Property Phone As String
<ApiMember>
Public Overridable Property Email As String
<ApiMember>
Public Overridable Property ResourceId As Nullable(Of Integer)
<ApiMember>
Public Overridable Property Roles As List(Of AddCompanyUserRolesResponse)
<ApiMember>
Public Overridable Property WorkerId As Nullable(Of Integer)
End Class
End Namespace
End Namespace
VB.NET SuperAdminUpdateCompanyUser DTOs
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 /superadmin/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 }