AccountService - Online Accounts JS API

# Online Accounts JS API: AccountService

API Docs for: 0.1

#### Class AccountService

Class defined in: `online-accounts.js:10`

AccountService represents an instance of a service in an Online Accounts.

The AcountService object is not directly constructible but returned as a result of OnlineAccounts api calls.

- Methods

String `accountId`( `` )
`online-accounts.js:38`

Returns the account's numeric ID; note that all AccountService objects which work on the same online account will have the same ID.

Returns: <String>

Value for the accountId

`authenticate`( `callback` )
`online-accounts.js:105`

Perform the authentication on this account.

The callback will be called with the authentication result object which will have these properties:

- 'error': error message if the authentication was a failure
- 'authenticated': boolean value that identifies if the operation was a success
- 'data': Object with the data returned by the authentication process. An 'AccessToken' property can be usually found (when it applies) with the OAuth access token.

If the callback parameter is not set, the current "local" value is retrieved.

Parameters:

- `callback` <Function(Object)>

`destroy`( `` )
`online-accounts.js:125`

Destroys the remote object. This proxy object is not valid anymore.

String `displayName`( `` )
`online-accounts.js:60`

Returns The account's display name (usually the user's login or ID). Note that all AccountService objects which work on the same online account will share the same display name.

Returns: <String>

Value of the displayName

Boolean `enabled`( `` )
`online-accounts.js:49`

This read-only property returns whether the AccountService is enabled. An application shouldn't use an AccountService which is disabled

Returns: <Boolean>

Value for the enabled flag

Object `provider`( `` )
`online-accounts.js:72`

Returns an object representing the provider which provides the account.

The returned object will have at least these properties:

- 'id' is the unique identifier for this provider
- 'displayName'
- 'iconName'

Returns: <Object>

Value object for the provider

Object `service`( `` )
`online-accounts.js:87`

Returns an object representing the service which this AccountService instantiates

The returned object will have at least these properties:

- 'id' is the unique identifier for this service
- 'displayName'
- 'iconName'
- 'serviceTypeId' identifies the provided service type

Returns: <Object>

Value object for the service