Skip to content

Commit c5ddfb6

Browse files
feat(api): support event_streams in auth_rules list endpoint
1 parent 7eacd6a commit c5ddfb6

File tree

18 files changed

+155
-338
lines changed

18 files changed

+155
-338
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 176
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-abe6a4f82f696099fa8ecb1cc44f08979e17d56578ae7ea68b0e9182e21df508.yml
33
openapi_spec_hash: d2ce51592a9a234c6f34a1168a31f91f
4-
config_hash: ba3fbfc99a1b8635d9e79e9e49d12952
4+
config_hash: 739714a3fead0b26ee3a3b7bc51081f6

lib/lithic.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
require_relative "lithic/models/auth_rules/conditional_operation"
9999
require_relative "lithic/models/auth_rules/conditional_tokenization_action_parameters"
100100
require_relative "lithic/models/auth_rules/conditional_value"
101+
require_relative "lithic/models/auth_rules/event_stream"
101102
require_relative "lithic/models/auth_rules/merchant_lock_parameters"
102103
require_relative "lithic/models/auth_rules/rule_stats"
103104
require_relative "lithic/models/auth_rules/v2/backtest_create_params"

lib/lithic/models/auth_rules/auth_rule.rb

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ class AuthRule < Lithic::Internal::Type::BaseModel
4242
# @!attribute event_stream
4343
# The event stream during which the rule will be evaluated.
4444
#
45-
# @return [Symbol, Lithic::Models::AuthRules::AuthRule::EventStream]
46-
required :event_stream, enum: -> { Lithic::AuthRules::AuthRule::EventStream }
45+
# @return [Symbol, Lithic::Models::AuthRules::EventStream]
46+
required :event_stream, enum: -> { Lithic::AuthRules::EventStream }
4747

4848
# @!attribute lithic_managed
4949
# Indicates whether this auth rule is managed by Lithic. If true, the rule cannot
@@ -107,7 +107,7 @@ class AuthRule < Lithic::Internal::Type::BaseModel
107107
#
108108
# @param draft_version [Lithic::Models::AuthRules::AuthRule::DraftVersion, nil]
109109
#
110-
# @param event_stream [Symbol, Lithic::Models::AuthRules::AuthRule::EventStream] The event stream during which the rule will be evaluated.
110+
# @param event_stream [Symbol, Lithic::Models::AuthRules::EventStream] The event stream during which the rule will be evaluated.
111111
#
112112
# @param lithic_managed [Boolean] Indicates whether this auth rule is managed by Lithic. If true, the rule cannot
113113
#
@@ -221,22 +221,6 @@ module Parameters
221221
end
222222
end
223223

224-
# The event stream during which the rule will be evaluated.
225-
#
226-
# @see Lithic::Models::AuthRules::AuthRule#event_stream
227-
module EventStream
228-
extend Lithic::Internal::Type::Enum
229-
230-
AUTHORIZATION = :AUTHORIZATION
231-
THREE_DS_AUTHENTICATION = :THREE_DS_AUTHENTICATION
232-
TOKENIZATION = :TOKENIZATION
233-
ACH_CREDIT_RECEIPT = :ACH_CREDIT_RECEIPT
234-
ACH_DEBIT_RECEIPT = :ACH_DEBIT_RECEIPT
235-
236-
# @!method self.values
237-
# @return [Array<Symbol>]
238-
end
239-
240224
# The state of the Auth Rule
241225
#
242226
# @see Lithic::Models::AuthRules::AuthRule#state
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# frozen_string_literal: true
2+
3+
module Lithic
4+
module Models
5+
module AuthRules
6+
# The event stream during which the rule will be evaluated.
7+
module EventStream
8+
extend Lithic::Internal::Type::Enum
9+
10+
AUTHORIZATION = :AUTHORIZATION
11+
THREE_DS_AUTHENTICATION = :THREE_DS_AUTHENTICATION
12+
TOKENIZATION = :TOKENIZATION
13+
ACH_CREDIT_RECEIPT = :ACH_CREDIT_RECEIPT
14+
ACH_DEBIT_RECEIPT = :ACH_DEBIT_RECEIPT
15+
16+
# @!method self.values
17+
# @return [Array<Symbol>]
18+
end
19+
end
20+
end
21+
end

lib/lithic/models/auth_rules/v2_create_params.rb

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ class V2CreateParams < Lithic::Internal::Type::BaseModel
4444
# @!attribute event_stream
4545
# The event stream during which the rule will be evaluated.
4646
#
47-
# @return [Symbol, Lithic::Models::AuthRules::V2CreateParams::EventStream, nil]
48-
optional :event_stream, enum: -> { Lithic::AuthRules::V2CreateParams::EventStream }
47+
# @return [Symbol, Lithic::Models::AuthRules::EventStream, nil]
48+
optional :event_stream, enum: -> { Lithic::AuthRules::EventStream }
4949

5050
# @!attribute name
5151
# Auth Rule Name
@@ -87,7 +87,7 @@ class V2CreateParams < Lithic::Internal::Type::BaseModel
8787
#
8888
# @param business_account_tokens [Array<String>] Business Account tokens to which the Auth Rule applies.
8989
#
90-
# @param event_stream [Symbol, Lithic::Models::AuthRules::V2CreateParams::EventStream] The event stream during which the rule will be evaluated.
90+
# @param event_stream [Symbol, Lithic::Models::AuthRules::EventStream] The event stream during which the rule will be evaluated.
9191
#
9292
# @param name [String, nil] Auth Rule Name
9393
#
@@ -138,20 +138,6 @@ module Type
138138
# @!method self.values
139139
# @return [Array<Symbol>]
140140
end
141-
142-
# The event stream during which the rule will be evaluated.
143-
module EventStream
144-
extend Lithic::Internal::Type::Enum
145-
146-
AUTHORIZATION = :AUTHORIZATION
147-
THREE_DS_AUTHENTICATION = :THREE_DS_AUTHENTICATION
148-
TOKENIZATION = :TOKENIZATION
149-
ACH_CREDIT_RECEIPT = :ACH_CREDIT_RECEIPT
150-
ACH_DEBIT_RECEIPT = :ACH_DEBIT_RECEIPT
151-
152-
# @!method self.values
153-
# @return [Array<Symbol>]
154-
end
155141
end
156142
end
157143
end

lib/lithic/models/auth_rules/v2_list_params.rb

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,16 @@ class V2ListParams < Lithic::Internal::Type::BaseModel
3737
# Deprecated: Use event_streams instead. Only return Auth rules that are executed
3838
# during the provided event stream.
3939
#
40-
# @return [Symbol, Lithic::Models::AuthRules::V2ListParams::EventStream, nil]
41-
optional :event_stream, enum: -> { Lithic::AuthRules::V2ListParams::EventStream }
40+
# @return [Symbol, Lithic::Models::AuthRules::EventStream, nil]
41+
optional :event_stream, enum: -> { Lithic::AuthRules::EventStream }
4242

4343
# @!attribute event_streams
4444
# Only return Auth rules that are executed during any of the provided event
4545
# streams. If event_streams and event_stream are specified, the values will be
4646
# combined.
4747
#
48-
# @return [Array<Symbol, Lithic::Models::AuthRules::V2ListParams::EventStream>, nil]
49-
optional :event_streams,
50-
-> { Lithic::Internal::Type::ArrayOf[enum: Lithic::AuthRules::V2ListParams::EventStream] }
48+
# @return [Array<Symbol, Lithic::Models::AuthRules::EventStream>, nil]
49+
optional :event_streams, -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::AuthRules::EventStream] }
5150

5251
# @!attribute page_size
5352
# Page size (for pagination).
@@ -80,9 +79,9 @@ class V2ListParams < Lithic::Internal::Type::BaseModel
8079
#
8180
# @param ending_before [String] A cursor representing an item's token before which a page of results should end.
8281
#
83-
# @param event_stream [Symbol, Lithic::Models::AuthRules::V2ListParams::EventStream] Deprecated: Use event_streams instead. Only return Auth rules that are executed
82+
# @param event_stream [Symbol, Lithic::Models::AuthRules::EventStream] Deprecated: Use event_streams instead. Only return Auth rules that are executed
8483
#
85-
# @param event_streams [Array<Symbol, Lithic::Models::AuthRules::V2ListParams::EventStream>] Only return Auth rules that are executed during any of the provided event stream
84+
# @param event_streams [Array<Symbol, Lithic::Models::AuthRules::EventStream>] Only return Auth rules that are executed during any of the provided event stream
8685
#
8786
# @param page_size [Integer] Page size (for pagination).
8887
#
@@ -92,21 +91,6 @@ class V2ListParams < Lithic::Internal::Type::BaseModel
9291
#
9392
# @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}]
9493

95-
# Deprecated: Use event_streams instead. Only return Auth rules that are executed
96-
# during the provided event stream.
97-
module EventStream
98-
extend Lithic::Internal::Type::Enum
99-
100-
AUTHORIZATION = :AUTHORIZATION
101-
THREE_DS_AUTHENTICATION = :THREE_DS_AUTHENTICATION
102-
TOKENIZATION = :TOKENIZATION
103-
ACH_CREDIT_RECEIPT = :ACH_CREDIT_RECEIPT
104-
ACH_DEBIT_RECEIPT = :ACH_DEBIT_RECEIPT
105-
106-
# @!method self.values
107-
# @return [Array<Symbol>]
108-
end
109-
11094
# Only return Auth Rules that are bound to the provided scope.
11195
module Scope
11296
extend Lithic::Internal::Type::Enum

lib/lithic/resources/auth_rules/v2.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class V2
2626
#
2727
# @param business_account_tokens [Array<String>] Business Account tokens to which the Auth Rule applies.
2828
#
29-
# @param event_stream [Symbol, Lithic::Models::AuthRules::V2CreateParams::EventStream] The event stream during which the rule will be evaluated.
29+
# @param event_stream [Symbol, Lithic::Models::AuthRules::EventStream] The event stream during which the rule will be evaluated.
3030
#
3131
# @param name [String, nil] Auth Rule Name
3232
#
@@ -125,9 +125,9 @@ def update(auth_rule_token, params = {})
125125
#
126126
# @param ending_before [String] A cursor representing an item's token before which a page of results should end.
127127
#
128-
# @param event_stream [Symbol, Lithic::Models::AuthRules::V2ListParams::EventStream] Deprecated: Use event_streams instead. Only return Auth rules that are executed
128+
# @param event_stream [Symbol, Lithic::Models::AuthRules::EventStream] Deprecated: Use event_streams instead. Only return Auth rules that are executed
129129
#
130-
# @param event_streams [Array<Symbol, Lithic::Models::AuthRules::V2ListParams::EventStream>] Only return Auth rules that are executed during any of the provided event stream
130+
# @param event_streams [Array<Symbol, Lithic::Models::AuthRules::EventStream>] Only return Auth rules that are executed during any of the provided event stream
131131
#
132132
# @param page_size [Integer] Page size (for pagination).
133133
#

rbi/lithic/models/auth_rules/auth_rule.rbi

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module Lithic
5050
attr_writer :draft_version
5151

5252
# The event stream during which the rule will be evaluated.
53-
sig { returns(Lithic::AuthRules::AuthRule::EventStream::TaggedSymbol) }
53+
sig { returns(Lithic::AuthRules::EventStream::TaggedSymbol) }
5454
attr_accessor :event_stream
5555

5656
# Indicates whether this auth rule is managed by Lithic. If true, the rule cannot
@@ -100,7 +100,7 @@ module Lithic
100100
T.nilable(Lithic::AuthRules::AuthRule::CurrentVersion::OrHash),
101101
draft_version:
102102
T.nilable(Lithic::AuthRules::AuthRule::DraftVersion::OrHash),
103-
event_stream: Lithic::AuthRules::AuthRule::EventStream::OrSymbol,
103+
event_stream: Lithic::AuthRules::EventStream::OrSymbol,
104104
lithic_managed: T::Boolean,
105105
name: T.nilable(String),
106106
program_level: T::Boolean,
@@ -158,8 +158,7 @@ module Lithic
158158
T.nilable(Lithic::AuthRules::AuthRule::CurrentVersion),
159159
draft_version:
160160
T.nilable(Lithic::AuthRules::AuthRule::DraftVersion),
161-
event_stream:
162-
Lithic::AuthRules::AuthRule::EventStream::TaggedSymbol,
161+
event_stream: Lithic::AuthRules::EventStream::TaggedSymbol,
163162
lithic_managed: T::Boolean,
164163
name: T.nilable(String),
165164
program_level: T::Boolean,
@@ -346,51 +345,6 @@ module Lithic
346345
end
347346
end
348347

349-
# The event stream during which the rule will be evaluated.
350-
module EventStream
351-
extend Lithic::Internal::Type::Enum
352-
353-
TaggedSymbol =
354-
T.type_alias do
355-
T.all(Symbol, Lithic::AuthRules::AuthRule::EventStream)
356-
end
357-
OrSymbol = T.type_alias { T.any(Symbol, String) }
358-
359-
AUTHORIZATION =
360-
T.let(
361-
:AUTHORIZATION,
362-
Lithic::AuthRules::AuthRule::EventStream::TaggedSymbol
363-
)
364-
THREE_DS_AUTHENTICATION =
365-
T.let(
366-
:THREE_DS_AUTHENTICATION,
367-
Lithic::AuthRules::AuthRule::EventStream::TaggedSymbol
368-
)
369-
TOKENIZATION =
370-
T.let(
371-
:TOKENIZATION,
372-
Lithic::AuthRules::AuthRule::EventStream::TaggedSymbol
373-
)
374-
ACH_CREDIT_RECEIPT =
375-
T.let(
376-
:ACH_CREDIT_RECEIPT,
377-
Lithic::AuthRules::AuthRule::EventStream::TaggedSymbol
378-
)
379-
ACH_DEBIT_RECEIPT =
380-
T.let(
381-
:ACH_DEBIT_RECEIPT,
382-
Lithic::AuthRules::AuthRule::EventStream::TaggedSymbol
383-
)
384-
385-
sig do
386-
override.returns(
387-
T::Array[Lithic::AuthRules::AuthRule::EventStream::TaggedSymbol]
388-
)
389-
end
390-
def self.values
391-
end
392-
end
393-
394348
# The state of the Auth Rule
395349
module State
396350
extend Lithic::Internal::Type::Enum
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# typed: strong
2+
3+
module Lithic
4+
module Models
5+
module AuthRules
6+
# The event stream during which the rule will be evaluated.
7+
module EventStream
8+
extend Lithic::Internal::Type::Enum
9+
10+
TaggedSymbol =
11+
T.type_alias { T.all(Symbol, Lithic::AuthRules::EventStream) }
12+
OrSymbol = T.type_alias { T.any(Symbol, String) }
13+
14+
AUTHORIZATION =
15+
T.let(:AUTHORIZATION, Lithic::AuthRules::EventStream::TaggedSymbol)
16+
THREE_DS_AUTHENTICATION =
17+
T.let(
18+
:THREE_DS_AUTHENTICATION,
19+
Lithic::AuthRules::EventStream::TaggedSymbol
20+
)
21+
TOKENIZATION =
22+
T.let(:TOKENIZATION, Lithic::AuthRules::EventStream::TaggedSymbol)
23+
ACH_CREDIT_RECEIPT =
24+
T.let(
25+
:ACH_CREDIT_RECEIPT,
26+
Lithic::AuthRules::EventStream::TaggedSymbol
27+
)
28+
ACH_DEBIT_RECEIPT =
29+
T.let(
30+
:ACH_DEBIT_RECEIPT,
31+
Lithic::AuthRules::EventStream::TaggedSymbol
32+
)
33+
34+
sig do
35+
override.returns(
36+
T::Array[Lithic::AuthRules::EventStream::TaggedSymbol]
37+
)
38+
end
39+
def self.values
40+
end
41+
end
42+
end
43+
end
44+
end

0 commit comments

Comments
 (0)