Namespace: TelephoneService

TelephoneService

A service that handles CRUD operations for user's telephones
Source:

Methods

(static) create(userId, telephone) → {Promise.<Telephone>}

Create a telephone
Parameters:
Name Type Description
userId String the owner of the telephone
telephone Object the telephone object to create
Source:
Returns:
Promise that eventually creates and resolves a telephone or throws error
Type
Promise.<Telephone>

(static) del(telephoneId) → {Promise}

Deletes a single telephone
Parameters:
Name Type Description
telephoneId String the ID of the telephone
Source:
Returns:
Promise that eventually deletes a telephone or throws error
Type
Promise

(static) findOrCreate(userId, telephone) → {Promise.<Telephone>}

Find or Create a telephone
Parameters:
Name Type Description
userId String the owner of the telephone
telephone Object the telephone object to create
Properties
Name Type Description
telephone String the telephone string in the object
Source:
Returns:
eventually creates and returns a telephone or throws error
Type
Promise.<Telephone>

(static) list(params) → {Promise.<Array.<Telephone>>}

List all telephones
Parameters:
Name Type Description
params Object the parameters to limit the query to desired results
Source:
Returns:
Promise that eventually resolves an array of telephones or throws error
Type
Promise.<Array.<Telephone>>

(static) read(telephoneId) → {Promise.<Telephone>}

Retrieves a single telephone by ID
Parameters:
Name Type Description
telephoneId String the ID of the telephone
Source:
Returns:
Promise that eventually resolves a telephone or throws error
Type
Promise.<Telephone>

(static) update(telephoneId, body) → {Promise.<Telephone>}

Updates a single telephone
Parameters:
Name Type Description
telephoneId String the ID of the telephone
body Object key/value pairs of the fields that should be changed
Source:
Returns:
Promise that eventually updates and resolves a telephone or throws error
Type
Promise.<Telephone>