Class: Aws::Endpoints::ErrorRule Private

Inherits:
Rule
  • Object
show all
Defined in:
lib/aws-sdk-core/endpoints/error_rule.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

This class is deprecated. It is used by the Runtime endpoint resolution approach. It has been replaced by a code generated approach in each service gem. It can be removed in a new major version. It has to exist because old service gems can use a new core version.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Rule

#resolve_value

Constructor Details

#initialize(type: 'error', conditions:, error: nil, documentation: nil) ⇒ ErrorRule

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 ErrorRule.



12
13
14
15
16
17
# File 'lib/aws-sdk-core/endpoints/error_rule.rb', line 12

def initialize(type: 'error', conditions:, error: nil, documentation: nil)
  @type = type
  @conditions = Condition.from_json(conditions)
  @error = error
  @documentation = documentation
end

Instance Attribute Details

#conditionsObject (readonly)

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.



20
21
22
# File 'lib/aws-sdk-core/endpoints/error_rule.rb', line 20

def conditions
  @conditions
end

#documentationObject (readonly)

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.



22
23
24
# File 'lib/aws-sdk-core/endpoints/error_rule.rb', line 22

def documentation
  @documentation
end

#errorObject (readonly)

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.



21
22
23
# File 'lib/aws-sdk-core/endpoints/error_rule.rb', line 21

def error
  @error
end

#typeObject (readonly)

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.



19
20
21
# File 'lib/aws-sdk-core/endpoints/error_rule.rb', line 19

def type
  @type
end

Instance Method Details

#match(parameters, assigned = {}) ⇒ Object

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.



24
25
26
27
28
29
30
31
32
# File 'lib/aws-sdk-core/endpoints/error_rule.rb', line 24

def match(parameters, assigned = {})
  assigns = assigned.dup
  matched = conditions.all? do |condition|
    output = condition.match?(parameters, assigns)
    assigns = assigns.merge(condition.assigned) if condition.assign
    output
  end
  resolved_error(parameters, assigns) if matched
end