Skip to content

Commit

Permalink
Make id inference safer and more correct
Browse files Browse the repository at this point in the history
  • Loading branch information
mzeitlin11 committed Nov 26, 2023
1 parent 0b958dc commit 0b46685
Show file tree
Hide file tree
Showing 52 changed files with 191 additions and 191 deletions.
4 changes: 2 additions & 2 deletions generated/stripe_billing/src/portal_configuration/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ impl<'a> UpdatePortalConfiguration<'a> {
pub fn send(
&self,
client: &stripe::Client,
configuration: &str,
configuration: &stripe_billing::portal_configuration::BillingPortalConfigurationId,
) -> stripe::Response<stripe_billing::PortalConfiguration> {
client.send_form(
&format!("/billing_portal/configurations/{configuration}"),
Expand All @@ -1285,7 +1285,7 @@ impl<'a> RetrievePortalConfiguration<'a> {
pub fn send(
&self,
client: &stripe::Client,
configuration: &str,
configuration: &stripe_billing::portal_configuration::BillingPortalConfigurationId,
) -> stripe::Response<stripe_billing::PortalConfiguration> {
client.get_query(&format!("/billing_portal/configurations/{configuration}"), self)
}
Expand Down
2 changes: 1 addition & 1 deletion generated/stripe_billing/src/subscription/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4785,7 +4785,7 @@ impl DeleteDiscountSubscription {
pub fn send(
&self,
client: &stripe::Client,
subscription_exposed_id: &str,
subscription_exposed_id: &stripe_types::subscription::SubscriptionId,
) -> stripe::Response<stripe_types::DeletedDiscount> {
client.send_form(
&format!("/subscriptions/{subscription_exposed_id}/discount"),
Expand Down
6 changes: 3 additions & 3 deletions generated/stripe_billing/src/subscription_item/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl<'a> RetrieveSubscriptionItem<'a> {
pub fn send(
&self,
client: &stripe::Client,
item: &stripe_types::line_item::ItemId,
item: &stripe_types::subscription_item::SubscriptionItemId,
) -> stripe::Response<stripe_types::SubscriptionItem> {
client.get_query(&format!("/subscription_items/{item}"), self)
}
Expand Down Expand Up @@ -866,7 +866,7 @@ impl<'a> UpdateSubscriptionItem<'a> {
pub fn send(
&self,
client: &stripe::Client,
item: &stripe_types::line_item::ItemId,
item: &stripe_types::subscription_item::SubscriptionItemId,
) -> stripe::Response<stripe_types::SubscriptionItem> {
client.send_form(&format!("/subscription_items/{item}"), self, http_types::Method::Post)
}
Expand Down Expand Up @@ -957,7 +957,7 @@ impl DeleteSubscriptionItem {
pub fn send(
&self,
client: &stripe::Client,
item: &stripe_types::line_item::ItemId,
item: &stripe_types::subscription_item::SubscriptionItemId,
) -> stripe::Response<stripe_types::DeletedSubscriptionItem> {
client.send_form(&format!("/subscription_items/{item}"), self, http_types::Method::Delete)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ impl<'a> RetrieveSubscriptionSchedule<'a> {
pub fn send(
&self,
client: &stripe::Client,
schedule: &str,
schedule: &stripe_types::subscription_schedule::SubscriptionScheduleId,
) -> stripe::Response<stripe_types::SubscriptionSchedule> {
client.get_query(&format!("/subscription_schedules/{schedule}"), self)
}
Expand Down Expand Up @@ -2296,7 +2296,7 @@ impl<'a> UpdateSubscriptionSchedule<'a> {
pub fn send(
&self,
client: &stripe::Client,
schedule: &str,
schedule: &stripe_types::subscription_schedule::SubscriptionScheduleId,
) -> stripe::Response<stripe_types::SubscriptionSchedule> {
client.send_form(
&format!("/subscription_schedules/{schedule}"),
Expand Down Expand Up @@ -2333,7 +2333,7 @@ impl<'a> CancelSubscriptionSchedule<'a> {
pub fn send(
&self,
client: &stripe::Client,
schedule: &str,
schedule: &stripe_types::subscription_schedule::SubscriptionScheduleId,
) -> stripe::Response<stripe_types::SubscriptionSchedule> {
client.send_form(
&format!("/subscription_schedules/{schedule}/cancel"),
Expand Down Expand Up @@ -2364,7 +2364,7 @@ impl<'a> ReleaseSubscriptionSchedule<'a> {
pub fn send(
&self,
client: &stripe::Client,
schedule: &str,
schedule: &stripe_types::subscription_schedule::SubscriptionScheduleId,
) -> stripe::Response<stripe_types::SubscriptionSchedule> {
client.send_form(
&format!("/subscription_schedules/{schedule}/release"),
Expand Down
6 changes: 3 additions & 3 deletions generated/stripe_billing/src/test_clock/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl<'a> RetrieveTestClock<'a> {
pub fn send(
&self,
client: &stripe::Client,
test_clock: &str,
test_clock: &stripe_types::test_clock::TestHelpersTestClockId,
) -> stripe::Response<stripe_types::TestClock> {
client.get_query(&format!("/test_helpers/test_clocks/{test_clock}"), self)
}
Expand Down Expand Up @@ -53,7 +53,7 @@ impl DeleteTestClock {
pub fn send(
&self,
client: &stripe::Client,
test_clock: &str,
test_clock: &stripe_types::test_clock::TestHelpersTestClockId,
) -> stripe::Response<stripe_types::DeletedTestClock> {
client.send_form(
&format!("/test_helpers/test_clocks/{test_clock}"),
Expand Down Expand Up @@ -86,7 +86,7 @@ impl<'a> AdvanceTestClock<'a> {
pub fn send(
&self,
client: &stripe::Client,
test_clock: &str,
test_clock: &stripe_types::test_clock::TestHelpersTestClockId,
) -> stripe::Response<stripe_types::TestClock> {
client.send_form(
&format!("/test_helpers/test_clocks/{test_clock}/advance"),
Expand Down
9 changes: 6 additions & 3 deletions generated/stripe_checkout/src/session/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7071,11 +7071,14 @@ impl<'a> ListLineItemsSession<'a> {
pub fn send(
&self,
client: &stripe::Client,
session: &str,
session: &stripe_checkout::session::CheckoutSessionId,
) -> stripe::Response<stripe_types::List<stripe_types::LineItem>> {
client.get_query(&format!("/checkout/sessions/{session}/line_items"), self)
}
pub fn paginate(self, session: &str) -> stripe::ListPaginator<stripe_types::LineItem> {
pub fn paginate(
self,
session: &stripe_checkout::session::CheckoutSessionId,
) -> stripe::ListPaginator<stripe_types::LineItem> {
stripe::ListPaginator::from_params(
&format!("/checkout/sessions/{session}/line_items"),
self,
Expand All @@ -7101,7 +7104,7 @@ impl<'a> ExpireSession<'a> {
pub fn send(
&self,
client: &stripe::Client,
session: &str,
session: &stripe_checkout::session::CheckoutSessionId,
) -> stripe::Response<stripe_checkout::Session> {
client.send_form(
&format!("/checkout/sessions/{session}/expire"),
Expand Down
4 changes: 2 additions & 2 deletions generated/stripe_connect/src/account_capability/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl<'a> RetrieveAccountCapability<'a> {
&self,
client: &stripe::Client,
account: &stripe_types::account::AccountId,
capability: &stripe_types::account_capability::CapabilityId,
capability: &str,
) -> stripe::Response<stripe_types::AccountCapability> {
client.get_query(&format!("/accounts/{account}/capabilities/{capability}"), self)
}
Expand Down Expand Up @@ -77,7 +77,7 @@ impl<'a> UpdateAccountCapability<'a> {
&self,
client: &stripe::Client,
account: &stripe_types::account::AccountId,
capability: &stripe_types::account_capability::CapabilityId,
capability: &str,
) -> stripe::Response<stripe_types::AccountCapability> {
client.send_form(
&format!("/accounts/{account}/capabilities/{capability}"),
Expand Down
2 changes: 1 addition & 1 deletion generated/stripe_connect/src/country_spec/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl<'a> RetrieveCountrySpec<'a> {
pub fn send(
&self,
client: &stripe::Client,
country: &str,
country: &stripe_connect::country_spec::CountrySpecId,
) -> stripe::Response<stripe_connect::CountrySpec> {
client.get_query(&format!("/country_specs/{country}"), self)
}
Expand Down
10 changes: 5 additions & 5 deletions generated/stripe_connect/src/fee_refund/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl<'a> CreateFeeRefund<'a> {
pub fn send(
&self,
client: &stripe::Client,
id: &stripe_types::fee_refund::FeeRefundId,
id: &stripe_types::platform_fee::ApplicationFeeId,
) -> stripe::Response<stripe_types::FeeRefund> {
client.send_form(&format!("/application_fees/{id}/refunds"), self, http_types::Method::Post)
}
Expand Down Expand Up @@ -75,13 +75,13 @@ impl<'a> ListFeeRefund<'a> {
pub fn send(
&self,
client: &stripe::Client,
id: &stripe_types::fee_refund::FeeRefundId,
id: &stripe_types::platform_fee::ApplicationFeeId,
) -> stripe::Response<stripe_types::List<stripe_types::FeeRefund>> {
client.get_query(&format!("/application_fees/{id}/refunds"), self)
}
pub fn paginate(
self,
id: &stripe_types::fee_refund::FeeRefundId,
id: &stripe_types::platform_fee::ApplicationFeeId,
) -> stripe::ListPaginator<stripe_types::FeeRefund> {
stripe::ListPaginator::from_params(&format!("/application_fees/{id}/refunds"), self)
}
Expand All @@ -103,7 +103,7 @@ impl<'a> RetrieveFeeRefund<'a> {
pub fn send(
&self,
client: &stripe::Client,
fee: &str,
fee: &stripe_types::platform_fee::ApplicationFeeId,
id: &str,
) -> stripe::Response<stripe_types::FeeRefund> {
client.get_query(&format!("/application_fees/{fee}/refunds/{id}"), self)
Expand Down Expand Up @@ -134,7 +134,7 @@ impl<'a> UpdateFeeRefund<'a> {
pub fn send(
&self,
client: &stripe::Client,
fee: &str,
fee: &stripe_types::platform_fee::ApplicationFeeId,
id: &str,
) -> stripe::Response<stripe_types::FeeRefund> {
client.send_form(
Expand Down
6 changes: 3 additions & 3 deletions generated/stripe_connect/src/person/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl<'a> RetrievePerson<'a> {
&self,
client: &stripe::Client,
account: &stripe_types::account::AccountId,
person: &stripe_types::person::PersonId,
person: &str,
) -> stripe::Response<stripe_types::Person> {
client.get_query(&format!("/accounts/{account}/persons/{person}"), self)
}
Expand Down Expand Up @@ -926,7 +926,7 @@ impl<'a> UpdatePerson<'a> {
&self,
client: &stripe::Client,
account: &stripe_types::account::AccountId,
person: &stripe_types::person::PersonId,
person: &str,
) -> stripe::Response<stripe_types::Person> {
client.send_form(
&format!("/accounts/{account}/persons/{person}"),
Expand All @@ -951,7 +951,7 @@ impl DeletePerson {
&self,
client: &stripe::Client,
account: &stripe_types::account::AccountId,
person: &stripe_types::person::PersonId,
person: &str,
) -> stripe::Response<stripe_types::DeletedPerson> {
client.send_form(
&format!("/accounts/{account}/persons/{person}"),
Expand Down
6 changes: 3 additions & 3 deletions generated/stripe_connect/src/transfer_reversal/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl<'a> CreateTransferReversal<'a> {
pub fn send(
&self,
client: &stripe::Client,
id: &stripe_types::transfer_reversal::TransferReversalId,
id: &stripe_types::transfer::TransferId,
) -> stripe::Response<stripe_types::TransferReversal> {
client.send_form(&format!("/transfers/{id}/reversals"), self, http_types::Method::Post)
}
Expand Down Expand Up @@ -86,13 +86,13 @@ impl<'a> ListTransferReversal<'a> {
pub fn send(
&self,
client: &stripe::Client,
id: &stripe_types::transfer_reversal::TransferReversalId,
id: &stripe_types::transfer::TransferId,
) -> stripe::Response<stripe_types::List<stripe_types::TransferReversal>> {
client.get_query(&format!("/transfers/{id}/reversals"), self)
}
pub fn paginate(
self,
id: &stripe_types::transfer_reversal::TransferReversalId,
id: &stripe_types::transfer::TransferId,
) -> stripe::ListPaginator<stripe_types::TransferReversal> {
stripe::ListPaginator::from_params(&format!("/transfers/{id}/reversals"), self)
}
Expand Down
4 changes: 2 additions & 2 deletions generated/stripe_core/src/customer/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1587,7 +1587,7 @@ impl<'a> RetrievePaymentMethodCustomer<'a> {
&self,
client: &stripe::Client,
customer: &stripe_types::customer::CustomerId,
payment_method: &stripe_types::payment_method::PaymentMethodId,
payment_method: &str,
) -> stripe::Response<stripe_types::PaymentMethod> {
client.get_query(&format!("/customers/{customer}/payment_methods/{payment_method}"), self)
}
Expand Down Expand Up @@ -1670,7 +1670,7 @@ impl<'a> FundCashBalanceCustomer<'a> {
pub fn send(
&self,
client: &stripe::Client,
customer: &stripe_types::customer::CustomerId,
customer: &str,
) -> stripe::Response<stripe_types::CustomerCashBalanceTransaction> {
client.send_form(
&format!("/test_helpers/customers/{customer}/fund_cash_balance"),
Expand Down
4 changes: 2 additions & 2 deletions generated/stripe_core/src/file_link/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl<'a> RetrieveFileLink<'a> {
pub fn send(
&self,
client: &stripe::Client,
link: &str,
link: &stripe_types::file_link::FileLinkId,
) -> stripe::Response<stripe_types::FileLink> {
client.get_query(&format!("/file_links/{link}"), self)
}
Expand Down Expand Up @@ -90,7 +90,7 @@ impl<'a> UpdateFileLink<'a> {
pub fn send(
&self,
client: &stripe::Client,
link: &str,
link: &stripe_types::file_link::FileLinkId,
) -> stripe::Response<stripe_types::FileLink> {
client.send_form(&format!("/file_links/{link}"), self, http_types::Method::Post)
}
Expand Down
16 changes: 8 additions & 8 deletions generated/stripe_core/src/payment_intent/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6944,7 +6944,7 @@ impl<'a> RetrievePaymentIntent<'a> {
pub fn send(
&self,
client: &stripe::Client,
intent: &str,
intent: &stripe_types::payment_intent::PaymentIntentId,
) -> stripe::Response<stripe_types::PaymentIntent> {
client.get_query(&format!("/payment_intents/{intent}"), self)
}
Expand Down Expand Up @@ -13355,7 +13355,7 @@ impl<'a> UpdatePaymentIntent<'a> {
pub fn send(
&self,
client: &stripe::Client,
intent: &str,
intent: &stripe_types::payment_intent::PaymentIntentId,
) -> stripe::Response<stripe_types::PaymentIntent> {
client.send_form(&format!("/payment_intents/{intent}"), self, http_types::Method::Post)
}
Expand Down Expand Up @@ -19952,7 +19952,7 @@ impl<'a> ConfirmPaymentIntent<'a> {
pub fn send(
&self,
client: &stripe::Client,
intent: &str,
intent: &stripe_types::payment_intent::PaymentIntentId,
) -> stripe::Response<stripe_types::PaymentIntent> {
client.send_form(
&format!("/payment_intents/{intent}/confirm"),
Expand Down Expand Up @@ -20046,7 +20046,7 @@ impl<'a> CancelPaymentIntent<'a> {
pub fn send(
&self,
client: &stripe::Client,
intent: &str,
intent: &stripe_types::payment_intent::PaymentIntentId,
) -> stripe::Response<stripe_types::PaymentIntent> {
client.send_form(
&format!("/payment_intents/{intent}/cancel"),
Expand Down Expand Up @@ -20132,7 +20132,7 @@ impl<'a> CapturePaymentIntent<'a> {
pub fn send(
&self,
client: &stripe::Client,
intent: &str,
intent: &stripe_types::payment_intent::PaymentIntentId,
) -> stripe::Response<stripe_types::PaymentIntent> {
client.send_form(
&format!("/payment_intents/{intent}/capture"),
Expand Down Expand Up @@ -20215,7 +20215,7 @@ impl<'a> IncrementAuthorizationPaymentIntent<'a> {
pub fn send(
&self,
client: &stripe::Client,
intent: &str,
intent: &stripe_types::payment_intent::PaymentIntentId,
) -> stripe::Response<stripe_types::PaymentIntent> {
client.send_form(
&format!("/payment_intents/{intent}/increment_authorization"),
Expand Down Expand Up @@ -20246,7 +20246,7 @@ impl<'a> VerifyMicrodepositsPaymentIntent<'a> {
pub fn send(
&self,
client: &stripe::Client,
intent: &str,
intent: &stripe_types::payment_intent::PaymentIntentId,
) -> stripe::Response<stripe_types::PaymentIntent> {
client.send_form(
&format!("/payment_intents/{intent}/verify_microdeposits"),
Expand Down Expand Up @@ -20285,7 +20285,7 @@ impl<'a> ApplyCustomerBalancePaymentIntent<'a> {
pub fn send(
&self,
client: &stripe::Client,
intent: &str,
intent: &stripe_types::payment_intent::PaymentIntentId,
) -> stripe::Response<stripe_types::PaymentIntent> {
client.send_form(
&format!("/payment_intents/{intent}/apply_customer_balance"),
Expand Down
2 changes: 1 addition & 1 deletion generated/stripe_core/src/refund/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ impl<'a> ExpireRefund<'a> {
pub fn send(
&self,
client: &stripe::Client,
refund: &stripe_types::refund::RefundId,
refund: &str,
) -> stripe::Response<stripe_types::Refund> {
client.send_form(
&format!("/test_helpers/refunds/{refund}/expire"),
Expand Down
Loading

0 comments on commit 0b46685

Please sign in to comment.