RICADO Gen 4 API JS Client

RICADO Gen 4 API JS Client

Class

UserAccountController

Controller Class for User Accounts

Constructor

new UserAccountController()

Source

Methods

static

changePassword(currentPassword, newPassword) → {Promise.<boolean>}

Change the Password for the Current User Account [POST /user/change-password]

Parameters

  • currentPassword string

    The Current Password

  • newPassword string

    The New Password

Returns

  • Promise.<boolean>

Source

static

changePinCode(currentPinCode, newPinCode) → {Promise.<boolean>}

Change the Pin Code for the Current User Account [POST /user/change-pin-code]

Parameters

  • currentPinCode string

    The Current Pin Code

  • newPinCode string

    The New Pin Code

Returns

  • Promise.<boolean>

Source

static

create(createData) → {Promise.<UserAccountModel>}

Create a User Account [POST /users]

Parameters

  • createData UserAccountController.CreateData

    The User Account Create Data

Returns

  • Promise.<UserAccountModel>

Source

static

deleteCurrent(currentPassword) → {Promise.<boolean>}

Delete the Current User Account [POST /user/delete-account]

Parameters

  • currentPassword string

    The Current Password

Returns

  • Promise.<boolean>

Source

static

getAll(queryParametersopt) → {Promise.<Array.<UserAccountModel>>}

List all User Accounts [GET /users]

Parameters

  • queryParameters UserAccountController.GetAllQueryParameters <optional>

    The Optional Query Parameters

Returns

  • Promise.<Array.<UserAccountModel>>

Source

static

getPolicies(id) → {Promise.<{policies: Array.<string>}>}

Retrieve the Policies Assigned to a User Account [GET /users/{id}/policies]

Parameters

  • id string

    The User Account ID

Returns

  • Promise.<{policies: Array.<string>}>

Source

static

setPassword(newPassword) → {Promise.<boolean>}

Set the Password for the Current User Account [POST /user/set-password]

Parameters

  • newPassword string

    The New Password

Returns

  • Promise.<boolean>

Source

static

setPinCode(newPinCode) → {Promise.<boolean>}

Set the Pin Code for the Current User Account [POST /user/set-pin-code]

Parameters

  • newPinCode string

    The New Pin Code

Returns

  • Promise.<boolean>

Source

static

setPolicies(id, policies) → {Promise.<boolean>}

Set the Policies Assigned to a User Account [POST /users/{id}/policies]

Parameters

  • id string

    The User Account ID

  • policies Array.<string>

    An Array of Account Policy IDs

Returns

  • Promise.<boolean>

Source

static

update(id, updateData) → {Promise.<UserAccountModel>}

Update a User Account [PATCH /users/{id}]

Parameters

  • id string

    The User Account ID

  • updateData UserAccountController.UpdateData

    The User Account Update Data

Returns

  • Promise.<UserAccountModel>

Source

static

updateCurrent(updateData) → {Promise.<UserAccountModel>}

Update the Current User Account [PATCH /user]

Parameters

  • updateData UserAccountController.UpdateData

    The User Account Update Data

Returns

  • Promise.<UserAccountModel>

Source

Type Definitions

CreateData

The Create Data for a User Account

Type

  • Object

Properties

  • email string

    The User's Email Address

  • firstName string <optional>
    <nullable>

    The User's First Name

  • lastName string <optional>
    <nullable>

    The User's Last Name

  • companyId string

    The Company this User belongs to

  • policies Array.<string> <optional>

    The Policies that apply to this User Account

Source

GetAllQueryParameters

The Optional Query Parameters for the getAll Function

Type

  • Object

Properties

  • email string <optional>

    The User's Email Address

  • firstName string <optional>
    <nullable>

    The User's First Name

  • lastName string <optional>
    <nullable>

    The User's Last Name

  • companyId string <optional>

    The Company this User belongs to

Source

UpdateData

The Update Data for a User Account

Type

  • Object

Properties

  • email string <optional>

    The User's Email Address

  • firstName string <optional>
    <nullable>

    The User's First Name

  • lastName string <optional>
    <nullable>

    The User's Last Name

Source