-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migration guide from seamapi package #7
Comments
Migration guideLearn how to migrate from the The new SDK has fewer dependencies and is generated daily to ensure methods and types are always up-to-date with the latest API changes. It is mostly a drop-in replacement, however some method signatures and options have changed to improve overall consistency with the Seam API. This guide includes descriptions of all breaking changes. Please refer to the README for updated usage instructions and a complete list of new features. New Python package nameChanged the package name from - pip install seamapi
+ pip install seam - from seamapi import Seam
+ from seam import Seam Updated API method signaturesKeyword argumentsAPI method signatures now only accept keyword arguments. - seam.access_codes.get("my_access_code_id")
+ seam.access_codes.get(access_code_id="my_access_code_id") - seam.thermostats.get("my_thermostat_device_id")
+ seam.thermostats.get(device_id="my_thermostat_device_id") Standardized resource ID argumentsChanged from accepting both resource objects and resource ID strings to accepting only resource ID strings. Includes a renaming scheme for clarity. - def get(resource: Union[str, Resource]) -> Resource
+ def get(resource_id: str) -> Resource Usage- seam.locks.get(device=my_device)
+ seam.locks.get(device_id=my_device.device_id) Removed method argumentsRemoved Return value changesChanged the return types for some methods to enhance API consistency and reliability. The following methods now return
The following methods now return a
The following methods now return an
Action attempt resolutionMethods returning action attempts still wait for the action attempt to resolve by default. Further, you can now configure this behavior using the Set per request# Wait for the action attempt to be ready with a default timeout of 5.0 seconds and a default polling interval of 0.5 seconds.
seam.locks.lock_door(
device_id="my_device_id",
wait_for_action_attempt=True
)
# Wait up to 10 seconds for the action attempt to be ready, checking every 2 seconds.
seam.locks.lock_door(
device_id="my_device_id",
wait_for_action_attempt={
"timeout": 10.0, # Up to 10 seconds
"polling_interval": 2.0 # Every 2 seconds
}
) Set default behaviorseam = Seam(wait_for_action_attempt=True) Environment variablesAdded support for the Using Personal Access Tokens without a Workspace IDUse - const seam = new Seam({ personal_access_token: 'your-personal-access-token' })
- const workspace = seam.workspaces.create({ company_name: 'Example Inc.' })
+ const seam_multi_workspace = new SeamMultiWorkspace({ personal_access_token: 'your-personal-access-token' })
+ const workspace = seam_multi_workspace.workspaces.create({ company_name: 'Example Inc.' }) Third-party component support and version changes
|
these changes are all around really nice |
API key authentication with
|
Migration Guide: SDK Transition from Handwritten to Auto-Generated Code
Welcome to the migration guide for transitioning from the handwritten version of our SDK to the new auto-generated version. This guide is intended for developers who have been using the previous version of our SDK and need to update their codebase to accommodate the breaking changes introduced in the latest release. Our aim is to ensure a smooth transition by covering all essential updates, including method signature changes, return value modifications, and adjustments in support for third-party components and environment variables.
Summary of Changes
wait_for_action_attempt
configuration options.New Python package name
Changed the package name from
seamapi
toseam
.Updated API Method Signatures
Method Parameter Changes
We have updated API method signatures to only accept keyword arguments, and standardized resource ID arguments across the SDK:
In addition, we've moved from accepting both resource objects and resource ID strings to only accepting resource ID strings, with a renaming scheme for clarity:
Usage has been updated accordingly:
Removed method arguments:
wait_for_code
fromaccess_codes.create
. Use the newly-createdaccess_code_id
to poll or watch for events.Return Value Changes
We've changed the return types for some methods to enhance API consistency and reliability:
access_codes.delete
access_codes.unmanaged.delete
access_codes.update
noise_sensors.noise_thresholds.delete
noise_sensors.noise_thresholds.update
thermostats.climate_setting_schedules.update
access_codes.unmanaged.convert_to_managed
.NoiseThreshold
:noise_sensors.noise_thresholds.create
. Use the newly-creatednoise_threshold_id
to poll or watch for events.ActionAttempt
:workspaces.reset_sandbox
Action Attempt Resolution
Methods returning action attempts no longer wait for the action attempt to resolve by default. You can configure this behavior on a per-request basis using the
wait_for_action_attempt
option:You can also set the default behavior for the client.
Environment Variables
SEAM_ENDPOINT
environment variable.Third-Party Component Support and Version Changes
dataclasses-json
Version: Updated to 0.6.4.requests
withniquests
version 3.6.4.The text was updated successfully, but these errors were encountered: