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.30"
".": "0.1.0-alpha.31"
}
7 changes: 5 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ Metrics/ParameterLists:
Metrics/PerceivedComplexity:
Enabled: false

# Need to preserve block identifier for documentation.
Naming/BlockForwarding:
Exclude:
- "**/*.rbi"
Enabled: false

Naming/ClassAndModuleCamelCase:
Exclude:
Expand Down Expand Up @@ -153,6 +153,9 @@ Style/Alias:
Style/AndOr:
EnforcedStyle: always

Style/ArgumentsForwarding:
Enabled: false

Style/BisectedAttrAccessor:
Exclude:
- "**/*.rbi"
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.1.0-alpha.31 (2025-04-01)

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

### Bug Fixes

* path interpolation template strings ([#193](https://github.com/orbcorp/orb-ruby/issues/193)) ([d7f8470](https://github.com/orbcorp/orb-ruby/commit/d7f847086456498cf218c449137e88d9b6d2aa64))


### Chores

* fix misc rubocop errors ([#192](https://github.com/orbcorp/orb-ruby/issues/192)) ([9a01dbc](https://github.com/orbcorp/orb-ruby/commit/9a01dbc37ef0e6508ed133d1a7e1891b6883f498))
* **internal:** version bump ([#190](https://github.com/orbcorp/orb-ruby/issues/190)) ([a25b776](https://github.com/orbcorp/orb-ruby/commit/a25b776d48ecb47779a0ec9d57d9047d5b627ed7))

## 0.1.0-alpha.30 (2025-04-01)

Full Changelog: [v0.1.0-alpha.29...v0.1.0-alpha.30](https://github.com/orbcorp/orb-ruby/compare/v0.1.0-alpha.29...v0.1.0-alpha.30)
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.30)
orb (0.1.0.pre.alpha.31)
connection_pool

GEM
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The underlying REST API documentation can be found on [docs.withorb.com](https:/
To use this gem, install via Bundler by adding the following to your application's `Gemfile`:

```ruby
gem "orb", "~> 0.1.0.pre.alpha.29"
gem "orb", "~> 0.1.0.pre.alpha.30"
```

To fetch an initial copy of the gem:
Expand Down Expand Up @@ -141,7 +141,7 @@ Due to limitations with the Sorbet type system, where a method otherwise can tak
Please follow Sorbet's [setup guides](https://sorbet.org/docs/adopting) for best experience.

```ruby
model = CustomerCreateParams.new(email: "example-customer@withorb.com", name: "My Customer")
model = Orb::Models::CustomerCreateParams.new(email: "example-customer@withorb.com", name: "My Customer")

orb.customers.create(**model)
```
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ xargs = %w[xargs --no-run-if-empty --null --max-procs=0 --max-args=300 --]
multitask(default: [:test])

multitask(:test) do
rb =
rb =
FileList[ENV.fetch("TEST", "./test/**/*_test.rb")]
.map { "require_relative(#{_1.dump});" }
.join
Expand Down
2 changes: 1 addition & 1 deletion Steepfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ target :lib do

YAML.safe_load_file("./manifest.yaml", symbolize_names: true) => { dependencies: }
# currently these libraries lack the `*.rbs` annotations required by `steep`
stdlibs = dependencies - %w[etc net/http rbconfig set stringio]
stdlibs = dependencies - %w[English etc net/http rbconfig set stringio]

stdlibs.each { library(_1) }
end
31 changes: 16 additions & 15 deletions lib/orb.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
# frozen_string_literal: true

# We already ship the preferred sorbet manifests in the package itself.
# `tapioca` currently does not offer us a way to opt out of unnecessary compilation.
if Object.const_defined?(:Tapioca) && caller.chain([$0]).chain(ARGV).grep(/tapioca/)
Warning.warn(
<<~WARN
\n
⚠️ skipped loading of "orb" gem under `tapioca`.

This message is normal and expected if you are running a `tapioca` command, and does not impact `.rbi` generation.
\n
WARN
)
return
end

# Standard libraries.
require "English"
require "cgi"
require "date"
require "erb"
Expand All @@ -30,6 +16,21 @@
require "time"
require "uri"

# We already ship the preferred sorbet manifests in the package itself.
# `tapioca` currently does not offer us a way to opt out of unnecessary compilation.
if Object.const_defined?(:Tapioca) && caller.chain([$PROGRAM_NAME]).chain(ARGV).grep(/tapioca/)
Warning.warn(
<<~WARN
\n
⚠️ skipped loading of "orb" gem under `tapioca`.

This message is normal and expected if you are running a `tapioca` command, and does not impact `.rbi` generation.
\n
WARN
)
return
end

# Gems.
require "connection_pool"

Expand Down
14 changes: 7 additions & 7 deletions lib/orb/resources/alerts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Alerts
def retrieve(alert_id, params = {})
@client.request(
method: :get,
path: ["alerts/%0s", alert_id],
path: ["alerts/%1$s", alert_id],
model: Orb::Models::Alert,
options: params[:request_options]
)
Expand All @@ -36,7 +36,7 @@ def update(alert_configuration_id, params)
parsed, options = Orb::Models::AlertUpdateParams.dump_request(params)
@client.request(
method: :put,
path: ["alerts/%0s", alert_configuration_id],
path: ["alerts/%1$s", alert_configuration_id],
body: parsed,
model: Orb::Models::Alert,
options: options
Expand Down Expand Up @@ -117,7 +117,7 @@ def create_for_customer(customer_id, params)
parsed, options = Orb::Models::AlertCreateForCustomerParams.dump_request(params)
@client.request(
method: :post,
path: ["alerts/customer_id/%0s", customer_id],
path: ["alerts/customer_id/%1$s", customer_id],
body: parsed,
model: Orb::Models::Alert,
options: options
Expand Down Expand Up @@ -150,7 +150,7 @@ def create_for_external_customer(external_customer_id, params)
parsed, options = Orb::Models::AlertCreateForExternalCustomerParams.dump_request(params)
@client.request(
method: :post,
path: ["alerts/external_customer_id/%0s", external_customer_id],
path: ["alerts/external_customer_id/%1$s", external_customer_id],
body: parsed,
model: Orb::Models::Alert,
options: options
Expand Down Expand Up @@ -186,7 +186,7 @@ def create_for_subscription(subscription_id, params)
parsed, options = Orb::Models::AlertCreateForSubscriptionParams.dump_request(params)
@client.request(
method: :post,
path: ["alerts/subscription_id/%0s", subscription_id],
path: ["alerts/subscription_id/%1$s", subscription_id],
body: parsed,
model: Orb::Models::Alert,
options: options
Expand All @@ -210,7 +210,7 @@ def disable(alert_configuration_id, params = {})
parsed, options = Orb::Models::AlertDisableParams.dump_request(params)
@client.request(
method: :post,
path: ["alerts/%0s/disable", alert_configuration_id],
path: ["alerts/%1$s/disable", alert_configuration_id],
query: parsed,
model: Orb::Models::Alert,
options: options
Expand All @@ -234,7 +234,7 @@ def enable(alert_configuration_id, params = {})
parsed, options = Orb::Models::AlertEnableParams.dump_request(params)
@client.request(
method: :post,
path: ["alerts/%0s/enable", alert_configuration_id],
path: ["alerts/%1$s/enable", alert_configuration_id],
query: parsed,
model: Orb::Models::Alert,
options: options
Expand Down
4 changes: 2 additions & 2 deletions lib/orb/resources/coupons.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def list(params = {})
def archive(coupon_id, params = {})
@client.request(
method: :post,
path: ["coupons/%0s/archive", coupon_id],
path: ["coupons/%1$s/archive", coupon_id],
model: Orb::Models::Coupon,
options: params[:request_options]
)
Expand All @@ -103,7 +103,7 @@ def archive(coupon_id, params = {})
def fetch(coupon_id, params = {})
@client.request(
method: :get,
path: ["coupons/%0s", coupon_id],
path: ["coupons/%1$s", coupon_id],
model: Orb::Models::Coupon,
options: params[:request_options]
)
Expand Down
2 changes: 1 addition & 1 deletion lib/orb/resources/coupons/subscriptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def list(coupon_id, params = {})
parsed, options = Orb::Models::Coupons::SubscriptionListParams.dump_request(params)
@client.request(
method: :get,
path: ["coupons/%0s/subscriptions", coupon_id],
path: ["coupons/%1$s/subscriptions", coupon_id],
query: parsed,
page: Orb::Page,
model: Orb::Models::Subscription,
Expand Down
2 changes: 1 addition & 1 deletion lib/orb/resources/credit_notes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def list(params = {})
def fetch(credit_note_id, params = {})
@client.request(
method: :get,
path: ["credit_notes/%0s", credit_note_id],
path: ["credit_notes/%1$s", credit_note_id],
model: Orb::Models::CreditNote,
options: params[:request_options]
)
Expand Down
14 changes: 7 additions & 7 deletions lib/orb/resources/customers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def update(customer_id, params = {})
parsed, options = Orb::Models::CustomerUpdateParams.dump_request(params)
@client.request(
method: :put,
path: ["customers/%0s", customer_id],
path: ["customers/%1$s", customer_id],
body: parsed,
model: Orb::Models::Customer,
options: options
Expand Down Expand Up @@ -435,7 +435,7 @@ def list(params = {})
def delete(customer_id, params = {})
@client.request(
method: :delete,
path: ["customers/%0s", customer_id],
path: ["customers/%1$s", customer_id],
model: NilClass,
options: params[:request_options]
)
Expand All @@ -458,7 +458,7 @@ def delete(customer_id, params = {})
def fetch(customer_id, params = {})
@client.request(
method: :get,
path: ["customers/%0s", customer_id],
path: ["customers/%1$s", customer_id],
model: Orb::Models::Customer,
options: params[:request_options]
)
Expand All @@ -480,7 +480,7 @@ def fetch(customer_id, params = {})
def fetch_by_external_id(external_customer_id, params = {})
@client.request(
method: :get,
path: ["customers/external_customer_id/%0s", external_customer_id],
path: ["customers/external_customer_id/%1$s", external_customer_id],
model: Orb::Models::Customer,
options: params[:request_options]
)
Expand All @@ -504,7 +504,7 @@ def sync_payment_methods_from_gateway(external_customer_id, params = {})
@client.request(
method: :post,
path: [
"customers/external_customer_id/%0s/sync_payment_methods_from_gateway",
"customers/external_customer_id/%1$s/sync_payment_methods_from_gateway",
external_customer_id
],
model: NilClass,
Expand All @@ -529,7 +529,7 @@ def sync_payment_methods_from_gateway(external_customer_id, params = {})
def sync_payment_methods_from_gateway_by_external_customer_id(customer_id, params = {})
@client.request(
method: :post,
path: ["customers/%0s/sync_payment_methods_from_gateway", customer_id],
path: ["customers/%1$s/sync_payment_methods_from_gateway", customer_id],
model: NilClass,
options: params[:request_options]
)
Expand Down Expand Up @@ -703,7 +703,7 @@ def update_by_external_id(id, params = {})
parsed, options = Orb::Models::CustomerUpdateByExternalIDParams.dump_request(params)
@client.request(
method: :put,
path: ["customers/external_customer_id/%0s", id],
path: ["customers/external_customer_id/%1$s", id],
body: parsed,
model: Orb::Models::Customer,
options: options
Expand Down
4 changes: 2 additions & 2 deletions lib/orb/resources/customers/balance_transactions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def create(customer_id, params)
parsed, options = Orb::Models::Customers::BalanceTransactionCreateParams.dump_request(params)
@client.request(
method: :post,
path: ["customers/%0s/balance_transactions", customer_id],
path: ["customers/%1$s/balance_transactions", customer_id],
body: parsed,
model: Orb::Models::Customers::BalanceTransactionCreateResponse,
options: options
Expand Down Expand Up @@ -84,7 +84,7 @@ def list(customer_id, params = {})
parsed, options = Orb::Models::Customers::BalanceTransactionListParams.dump_request(params)
@client.request(
method: :get,
path: ["customers/%0s/balance_transactions", customer_id],
path: ["customers/%1$s/balance_transactions", customer_id],
query: parsed,
page: Orb::Page,
model: Orb::Models::Customers::BalanceTransactionListResponse,
Expand Down
4 changes: 2 additions & 2 deletions lib/orb/resources/customers/costs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def list(customer_id, params = {})
parsed, options = Orb::Models::Customers::CostListParams.dump_request(params)
@client.request(
method: :get,
path: ["customers/%0s/costs", customer_id],
path: ["customers/%1$s/costs", customer_id],
query: parsed,
model: Orb::Models::Customers::CostListResponse,
options: options
Expand Down Expand Up @@ -291,7 +291,7 @@ def list_by_external_id(external_customer_id, params = {})
parsed, options = Orb::Models::Customers::CostListByExternalIDParams.dump_request(params)
@client.request(
method: :get,
path: ["customers/external_customer_id/%0s/costs", external_customer_id],
path: ["customers/external_customer_id/%1$s/costs", external_customer_id],
query: parsed,
model: Orb::Models::Customers::CostListByExternalIDResponse,
options: options
Expand Down
4 changes: 2 additions & 2 deletions lib/orb/resources/customers/credits.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def list(customer_id, params = {})
parsed, options = Orb::Models::Customers::CreditListParams.dump_request(params)
@client.request(
method: :get,
path: ["customers/%0s/credits", customer_id],
path: ["customers/%1$s/credits", customer_id],
query: parsed,
page: Orb::Page,
model: Orb::Models::Customers::CreditListResponse,
Expand Down Expand Up @@ -76,7 +76,7 @@ def list_by_external_id(external_customer_id, params = {})
parsed, options = Orb::Models::Customers::CreditListByExternalIDParams.dump_request(params)
@client.request(
method: :get,
path: ["customers/external_customer_id/%0s/credits", external_customer_id],
path: ["customers/external_customer_id/%1$s/credits", external_customer_id],
query: parsed,
page: Orb::Page,
model: Orb::Models::Customers::CreditListByExternalIDResponse,
Expand Down
8 changes: 4 additions & 4 deletions lib/orb/resources/customers/credits/ledger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def list(customer_id, params = {})
parsed, options = Orb::Models::Customers::Credits::LedgerListParams.dump_request(params)
@client.request(
method: :get,
path: ["customers/%0s/credits/ledger", customer_id],
path: ["customers/%1$s/credits/ledger", customer_id],
query: parsed,
page: Orb::Page,
model: Orb::Models::Customers::Credits::LedgerListResponse,
Expand Down Expand Up @@ -286,7 +286,7 @@ def create_entry(customer_id, params)
parsed, options = Orb::Models::Customers::Credits::LedgerCreateEntryParams.dump_request(params)
@client.request(
method: :post,
path: ["customers/%0s/credits/ledger_entry", customer_id],
path: ["customers/%1$s/credits/ledger_entry", customer_id],
body: parsed,
model: Orb::Models::Customers::Credits::LedgerCreateEntryResponse,
options: options
Expand Down Expand Up @@ -453,7 +453,7 @@ def create_entry_by_external_id(external_customer_id, params)
Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams.dump_request(params)
@client.request(
method: :post,
path: ["customers/external_customer_id/%0s/credits/ledger_entry", external_customer_id],
path: ["customers/external_customer_id/%1$s/credits/ledger_entry", external_customer_id],
body: parsed,
model: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse,
options: options
Expand Down Expand Up @@ -574,7 +574,7 @@ def list_by_external_id(external_customer_id, params = {})
parsed, options = Orb::Models::Customers::Credits::LedgerListByExternalIDParams.dump_request(params)
@client.request(
method: :get,
path: ["customers/external_customer_id/%0s/credits/ledger", external_customer_id],
path: ["customers/external_customer_id/%1$s/credits/ledger", external_customer_id],
query: parsed,
page: Orb::Page,
model: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse,
Expand Down
Loading
Loading