Class: Lithic::Resources::AuthRules::V2
- Inherits:
-
Object
- Object
- Lithic::Resources::AuthRules::V2
- Defined in:
- lib/lithic/resources/auth_rules/v2.rb,
lib/lithic/resources/auth_rules/v2/backtests.rb
Defined Under Namespace
Classes: Backtests
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(body:, request_options: {}) ⇒ Lithic::Models::AuthRules::AuthRule
Creates a new V2 Auth rule in draft mode.
-
#delete(auth_rule_token, request_options: {}) ⇒ nil
Deletes a V2 Auth rule.
-
#draft(auth_rule_token, parameters: nil, request_options: {}) ⇒ Lithic::Models::AuthRules::AuthRule
Creates a new draft version of a rule that will be ran in shadow mode.
-
#initialize(client:) ⇒ V2
constructor
private
A new instance of V2.
-
#list(account_token: nil, business_account_token: nil, card_token: nil, ending_before: nil, event_stream: nil, event_streams: nil, page_size: nil, scope: nil, starting_after: nil, request_options: {}) ⇒ Lithic::Internal::CursorPage<Lithic::Models::AuthRules::AuthRule>
Some parameter documentations has been truncated, see Models::AuthRules::V2ListParams for more details.
-
#list_results(auth_rule_token: nil, begin_: nil, end_: nil, ending_before: nil, event_token: nil, has_actions: nil, page_size: nil, starting_after: nil, request_options: {}) ⇒ Lithic::Internal::CursorPage<Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult, Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult, Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult, Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult>
Some parameter documentations has been truncated, see Models::AuthRules::V2ListResultsParams for more details.
-
#list_versions(auth_rule_token, request_options: {}) ⇒ Lithic::Models::AuthRules::V2ListVersionsResponse
Returns all versions of an auth rule, sorted by version number descending (newest first).
-
#promote(auth_rule_token, request_options: {}) ⇒ Lithic::Models::AuthRules::AuthRule
Promotes the draft version of an Auth rule to the currently active version such that it is enforced in the respective stream.
-
#retrieve(auth_rule_token, request_options: {}) ⇒ Lithic::Models::AuthRules::AuthRule
Fetches a V2 Auth rule by its token.
-
#retrieve_features(auth_rule_token, account_token: nil, card_token: nil, request_options: {}) ⇒ Lithic::Models::AuthRules::V2RetrieveFeaturesResponse
Fetches the current calculated Feature values for the given Auth Rule.
-
#retrieve_report(auth_rule_token, begin_:, end_:, request_options: {}) ⇒ Lithic::Models::AuthRules::V2RetrieveReportResponse
Retrieves a performance report for an Auth rule containing daily statistics and evaluation outcomes.
-
#update(auth_rule_token, body:, request_options: {}) ⇒ Lithic::Models::AuthRules::AuthRule
Updates a V2 Auth rule’s properties.
Constructor Details
#initialize(client:) ⇒ V2
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of V2.
326 327 328 329 |
# File 'lib/lithic/resources/auth_rules/v2.rb', line 326 def initialize(client:) @client = client @backtests = Lithic::Resources::AuthRules::V2::Backtests.new(client: client) end |
Instance Attribute Details
#backtests ⇒ Lithic::Resources::AuthRules::V2::Backtests (readonly)
8 9 10 |
# File 'lib/lithic/resources/auth_rules/v2.rb', line 8 def backtests @backtests end |
Instance Method Details
#create(body:, request_options: {}) ⇒ Lithic::Models::AuthRules::AuthRule
Creates a new V2 Auth rule in draft mode
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/lithic/resources/auth_rules/v2.rb', line 20 def create(params) parsed, = Lithic::AuthRules::V2CreateParams.dump_request(params) @client.request( method: :post, path: "v2/auth_rules", body: parsed[:body], model: Lithic::AuthRules::AuthRule, options: ) end |
#delete(auth_rule_token, request_options: {}) ⇒ nil
Deletes a V2 Auth rule
129 130 131 132 133 134 135 136 |
# File 'lib/lithic/resources/auth_rules/v2.rb', line 129 def delete(auth_rule_token, params = {}) @client.request( method: :delete, path: ["v2/auth_rules/%1$s", auth_rule_token], model: NilClass, options: params[:request_options] ) end |
#draft(auth_rule_token, parameters: nil, request_options: {}) ⇒ Lithic::Models::AuthRules::AuthRule
Creates a new draft version of a rule that will be ran in shadow mode.
This can also be utilized to reset the draft parameters, causing a draft version to no longer be ran in shadow mode.
154 155 156 157 158 159 160 161 162 163 |
# File 'lib/lithic/resources/auth_rules/v2.rb', line 154 def draft(auth_rule_token, params = {}) parsed, = Lithic::AuthRules::V2DraftParams.dump_request(params) @client.request( method: :post, path: ["v2/auth_rules/%1$s/draft", auth_rule_token], body: parsed, model: Lithic::AuthRules::AuthRule, options: ) end |
#list(account_token: nil, business_account_token: nil, card_token: nil, ending_before: nil, event_stream: nil, event_streams: nil, page_size: nil, scope: nil, starting_after: nil, request_options: {}) ⇒ Lithic::Internal::CursorPage<Lithic::Models::AuthRules::AuthRule>
Some parameter documentations has been truncated, see Models::AuthRules::V2ListParams for more details.
Lists V2 Auth rules
106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/lithic/resources/auth_rules/v2.rb', line 106 def list(params = {}) parsed, = Lithic::AuthRules::V2ListParams.dump_request(params) query = Lithic::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "v2/auth_rules", query: query, page: Lithic::Internal::CursorPage, model: Lithic::AuthRules::AuthRule, options: ) end |
#list_results(auth_rule_token: nil, begin_: nil, end_: nil, ending_before: nil, event_token: nil, has_actions: nil, page_size: nil, starting_after: nil, request_options: {}) ⇒ Lithic::Internal::CursorPage<Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult, Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult, Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult, Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult>
Some parameter documentations has been truncated, see Models::AuthRules::V2ListResultsParams for more details.
Lists Auth Rule evaluation results.
Limitations:
-
Results are available for the past 3 months only
-
At least one filter (‘event_token` or `auth_rule_token`) must be provided
-
When filtering by ‘event_token`, pagination is not supported
199 200 201 202 203 204 205 206 207 208 209 210 |
# File 'lib/lithic/resources/auth_rules/v2.rb', line 199 def list_results(params = {}) parsed, = Lithic::AuthRules::V2ListResultsParams.dump_request(params) query = Lithic::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "v2/auth_rules/results", query: query.transform_keys(begin_: "begin", end_: "end"), page: Lithic::Internal::CursorPage, model: Lithic::Models::AuthRules::V2ListResultsResponse, options: ) end |
#list_versions(auth_rule_token, request_options: {}) ⇒ Lithic::Models::AuthRules::V2ListVersionsResponse
Returns all versions of an auth rule, sorted by version number descending (newest first).
223 224 225 226 227 228 229 230 |
# File 'lib/lithic/resources/auth_rules/v2.rb', line 223 def list_versions(auth_rule_token, params = {}) @client.request( method: :get, path: ["v2/auth_rules/%1$s/versions", auth_rule_token], model: Lithic::Models::AuthRules::V2ListVersionsResponse, options: params[:request_options] ) end |
#promote(auth_rule_token, request_options: {}) ⇒ Lithic::Models::AuthRules::AuthRule
Promotes the draft version of an Auth rule to the currently active version such that it is enforced in the respective stream.
243 244 245 246 247 248 249 250 |
# File 'lib/lithic/resources/auth_rules/v2.rb', line 243 def promote(auth_rule_token, params = {}) @client.request( method: :post, path: ["v2/auth_rules/%1$s/promote", auth_rule_token], model: Lithic::AuthRules::AuthRule, options: params[:request_options] ) end |
#retrieve(auth_rule_token, request_options: {}) ⇒ Lithic::Models::AuthRules::AuthRule
Fetches a V2 Auth rule by its token
41 42 43 44 45 46 47 48 |
# File 'lib/lithic/resources/auth_rules/v2.rb', line 41 def retrieve(auth_rule_token, params = {}) @client.request( method: :get, path: ["v2/auth_rules/%1$s", auth_rule_token], model: Lithic::AuthRules::AuthRule, options: params[:request_options] ) end |
#retrieve_features(auth_rule_token, account_token: nil, card_token: nil, request_options: {}) ⇒ Lithic::Models::AuthRules::V2RetrieveFeaturesResponse
Fetches the current calculated Feature values for the given Auth Rule
This only calculates the features for the active version.
-
VelocityLimit Rules calculates the current Velocity Feature data. This requires a ‘card_token` or `account_token` matching what the rule is Scoped to.
-
ConditionalBlock Rules calculates the CARD*TRANSACTION_COUNT** attributes on the rule. This requires a ‘card_token`
272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/lithic/resources/auth_rules/v2.rb', line 272 def retrieve_features(auth_rule_token, params = {}) parsed, = Lithic::AuthRules::V2RetrieveFeaturesParams.dump_request(params) query = Lithic::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["v2/auth_rules/%1$s/features", auth_rule_token], query: query, model: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse, options: ) end |
#retrieve_report(auth_rule_token, begin_:, end_:, request_options: {}) ⇒ Lithic::Models::AuthRules::V2RetrieveReportResponse
Retrieves a performance report for an Auth rule containing daily statistics and evaluation outcomes.
**Time Range Limitations:**
-
Reports are supported for the past 3 months only
-
Maximum interval length is 1 month
-
Report data is available only through the previous day in UTC (current day data is not available)
The report provides daily statistics for both current and draft versions of the Auth rule, including approval, decline, and challenge counts along with sample events.
311 312 313 314 315 316 317 318 319 320 321 |
# File 'lib/lithic/resources/auth_rules/v2.rb', line 311 def retrieve_report(auth_rule_token, params) parsed, = Lithic::AuthRules::V2RetrieveReportParams.dump_request(params) query = Lithic::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["v2/auth_rules/%1$s/report", auth_rule_token], query: query.transform_keys(begin_: "begin", end_: "end"), model: Lithic::Models::AuthRules::V2RetrieveReportResponse, options: ) end |
#update(auth_rule_token, body:, request_options: {}) ⇒ Lithic::Models::AuthRules::AuthRule
Updates a V2 Auth rule’s properties
If ‘account_tokens`, `card_tokens`, `program_level`, `excluded_card_tokens`, `excluded_account_tokens`, or `excluded_business_account_tokens` is provided, this will replace existing associations with the provided list of entities.
65 66 67 68 69 70 71 72 73 74 |
# File 'lib/lithic/resources/auth_rules/v2.rb', line 65 def update(auth_rule_token, params) parsed, = Lithic::AuthRules::V2UpdateParams.dump_request(params) @client.request( method: :patch, path: ["v2/auth_rules/%1$s", auth_rule_token], body: parsed[:body], model: Lithic::AuthRules::AuthRule, options: ) end |