client.createAgent()
Create a new agent. This is a convenience function around creating a user and adding that user to a property-manager's team.
const appId = '575027e58178f56a008b4568'
const propertyManagerId = '5a818c07ef5f2f00441146a2'
const username = 'mr.example@allthings.test'
const agent = await client.createAgent(
appId,
propertyManagerId,
username,
{ email: 'mr.example@allthings.test', locale: 'en_US' }
)
export type MethodCreateAgent = (
appId: string,
propertyManagerId: string,
username: string,
data: PartialUser & {
readonly email: string
readonly locale: EnumLocale
},
) => UserResult
export interface InterfaceAllthingsRestApi {
readonly delete: MethodHttpDelete
readonly get: MethodHttpGet
readonly post: MethodHttpPost
readonly patch: MethodHttpPatch
readonly createAgent: MethodCreateAgent
readonly createAgentPermissions: MethodCreateAgentPermissions
readonly createApp: MethodCreateApp
readonly createIdLookup: MethodCreateIdLookup
readonly createGroup: MethodCreateGroup
readonly getGroupById: MethodGetGroupById
readonly updateGroupById: MethodUpdateGroupById
readonly createProperty: MethodCreateProperty
readonly getPropertyById: MethodGetPropertyById
readonly updatePropertyById: MethodUpdatePropertyById
readonly createRegistrationCode: MethodCreateRegistrationCode
readonly createUnit: MethodCreateUnit
readonly getUnitById: MethodGetUnitById
readonly updateUnitById: MethodUpdateUnitById
readonly createUser: MethodCreateUser
readonly createUserPermission: MethodCreateUserPermission
readonly deleteUserPermission: MethodDeleteUserPermission
readonly getUsers: MethodGetUsers
readonly getCurrentUser: MethodGetCurrentUser
readonly getUserById: MethodGetUserById
readonly getUserPermissions: MethodGetUserPermissions
readonly updateUserById: MethodUpdateUserById
readonly createUtilisationPeriod: MethodCreateUtilisationPeriod
readonly getUtilisationPeriodById: MethodGetUtilisationPeriodById
readonly updateUtilisationPeriodById: MethodUpdateUtilisationPeriodById
}