Releases: seamapi/ruby
v2.3.2
v2.3.1
v2.3.0
v2.2.0
v2.1.0
v2.0.1
v2.0.0rc0
Bug Fixes
- Fix
update_from_response
base resource method to useDeepHashAccessor
for nested hashes (#164) (ed99936) - Import from svix subpaths (#154) (d361c4b)
- Import version (9dd12da)
- Missing require statements (#157) (4b55a41)
Features
- deps-dev: Bump @seamapi/nextlove-sdk-generator in the seam group (db0346e)
- deps-dev: Bump @seamapi/types in the seam group (31a888b)
- deps-dev: Bump @seamapi/types in the seam group (a473a6e)
- deps-dev: Bump @seamapi/types in the seam group (04848be)
- deps-dev: Bump @seamapi/types in the seam group (cb23118)
- deps-dev: Bump @seamapi/types in the seam group (ef0f7e0)
- deps-dev: Bump @seamapi/types in the seam group (6ea2411)
- deps-dev: Bump @seamapi/types in the seam group (3d3a931)
- deps-dev: Bump @seamapi/types in the seam group (dfc97ce)
- deps-dev: Bump @seamapi/types in the seam group (0d5cb72)
- deps-dev: Bump @seamapi/types in the seam group (f039554)
- deps-dev: Bump @seamapi/types in the seam group (29512c3)
- deps-dev: Bump @seamapi/types in the seam group (6f70e9d)
- deps-dev: Bump @seamapi/types in the seam group (c2ad8d6)
- deps-dev: Bump @seamapi/types in the seam group (3280a29)
- deps-dev: Bump @seamapi/types in the seam group (1017e4a)
- deps-dev: Bump @seamapi/types in the seam group (e6cf324)
- deps-dev: Bump @seamapi/types in the seam group (ef0dfe0)
- deps-dev: Bump @seamapi/types in the seam group (f40db39)
- deps-dev: Bump @seamapi/types in the seam group (0655f9c)
- deps-dev: Bump @seamapi/types in the seam group (e722679)
- deps-dev: Bump @seamapi/types in the seam group (8cbca39)
- deps-dev: Bump @seamapi/types in the seam group (dc95187)
- deps-dev: Bump @seamapi/types in the seam group (4a15d78)
- deps-dev: Bump @seamapi/types in the seam group (023178f)
- deps-dev: Bump @seamapi/types in the seam group across 1 directory (eac2f9a)
- deps-dev: Bump @seamapi/types in the seam group across 1 directory (0dbcd9b)
- deps-dev: Bump @seamapi/types in the seam group across 1 directory (6709e89)
- deps-dev: Bump the seam group across 1 directory with 2 updates (786e1ee)
- deps-dev: bump the seam group with 2 updates (88f2bb5)
- deps-dev: bump the seam group with 2 updates (bb79a54)
- deps-dev: bump the seam group with 2 updates (f30aad9)
- deps-dev: Bump the seam group with 2 updates (1a64314)
- deps-dev: Bump the seam group with 2 updates (1e3246c)
- deps-dev: Bump the seam group with 2 updates (67b9edf)
- deps-dev: Bump the seam group with 2 updates (40ce74c)
- deps-dev: Bump the seam group with 2 updates (0abbe17)
- deps-dev: Bump the seam group with 2 updates (01e924d)
v2.0.0
Migration guide
Learn how to migrate from the seamapi
package to the seam
package.
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 Ruby gem name
Changed the gem name from seamapi
to seam
.
- bundle add seamapi
+ bundle add seam
Simplified main class initialization
The main class has been renamed from Seam::Client
to Seam
. You can now initialize it directly.
seam = Seam.new(api_key: "your-api-key")
Specify your-api-key
during initialization, or Seam automatically uses your exported SEAM_API_KEY
.
Updated API method signatures
Keyword arguments
API method signatures now only accept keyword arguments.
- seam.access_codes.get("your-access-code-id")
+ seam.access_codes.get(access_code_id: "your-access-code-id")
- seam.devices.get("your-device-id")
+ seam.devices.get(device_id: "your-device-id")
Standardized resource ID arguments
Changed from accepting both resource objects and resource ID strings to accepting only resource ID strings. Includes a renaming scheme for clarity.
- def unlock_door(device_or_id)
+ def unlock_door(device_id:)
Usage
- seam.devices.get(device: your_device)
+ seam.devices.get(device_id: your_device.device_id)
Removed methods
wait_until_finished
Removed wait_until_finished
from the ActionAttempt
resource. To resolve an action attempt returned by the method, use the wait_for_action_attempt
method argument instead.
- seam.locks.unlock_door(device_id: "your-device-id").wait_until_finished
+ seam.locks.unlock_door(device_id: "your-device-id", wait_for_action_attempt: true)
seam.health
Removed the seam.health
method for checking client health. In the future, we plan to add a health check mechanism that is consistent across all the Seam SDKs.
Removed constructor argument
Removed the debug
argument from the Seam
class constructor.
Renamed constructor argument
Renamed the base_uri
argument to endpoint
for overriding the default API endpoint.
Deprecated methods
seam.unmanaged_access_codes
seam.unmanaged_access_codes
is now deprecated. Use seam.access_codes.unmanaged
instead.
- seam.unmanaged_access_codes.get(access_code_id: "your-access-code-id")
+ seam.access_codes.unmanaged.get(access_code_id: "your-access-code-id")
seam.unmanaged_devices
seam.unmanaged_devices
is now deprecated. Use seam.devices.unmanaged
instead.
- seam.unmanaged_devices.get(device_id: "your-device-id")
+ seam.devices.unmanaged.get(device_id: "your-device-id")
Return value changes
Changed the return values for some methods to enhance API consistency and reliability.
The following methods now return nil
:
access_codes.delete
: Instead, you should wait for theaccess_code.deleted
event.access_codes.update
: Instead, you should watch for relevantaccess_code.*
events or poll the resource as needed.access_codes.unmanaged.delete
access_codes.unmanaged.convert_to_managed
: Instead, you should wait for theaccess_code.unmanaged.converted_to_managed
andaccess_code.unmanaged.failed_to_convert_to_managed
events.
The following methods now return an ActionAttempt
:
workspaces.reset_sandbox
: Instead, you should use the newly-createdaction_attempt_id
to poll the status of the action attempt usingseam.action_attempts.get
.
Action attempt resolution
Now, all methods returning action attempts wait for the action attempt to resolve by default. Further, you can configure this behavior using the wait_for_action_attempt
option on a per-request basis. You can also set the default behavior for the client.
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: "your-device-id",
wait_for_action_attempt: false
)
# Wait up to 10 seconds for the action attempt to be ready, checking every 2 seconds.
seam.locks.lock_door(
device_id: "your-device-id",
wait_for_action_attempt: {
timeout: 10.0, # Up to 10 seconds
polling_interval: 2.0 # Every 2 seconds
}
)
Set default behavior
seam = Seam.new(wait_for_action_attempt: false)
Resource attribute references
Now, use dot notation instead of square brackets to refer to resource attributes.
- front_door.properties['online']
+ front_door.properties.online
Environment variables
The SEAM_API_URL
environment variable is now deprecated. Use SEAM_ENDPOINT
instead.
Version changes
Updated the minimum supported Ruby version to 3.1.0.
Highlighted new features
API key authentication with from_api_key
factory method
Added a new from_api_key
factory method for API key authentication of the Seam
client.
seam = Seam.from_api_key("your-api-key")
PAT authentication scoped to a single workspace
Added support for workspace personal access token (PAT) authentication.
# Pass as an option to the constructor.
seam = Seam.new(
personal_access_token: "your-personal-access-token",
workspace_id: "your-workspace-id",
)
# Use the factory method
seam = Seam.from_personal_access_token(
"your-personal-access-token",
"your-workspace-id",
)
PAT authentication not bound to a specific workspace
For authentication with a personal access token not bound to a specific workspace, use Seam::Http::SeamMultiWorkspace
.
# Pass as an option to the constructor.
seam_multi_workspace = Seam::Http::SeamMultiWorkspace.new(personal_access_token: "your-personal-access-token")
# Use the factory method.
seam_multi_workspace = Seam::Http::SeamMultiWorkspace.from_personal_access_token(
"your-personal-access-token"
)
workspace = seam_multi_workspace.workspaces.create(company_name: "Example Inc.")
Webhook handler
The Ruby SDK exports a thin wrapper Seam::Webhook
around the svix package. Use it to parse and validate Seam webhook events.
New configurable Faraday HTTP client with retry options
The Ruby SDK now uses the Faraday HTTP client under the hood, which you can configure using faraday_options
and faraday_retry_options
.
seam = Seam.new(
api_key: "your-api-key",
faraday_options: {
headers: {
"Custom-Header": "Custom-Value"
}
},
faraday_retry_options: {
max: 3,
backoff_factor: 2
}
)
The Faraday client is also exposed through the seam.client
property and can be used or configured directly.
require "seam"
require "faraday"
class MyMiddleware < Faraday::Middleware
def on_complete(env)
puts env.response.inspect
end
end
seam = Seam.new
seam.client.builder.use MyMiddleware
devices = seam.client.get("/devices/list").body["devices"]
v2.0.0b5
Bug Fixes
- Fix
update_from_response
base resource method to useDeepHashAccessor
for nested hashes (#164) (ed99936) - Import from svix subpaths (#154) (d361c4b)
- Import version (9dd12da)
- Missing require statements (#157) (4b55a41)
Features
- deps-dev: Bump @seamapi/nextlove-sdk-generator in the seam group (db0346e)
- deps-dev: Bump @seamapi/types in the seam group (31a888b)
- deps-dev: Bump @seamapi/types in the seam group (a473a6e)
- deps-dev: Bump @seamapi/types in the seam group (04848be)
- deps-dev: Bump @seamapi/types in the seam group (cb23118)
- deps-dev: Bump @seamapi/types in the seam group (ef0f7e0)
- deps-dev: Bump @seamapi/types in the seam group (6ea2411)
- deps-dev: Bump @seamapi/types in the seam group (3d3a931)
- deps-dev: Bump @seamapi/types in the seam group (dfc97ce)
- deps-dev: Bump @seamapi/types in the seam group (0d5cb72)
- deps-dev: Bump @seamapi/types in the seam group (f039554)
- deps-dev: Bump @seamapi/types in the seam group (29512c3)
- deps-dev: Bump @seamapi/types in the seam group (6f70e9d)
- deps-dev: Bump @seamapi/types in the seam group (c2ad8d6)
- deps-dev: Bump @seamapi/types in the seam group (3280a29)
- deps-dev: Bump @seamapi/types in the seam group (1017e4a)
- deps-dev: Bump @seamapi/types in the seam group (e6cf324)
- deps-dev: Bump @seamapi/types in the seam group (ef0dfe0)
- deps-dev: Bump @seamapi/types in the seam group (f40db39)
- deps-dev: Bump @seamapi/types in the seam group (0655f9c)
- deps-dev: Bump @seamapi/types in the seam group (e722679)
- deps-dev: Bump @seamapi/types in the seam group (8cbca39)
- deps-dev: Bump @seamapi/types in the seam group (dc95187)
- deps-dev: Bump @seamapi/types in the seam group (4a15d78)
- deps-dev: Bump @seamapi/types in the seam group (023178f)
- deps-dev: Bump @seamapi/types in the seam group across 1 directory (eac2f9a)
- deps-dev: Bump @seamapi/types in the seam group across 1 directory (0dbcd9b)
- deps-dev: Bump @seamapi/types in the seam group across 1 directory (6709e89)
- deps-dev: Bump the seam group across 1 directory with 2 updates (786e1ee)
- deps-dev: bump the seam group with 2 updates (88f2bb5)
- deps-dev: bump the seam group with 2 updates (bb79a54)
- deps-dev: bump the seam group with 2 updates (f30aad9)
- deps-dev: Bump the seam group with 2 updates (1a64314)
- deps-dev: Bump the seam group with 2 updates (1e3246c)
- deps-dev: Bump the seam group with 2 updates (67b9edf)
- deps-dev: Bump the seam group with 2 updates (40ce74c)
- deps-dev: Bump the seam group with 2 updates (0abbe17)
- deps-dev: Bump the seam group with 2 updates (01e924d)
v2.0.0b4
Bug Fixes
- Import from svix subpaths (#154) (d361c4b)
- Import version (9dd12da)
- Missing require statements (#157) (4b55a41)
Features
- deps-dev: Bump @seamapi/nextlove-sdk-generator in the seam group (db0346e)
- deps-dev: Bump @seamapi/types in the seam group (31a888b)
- deps-dev: Bump @seamapi/types in the seam group (a473a6e)
- deps-dev: Bump @seamapi/types in the seam group (04848be)
- deps-dev: Bump @seamapi/types in the seam group (cb23118)
- deps-dev: Bump @seamapi/types in the seam group (ef0f7e0)
- deps-dev: Bump @seamapi/types in the seam group (6ea2411)
- deps-dev: Bump @seamapi/types in the seam group (3d3a931)
- deps-dev: Bump @seamapi/types in the seam group (dfc97ce)
- deps-dev: Bump @seamapi/types in the seam group (0d5cb72)
- deps-dev: Bump @seamapi/types in the seam group (f039554)
- deps-dev: Bump @seamapi/types in the seam group (29512c3)
- deps-dev: Bump @seamapi/types in the seam group (6f70e9d)
- deps-dev: Bump @seamapi/types in the seam group (c2ad8d6)
- deps-dev: Bump @seamapi/types in the seam group (3280a29)
- deps-dev: Bump @seamapi/types in the seam group (1017e4a)
- deps-dev: Bump @seamapi/types in the seam group (e6cf324)
- deps-dev: Bump @seamapi/types in the seam group (ef0dfe0)
- deps-dev: Bump @seamapi/types in the seam group (f40db39)
- deps-dev: Bump @seamapi/types in the seam group (0655f9c)
- deps-dev: Bump @seamapi/types in the seam group (e722679)
- deps-dev: Bump @seamapi/types in the seam group (8cbca39)
- deps-dev: Bump @seamapi/types in the seam group (dc95187)
- deps-dev: Bump @seamapi/types in the seam group (4a15d78)
- deps-dev: Bump @seamapi/types in the seam group (023178f)
- deps-dev: Bump @seamapi/types in the seam group across 1 directory (eac2f9a)
- deps-dev: Bump @seamapi/types in the seam group across 1 directory (0dbcd9b)
- deps-dev: Bump @seamapi/types in the seam group across 1 directory (6709e89)
- deps-dev: Bump the seam group across 1 directory with 2 updates (786e1ee)
- deps-dev: bump the seam group with 2 updates (88f2bb5)
- deps-dev: bump the seam group with 2 updates (bb79a54)
- deps-dev: bump the seam group with 2 updates (f30aad9)
- deps-dev: Bump the seam group with 2 updates (1a64314)
- deps-dev: Bump the seam group with 2 updates (1e3246c)
- deps-dev: Bump the seam group with 2 updates (67b9edf)
- deps-dev: Bump the seam group with 2 updates (40ce74c)
- deps-dev: Bump the seam group with 2 updates (0abbe17)
- deps-dev: Bump the seam group with 2 updates (01e924d)