diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ba6c3483..f14b480a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.1" + ".": "0.1.0-alpha.2" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 38f6bdae..d485b474 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 0.1.0-alpha.2 (2025-02-06) + +Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/orbcorp/orb-ruby/compare/v0.1.0-alpha.1...v0.1.0-alpha.2) + +### Bug Fixes + +* update outdated examples ([#5](https://github.com/orbcorp/orb-ruby/issues/5)) ([311b749](https://github.com/orbcorp/orb-ruby/commit/311b749020de437b6434e8af54e88e1b7261daef)) + + +### Chores + +* **internal:** version bump ([#3](https://github.com/orbcorp/orb-ruby/issues/3)) ([22794fd](https://github.com/orbcorp/orb-ruby/commit/22794fdb04836b18e1a9e06f507d1b86c907a4c9)) + ## 0.1.0-alpha.1 (2025-02-06) Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/orbcorp/orb-ruby/compare/v0.0.1-alpha.0...v0.1.0-alpha.1) diff --git a/Gemfile.lock b/Gemfile.lock index 02158768..c0636800 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - orb (0.0.1.pre.alpha.0) + orb (0.1.0.pre.alpha.1) connection_pool GEM diff --git a/README.md b/README.md index 08a8e08f..87cd9cf4 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ non-success status code (i.e., 4xx or 5xx response), a subclass of begin customer = orb.customers.create(email: "example-customer@withorb.com", name: "My Customer") rescue Orb::Error => e - puts(e.code) # 400 + puts(e.status) # 400 end ``` @@ -92,7 +92,11 @@ orb = Orb::Client.new( ) # Or, configure per-request: -orb.customers.create(email: "example-customer@withorb.com", name: "My Customer", max_retries: 5) +orb.customers.create( + email: "example-customer@withorb.com", + name: "My Customer", + request_options: {max_retries: 5} +) ``` ### Timeouts @@ -110,7 +114,11 @@ orb = Orb::Client.new( ) # Or, configure per-request: -orb.customers.create(email: "example-customer@withorb.com", name: "My Customer", timeout: 5) +orb.customers.create( + email: "example-customer@withorb.com", + name: "My Customer", + request_options: {timeout: 5} +) ``` ## Versioning diff --git a/lib/orb/version.rb b/lib/orb/version.rb index 6f7fad3c..b9454eab 100644 --- a/lib/orb/version.rb +++ b/lib/orb/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Orb - VERSION = "0.1.0-alpha.1" + VERSION = "0.1.0-alpha.2" end diff --git a/rbi/lib/orb/version.rbi b/rbi/lib/orb/version.rbi index f49c5fcd..58a3f3d4 100644 --- a/rbi/lib/orb/version.rbi +++ b/rbi/lib/orb/version.rbi @@ -1,5 +1,5 @@ # typed: strong module Orb - VERSION = "0.0.1-alpha.0" + VERSION = "0.1.0-alpha.1" end diff --git a/sig/orb/version.rbs b/sig/orb/version.rbs index 522ee877..7968b18d 100644 --- a/sig/orb/version.rbs +++ b/sig/orb/version.rbs @@ -1,3 +1,3 @@ module Orb - VERSION: "0.0.1-alpha.0" + VERSION: "0.1.0-alpha.1" end diff --git a/test/orb/resources/alerts_test.rb b/test/orb/resources/alerts_test.rb index e9968518..cfb55349 100644 --- a/test/orb/resources/alerts_test.rb +++ b/test/orb/resources/alerts_test.rb @@ -19,7 +19,7 @@ def test_retrieve end def test_update_required_params - response = @orb.alerts.update("alert_configuration_id", thresholds: [{"value" => 0}]) + response = @orb.alerts.update("alert_configuration_id", thresholds: [{value: 0}]) assert_pattern do response => Orb::Models::Alert @@ -42,7 +42,7 @@ def test_list end def test_create_for_customer_required_params - response = @orb.alerts.create_for_customer("customer_id", currency: "currency", type: "usage_exceeded") + response = @orb.alerts.create_for_customer("customer_id", currency: "currency", type: :usage_exceeded) assert_pattern do response => Orb::Models::Alert @@ -53,7 +53,7 @@ def test_create_for_external_customer_required_params response = @orb.alerts.create_for_external_customer( "external_customer_id", currency: "currency", - type: "usage_exceeded" + type: :usage_exceeded ) assert_pattern do @@ -64,8 +64,8 @@ def test_create_for_external_customer_required_params def test_create_for_subscription_required_params response = @orb.alerts.create_for_subscription( "subscription_id", - thresholds: [{"value" => 0}], - type: "usage_exceeded" + thresholds: [{value: 0}], + type: :usage_exceeded ) assert_pattern do diff --git a/test/orb/resources/coupons_test.rb b/test/orb/resources/coupons_test.rb index d1913f95..81cf00a3 100644 --- a/test/orb/resources/coupons_test.rb +++ b/test/orb/resources/coupons_test.rb @@ -12,7 +12,7 @@ def before_all def test_create_required_params response = @orb.coupons.create( - discount: {"discount_type" => "percentage", "percentage_discount" => 0}, + discount: {discount_type: :percentage, percentage_discount: 0}, redemption_code: "HALFOFF" ) diff --git a/test/orb/resources/credit_notes_test.rb b/test/orb/resources/credit_notes_test.rb index 1cc7328a..55db334f 100644 --- a/test/orb/resources/credit_notes_test.rb +++ b/test/orb/resources/credit_notes_test.rb @@ -14,8 +14,8 @@ def test_create_required_params response = @orb.credit_notes.create( line_items: [ { - "amount" => "amount", - "invoice_line_item_id" => "4khy3nwzktxv7" + amount: "amount", + invoice_line_item_id: "4khy3nwzktxv7" } ] ) diff --git a/test/orb/resources/customers/balance_transactions_test.rb b/test/orb/resources/customers/balance_transactions_test.rb index b70cd0b7..9d15d27d 100644 --- a/test/orb/resources/customers/balance_transactions_test.rb +++ b/test/orb/resources/customers/balance_transactions_test.rb @@ -11,7 +11,7 @@ def before_all end def test_create_required_params - response = @orb.customers.balance_transactions.create("customer_id", amount: "amount", type: "increment") + response = @orb.customers.balance_transactions.create("customer_id", amount: "amount", type: :increment) assert_pattern do response => Orb::Models::Customers::BalanceTransactionCreateResponse diff --git a/test/orb/resources/customers/credits/ledger_test.rb b/test/orb/resources/customers/credits/ledger_test.rb index bda50b34..abab41d6 100644 --- a/test/orb/resources/customers/credits/ledger_test.rb +++ b/test/orb/resources/customers/credits/ledger_test.rb @@ -26,7 +26,7 @@ def test_list def test_create_entry_required_params response = @orb.customers.credits.ledger.create_entry( "customer_id", - entry_type: "expiration_change", + entry_type: :expiration_change, expiry_date: "2019-12-27T18:11:19.117Z", target_expiry_date: "2019-12-27" ) @@ -39,7 +39,7 @@ def test_create_entry_required_params def test_create_entry_by_external_id_required_params response = @orb.customers.credits.ledger.create_entry_by_external_id( "external_customer_id", - entry_type: "expiration_change", + entry_type: :expiration_change, expiry_date: "2019-12-27T18:11:19.117Z", target_expiry_date: "2019-12-27" ) diff --git a/test/orb/resources/customers/credits/top_ups_test.rb b/test/orb/resources/customers/credits/top_ups_test.rb index ac236492..5d6f1f33 100644 --- a/test/orb/resources/customers/credits/top_ups_test.rb +++ b/test/orb/resources/customers/credits/top_ups_test.rb @@ -15,7 +15,7 @@ def test_create_required_params "customer_id", amount: "amount", currency: "currency", - invoice_settings: {"auto_collection" => true, "net_terms" => 0}, + invoice_settings: {auto_collection: true, net_terms: 0}, per_unit_cost_basis: "per_unit_cost_basis", threshold: "threshold" ) @@ -51,7 +51,7 @@ def test_create_by_external_id_required_params "external_customer_id", amount: "amount", currency: "currency", - invoice_settings: {"auto_collection" => true, "net_terms" => 0}, + invoice_settings: {auto_collection: true, net_terms: 0}, per_unit_cost_basis: "per_unit_cost_basis", threshold: "threshold" ) diff --git a/test/orb/resources/events_test.rb b/test/orb/resources/events_test.rb index 1b5b7c19..1fe2418b 100644 --- a/test/orb/resources/events_test.rb +++ b/test/orb/resources/events_test.rb @@ -35,10 +35,10 @@ def test_ingest_required_params response = @orb.events.ingest( events: [ { - "event_name" => "event_name", - "idempotency_key" => "idempotency_key", - "properties" => {}, - "timestamp" => "2020-12-09T16:09:53Z" + event_name: "event_name", + idempotency_key: "idempotency_key", + properties: {}, + timestamp: "2020-12-09T16:09:53Z" } ] ) diff --git a/test/orb/resources/invoices_test.rb b/test/orb/resources/invoices_test.rb index d1847f8b..32d15f10 100644 --- a/test/orb/resources/invoices_test.rb +++ b/test/orb/resources/invoices_test.rb @@ -16,13 +16,13 @@ def test_create_required_params invoice_date: "2019-12-27T18:11:19.117Z", line_items: [ { - "end_date" => "2023-09-22", - "item_id" => "4khy3nwzktxv7", - "model_type" => "unit", - "name" => "Line Item Name", - "quantity" => 1, - "start_date" => "2023-09-22", - "unit_config" => {"unit_amount" => "unit_amount"} + end_date: "2023-09-22", + item_id: "4khy3nwzktxv7", + model_type: :unit, + name: "Line Item Name", + quantity: 1, + start_date: "2023-09-22", + unit_config: {unit_amount: "unit_amount"} } ], net_terms: 0 diff --git a/test/orb/resources/plans_test.rb b/test/orb/resources/plans_test.rb index 6bc703ec..546f62b8 100644 --- a/test/orb/resources/plans_test.rb +++ b/test/orb/resources/plans_test.rb @@ -16,11 +16,11 @@ def test_create_required_params name: "name", prices: [ { - "cadence" => "annual", - "item_id" => "item_id", - "model_type" => "unit", - "name" => "Annual fee", - "unit_config" => {"unit_amount" => "unit_amount"} + cadence: :annual, + item_id: "item_id", + model_type: :unit, + name: "Annual fee", + unit_config: {unit_amount: "unit_amount"} } ] ) diff --git a/test/orb/resources/prices_test.rb b/test/orb/resources/prices_test.rb index 0f3d599f..76baf7ba 100644 --- a/test/orb/resources/prices_test.rb +++ b/test/orb/resources/prices_test.rb @@ -12,12 +12,12 @@ def before_all def test_create_required_params response = @orb.prices.create( - cadence: "annual", + cadence: :annual, currency: "currency", item_id: "item_id", - model_type: "unit", + model_type: :unit, name: "Annual fee", - unit_config: {"unit_amount" => "unit_amount"} + unit_config: {unit_amount: "unit_amount"} ) assert_pattern do diff --git a/test/orb/resources/subscriptions_test.rb b/test/orb/resources/subscriptions_test.rb index 14f43d3d..a960ebb2 100644 --- a/test/orb/resources/subscriptions_test.rb +++ b/test/orb/resources/subscriptions_test.rb @@ -40,7 +40,7 @@ def test_list end def test_cancel_required_params - response = @orb.subscriptions.cancel("subscription_id", cancel_option: "end_of_subscription_term") + response = @orb.subscriptions.cancel("subscription_id", cancel_option: :end_of_subscription_term) assert_pattern do response => Orb::Models::SubscriptionCancelResponse @@ -97,7 +97,7 @@ def test_price_intervals end def test_schedule_plan_change_required_params - response = @orb.subscriptions.schedule_plan_change("subscription_id", change_option: "requested_date") + response = @orb.subscriptions.schedule_plan_change("subscription_id", change_option: :requested_date) assert_pattern do response => Orb::Models::SubscriptionSchedulePlanChangeResponse