lithic 0.1.0.pre.alpha.25 → 0.1.0.pre.alpha.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -0
  3. data/README.md +94 -54
  4. data/lib/lithic/client.rb +8 -4
  5. data/lib/lithic/internal/transport/pooled_net_requester.rb +3 -1
  6. data/lib/lithic/internal/type/array_of.rb +8 -0
  7. data/lib/lithic/internal/type/base_model.rb +15 -0
  8. data/lib/lithic/internal/type/boolean.rb +8 -0
  9. data/lib/lithic/internal/type/enum.rb +12 -0
  10. data/lib/lithic/internal/type/file_input.rb +7 -0
  11. data/lib/lithic/internal/type/hash_of.rb +8 -0
  12. data/lib/lithic/internal/type/union.rb +12 -0
  13. data/lib/lithic/internal/type/unknown.rb +8 -0
  14. data/lib/lithic/internal/util.rb +45 -0
  15. data/lib/lithic/internal.rb +3 -0
  16. data/lib/lithic/models/account_holder_update_response.rb +0 -9
  17. data/lib/lithic/models/auth_rules/auth_rule_condition.rb +0 -4
  18. data/lib/lithic/models/auth_rules/v2_apply_response.rb +0 -20
  19. data/lib/lithic/models/auth_rules/v2_create_params.rb +0 -10
  20. data/lib/lithic/models/auth_rules/v2_create_response.rb +0 -20
  21. data/lib/lithic/models/auth_rules/v2_draft_params.rb +0 -10
  22. data/lib/lithic/models/auth_rules/v2_draft_response.rb +0 -20
  23. data/lib/lithic/models/auth_rules/v2_list_response.rb +0 -20
  24. data/lib/lithic/models/auth_rules/v2_promote_response.rb +0 -20
  25. data/lib/lithic/models/auth_rules/v2_retrieve_response.rb +0 -20
  26. data/lib/lithic/models/auth_rules/v2_update_response.rb +0 -20
  27. data/lib/lithic/models/auth_rules/velocity_limit_params.rb +0 -4
  28. data/lib/lithic/models/card_web_provision_params.rb +32 -0
  29. data/lib/lithic/models/card_web_provision_response.rb +83 -0
  30. data/lib/lithic/models/funding_event_list_params.rb +43 -0
  31. data/lib/lithic/models/funding_event_list_response.rb +104 -0
  32. data/lib/lithic/models/funding_event_retrieve_details_params.rb +14 -0
  33. data/lib/lithic/models/funding_event_retrieve_details_response.rb +33 -0
  34. data/lib/lithic/models/funding_event_retrieve_params.rb +14 -0
  35. data/lib/lithic/models/funding_event_retrieve_response.rb +104 -0
  36. data/lib/lithic/models.rb +38 -19
  37. data/lib/lithic/resources/cards.rb +29 -0
  38. data/lib/lithic/resources/funding_events.rb +84 -0
  39. data/lib/lithic/version.rb +1 -1
  40. data/lib/lithic.rb +9 -0
  41. data/rbi/lithic/client.rbi +3 -0
  42. data/rbi/lithic/internal/transport/pooled_net_requester.rbi +5 -1
  43. data/rbi/lithic/internal/type/array_of.rbi +6 -0
  44. data/rbi/lithic/internal/type/base_model.rbi +5 -0
  45. data/rbi/lithic/internal/type/boolean.rbi +6 -0
  46. data/rbi/lithic/internal/type/enum.rbi +5 -0
  47. data/rbi/lithic/internal/type/file_input.rbi +5 -0
  48. data/rbi/lithic/internal/type/hash_of.rbi +6 -0
  49. data/rbi/lithic/internal/type/union.rbi +5 -0
  50. data/rbi/lithic/internal/type/unknown.rbi +6 -0
  51. data/rbi/lithic/internal/util.rbi +31 -0
  52. data/rbi/lithic/internal.rbi +3 -0
  53. data/rbi/lithic/models/auth_rules/auth_rule_condition.rbi +12 -4
  54. data/rbi/lithic/models/auth_rules/v2_apply_response.rbi +4 -20
  55. data/rbi/lithic/models/auth_rules/v2_create_response.rbi +4 -20
  56. data/rbi/lithic/models/auth_rules/v2_draft_response.rbi +4 -20
  57. data/rbi/lithic/models/auth_rules/v2_list_response.rbi +4 -20
  58. data/rbi/lithic/models/auth_rules/v2_promote_response.rbi +4 -20
  59. data/rbi/lithic/models/auth_rules/v2_retrieve_response.rbi +4 -20
  60. data/rbi/lithic/models/auth_rules/v2_update_response.rbi +4 -20
  61. data/rbi/lithic/models/card_web_provision_params.rbi +84 -0
  62. data/rbi/lithic/models/card_web_provision_response.rbi +169 -0
  63. data/rbi/lithic/models/funding_event_list_params.rbi +72 -0
  64. data/rbi/lithic/models/funding_event_list_response.rbi +177 -0
  65. data/rbi/lithic/models/funding_event_retrieve_details_params.rbi +30 -0
  66. data/rbi/lithic/models/funding_event_retrieve_details_response.rbi +56 -0
  67. data/rbi/lithic/models/funding_event_retrieve_params.rbi +27 -0
  68. data/rbi/lithic/models/funding_event_retrieve_response.rbi +177 -0
  69. data/rbi/lithic/models.rbi +9 -0
  70. data/rbi/lithic/resources/account_holders.rbi +1 -6
  71. data/rbi/lithic/resources/cards.rbi +23 -0
  72. data/rbi/lithic/resources/funding_events.rbi +64 -0
  73. data/sig/lithic/client.rbs +2 -0
  74. data/sig/lithic/internal/transport/pooled_net_requester.rbs +2 -0
  75. data/sig/lithic/internal/type/array_of.rbs +3 -0
  76. data/sig/lithic/internal/type/base_model.rbs +2 -0
  77. data/sig/lithic/internal/type/boolean.rbs +3 -0
  78. data/sig/lithic/internal/type/enum.rbs +2 -0
  79. data/sig/lithic/internal/type/file_input.rbs +2 -0
  80. data/sig/lithic/internal/type/hash_of.rbs +3 -0
  81. data/sig/lithic/internal/type/union.rbs +2 -0
  82. data/sig/lithic/internal/type/unknown.rbs +3 -0
  83. data/sig/lithic/internal/util.rbs +12 -0
  84. data/sig/lithic/internal.rbs +2 -0
  85. data/sig/lithic/models/card_web_provision_params.rbs +33 -0
  86. data/sig/lithic/models/card_web_provision_response.rbs +68 -0
  87. data/sig/lithic/models/funding_event_list_params.rbs +31 -0
  88. data/sig/lithic/models/funding_event_list_response.rbs +65 -0
  89. data/sig/lithic/models/funding_event_retrieve_details_params.rbs +13 -0
  90. data/sig/lithic/models/funding_event_retrieve_details_response.rbs +24 -0
  91. data/sig/lithic/models/funding_event_retrieve_params.rbs +13 -0
  92. data/sig/lithic/models/funding_event_retrieve_response.rbs +65 -0
  93. data/sig/lithic/models.rbs +8 -0
  94. data/sig/lithic/resources/cards.rbs +6 -0
  95. data/sig/lithic/resources/funding_events.rbs +24 -0
  96. metadata +29 -2
data/lib/lithic/models.rb CHANGED
@@ -5,29 +5,40 @@ module Lithic
5
5
  cls.define_sorbet_constant!(:OrHash) { T.type_alias { T.any(cls, Lithic::Internal::AnyHash) } }
6
6
  end
7
7
 
8
- [
9
- *Lithic::Internal::Type::Enum.included_modules,
10
- *Lithic::Internal::Type::Union.included_modules
11
- ].each do |cls|
12
- cls.constants.each do |name|
13
- case cls.const_get(name)
14
- in true | false
15
- cls.define_sorbet_constant!(:TaggedBoolean) { T.type_alias { T.all(T::Boolean, cls) } }
16
- cls.define_sorbet_constant!(:OrBoolean) { T.type_alias { T::Boolean } }
17
- in Integer
18
- cls.define_sorbet_constant!(:TaggedInteger) { T.type_alias { T.all(Integer, cls) } }
19
- cls.define_sorbet_constant!(:OrInteger) { T.type_alias { Integer } }
20
- in Float
21
- cls.define_sorbet_constant!(:TaggedFloat) { T.type_alias { T.all(Float, cls) } }
22
- cls.define_sorbet_constant!(:OrFloat) { T.type_alias { Float } }
23
- in Symbol
24
- cls.define_sorbet_constant!(:TaggedSymbol) { T.type_alias { T.all(Symbol, cls) } }
25
- cls.define_sorbet_constant!(:OrSymbol) { T.type_alias { T.any(Symbol, String) } }
26
- else
8
+ Lithic::Internal::Util.walk_namespaces(Lithic::Models).each do |mod|
9
+ case mod
10
+ in Lithic::Internal::Type::Enum | Lithic::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
27
27
  end
28
+ else
28
29
  end
29
30
  end
30
31
 
32
+ Lithic::Internal::Util.walk_namespaces(Lithic::Models)
33
+ .lazy
34
+ .grep(Lithic::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
+
31
42
  Account = Lithic::Models::Account
32
43
 
33
44
  AccountFinancialAccountType = Lithic::Models::AccountFinancialAccountType
@@ -129,6 +140,8 @@ module Lithic
129
140
 
130
141
  CardUpdateParams = Lithic::Models::CardUpdateParams
131
142
 
143
+ CardWebProvisionParams = Lithic::Models::CardWebProvisionParams
144
+
132
145
  Carrier = Lithic::Models::Carrier
133
146
 
134
147
  ClientAPIStatusParams = Lithic::Models::ClientAPIStatusParams
@@ -227,6 +240,12 @@ module Lithic
227
240
 
228
241
  FinancialTransaction = Lithic::Models::FinancialTransaction
229
242
 
243
+ FundingEventListParams = Lithic::Models::FundingEventListParams
244
+
245
+ FundingEventRetrieveDetailsParams = Lithic::Models::FundingEventRetrieveDetailsParams
246
+
247
+ FundingEventRetrieveParams = Lithic::Models::FundingEventRetrieveParams
248
+
230
249
  InstanceFinancialAccountType = Lithic::Models::InstanceFinancialAccountType
231
250
 
232
251
  KYB = Lithic::Models::KYB
@@ -431,6 +431,35 @@ module Lithic
431
431
  )
432
432
  end
433
433
 
434
+ # Allow your cardholders to directly add payment cards to the device's digital
435
+ # wallet from a browser on the web. Currently only suported for Apple Pay.
436
+ #
437
+ # This requires some additional setup and configuration. Please
438
+ # [Contact Us](https://lithic.com/contact) or your Customer Success representative
439
+ # for more information.
440
+ #
441
+ # @overload web_provision(card_token, digital_wallet: nil, request_options: {})
442
+ #
443
+ # @param card_token [String] The unique token of the card to add to the device's digital wallet.
444
+ #
445
+ # @param digital_wallet [Symbol, Lithic::CardWebProvisionParams::DigitalWallet] Name of digital wallet provider.
446
+ #
447
+ # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
448
+ #
449
+ # @return [Lithic::Models::CardWebProvisionResponse]
450
+ #
451
+ # @see Lithic::Models::CardWebProvisionParams
452
+ def web_provision(card_token, params = {})
453
+ parsed, options = Lithic::CardWebProvisionParams.dump_request(params)
454
+ @client.request(
455
+ method: :post,
456
+ path: ["v1/cards/%1$s/web_provision", card_token],
457
+ body: parsed,
458
+ model: Lithic::Models::CardWebProvisionResponse,
459
+ options: options
460
+ )
461
+ end
462
+
434
463
  # @api private
435
464
  #
436
465
  # @param client [Lithic::Client]
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lithic
4
+ module Resources
5
+ class FundingEvents
6
+ # Get funding event for program by id
7
+ #
8
+ # @overload retrieve(funding_event_token, request_options: {})
9
+ #
10
+ # @param funding_event_token [String] Globally unique identifier for funding event.
11
+ #
12
+ # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
13
+ #
14
+ # @return [Lithic::Models::FundingEventRetrieveResponse]
15
+ #
16
+ # @see Lithic::Models::FundingEventRetrieveParams
17
+ def retrieve(funding_event_token, params = {})
18
+ @client.request(
19
+ method: :get,
20
+ path: ["v1/funding_events/%1$s", funding_event_token],
21
+ model: Lithic::Models::FundingEventRetrieveResponse,
22
+ options: params[:request_options]
23
+ )
24
+ end
25
+
26
+ # Some parameter documentations has been truncated, see
27
+ # {Lithic::Models::FundingEventListParams} for more details.
28
+ #
29
+ # Get all funding events for program
30
+ #
31
+ # @overload list(ending_before: nil, page_size: nil, starting_after: nil, request_options: {})
32
+ #
33
+ # @param ending_before [String] A cursor representing an item's token before which a page of results should end.
34
+ #
35
+ # @param page_size [Integer] Page size (for pagination).
36
+ #
37
+ # @param starting_after [String] A cursor representing an item's token after which a page of results should begin
38
+ #
39
+ # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
40
+ #
41
+ # @return [Lithic::Internal::CursorPage<Lithic::Models::FundingEventListResponse>]
42
+ #
43
+ # @see Lithic::Models::FundingEventListParams
44
+ def list(params = {})
45
+ parsed, options = Lithic::FundingEventListParams.dump_request(params)
46
+ @client.request(
47
+ method: :get,
48
+ path: "v1/funding_events",
49
+ query: parsed,
50
+ page: Lithic::Internal::CursorPage,
51
+ model: Lithic::Models::FundingEventListResponse,
52
+ options: options
53
+ )
54
+ end
55
+
56
+ # Get funding event details by id
57
+ #
58
+ # @overload retrieve_details(funding_event_token, request_options: {})
59
+ #
60
+ # @param funding_event_token [String] Globally unique identifier for funding event.
61
+ #
62
+ # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
63
+ #
64
+ # @return [Lithic::Models::FundingEventRetrieveDetailsResponse]
65
+ #
66
+ # @see Lithic::Models::FundingEventRetrieveDetailsParams
67
+ def retrieve_details(funding_event_token, params = {})
68
+ @client.request(
69
+ method: :get,
70
+ path: ["v1/funding_events/%1$s/details", funding_event_token],
71
+ model: Lithic::Models::FundingEventRetrieveDetailsResponse,
72
+ options: params[:request_options]
73
+ )
74
+ end
75
+
76
+ # @api private
77
+ #
78
+ # @param client [Lithic::Client]
79
+ def initialize(client:)
80
+ @client = client
81
+ end
82
+ end
83
+ end
84
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lithic
4
- VERSION = "0.1.0.pre.alpha.25"
4
+ VERSION = "0.1.0.pre.alpha.27"
5
5
  end
data/lib/lithic.rb CHANGED
@@ -140,6 +140,8 @@ require_relative "lithic/models/cards/financial_transaction_retrieve_params"
140
140
  require_relative "lithic/models/card_search_by_pan_params"
141
141
  require_relative "lithic/models/card_spend_limits"
142
142
  require_relative "lithic/models/card_update_params"
143
+ require_relative "lithic/models/card_web_provision_params"
144
+ require_relative "lithic/models/card_web_provision_response"
143
145
  require_relative "lithic/models/carrier"
144
146
  require_relative "lithic/models/client_api_status_params"
145
147
  require_relative "lithic/models/credit_products/extended_credit"
@@ -227,6 +229,12 @@ require_relative "lithic/models/financial_accounts/statements/statement_line_ite
227
229
  require_relative "lithic/models/financial_account_update_params"
228
230
  require_relative "lithic/models/financial_account_update_status_params"
229
231
  require_relative "lithic/models/financial_transaction"
232
+ require_relative "lithic/models/funding_event_list_params"
233
+ require_relative "lithic/models/funding_event_list_response"
234
+ require_relative "lithic/models/funding_event_retrieve_details_params"
235
+ require_relative "lithic/models/funding_event_retrieve_details_response"
236
+ require_relative "lithic/models/funding_event_retrieve_params"
237
+ require_relative "lithic/models/funding_event_retrieve_response"
230
238
  require_relative "lithic/models/instance_financial_account_type"
231
239
  require_relative "lithic/models/kyb"
232
240
  require_relative "lithic/models/kyb_business_entity"
@@ -355,6 +363,7 @@ require_relative "lithic/resources/financial_accounts/financial_transactions"
355
363
  require_relative "lithic/resources/financial_accounts/loan_tapes"
356
364
  require_relative "lithic/resources/financial_accounts/statements"
357
365
  require_relative "lithic/resources/financial_accounts/statements/line_items"
366
+ require_relative "lithic/resources/funding_events"
358
367
  require_relative "lithic/resources/management_operations"
359
368
  require_relative "lithic/resources/payments"
360
369
  require_relative "lithic/resources/reports"
@@ -97,6 +97,9 @@ module Lithic
97
97
  sig { returns(Lithic::Resources::ManagementOperations) }
98
98
  attr_reader :management_operations
99
99
 
100
+ sig { returns(Lithic::Resources::FundingEvents) }
101
+ attr_reader :funding_events
102
+
100
103
  # Status of api
101
104
  sig do
102
105
  params(request_options: Lithic::RequestOptions::OrHash).returns(
@@ -22,6 +22,8 @@ module Lithic
22
22
  # https://github.com/golang/go/blob/c8eced8580028328fde7c03cbfcb720ce15b2358/src/net/http/transport.go#L49
23
23
  KEEP_ALIVE_TIMEOUT = 30
24
24
 
25
+ DEFAULT_MAX_CONNECTIONS = T.let(T.unsafe(nil), Integer)
26
+
25
27
  class << self
26
28
  # @api private
27
29
  sig { params(url: URI::Generic).returns(Net::HTTP) }
@@ -66,7 +68,9 @@ module Lithic
66
68
 
67
69
  # @api private
68
70
  sig { params(size: Integer).returns(T.attached_class) }
69
- def self.new(size: Etc.nprocessors)
71
+ def self.new(
72
+ size: Lithic::Internal::Transport::PooledNetRequester::DEFAULT_MAX_CONNECTIONS
73
+ )
70
74
  end
71
75
  end
72
76
  end
@@ -8,6 +8,7 @@ module Lithic
8
8
  # Array of items of a given type.
9
9
  class ArrayOf
10
10
  include Lithic::Internal::Type::Converter
11
+ include Lithic::Internal::Util::SorbetRuntimeSupport
11
12
 
12
13
  abstract!
13
14
 
@@ -63,6 +64,11 @@ module Lithic
63
64
  def dump(value, state:)
64
65
  end
65
66
 
67
+ # @api private
68
+ sig { returns(T.anything) }
69
+ def to_sorbet_type
70
+ end
71
+
66
72
  # @api private
67
73
  sig { returns(Elem) }
68
74
  protected def item_type
@@ -190,6 +190,11 @@ module Lithic
190
190
  end
191
191
  def dump(value, state:)
192
192
  end
193
+
194
+ # @api private
195
+ sig { returns(T.anything) }
196
+ def to_sorbet_type
197
+ end
193
198
  end
194
199
 
195
200
  class << self
@@ -8,6 +8,7 @@ module Lithic
8
8
  # Ruby has no Boolean class; this is something for models to refer to.
9
9
  class Boolean
10
10
  extend Lithic::Internal::Type::Converter
11
+ extend Lithic::Internal::Util::SorbetRuntimeSupport
11
12
 
12
13
  abstract!
13
14
 
@@ -43,6 +44,11 @@ module Lithic
43
44
  end
44
45
  def dump(value, state:)
45
46
  end
47
+
48
+ # @api private
49
+ sig { returns(T.anything) }
50
+ def to_sorbet_type
51
+ end
46
52
  end
47
53
  end
48
54
  end
@@ -67,6 +67,11 @@ module Lithic
67
67
  def dump(value, state:)
68
68
  end
69
69
 
70
+ # @api private
71
+ sig { returns(T.anything) }
72
+ def to_sorbet_type
73
+ end
74
+
70
75
  # @api private
71
76
  sig { params(depth: Integer).returns(String) }
72
77
  def inspect(depth: 0)
@@ -47,6 +47,11 @@ module Lithic
47
47
  end
48
48
  def dump(value, state:)
49
49
  end
50
+
51
+ # @api private
52
+ sig { returns(T.anything) }
53
+ def to_sorbet_type
54
+ end
50
55
  end
51
56
  end
52
57
  end
@@ -8,6 +8,7 @@ module Lithic
8
8
  # Hash of items of a given type.
9
9
  class HashOf
10
10
  include Lithic::Internal::Type::Converter
11
+ include Lithic::Internal::Util::SorbetRuntimeSupport
11
12
 
12
13
  abstract!
13
14
 
@@ -63,6 +64,11 @@ module Lithic
63
64
  def dump(value, state:)
64
65
  end
65
66
 
67
+ # @api private
68
+ sig { returns(T.anything) }
69
+ def to_sorbet_type
70
+ end
71
+
66
72
  # @api private
67
73
  sig { returns(Elem) }
68
74
  protected def item_type
@@ -101,6 +101,11 @@ module Lithic
101
101
  def dump(value, state:)
102
102
  end
103
103
 
104
+ # @api private
105
+ sig { returns(T.anything) }
106
+ def to_sorbet_type
107
+ end
108
+
104
109
  # @api private
105
110
  sig { params(depth: Integer).returns(String) }
106
111
  def inspect(depth: 0)
@@ -8,6 +8,7 @@ module Lithic
8
8
  # When we don't know what to expect for the value.
9
9
  class Unknown
10
10
  extend Lithic::Internal::Type::Converter
11
+ extend Lithic::Internal::Util::SorbetRuntimeSupport
11
12
 
12
13
  abstract!
13
14
 
@@ -43,6 +44,11 @@ module Lithic
43
44
  end
44
45
  def dump(value, state:)
45
46
  end
47
+
48
+ # @api private
49
+ sig { returns(T.anything) }
50
+ def to_sorbet_type
51
+ end
46
52
  end
47
53
  end
48
54
  end
@@ -11,6 +11,15 @@ module Lithic
11
11
  def self.monotonic_secs
12
12
  end
13
13
 
14
+ # @api private
15
+ sig do
16
+ params(ns: T.any(Module, T::Class[T.anything])).returns(
17
+ T::Enumerable[T.any(Module, T::Class[T.anything])]
18
+ )
19
+ end
20
+ def self.walk_namespaces(ns)
21
+ end
22
+
14
23
  class << self
15
24
  # @api private
16
25
  sig { returns(String) }
@@ -441,10 +450,32 @@ module Lithic
441
450
  def const_missing(name)
442
451
  end
443
452
 
453
+ # @api private
454
+ sig { params(name: Symbol).returns(T::Boolean) }
455
+ def sorbet_constant_defined?(name)
456
+ end
457
+
444
458
  # @api private
445
459
  sig { params(name: Symbol, blk: T.proc.returns(T.anything)).void }
446
460
  def define_sorbet_constant!(name, &blk)
447
461
  end
462
+
463
+ # @api private
464
+ sig { returns(T.anything) }
465
+ def to_sorbet_type
466
+ end
467
+
468
+ class << self
469
+ # @api private
470
+ sig do
471
+ params(
472
+ type:
473
+ T.any(Lithic::Internal::Util::SorbetRuntimeSupport, T.anything)
474
+ ).returns(T.anything)
475
+ end
476
+ def to_sorbet_type(type)
477
+ end
478
+ end
448
479
  end
449
480
  end
450
481
  end
@@ -8,6 +8,9 @@ module Lithic
8
8
  # this alias might be refined in the future.
9
9
  AnyHash = T.type_alias { T::Hash[Symbol, T.anything] }
10
10
 
11
+ FileInput =
12
+ T.type_alias { T.any(Pathname, StringIO, IO, String, Lithic::FilePart) }
13
+
11
14
  OMIT = T.let(Object.new.freeze, T.anything)
12
15
  end
13
16
  end
@@ -89,10 +89,18 @@ module Lithic
89
89
  attr_writer :operation
90
90
 
91
91
  # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH`
92
- sig { returns(T.nilable(T.any(String, Integer, T::Array[String]))) }
92
+ sig do
93
+ returns(
94
+ T.nilable(Lithic::AuthRules::AuthRuleCondition::Value::Variants)
95
+ )
96
+ end
93
97
  attr_reader :value
94
98
 
95
- sig { params(value: T.any(String, Integer, T::Array[String])).void }
99
+ sig do
100
+ params(
101
+ value: Lithic::AuthRules::AuthRuleCondition::Value::Variants
102
+ ).void
103
+ end
96
104
  attr_writer :value
97
105
 
98
106
  sig do
@@ -100,7 +108,7 @@ module Lithic
100
108
  attribute: Lithic::AuthRules::ConditionalAttribute::OrSymbol,
101
109
  operation:
102
110
  Lithic::AuthRules::AuthRuleCondition::Operation::OrSymbol,
103
- value: T.any(String, Integer, T::Array[String])
111
+ value: Lithic::AuthRules::AuthRuleCondition::Value::Variants
104
112
  ).returns(T.attached_class)
105
113
  end
106
114
  def self.new(
@@ -165,7 +173,7 @@ module Lithic
165
173
  attribute: Lithic::AuthRules::ConditionalAttribute::OrSymbol,
166
174
  operation:
167
175
  Lithic::AuthRules::AuthRuleCondition::Operation::OrSymbol,
168
- value: T.any(String, Integer, T::Array[String])
176
+ value: Lithic::AuthRules::AuthRuleCondition::Value::Variants
169
177
  }
170
178
  )
171
179
  end
@@ -172,11 +172,7 @@ module Lithic
172
172
  # Parameters for the Auth Rule
173
173
  sig do
174
174
  returns(
175
- T.any(
176
- Lithic::AuthRules::ConditionalBlockParameters,
177
- Lithic::AuthRules::VelocityLimitParams,
178
- Lithic::Models::AuthRules::V2ApplyResponse::CurrentVersion::Parameters::MerchantLockParameters
179
- )
175
+ Lithic::Models::AuthRules::V2ApplyResponse::CurrentVersion::Parameters::Variants
180
176
  )
181
177
  end
182
178
  attr_accessor :parameters
@@ -210,11 +206,7 @@ module Lithic
210
206
  override.returns(
211
207
  {
212
208
  parameters:
213
- T.any(
214
- Lithic::AuthRules::ConditionalBlockParameters,
215
- Lithic::AuthRules::VelocityLimitParams,
216
- Lithic::Models::AuthRules::V2ApplyResponse::CurrentVersion::Parameters::MerchantLockParameters
217
- ),
209
+ Lithic::Models::AuthRules::V2ApplyResponse::CurrentVersion::Parameters::Variants,
218
210
  version: Integer
219
211
  }
220
212
  )
@@ -377,11 +369,7 @@ module Lithic
377
369
  # Parameters for the Auth Rule
378
370
  sig do
379
371
  returns(
380
- T.any(
381
- Lithic::AuthRules::ConditionalBlockParameters,
382
- Lithic::AuthRules::VelocityLimitParams,
383
- Lithic::Models::AuthRules::V2ApplyResponse::DraftVersion::Parameters::MerchantLockParameters
384
- )
372
+ Lithic::Models::AuthRules::V2ApplyResponse::DraftVersion::Parameters::Variants
385
373
  )
386
374
  end
387
375
  attr_accessor :parameters
@@ -415,11 +403,7 @@ module Lithic
415
403
  override.returns(
416
404
  {
417
405
  parameters:
418
- T.any(
419
- Lithic::AuthRules::ConditionalBlockParameters,
420
- Lithic::AuthRules::VelocityLimitParams,
421
- Lithic::Models::AuthRules::V2ApplyResponse::DraftVersion::Parameters::MerchantLockParameters
422
- ),
406
+ Lithic::Models::AuthRules::V2ApplyResponse::DraftVersion::Parameters::Variants,
423
407
  version: Integer
424
408
  }
425
409
  )
@@ -172,11 +172,7 @@ module Lithic
172
172
  # Parameters for the Auth Rule
173
173
  sig do
174
174
  returns(
175
- T.any(
176
- Lithic::AuthRules::ConditionalBlockParameters,
177
- Lithic::AuthRules::VelocityLimitParams,
178
- Lithic::Models::AuthRules::V2CreateResponse::CurrentVersion::Parameters::MerchantLockParameters
179
- )
175
+ Lithic::Models::AuthRules::V2CreateResponse::CurrentVersion::Parameters::Variants
180
176
  )
181
177
  end
182
178
  attr_accessor :parameters
@@ -210,11 +206,7 @@ module Lithic
210
206
  override.returns(
211
207
  {
212
208
  parameters:
213
- T.any(
214
- Lithic::AuthRules::ConditionalBlockParameters,
215
- Lithic::AuthRules::VelocityLimitParams,
216
- Lithic::Models::AuthRules::V2CreateResponse::CurrentVersion::Parameters::MerchantLockParameters
217
- ),
209
+ Lithic::Models::AuthRules::V2CreateResponse::CurrentVersion::Parameters::Variants,
218
210
  version: Integer
219
211
  }
220
212
  )
@@ -377,11 +369,7 @@ module Lithic
377
369
  # Parameters for the Auth Rule
378
370
  sig do
379
371
  returns(
380
- T.any(
381
- Lithic::AuthRules::ConditionalBlockParameters,
382
- Lithic::AuthRules::VelocityLimitParams,
383
- Lithic::Models::AuthRules::V2CreateResponse::DraftVersion::Parameters::MerchantLockParameters
384
- )
372
+ Lithic::Models::AuthRules::V2CreateResponse::DraftVersion::Parameters::Variants
385
373
  )
386
374
  end
387
375
  attr_accessor :parameters
@@ -415,11 +403,7 @@ module Lithic
415
403
  override.returns(
416
404
  {
417
405
  parameters:
418
- T.any(
419
- Lithic::AuthRules::ConditionalBlockParameters,
420
- Lithic::AuthRules::VelocityLimitParams,
421
- Lithic::Models::AuthRules::V2CreateResponse::DraftVersion::Parameters::MerchantLockParameters
422
- ),
406
+ Lithic::Models::AuthRules::V2CreateResponse::DraftVersion::Parameters::Variants,
423
407
  version: Integer
424
408
  }
425
409
  )
@@ -172,11 +172,7 @@ module Lithic
172
172
  # Parameters for the Auth Rule
173
173
  sig do
174
174
  returns(
175
- T.any(
176
- Lithic::AuthRules::ConditionalBlockParameters,
177
- Lithic::AuthRules::VelocityLimitParams,
178
- Lithic::Models::AuthRules::V2DraftResponse::CurrentVersion::Parameters::MerchantLockParameters
179
- )
175
+ Lithic::Models::AuthRules::V2DraftResponse::CurrentVersion::Parameters::Variants
180
176
  )
181
177
  end
182
178
  attr_accessor :parameters
@@ -210,11 +206,7 @@ module Lithic
210
206
  override.returns(
211
207
  {
212
208
  parameters:
213
- T.any(
214
- Lithic::AuthRules::ConditionalBlockParameters,
215
- Lithic::AuthRules::VelocityLimitParams,
216
- Lithic::Models::AuthRules::V2DraftResponse::CurrentVersion::Parameters::MerchantLockParameters
217
- ),
209
+ Lithic::Models::AuthRules::V2DraftResponse::CurrentVersion::Parameters::Variants,
218
210
  version: Integer
219
211
  }
220
212
  )
@@ -377,11 +369,7 @@ module Lithic
377
369
  # Parameters for the Auth Rule
378
370
  sig do
379
371
  returns(
380
- T.any(
381
- Lithic::AuthRules::ConditionalBlockParameters,
382
- Lithic::AuthRules::VelocityLimitParams,
383
- Lithic::Models::AuthRules::V2DraftResponse::DraftVersion::Parameters::MerchantLockParameters
384
- )
372
+ Lithic::Models::AuthRules::V2DraftResponse::DraftVersion::Parameters::Variants
385
373
  )
386
374
  end
387
375
  attr_accessor :parameters
@@ -415,11 +403,7 @@ module Lithic
415
403
  override.returns(
416
404
  {
417
405
  parameters:
418
- T.any(
419
- Lithic::AuthRules::ConditionalBlockParameters,
420
- Lithic::AuthRules::VelocityLimitParams,
421
- Lithic::Models::AuthRules::V2DraftResponse::DraftVersion::Parameters::MerchantLockParameters
422
- ),
406
+ Lithic::Models::AuthRules::V2DraftResponse::DraftVersion::Parameters::Variants,
423
407
  version: Integer
424
408
  }
425
409
  )