@@ -99,7 +99,7 @@ Personal Access Token
9999
100100A Personal Access Token is scoped to a Seam Console user.
101101Obtain one from the Seam Console.
102- A workspace id must be provided when using this method and all requests will be scoped to that workspace.
102+ A workspace ID must be provided when using this method and all requests will be scoped to that workspace.
103103
104104.. code-block :: python
105105
@@ -118,50 +118,60 @@ A workspace id must be provided when using this method and all requests will be
118118 Action Attempts
119119~~~~~~~~~~~~~~~
120120
121- Some asynchronous operations, e.g., unlocking a door, return an `action attempt <https://docs.seam.co/latest/core-concepts/action-attempts >`_.
122- Seam tracks the progress of requested operation and updates the action attempt.
121+ Some asynchronous operations, e.g., unlocking a door, return an
122+ `action attempt <https://docs.seam.co/latest/core-concepts/action-attempts >`_.
123+ Seam tracks the progress of the requested operation and updates the action attempt
124+ when it succeeds or fails.
123125
124126To make working with action attempts more convenient for applications,
125- this library provides the ``wait_for_action_attempt `` option.
127+ this library provides the ``wait_for_action_attempt `` option and enables it by default .
126128
127- Pass the option per-request,
129+ When the ``wait_for_action_attempt `` option is enable, the SDK:
130+
131+ - Polls the action attempt up to the ``timeout ``
132+ at the ``polling_interval `` (both in seconds).
133+ - Resolves with a fresh copy of the successful action attempt.
134+ - Raises a ``SeamActionAttemptFailedError `` if the action attempt is unsuccessful.
135+ - Raises a ``SeamActionAttemptTimeoutError `` if the action attempt is still pending when the ``timeout `` is reached.
136+ - Both errors expose an ``action_attempt `` property.
137+
138+ If you already have an action attempt ID
139+ and want to wait for it to resolve, simply use
128140
129141.. code-block :: python
130142
131- seam.locks.unlock_door(
132- device_id = device_id,
133- wait_for_action_attempt = True ,
143+ seam.action_attempts.get(action_attempt_id = action_attempt_id)
144+
145+ Or, to get the current state of an action attempt by ID without waiting,
146+
147+ .. code-block :: python
148+
149+ seam.action_attempts.get(
150+ action_attempt_id = action_attempt_id,
151+ wait_for_action_attempt = False ,
134152 )
135153
136- or set the default option for the client:
154+ To disable this behavior, set the default option for the client,
137155
138156.. code-block :: python
139157
140158 seam = Seam(
141159 api_key = " your-api-key" ,
142- wait_for_action_attempt = True ,
160+ wait_for_action_attempt = False ,
143161 )
144162
145163 seam.locks.unlock_door(device_id = device_id)
146164
147- If you already have an action attempt id
148- and want to wait for it to resolve, simply use
165+ or the behavior may be configured per-request,
149166
150167.. code-block :: python
151168
152- seam.action_attempts.get (
153- action_attempt_id = action_attempt_id ,
154- wait_for_action_attempt = True ,
169+ seam.locks.unlock_door (
170+ device_id = device_id ,
171+ wait_for_action_attempt = False ,
155172 )
156173
157- Using the ``wait_for_action_attempt `` option:
158-
159- - Polls the action attempt up to the ``timeout ``
160- at the ``polling_interval `` (both in seconds).
161- - Resolves with a fresh copy of the successful action attempt.
162- - Raises a ``SeamActionAttemptFailedError `` if the action attempt is unsuccessful.
163- - Raises a ``SeamActionAttemptTimeoutError `` if the action attempt is still pending when the ``timeout `` is reached.
164- - Both errors expose an ``action_attempt `` property.
174+ The ``polling_interval `` and ``timeout `` may be configured for the client or per-request, for example
165175
166176.. code-block :: python
167177
0 commit comments