Skip to content

Commit 13766d1

Browse files
Remove double T.nilable before every emptyable field in update methods (stripe#1633)
1 parent 31dbce8 commit 13766d1

115 files changed

Lines changed: 2649 additions & 2761 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

rbi/stripe/resources/account.rbi

Lines changed: 49 additions & 53 deletions
Large diffs are not rendered by default.

rbi/stripe/resources/billing/credit_grant.rbi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,13 @@ module Stripe
221221
sig { returns(T.nilable(T::Array[String])) }
222222
attr_accessor :expand
223223
# The time when the billing credits created by this credit grant expire. If set to empty, the billing credits never expire.
224-
sig { returns(T.nilable(T.nilable(T.any(String, Integer)))) }
224+
sig { returns(T.nilable(T.any(String, Integer))) }
225225
attr_accessor :expires_at
226226
# Set of key-value pairs you can attach to an object. You can use this to store additional information about the object (for example, cost basis) in a structured format.
227227
sig { returns(T.nilable(T::Hash[String, String])) }
228228
attr_accessor :metadata
229229
sig {
230-
params(expand: T.nilable(T::Array[String]), expires_at: T.nilable(T.nilable(T.any(String, Integer))), metadata: T.nilable(T::Hash[String, String])).void
230+
params(expand: T.nilable(T::Array[String]), expires_at: T.nilable(T.any(String, Integer)), metadata: T.nilable(T::Hash[String, String])).void
231231
}
232232
def initialize(expand: nil, expires_at: nil, metadata: nil); end
233233
end

rbi/stripe/resources/billing_portal/configuration.rbi

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ module Stripe
206206
class CreateParams < Stripe::RequestParams
207207
class BusinessProfile < Stripe::RequestParams
208208
# The messaging shown to customers in the portal.
209-
sig { returns(T.nilable(T.nilable(String))) }
209+
sig { returns(T.nilable(String)) }
210210
attr_accessor :headline
211211
# A link to the business’s publicly available privacy policy.
212212
sig { returns(T.nilable(String)) }
@@ -215,20 +215,20 @@ module Stripe
215215
sig { returns(T.nilable(String)) }
216216
attr_accessor :terms_of_service_url
217217
sig {
218-
params(headline: T.nilable(T.nilable(String)), privacy_policy_url: T.nilable(String), terms_of_service_url: T.nilable(String)).void
218+
params(headline: T.nilable(String), privacy_policy_url: T.nilable(String), terms_of_service_url: T.nilable(String)).void
219219
}
220220
def initialize(headline: nil, privacy_policy_url: nil, terms_of_service_url: nil); end
221221
end
222222
class Features < Stripe::RequestParams
223223
class CustomerUpdate < Stripe::RequestParams
224224
# The types of customer updates that are supported. When empty, customers are not updateable.
225-
sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
225+
sig { returns(T.nilable(T.any(String, T::Array[String]))) }
226226
attr_accessor :allowed_updates
227227
# Whether the feature is enabled.
228228
sig { returns(T::Boolean) }
229229
attr_accessor :enabled
230230
sig {
231-
params(allowed_updates: T.nilable(T.nilable(T.any(String, T::Array[String]))), enabled: T::Boolean).void
231+
params(allowed_updates: T.nilable(T.any(String, T::Array[String])), enabled: T::Boolean).void
232232
}
233233
def initialize(allowed_updates: nil, enabled: nil); end
234234
end
@@ -252,11 +252,9 @@ module Stripe
252252
sig { returns(T::Boolean) }
253253
attr_accessor :enabled
254254
# Which cancellation reasons will be given as options to the customer.
255-
sig { returns(T.nilable(T.any(String, T::Array[String]))) }
255+
sig { returns(T.any(String, T::Array[String])) }
256256
attr_accessor :options
257-
sig {
258-
params(enabled: T::Boolean, options: T.nilable(T.any(String, T::Array[String]))).void
259-
}
257+
sig { params(enabled: T::Boolean, options: T.any(String, T::Array[String])).void }
260258
def initialize(enabled: nil, options: nil); end
261259
end
262260
# Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer
@@ -335,14 +333,14 @@ module Stripe
335333
def initialize(conditions: nil); end
336334
end
337335
# The types of subscription updates that are supported. When empty, subscriptions are not updateable.
338-
sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
336+
sig { returns(T.nilable(T.any(String, T::Array[String]))) }
339337
attr_accessor :default_allowed_updates
340338
# Whether the feature is enabled.
341339
sig { returns(T::Boolean) }
342340
attr_accessor :enabled
343341
# The list of up to 10 products that support subscription updates.
344342
sig {
345-
returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::BillingPortal::Configuration::CreateParams::Features::SubscriptionUpdate::Product]))))
343+
returns(T.nilable(T.any(String, T::Array[::Stripe::BillingPortal::Configuration::CreateParams::Features::SubscriptionUpdate::Product])))
346344
}
347345
attr_accessor :products
348346
# Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`.
@@ -354,7 +352,7 @@ module Stripe
354352
}
355353
attr_accessor :schedule_at_period_end
356354
sig {
357-
params(default_allowed_updates: T.nilable(T.nilable(T.any(String, T::Array[String]))), enabled: T::Boolean, products: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::BillingPortal::Configuration::CreateParams::Features::SubscriptionUpdate::Product]))), proration_behavior: T.nilable(String), schedule_at_period_end: T.nilable(::Stripe::BillingPortal::Configuration::CreateParams::Features::SubscriptionUpdate::ScheduleAtPeriodEnd)).void
355+
params(default_allowed_updates: T.nilable(T.any(String, T::Array[String])), enabled: T::Boolean, products: T.nilable(T.any(String, T::Array[::Stripe::BillingPortal::Configuration::CreateParams::Features::SubscriptionUpdate::Product])), proration_behavior: T.nilable(String), schedule_at_period_end: T.nilable(::Stripe::BillingPortal::Configuration::CreateParams::Features::SubscriptionUpdate::ScheduleAtPeriodEnd)).void
358356
}
359357
def initialize(
360358
default_allowed_updates: nil,
@@ -413,7 +411,7 @@ module Stripe
413411
}
414412
attr_accessor :business_profile
415413
# The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session.
416-
sig { returns(T.nilable(T.nilable(String))) }
414+
sig { returns(T.nilable(String)) }
417415
attr_accessor :default_return_url
418416
# Specifies which fields in the response should be expanded.
419417
sig { returns(T.nilable(T::Array[String])) }
@@ -428,7 +426,7 @@ module Stripe
428426
sig { returns(T.nilable(T::Hash[String, String])) }
429427
attr_accessor :metadata
430428
sig {
431-
params(business_profile: T.nilable(::Stripe::BillingPortal::Configuration::CreateParams::BusinessProfile), default_return_url: T.nilable(T.nilable(String)), expand: T.nilable(T::Array[String]), features: ::Stripe::BillingPortal::Configuration::CreateParams::Features, login_page: T.nilable(::Stripe::BillingPortal::Configuration::CreateParams::LoginPage), metadata: T.nilable(T::Hash[String, String])).void
429+
params(business_profile: T.nilable(::Stripe::BillingPortal::Configuration::CreateParams::BusinessProfile), default_return_url: T.nilable(String), expand: T.nilable(T::Array[String]), features: ::Stripe::BillingPortal::Configuration::CreateParams::Features, login_page: T.nilable(::Stripe::BillingPortal::Configuration::CreateParams::LoginPage), metadata: T.nilable(T::Hash[String, String])).void
432430
}
433431
def initialize(
434432
business_profile: nil,
@@ -442,29 +440,29 @@ module Stripe
442440
class UpdateParams < Stripe::RequestParams
443441
class BusinessProfile < Stripe::RequestParams
444442
# The messaging shown to customers in the portal.
445-
sig { returns(T.nilable(T.nilable(String))) }
443+
sig { returns(T.nilable(String)) }
446444
attr_accessor :headline
447445
# A link to the business’s publicly available privacy policy.
448-
sig { returns(T.nilable(T.nilable(String))) }
446+
sig { returns(T.nilable(String)) }
449447
attr_accessor :privacy_policy_url
450448
# A link to the business’s publicly available terms of service.
451-
sig { returns(T.nilable(T.nilable(String))) }
449+
sig { returns(T.nilable(String)) }
452450
attr_accessor :terms_of_service_url
453451
sig {
454-
params(headline: T.nilable(T.nilable(String)), privacy_policy_url: T.nilable(T.nilable(String)), terms_of_service_url: T.nilable(T.nilable(String))).void
452+
params(headline: T.nilable(String), privacy_policy_url: T.nilable(String), terms_of_service_url: T.nilable(String)).void
455453
}
456454
def initialize(headline: nil, privacy_policy_url: nil, terms_of_service_url: nil); end
457455
end
458456
class Features < Stripe::RequestParams
459457
class CustomerUpdate < Stripe::RequestParams
460458
# The types of customer updates that are supported. When empty, customers are not updateable.
461-
sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
459+
sig { returns(T.nilable(T.any(String, T::Array[String]))) }
462460
attr_accessor :allowed_updates
463461
# Whether the feature is enabled.
464462
sig { returns(T.nilable(T::Boolean)) }
465463
attr_accessor :enabled
466464
sig {
467-
params(allowed_updates: T.nilable(T.nilable(T.any(String, T::Array[String]))), enabled: T.nilable(T::Boolean)).void
465+
params(allowed_updates: T.nilable(T.any(String, T::Array[String])), enabled: T.nilable(T::Boolean)).void
468466
}
469467
def initialize(allowed_updates: nil, enabled: nil); end
470468
end
@@ -488,10 +486,10 @@ module Stripe
488486
sig { returns(T::Boolean) }
489487
attr_accessor :enabled
490488
# Which cancellation reasons will be given as options to the customer.
491-
sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
489+
sig { returns(T.nilable(T.any(String, T::Array[String]))) }
492490
attr_accessor :options
493491
sig {
494-
params(enabled: T::Boolean, options: T.nilable(T.nilable(T.any(String, T::Array[String])))).void
492+
params(enabled: T::Boolean, options: T.nilable(T.any(String, T::Array[String]))).void
495493
}
496494
def initialize(enabled: nil, options: nil); end
497495
end
@@ -562,23 +560,23 @@ module Stripe
562560
end
563561
# List of conditions. When any condition is true, the update will be scheduled at the end of the current period.
564562
sig {
565-
returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::BillingPortal::Configuration::UpdateParams::Features::SubscriptionUpdate::ScheduleAtPeriodEnd::Condition]))))
563+
returns(T.nilable(T.any(String, T::Array[::Stripe::BillingPortal::Configuration::UpdateParams::Features::SubscriptionUpdate::ScheduleAtPeriodEnd::Condition])))
566564
}
567565
attr_accessor :conditions
568566
sig {
569-
params(conditions: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::BillingPortal::Configuration::UpdateParams::Features::SubscriptionUpdate::ScheduleAtPeriodEnd::Condition])))).void
567+
params(conditions: T.nilable(T.any(String, T::Array[::Stripe::BillingPortal::Configuration::UpdateParams::Features::SubscriptionUpdate::ScheduleAtPeriodEnd::Condition]))).void
570568
}
571569
def initialize(conditions: nil); end
572570
end
573571
# The types of subscription updates that are supported. When empty, subscriptions are not updateable.
574-
sig { returns(T.nilable(T.nilable(T.any(String, T::Array[String])))) }
572+
sig { returns(T.nilable(T.any(String, T::Array[String]))) }
575573
attr_accessor :default_allowed_updates
576574
# Whether the feature is enabled.
577575
sig { returns(T.nilable(T::Boolean)) }
578576
attr_accessor :enabled
579577
# The list of up to 10 products that support subscription updates.
580578
sig {
581-
returns(T.nilable(T.nilable(T.any(String, T::Array[::Stripe::BillingPortal::Configuration::UpdateParams::Features::SubscriptionUpdate::Product]))))
579+
returns(T.nilable(T.any(String, T::Array[::Stripe::BillingPortal::Configuration::UpdateParams::Features::SubscriptionUpdate::Product])))
582580
}
583581
attr_accessor :products
584582
# Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`.
@@ -590,7 +588,7 @@ module Stripe
590588
}
591589
attr_accessor :schedule_at_period_end
592590
sig {
593-
params(default_allowed_updates: T.nilable(T.nilable(T.any(String, T::Array[String]))), enabled: T.nilable(T::Boolean), products: T.nilable(T.nilable(T.any(String, T::Array[::Stripe::BillingPortal::Configuration::UpdateParams::Features::SubscriptionUpdate::Product]))), proration_behavior: T.nilable(String), schedule_at_period_end: T.nilable(::Stripe::BillingPortal::Configuration::UpdateParams::Features::SubscriptionUpdate::ScheduleAtPeriodEnd)).void
591+
params(default_allowed_updates: T.nilable(T.any(String, T::Array[String])), enabled: T.nilable(T::Boolean), products: T.nilable(T.any(String, T::Array[::Stripe::BillingPortal::Configuration::UpdateParams::Features::SubscriptionUpdate::Product])), proration_behavior: T.nilable(String), schedule_at_period_end: T.nilable(::Stripe::BillingPortal::Configuration::UpdateParams::Features::SubscriptionUpdate::ScheduleAtPeriodEnd)).void
594592
}
595593
def initialize(
596594
default_allowed_updates: nil,
@@ -654,7 +652,7 @@ module Stripe
654652
}
655653
attr_accessor :business_profile
656654
# The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session.
657-
sig { returns(T.nilable(T.nilable(String))) }
655+
sig { returns(T.nilable(String)) }
658656
attr_accessor :default_return_url
659657
# Specifies which fields in the response should be expanded.
660658
sig { returns(T.nilable(T::Array[String])) }
@@ -666,10 +664,10 @@ module Stripe
666664
sig { returns(T.nilable(::Stripe::BillingPortal::Configuration::UpdateParams::LoginPage)) }
667665
attr_accessor :login_page
668666
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
669-
sig { returns(T.nilable(T.nilable(T.any(String, T::Hash[String, String])))) }
667+
sig { returns(T.nilable(T.any(String, T::Hash[String, String]))) }
670668
attr_accessor :metadata
671669
sig {
672-
params(active: T.nilable(T::Boolean), business_profile: T.nilable(::Stripe::BillingPortal::Configuration::UpdateParams::BusinessProfile), default_return_url: T.nilable(T.nilable(String)), expand: T.nilable(T::Array[String]), features: T.nilable(::Stripe::BillingPortal::Configuration::UpdateParams::Features), login_page: T.nilable(::Stripe::BillingPortal::Configuration::UpdateParams::LoginPage), metadata: T.nilable(T.nilable(T.any(String, T::Hash[String, String])))).void
670+
params(active: T.nilable(T::Boolean), business_profile: T.nilable(::Stripe::BillingPortal::Configuration::UpdateParams::BusinessProfile), default_return_url: T.nilable(String), expand: T.nilable(T::Array[String]), features: T.nilable(::Stripe::BillingPortal::Configuration::UpdateParams::Features), login_page: T.nilable(::Stripe::BillingPortal::Configuration::UpdateParams::LoginPage), metadata: T.nilable(T.any(String, T::Hash[String, String]))).void
673671
}
674672
def initialize(
675673
active: nil,

0 commit comments

Comments
 (0)