Skip to content

Commit d7f8470

Browse files
fix: path interpolation template strings (#193)
1 parent 9a01dbc commit d7f8470

24 files changed

Lines changed: 77 additions & 77 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Due to limitations with the Sorbet type system, where a method otherwise can tak
141141
Please follow Sorbet's [setup guides](https://sorbet.org/docs/adopting) for best experience.
142142

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

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

lib/orb/resources/alerts.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Alerts
1515
def retrieve(alert_id, params = {})
1616
@client.request(
1717
method: :get,
18-
path: ["alerts/%0s", alert_id],
18+
path: ["alerts/%1$s", alert_id],
1919
model: Orb::Models::Alert,
2020
options: params[:request_options]
2121
)
@@ -36,7 +36,7 @@ def update(alert_configuration_id, params)
3636
parsed, options = Orb::Models::AlertUpdateParams.dump_request(params)
3737
@client.request(
3838
method: :put,
39-
path: ["alerts/%0s", alert_configuration_id],
39+
path: ["alerts/%1$s", alert_configuration_id],
4040
body: parsed,
4141
model: Orb::Models::Alert,
4242
options: options
@@ -117,7 +117,7 @@ def create_for_customer(customer_id, params)
117117
parsed, options = Orb::Models::AlertCreateForCustomerParams.dump_request(params)
118118
@client.request(
119119
method: :post,
120-
path: ["alerts/customer_id/%0s", customer_id],
120+
path: ["alerts/customer_id/%1$s", customer_id],
121121
body: parsed,
122122
model: Orb::Models::Alert,
123123
options: options
@@ -150,7 +150,7 @@ def create_for_external_customer(external_customer_id, params)
150150
parsed, options = Orb::Models::AlertCreateForExternalCustomerParams.dump_request(params)
151151
@client.request(
152152
method: :post,
153-
path: ["alerts/external_customer_id/%0s", external_customer_id],
153+
path: ["alerts/external_customer_id/%1$s", external_customer_id],
154154
body: parsed,
155155
model: Orb::Models::Alert,
156156
options: options
@@ -186,7 +186,7 @@ def create_for_subscription(subscription_id, params)
186186
parsed, options = Orb::Models::AlertCreateForSubscriptionParams.dump_request(params)
187187
@client.request(
188188
method: :post,
189-
path: ["alerts/subscription_id/%0s", subscription_id],
189+
path: ["alerts/subscription_id/%1$s", subscription_id],
190190
body: parsed,
191191
model: Orb::Models::Alert,
192192
options: options
@@ -210,7 +210,7 @@ def disable(alert_configuration_id, params = {})
210210
parsed, options = Orb::Models::AlertDisableParams.dump_request(params)
211211
@client.request(
212212
method: :post,
213-
path: ["alerts/%0s/disable", alert_configuration_id],
213+
path: ["alerts/%1$s/disable", alert_configuration_id],
214214
query: parsed,
215215
model: Orb::Models::Alert,
216216
options: options
@@ -234,7 +234,7 @@ def enable(alert_configuration_id, params = {})
234234
parsed, options = Orb::Models::AlertEnableParams.dump_request(params)
235235
@client.request(
236236
method: :post,
237-
path: ["alerts/%0s/enable", alert_configuration_id],
237+
path: ["alerts/%1$s/enable", alert_configuration_id],
238238
query: parsed,
239239
model: Orb::Models::Alert,
240240
options: options

lib/orb/resources/coupons.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def list(params = {})
8383
def archive(coupon_id, params = {})
8484
@client.request(
8585
method: :post,
86-
path: ["coupons/%0s/archive", coupon_id],
86+
path: ["coupons/%1$s/archive", coupon_id],
8787
model: Orb::Models::Coupon,
8888
options: params[:request_options]
8989
)
@@ -103,7 +103,7 @@ def archive(coupon_id, params = {})
103103
def fetch(coupon_id, params = {})
104104
@client.request(
105105
method: :get,
106-
path: ["coupons/%0s", coupon_id],
106+
path: ["coupons/%1$s", coupon_id],
107107
model: Orb::Models::Coupon,
108108
options: params[:request_options]
109109
)

lib/orb/resources/coupons/subscriptions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def list(coupon_id, params = {})
2525
parsed, options = Orb::Models::Coupons::SubscriptionListParams.dump_request(params)
2626
@client.request(
2727
method: :get,
28-
path: ["coupons/%0s/subscriptions", coupon_id],
28+
path: ["coupons/%1$s/subscriptions", coupon_id],
2929
query: parsed,
3030
page: Orb::Page,
3131
model: Orb::Models::Subscription,

lib/orb/resources/credit_notes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def list(params = {})
7575
def fetch(credit_note_id, params = {})
7676
@client.request(
7777
method: :get,
78-
path: ["credit_notes/%0s", credit_note_id],
78+
path: ["credit_notes/%1$s", credit_note_id],
7979
model: Orb::Models::CreditNote,
8080
options: params[:request_options]
8181
)

lib/orb/resources/customers.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ def update(customer_id, params = {})
365365
parsed, options = Orb::Models::CustomerUpdateParams.dump_request(params)
366366
@client.request(
367367
method: :put,
368-
path: ["customers/%0s", customer_id],
368+
path: ["customers/%1$s", customer_id],
369369
body: parsed,
370370
model: Orb::Models::Customer,
371371
options: options
@@ -435,7 +435,7 @@ def list(params = {})
435435
def delete(customer_id, params = {})
436436
@client.request(
437437
method: :delete,
438-
path: ["customers/%0s", customer_id],
438+
path: ["customers/%1$s", customer_id],
439439
model: NilClass,
440440
options: params[:request_options]
441441
)
@@ -458,7 +458,7 @@ def delete(customer_id, params = {})
458458
def fetch(customer_id, params = {})
459459
@client.request(
460460
method: :get,
461-
path: ["customers/%0s", customer_id],
461+
path: ["customers/%1$s", customer_id],
462462
model: Orb::Models::Customer,
463463
options: params[:request_options]
464464
)
@@ -480,7 +480,7 @@ def fetch(customer_id, params = {})
480480
def fetch_by_external_id(external_customer_id, params = {})
481481
@client.request(
482482
method: :get,
483-
path: ["customers/external_customer_id/%0s", external_customer_id],
483+
path: ["customers/external_customer_id/%1$s", external_customer_id],
484484
model: Orb::Models::Customer,
485485
options: params[:request_options]
486486
)
@@ -504,7 +504,7 @@ def sync_payment_methods_from_gateway(external_customer_id, params = {})
504504
@client.request(
505505
method: :post,
506506
path: [
507-
"customers/external_customer_id/%0s/sync_payment_methods_from_gateway",
507+
"customers/external_customer_id/%1$s/sync_payment_methods_from_gateway",
508508
external_customer_id
509509
],
510510
model: NilClass,
@@ -529,7 +529,7 @@ def sync_payment_methods_from_gateway(external_customer_id, params = {})
529529
def sync_payment_methods_from_gateway_by_external_customer_id(customer_id, params = {})
530530
@client.request(
531531
method: :post,
532-
path: ["customers/%0s/sync_payment_methods_from_gateway", customer_id],
532+
path: ["customers/%1$s/sync_payment_methods_from_gateway", customer_id],
533533
model: NilClass,
534534
options: params[:request_options]
535535
)
@@ -703,7 +703,7 @@ def update_by_external_id(id, params = {})
703703
parsed, options = Orb::Models::CustomerUpdateByExternalIDParams.dump_request(params)
704704
@client.request(
705705
method: :put,
706-
path: ["customers/external_customer_id/%0s", id],
706+
path: ["customers/external_customer_id/%1$s", id],
707707
body: parsed,
708708
model: Orb::Models::Customer,
709709
options: options

lib/orb/resources/customers/balance_transactions.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def create(customer_id, params)
2424
parsed, options = Orb::Models::Customers::BalanceTransactionCreateParams.dump_request(params)
2525
@client.request(
2626
method: :post,
27-
path: ["customers/%0s/balance_transactions", customer_id],
27+
path: ["customers/%1$s/balance_transactions", customer_id],
2828
body: parsed,
2929
model: Orb::Models::Customers::BalanceTransactionCreateResponse,
3030
options: options
@@ -84,7 +84,7 @@ def list(customer_id, params = {})
8484
parsed, options = Orb::Models::Customers::BalanceTransactionListParams.dump_request(params)
8585
@client.request(
8686
method: :get,
87-
path: ["customers/%0s/balance_transactions", customer_id],
87+
path: ["customers/%1$s/balance_transactions", customer_id],
8888
query: parsed,
8989
page: Orb::Page,
9090
model: Orb::Models::Customers::BalanceTransactionListResponse,

lib/orb/resources/customers/costs.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def list(customer_id, params = {})
144144
parsed, options = Orb::Models::Customers::CostListParams.dump_request(params)
145145
@client.request(
146146
method: :get,
147-
path: ["customers/%0s/costs", customer_id],
147+
path: ["customers/%1$s/costs", customer_id],
148148
query: parsed,
149149
model: Orb::Models::Customers::CostListResponse,
150150
options: options
@@ -291,7 +291,7 @@ def list_by_external_id(external_customer_id, params = {})
291291
parsed, options = Orb::Models::Customers::CostListByExternalIDParams.dump_request(params)
292292
@client.request(
293293
method: :get,
294-
path: ["customers/external_customer_id/%0s/costs", external_customer_id],
294+
path: ["customers/external_customer_id/%1$s/costs", external_customer_id],
295295
query: parsed,
296296
model: Orb::Models::Customers::CostListByExternalIDResponse,
297297
options: options

lib/orb/resources/customers/credits.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def list(customer_id, params = {})
3939
parsed, options = Orb::Models::Customers::CreditListParams.dump_request(params)
4040
@client.request(
4141
method: :get,
42-
path: ["customers/%0s/credits", customer_id],
42+
path: ["customers/%1$s/credits", customer_id],
4343
query: parsed,
4444
page: Orb::Page,
4545
model: Orb::Models::Customers::CreditListResponse,
@@ -76,7 +76,7 @@ def list_by_external_id(external_customer_id, params = {})
7676
parsed, options = Orb::Models::Customers::CreditListByExternalIDParams.dump_request(params)
7777
@client.request(
7878
method: :get,
79-
path: ["customers/external_customer_id/%0s/credits", external_customer_id],
79+
path: ["customers/external_customer_id/%1$s/credits", external_customer_id],
8080
query: parsed,
8181
page: Orb::Page,
8282
model: Orb::Models::Customers::CreditListByExternalIDResponse,

lib/orb/resources/customers/credits/ledger.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def list(customer_id, params = {})
119119
parsed, options = Orb::Models::Customers::Credits::LedgerListParams.dump_request(params)
120120
@client.request(
121121
method: :get,
122-
path: ["customers/%0s/credits/ledger", customer_id],
122+
path: ["customers/%1$s/credits/ledger", customer_id],
123123
query: parsed,
124124
page: Orb::Page,
125125
model: Orb::Models::Customers::Credits::LedgerListResponse,
@@ -286,7 +286,7 @@ def create_entry(customer_id, params)
286286
parsed, options = Orb::Models::Customers::Credits::LedgerCreateEntryParams.dump_request(params)
287287
@client.request(
288288
method: :post,
289-
path: ["customers/%0s/credits/ledger_entry", customer_id],
289+
path: ["customers/%1$s/credits/ledger_entry", customer_id],
290290
body: parsed,
291291
model: Orb::Models::Customers::Credits::LedgerCreateEntryResponse,
292292
options: options
@@ -453,7 +453,7 @@ def create_entry_by_external_id(external_customer_id, params)
453453
Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDParams.dump_request(params)
454454
@client.request(
455455
method: :post,
456-
path: ["customers/external_customer_id/%0s/credits/ledger_entry", external_customer_id],
456+
path: ["customers/external_customer_id/%1$s/credits/ledger_entry", external_customer_id],
457457
body: parsed,
458458
model: Orb::Models::Customers::Credits::LedgerCreateEntryByExternalIDResponse,
459459
options: options
@@ -574,7 +574,7 @@ def list_by_external_id(external_customer_id, params = {})
574574
parsed, options = Orb::Models::Customers::Credits::LedgerListByExternalIDParams.dump_request(params)
575575
@client.request(
576576
method: :get,
577-
path: ["customers/external_customer_id/%0s/credits/ledger", external_customer_id],
577+
path: ["customers/external_customer_id/%1$s/credits/ledger", external_customer_id],
578578
query: parsed,
579579
page: Orb::Page,
580580
model: Orb::Models::Customers::Credits::LedgerListByExternalIDResponse,

0 commit comments

Comments
 (0)