-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathauth_rule.rb
More file actions
361 lines (301 loc) · 19.4 KB
/
Copy pathauth_rule.rb
File metadata and controls
361 lines (301 loc) · 19.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# frozen_string_literal: true
module Lithic
module Models
module AuthRules
# @see Lithic::Resources::AuthRules::V2#create
class AuthRule < Lithic::Internal::Type::BaseModel
# @!attribute token
# Auth Rule Token
#
# @return [String]
required :token, String
# @!attribute account_tokens
# Account tokens to which the Auth Rule applies.
#
# @return [Array<String>]
required :account_tokens, Lithic::Internal::Type::ArrayOf[String]
# @!attribute business_account_tokens
# Business Account tokens to which the Auth Rule applies.
#
# @return [Array<String>]
required :business_account_tokens, Lithic::Internal::Type::ArrayOf[String]
# @!attribute card_tokens
# Card tokens to which the Auth Rule applies.
#
# @return [Array<String>]
required :card_tokens, Lithic::Internal::Type::ArrayOf[String]
# @!attribute current_version
#
# @return [Lithic::Models::AuthRules::AuthRule::CurrentVersion, nil]
required :current_version, -> { Lithic::AuthRules::AuthRule::CurrentVersion }, nil?: true
# @!attribute draft_version
#
# @return [Lithic::Models::AuthRules::AuthRule::DraftVersion, nil]
required :draft_version, -> { Lithic::AuthRules::AuthRule::DraftVersion }, nil?: true
# @!attribute event_stream
# The event stream during which the rule will be evaluated.
#
# @return [Symbol, Lithic::Models::AuthRules::EventStream]
required :event_stream, enum: -> { Lithic::AuthRules::EventStream }
# @!attribute lithic_managed
# Indicates whether this auth rule is managed by Lithic. If true, the rule cannot
# be modified or deleted by the user
#
# @return [Boolean]
required :lithic_managed, Lithic::Internal::Type::Boolean
# @!attribute name
# Auth Rule Name
#
# @return [String, nil]
required :name, String, nil?: true
# @!attribute program_level
# Whether the Auth Rule applies to all authorizations on the card program.
#
# @return [Boolean]
required :program_level, Lithic::Internal::Type::Boolean
# @!attribute state
# The state of the Auth Rule
#
# @return [Symbol, Lithic::Models::AuthRules::AuthRule::State]
required :state, enum: -> { Lithic::AuthRules::AuthRule::State }
# @!attribute type
# The type of Auth Rule. For certain rule types, this determines the event stream
# during which it will be evaluated. For rules that can be applied to one of
# several event streams, the effective one is defined by the separate
# `event_stream` field.
#
# - `CONDITIONAL_BLOCK`: Deprecated. Use `CONDITIONAL_ACTION` instead.
# AUTHORIZATION event stream.
# - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
# - `MERCHANT_LOCK`: AUTHORIZATION event stream.
# - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
# ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
# ACH_PAYMENT_UPDATE event stream.
# - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
# ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
# ACH_PAYMENT_UPDATE event stream.
#
# @return [Symbol, Lithic::Models::AuthRules::AuthRule::Type]
required :type, enum: -> { Lithic::AuthRules::AuthRule::Type }
# @!attribute excluded_account_tokens
# Account tokens to which the Auth Rule does not apply.
#
# @return [Array<String>, nil]
optional :excluded_account_tokens, Lithic::Internal::Type::ArrayOf[String]
# @!attribute excluded_business_account_tokens
# Business account tokens to which the Auth Rule does not apply.
#
# @return [Array<String>, nil]
optional :excluded_business_account_tokens, Lithic::Internal::Type::ArrayOf[String]
# @!attribute excluded_card_tokens
# Card tokens to which the Auth Rule does not apply.
#
# @return [Array<String>, nil]
optional :excluded_card_tokens, Lithic::Internal::Type::ArrayOf[String]
# @!method initialize(token:, account_tokens:, business_account_tokens:, card_tokens:, current_version:, draft_version:, event_stream:, lithic_managed:, name:, program_level:, state:, type:, excluded_account_tokens: nil, excluded_business_account_tokens: nil, excluded_card_tokens: nil)
# Some parameter documentations has been truncated, see
# {Lithic::Models::AuthRules::AuthRule} for more details.
#
# @param token [String] Auth Rule Token
#
# @param account_tokens [Array<String>] Account tokens to which the Auth Rule applies.
#
# @param business_account_tokens [Array<String>] Business Account tokens to which the Auth Rule applies.
#
# @param card_tokens [Array<String>] Card tokens to which the Auth Rule applies.
#
# @param current_version [Lithic::Models::AuthRules::AuthRule::CurrentVersion, nil]
#
# @param draft_version [Lithic::Models::AuthRules::AuthRule::DraftVersion, nil]
#
# @param event_stream [Symbol, Lithic::Models::AuthRules::EventStream] The event stream during which the rule will be evaluated.
#
# @param lithic_managed [Boolean] Indicates whether this auth rule is managed by Lithic. If true, the rule cannot
#
# @param name [String, nil] Auth Rule Name
#
# @param program_level [Boolean] Whether the Auth Rule applies to all authorizations on the card program.
#
# @param state [Symbol, Lithic::Models::AuthRules::AuthRule::State] The state of the Auth Rule
#
# @param type [Symbol, Lithic::Models::AuthRules::AuthRule::Type] The type of Auth Rule. For certain rule types, this determines the event stream
#
# @param excluded_account_tokens [Array<String>] Account tokens to which the Auth Rule does not apply.
#
# @param excluded_business_account_tokens [Array<String>] Business account tokens to which the Auth Rule does not apply.
#
# @param excluded_card_tokens [Array<String>] Card tokens to which the Auth Rule does not apply.
# @see Lithic::Models::AuthRules::AuthRule#current_version
class CurrentVersion < Lithic::Internal::Type::BaseModel
# @!attribute parameters
# Parameters for the Auth Rule
#
# @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::ConditionalACHPaymentUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters]
required :parameters, union: -> { Lithic::AuthRules::AuthRule::CurrentVersion::Parameters }
response_only do
# @!attribute version
# The version of the rule, this is incremented whenever the rule's parameters
# change.
#
# @return [Integer]
required :version, Integer
end
# @!method initialize(parameters:, version:)
# Some parameter documentations has been truncated, see
# {Lithic::Models::AuthRules::AuthRule::CurrentVersion} for more details.
#
# @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::ConditionalACHPaymentUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters] Parameters for the Auth Rule
#
# @param version [Integer] The version of the rule, this is incremented whenever the rule's parameters chan
# Parameters for the Auth Rule
#
# @see Lithic::Models::AuthRules::AuthRule::CurrentVersion#parameters
module Parameters
extend Lithic::Internal::Type::Union
# Deprecated: Use CONDITIONAL_ACTION instead.
variant -> { Lithic::AuthRules::ConditionalBlockParameters }
variant -> { Lithic::AuthRules::VelocityLimitParams }
variant -> { Lithic::AuthRules::MerchantLockParameters }
variant -> { Lithic::AuthRules::Conditional3DSActionParameters }
variant -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters }
variant -> { Lithic::AuthRules::ConditionalACHActionParameters }
variant -> { Lithic::AuthRules::ConditionalTokenizationActionParameters }
variant -> { Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters }
variant -> { Lithic::AuthRules::ConditionalACHPaymentUpdateActionParameters }
# Parameters for defining a TypeScript code rule
variant -> { Lithic::AuthRules::TypescriptCodeParameters }
variant -> { Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters }
# @!method self.variants
# @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::ConditionalACHPaymentUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters)]
end
end
# @see Lithic::Models::AuthRules::AuthRule#draft_version
class DraftVersion < Lithic::Internal::Type::BaseModel
# @!attribute error
# An error message if the draft version failed compilation. Populated when `state`
# is `ERROR`, `null` otherwise.
#
# @return [String, nil]
required :error, String, nil?: true
# @!attribute parameters
# Parameters for the Auth Rule
#
# @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::ConditionalACHPaymentUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters]
required :parameters, union: -> { Lithic::AuthRules::AuthRule::DraftVersion::Parameters }
# @!attribute state
# The state of the draft version. Most rules are created synchronously and the
# state is immediately `SHADOWING`. Rules backed by TypeScript code are compiled
# asynchronously — the state starts as `PENDING` and transitions to `SHADOWING` on
# success or `ERROR` on failure.
#
# - `PENDING`: Compilation of the rule is in progress (TypeScript rules only).
# - `SHADOWING`: The draft version is ready and evaluating in shadow mode
# alongside the current active version. It can be promoted to the active
# version.
# - `ERROR`: Compilation of the rule failed. Check the `error` field for details.
#
# @return [Symbol, Lithic::Models::AuthRules::AuthRule::DraftVersion::State]
required :state, enum: -> { Lithic::AuthRules::AuthRule::DraftVersion::State }
response_only do
# @!attribute version
# The version of the rule, this is incremented whenever the rule's parameters
# change.
#
# @return [Integer]
required :version, Integer
end
# @!method initialize(error:, parameters:, state:, version:)
# Some parameter documentations has been truncated, see
# {Lithic::Models::AuthRules::AuthRule::DraftVersion} for more details.
#
# @param error [String, nil] An error message if the draft version failed compilation. Populated when `state`
#
# @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::ConditionalACHPaymentUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters] Parameters for the Auth Rule
#
# @param state [Symbol, Lithic::Models::AuthRules::AuthRule::DraftVersion::State] The state of the draft version. Most rules are created synchronously and the sta
#
# @param version [Integer] The version of the rule, this is incremented whenever the rule's parameters chan
# Parameters for the Auth Rule
#
# @see Lithic::Models::AuthRules::AuthRule::DraftVersion#parameters
module Parameters
extend Lithic::Internal::Type::Union
# Deprecated: Use CONDITIONAL_ACTION instead.
variant -> { Lithic::AuthRules::ConditionalBlockParameters }
variant -> { Lithic::AuthRules::VelocityLimitParams }
variant -> { Lithic::AuthRules::MerchantLockParameters }
variant -> { Lithic::AuthRules::Conditional3DSActionParameters }
variant -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters }
variant -> { Lithic::AuthRules::ConditionalACHActionParameters }
variant -> { Lithic::AuthRules::ConditionalTokenizationActionParameters }
variant -> { Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters }
variant -> { Lithic::AuthRules::ConditionalACHPaymentUpdateActionParameters }
# Parameters for defining a TypeScript code rule
variant -> { Lithic::AuthRules::TypescriptCodeParameters }
variant -> { Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters }
# @!method self.variants
# @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::ConditionalACHPaymentUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters)]
end
# The state of the draft version. Most rules are created synchronously and the
# state is immediately `SHADOWING`. Rules backed by TypeScript code are compiled
# asynchronously — the state starts as `PENDING` and transitions to `SHADOWING` on
# success or `ERROR` on failure.
#
# - `PENDING`: Compilation of the rule is in progress (TypeScript rules only).
# - `SHADOWING`: The draft version is ready and evaluating in shadow mode
# alongside the current active version. It can be promoted to the active
# version.
# - `ERROR`: Compilation of the rule failed. Check the `error` field for details.
#
# @see Lithic::Models::AuthRules::AuthRule::DraftVersion#state
module State
extend Lithic::Internal::Type::Enum
PENDING = :PENDING
SHADOWING = :SHADOWING
ERROR = :ERROR
# @!method self.values
# @return [Array<Symbol>]
end
end
# The state of the Auth Rule
#
# @see Lithic::Models::AuthRules::AuthRule#state
module State
extend Lithic::Internal::Type::Enum
ACTIVE = :ACTIVE
INACTIVE = :INACTIVE
# @!method self.values
# @return [Array<Symbol>]
end
# The type of Auth Rule. For certain rule types, this determines the event stream
# during which it will be evaluated. For rules that can be applied to one of
# several event streams, the effective one is defined by the separate
# `event_stream` field.
#
# - `CONDITIONAL_BLOCK`: Deprecated. Use `CONDITIONAL_ACTION` instead.
# AUTHORIZATION event stream.
# - `VELOCITY_LIMIT`: AUTHORIZATION event stream.
# - `MERCHANT_LOCK`: AUTHORIZATION event stream.
# - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
# ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
# ACH_PAYMENT_UPDATE event stream.
# - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION,
# ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, CARD_TRANSACTION_UPDATE, or
# ACH_PAYMENT_UPDATE event stream.
#
# @see Lithic::Models::AuthRules::AuthRule#type
module Type
extend Lithic::Internal::Type::Enum
CONDITIONAL_BLOCK = :CONDITIONAL_BLOCK
VELOCITY_LIMIT = :VELOCITY_LIMIT
MERCHANT_LOCK = :MERCHANT_LOCK
CONDITIONAL_ACTION = :CONDITIONAL_ACTION
TYPESCRIPT_CODE = :TYPESCRIPT_CODE
# @!method self.values
# @return [Array<Symbol>]
end
end
end
AuthRule = AuthRules::AuthRule
end
end