Skip to content

Releases: seamapi/ruby

v2.3.2

16 Dec 12:07
v2.3.2
f8a1fec
Compare
Choose a tag to compare

2.3.2 (2024-12-16)

Bug Fixes

v2.3.1

16 Dec 12:03
v2.3.1
8b43e35
Compare
Choose a tag to compare

2.3.1 (2024-12-16)

Bug Fixes

  • Avoid wrapping empty hash resource values in DeepHashAccessor (#190) (05573f9)

v2.3.0

22 Nov 07:09
v2.3.0
63f604a
Compare
Choose a tag to compare

2.3.0 (2024-11-22)

Features

  • deps-dev: Bump the seam group with 2 updates (41a7a01)

v2.2.0

21 Nov 07:05
v2.2.0
af5365c
Compare
Choose a tag to compare

2.2.0 (2024-11-21)

Features

  • deps-dev: Bump the seam group with 2 updates (a6f05a6)

v2.1.0

19 Nov 06:35
v2.1.0
f97eb43
Compare
Choose a tag to compare

2.1.0 (2024-11-19)

Features

  • deps-dev: Bump @seamapi/types in the seam group across 1 directory (83c97e7)

v2.0.1

18 Nov 19:52
v2.0.1
b8a7bc2
Compare
Choose a tag to compare

2.0.1 (2024-11-18)

Bug Fixes

  • Bump SDK generator to 1.14.12, fix tests (#169) (4ecd611)

v2.0.0rc0

15 Nov 22:46
v2.0.0rc0
fd645cf
Compare
Choose a tag to compare

Bug Fixes

  • Fix update_from_response base resource method to use DeepHashAccessor 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

15 Nov 22:49
v2.0.0
a1a621e
Compare
Choose a tag to compare

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 the access_code.deleted event.
  • access_codes.update: Instead, you should watch for relevant access_code.* events or poll the resource as needed.
  • access_codes.unmanaged.delete
  • access_codes.unmanaged.convert_to_managed: Instead, you should wait for the access_code.unmanaged.converted_to_managed and access_code.unmanaged.failed_to_convert_to_managed events.

The following methods now return an ActionAttempt:

  • workspaces.reset_sandbox: Instead, you should use the newly-created action_attempt_id to poll the status of the action attempt using seam.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

14 Nov 16:28
v2.0.0b5
5f0af0c
Compare
Choose a tag to compare

Bug Fixes

  • Fix update_from_response base resource method to use DeepHashAccessor 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

13 Nov 17:25
v2.0.0b4
541b9b0
Compare
Choose a tag to compare

Bug Fixes

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)