Skip to content

Commit

Permalink
docs: update docs (#516)
Browse files Browse the repository at this point in the history
- Include information for deleteAttributes operation
_ Include information for play behavior in response
- Update missing reference
  • Loading branch information
tianrenz committed Feb 21, 2019
1 parent 7a51f29 commit 9d7a343
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/en/Building-Response.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Available Methods

.. code-block:: typescript
speak(speechOutput: string): this;
reprompt(repromptSpeechOutput: string): this;
speak(speechOutput: string, playBehavior? : ui.PlayBehavior): this;
reprompt(repromptSpeechOutput: string, playBehavior? : ui.PlayBehavior): this;
withSimpleCard(cardTitle: string, cardContent: string): this;
withStandardCard(cardTitle: string, cardContent: string, smallImageUrl?: string, largeImageUrl?: string): this;
withLinkAccountCard(): this;
Expand Down
5 changes: 3 additions & 2 deletions docs/en/Calling-Alexa-Service-APIs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ Available Methods
getDirectiveServiceClient() : directive.DirectiveServiceClient;
getListManagementServiceClient() : listManagement.ListManagementServiceClient;
getMonetizationServiceClient() : monetization.MonetizationServiceClient;
getReminderManagementServiceClient(): reminderManagement.ReminderManagementServiceClient;
getUpsServiceClient() : ups.UpsServiceClient;
.. note::

``ServiceClientFactory`` are only available when you `configure the skill instance <Configuring-Skill-Instance.html>`_ with an ``ApiClient``.
``ServiceClientFactory`` is only available when you `configure the skill instance <Configuring-Skill-Instance.html>`_ with an ``ApiClient``.

ApiClient
=========
Expand Down Expand Up @@ -55,7 +56,7 @@ Interface
DefaultApiClient
----------------

``ask-sdk-core`` package provides a ``DefaultApiClient`` which is an implemenntation of ``ApiClient`` using the Node.js native ``https`` client.
``ask-sdk-core`` package provides a ``DefaultApiClient`` which is an implementation of ``ApiClient`` using the Node.js native ``https`` client.

Constructor Details
^^^^^^^^^^^^^^^^^^^
Expand Down
16 changes: 14 additions & 2 deletions docs/en/Managing-Attributes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Available Methods
setSessionAttributes(sessionAttributes : {[key : string] : any}) : void;
setPersistentAttributes(persistentAttributes : {[key : string] : any}) : void;
savePersistentAttributes() : Promise<void>;
deletePersistentAttributes?() : Promise<void>;
The following example shows how you can retrieve and save persistent attributes.
Expand Down Expand Up @@ -120,7 +121,7 @@ The following example shows how you can retrieve and save persistent attributes.
.. note::

To improve skill performance, ``AttributesManager`` caches the persistent attributes locally. ``setPersistentAttributes()`` will only update the locally cached persistent attributes. You need to call ``savePersistentAttributes()`` to save persistent attributes to the persistence layer.
To improve skill performance, ``AttributesManager`` caches the persistent attributes locally. ``setPersistentAttributes()`` will only update the locally cached persistent attributes. You need to call ``savePersistentAttributes()`` to save persistent attributes to the persistence layer. Calling ``deletePersistentAttributes()`` will also delete the locally cached persistent attributes.

PersistenceAdapter
==================
Expand All @@ -135,6 +136,7 @@ Interface
interface PersistenceAdapter {
getAttributes(requestEnvelope : RequestEnvelope) : Promise<{[key : string] : any}>;
saveAttributes(requestEnvelope : RequestEnvelope, attributes : {[key : string] : any}) : Promise<void>;
deleteAttributes?(requestEnvelope : RequestEnvelope) : Promise<void>;
}
DynamoDbPersistenceAdapter
Expand All @@ -149,7 +151,7 @@ Constructor Details
new DynamoDbPersistenceAdapter(config = {}) => Object
Constructs a ``DynamoDbPersistenceAdapter`` object. This object is used by ``AttributesManager`` to retrieve and save attributes object to a DynamoDB table. The table will have two columns: one for the parition key and one for attributes. If ``createTable`` config is set to ``true``, SDK will attempt to create a new DynamoDB table with the given ``tableName`` when instantiating the ``DynamoDbPersistenceAdapter``.
Constructs a ``DynamoDbPersistenceAdapter`` object. This object is used by ``AttributesManager`` to retrieve, save and delete attributes object to/from a DynamoDB table. The table will have two columns: one for the parition key and one for attributes. If ``createTable`` config is set to ``true``, SDK will attempt to create a new DynamoDB table with the given ``tableName`` when instantiating the ``DynamoDbPersistenceAdapter``.

Examples
""""""""
Expand Down Expand Up @@ -192,6 +194,11 @@ The ``getAttributes`` operation retrieves the attributes from the DynamoDB table

The ``saveAttributes`` operation saves the attributes to the DynamoDB table using the partition key generated from the ``RequestEnvelope``. It uses a ``DynamoDBDocumentClient`` with ``convertEmptyValues`` set to ``true``. So that any ``""``, ``null`` or ``undefined`` values in the attributes object will be converted.

``deleteAttributes(requestEnvelope : RequestEnvelope) : Promise<void>``
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

The ``deleteAttributes`` operation deletes the attributes from the DynamoDb table suing the partition key generated from the ``RequestEnvelope``. This operation will also clear the locally cached persistent attributes to ensure consistency. If the attributes with the partition key does not exist in the table, ``deleteAttributes`` will do nothing.

S3PersistenceAdapter
--------------------

Expand Down Expand Up @@ -248,3 +255,8 @@ The ``getAttributes`` operation retrieves the attributes from the S3 bucket. It
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

The ``saveAttributes`` operation saves the attributes to the S3 bucket using the object key generated from the ``RequestEnvelope``.

``deleteAttributes(requestEnvelope : RequestEnvelope) : Promise<void>``
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

The ``deleteAttributes`` operation deletes the attributes from the S3 bucket using the object key generated from the ``RequestEnvelope``.

0 comments on commit 9d7a343

Please sign in to comment.