@@ -5,26 +5,40 @@ module Orb
55 cls . define_sorbet_constant! ( :OrHash ) { T . type_alias { T . any ( cls , Orb ::Internal ::AnyHash ) } }
66 end
77
8- [ *Orb ::Internal ::Type ::Enum . included_modules , *Orb ::Internal ::Type ::Union . included_modules ] . each do |cls |
9- cls . constants . each do |name |
10- case cls . const_get ( name )
11- in true | false
12- cls . define_sorbet_constant! ( :TaggedBoolean ) { T . type_alias { T . all ( T ::Boolean , cls ) } }
13- cls . define_sorbet_constant! ( :OrBoolean ) { T . type_alias { T ::Boolean } }
14- in Integer
15- cls . define_sorbet_constant! ( :TaggedInteger ) { T . type_alias { T . all ( Integer , cls ) } }
16- cls . define_sorbet_constant! ( :OrInteger ) { T . type_alias { Integer } }
17- in Float
18- cls . define_sorbet_constant! ( :TaggedFloat ) { T . type_alias { T . all ( Float , cls ) } }
19- cls . define_sorbet_constant! ( :OrFloat ) { T . type_alias { Float } }
20- in Symbol
21- cls . define_sorbet_constant! ( :TaggedSymbol ) { T . type_alias { T . all ( Symbol , cls ) } }
22- cls . define_sorbet_constant! ( :OrSymbol ) { T . type_alias { T . any ( Symbol , String ) } }
23- else
8+ Orb ::Internal ::Util . walk_namespaces ( Orb ::Models ) . each do |mod |
9+ case mod
10+ in Orb ::Internal ::Type ::Enum | Orb ::Internal ::Type ::Union
11+ mod . constants . each do |name |
12+ case mod . const_get ( name )
13+ in true | false
14+ mod . define_sorbet_constant! ( :TaggedBoolean ) { T . type_alias { T . all ( T ::Boolean , mod ) } }
15+ mod . define_sorbet_constant! ( :OrBoolean ) { T . type_alias { T ::Boolean } }
16+ in Integer
17+ mod . define_sorbet_constant! ( :TaggedInteger ) { T . type_alias { T . all ( Integer , mod ) } }
18+ mod . define_sorbet_constant! ( :OrInteger ) { T . type_alias { Integer } }
19+ in Float
20+ mod . define_sorbet_constant! ( :TaggedFloat ) { T . type_alias { T . all ( Float , mod ) } }
21+ mod . define_sorbet_constant! ( :OrFloat ) { T . type_alias { Float } }
22+ in Symbol
23+ mod . define_sorbet_constant! ( :TaggedSymbol ) { T . type_alias { T . all ( Symbol , mod ) } }
24+ mod . define_sorbet_constant! ( :OrSymbol ) { T . type_alias { T . any ( Symbol , String ) } }
25+ else
26+ end
2427 end
28+ else
2529 end
2630 end
2731
32+ Orb ::Internal ::Util . walk_namespaces ( Orb ::Models )
33+ . lazy
34+ . grep ( Orb ::Internal ::Type ::Union )
35+ . each do |mod |
36+ const = :Variants
37+ next if mod . sorbet_constant_defined? ( const )
38+
39+ mod . define_sorbet_constant! ( const ) { T . type_alias { mod . to_sorbet_type } }
40+ end
41+
2842 Alert = Orb ::Models ::Alert
2943
3044 AlertCreateForCustomerParams = Orb ::Models ::AlertCreateForCustomerParams
0 commit comments