Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.22"
".": "0.1.0-alpha.23"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 103
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-6797b438a8e6a6856e28f4304a5a3c81bb67e74fa2d6fcc20e734880c725295a.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-04f02fa57c3ab8d15ecf0a16a41a83814c21cdc2a830fae4d65f1b7b2196d819.yml
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## 0.1.0-alpha.23 (2025-03-10)

Full Changelog: [v0.1.0-alpha.22...v0.1.0-alpha.23](https://github.com/orbcorp/orb-ruby/compare/v0.1.0-alpha.22...v0.1.0-alpha.23)

### Features

* add SKIP_BREW env var to ./scripts/bootstrap ([#116](https://github.com/orbcorp/orb-ruby/issues/116)) ([13e5aee](https://github.com/orbcorp/orb-ruby/commit/13e5aeefd3b81ab28d68c5b20cfeea50f95615a7))
* **api:** api update ([#119](https://github.com/orbcorp/orb-ruby/issues/119)) ([7e4a750](https://github.com/orbcorp/orb-ruby/commit/7e4a750bfa69726c4fd112f3dce9d4ee8adc1df8))


### Chores

* add `sorbet` section to README ([#117](https://github.com/orbcorp/orb-ruby/issues/117)) ([9b1ea1d](https://github.com/orbcorp/orb-ruby/commit/9b1ea1d610be3cf87332ec4bdab36f1c57f30db9))
* add more examples to README.md ([#118](https://github.com/orbcorp/orb-ruby/issues/118)) ([0420f35](https://github.com/orbcorp/orb-ruby/commit/0420f3533b7548de13162ff194fe1cc78d9fa2de))
* generate better supported rbi signatures ([#114](https://github.com/orbcorp/orb-ruby/issues/114)) ([0c64668](https://github.com/orbcorp/orb-ruby/commit/0c6466871d43ec9bfe380f050f2d7a2267373465))
* **internal:** version bump ([#112](https://github.com/orbcorp/orb-ruby/issues/112)) ([90a1f37](https://github.com/orbcorp/orb-ruby/commit/90a1f37d3fbe4c92126e3a7d6de4aba91dbaf193))
* modify sorbet initializers to better support auto-completion ([#115](https://github.com/orbcorp/orb-ruby/issues/115)) ([cbc6906](https://github.com/orbcorp/orb-ruby/commit/cbc69067aa90231c564ecc3f6cb6076aa1dfd343))

## 0.1.0-alpha.22 (2025-03-07)

Full Changelog: [v0.1.0-alpha.21...v0.1.0-alpha.22](https://github.com/orbcorp/orb-ruby/compare/v0.1.0-alpha.21...v0.1.0-alpha.22)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
orb (0.1.0.pre.alpha.22)
orb (0.1.0.pre.alpha.23)
connection_pool

GEM
Expand Down
65 changes: 46 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Orb Ruby API library

The Orb Ruby library provides convenient access to the Orb REST API from any Ruby 3.0.0+
application.
The Orb Ruby library provides convenient access to the Orb REST API from any Ruby 3.0.0+ application.

## Documentation

Expand All @@ -11,8 +10,7 @@ The underlying REST API documentation can be found on [docs.withorb.com](https:/

## Installation

To use this gem during the beta, install directly from GitHub with Bundler by
adding the following to your application's `Gemfile`:
To use this gem during the beta, install directly from GitHub with Bundler by adding the following to your application's `Gemfile`:

```ruby
gem "orb", git: "https://github.com/orbcorp/orb-ruby", branch: "main"
Expand All @@ -24,8 +22,7 @@ To fetch an initial copy of the gem:
bundle install
```

To update the version used by your application when updates are pushed to
GitHub:
To update the version used by your application when updates are pushed to GitHub:

```sh
bundle update orb
Expand All @@ -46,11 +43,28 @@ customer = orb.customers.create(email: "[email protected]", name: "My
puts(customer.id)
```

## Pagination

List methods in the Orb API are paginated.

This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:

```ruby
page = orb.coupons.list

# Fetch single item from page.
coupon = page.data[0]
puts(coupon.id)

# Automatically fetches more pages as needed.
page.auto_paging_each do |coupon|
puts(coupon.id)
end
```

### Errors

When the library is unable to connect to the API, or if the API returns a
non-success status code (i.e., 4xx or 5xx response), a subclass of
`Orb::Error` will be thrown:
When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `Orb::Error` will be thrown:

```ruby
begin
Expand Down Expand Up @@ -78,10 +92,9 @@ Error codes are as followed:

### Retries

Certain errors will be automatically retried 2 times by default, with a short
exponential backoff. Connection errors (for example, due to a network
connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors,
and timeouts will all be retried by default.
Certain errors will be automatically retried 2 times by default, with a short exponential backoff.

Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, and timeouts will all be retried by default.

You can use the `max_retries` option to configure or disable this:

Expand All @@ -102,8 +115,8 @@ orb.customers.create(
### Timeouts

By default, requests will time out after 60 seconds.
Timeouts are applied separately to the initial connection and the overall request time,
so in some cases a request could wait 2\*timeout seconds before it fails.

Timeouts are applied separately to the initial connection and the overall request time, so in some cases a request could wait 2\*timeout seconds before it fails.

You can use the `timeout` option to configure or disable this:

Expand All @@ -121,12 +134,26 @@ orb.customers.create(
)
```

## Sorbet Support

This library is written with [Sorbet type definitions](https://sorbet.org/docs/rbi). However, there is no runtime dependency on the `sorbet-runtime`.

What this means is that while you can use Sorbet to type check your code statically, and benefit from the [Sorbet Language Server](https://sorbet.org/docs/lsp) in your editor, there is no runtime type checking and execution overhead from Sorbet itself.

Due to limitations with the Sorbet type system, where a method otherwise can take an instance of `Orb::BaseModel` class, you will need to use the `**` splat operator to pass the arguments:

```ruby
model = CustomerCreateParams.new(email: "[email protected]", name: "My Customer")

orb.customers.create(**model)
```

## Versioning

This package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the
library is in initial development and has a major version of `0`, APIs may change
at any time.
This package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the library is in initial development and has a major version of `0`, APIs may change at any time.

This package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` type definitions to be non-breaking changes.

## Requirements

Ruby 3.0 or higher.
Ruby 3.0.0 or higher.
Loading
Loading