Alexa Auto SDK  2.0.0
Public Types | Public Member Functions | List of all members
aace::contactUploader::ContactUploader Class Referenceabstract

Public Types

using ContactUploaderStatus = aace::contactUploader::ContactUploaderEngineInterface::ContactUploaderStatus
 

Public Member Functions

bool addContactsBegin ()
 
bool addContactsEnd ()
 
bool addContactsCancel ()
 
bool addContact (const std::string &contact)
 
bool removeUploadedContacts ()
 
virtual void contactsUploaderStatusChanged (ContactUploaderStatus status, const std::string &info)=0
 

Detailed Description

ContactUploader should be extended to upload the local (aka native) contacts to the Alexa Cloud. ContactUploader Engine uploads the contacts to the Alexa Cloud in batches. The Engine API blocks calls, so platform implementation should make sure ContactUploader is called on a separate process other then the user interface thread.

The platform implementation is notified about the status of the upload by contactsUploaderStatusChanged.

Member Typedef Documentation

◆ ContactUploaderStatus

using aace::contactUploader::ContactUploader::ContactUploaderStatus = aace::contactUploader::ContactUploaderEngineInterface::ContactUploaderStatus

Describes the status of contact uploader.

See also
aace::contactUploader::ContactUploaderEngineInterface::ContactUploadStatus

Member Function Documentation

◆ addContactsBegin()

bool aace::contactUploader::ContactUploader::addContactsBegin ( )

Notifies the Engine to begin the contact upload.

After returning true, the Engine will remove the previously uploaded contacts, if any, and the platform implementation may start calling addContact to upload the contacts.

Returns
true on successful start, false if previous upload is in progress or due to any internal error.

◆ addContactsEnd()

bool aace::contactUploader::ContactUploader::addContactsEnd ( )

Notifies the Engine about the completion of the contact upload.

The platform implementation to call this when all the contacts are uploaded via

See also
addContact. Engine on returning true, will not accept any contact and shall notify the platform implementation
contactsUploaderStatusChanged about the status of upload.
Returns
true on successful, false if no upload in progress or due to any internal error.

◆ addContactsCancel()

bool aace::contactUploader::ContactUploader::addContactsCancel ( )

Notifies the Engine to cancel the upload which is in progress.

The platform implementation can call this anytime to cancel the contact upload when it is in progress. Engine on returning , will not accept any contact, and shall notify the platform implementation

See also
contactsUploaderStatusChanged about the cancel status and it shall also remove any partial uploaded contacts from Alexa Cloud.
Returns
true on successful, false if no upload in progress or due to any internal error.

◆ addContact()

bool aace::contactUploader::ContactUploader::addContact ( const std::string &  contact)

Notifies the Engine to upload the contact.

Engine on returning true shall queue this contact for uploading in batches.

Parameters
[in]contactDetails of one contact to upload in structured JSON format. See the following payload structure and the description of each field:
)
{
"id" : "{{STRING}}",
"firstName" : "{{STRING}}",
"lastName" : "{{STRING}}",
"nickName" : "{{STRING}}"
"company" : "{{STRING}}",
"addresses" : [
{
"type" : "{{STRING}}",
"value" : "{{STRING}}",
"label" : "{{STRING}}"
}
]
}
  • id (required): A unique identifier for the contact in the platform contact store.
  • firstName (optional): The first name of the contact. Limit is 1000 characters.
  • lastName (optional): The last name of the contact. Limit is 1000 characters.
  • nickName (optional): The nick name of the contact. Limit is 1000 characters.
  • company (optional): The company name of the contact. Limit is 1000 characters.
  • addresses (required): The address information of the contact. At least one address required to be specified.
  • addresses.type (required): Supported address type is "phonenumber" only. And the max supported phone number per contact is 30.
  • addresses.value (required): The phone number of the contact. Limit is 100 characters.
  • addresses.label (optional): The type value of the phone number like HOME. MOBILE, Phone1.
Returns
true if successfully queued, false when contact format is not valid, upload not started or for any internal error.

◆ removeUploadedContacts()

bool aace::contactUploader::ContactUploader::removeUploadedContacts ( )

Notifies the Engine to remove the uploaded local contacts from the Alexa Cloud. This API to be called when the local contacts become unavailable (Example use case, Phone is disconnected from the Head Unit) and contacts were already successfully uploaded to Alexa Cloud.

Engine on returning true shall notify the platform implementation about the removal status of contacts via

See also
contactsUploaderStatusChanged.
Returns
true on successful, false if upload is in progress or due to any internal error.

◆ contactsUploaderStatusChanged()

virtual void aace::contactUploader::ContactUploader::contactsUploaderStatusChanged ( ContactUploaderStatus  status,
const std::string &  info 
)
pure virtual

Notifies the platform implementation about status that occurred while uploading the batch of contacts or while removing the uploaded contacts.

Parameters
[in]statusThe ContactUploaderStatus
[in]infoThe string with additional information.

Alexa Auto SDK 2.0.0 - Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0