Class: Aws::ParamValidator Private
- Inherits:
-
Object
- Object
- Aws::ParamValidator
- Includes:
- Seahorse::Model::Shapes
- Defined in:
- lib/aws-sdk-core/param_validator.rb
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.
Constant Summary collapse
- EXPECTED_GOT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'expected %s to be %s, got class %s instead.'
Class Method Summary collapse
- .validate!(rules, params) ⇒ void private
Instance Method Summary collapse
-
#initialize(rules, options = {}) ⇒ ParamValidator
constructor
private
A new instance of ParamValidator.
- #validate!(params) ⇒ void private
Constructor Details
#initialize(rules, options = {}) ⇒ ParamValidator
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 ParamValidator.
20 21 22 23 24 25 26 27 28 |
# File 'lib/aws-sdk-core/param_validator.rb', line 20 def initialize(rules, = {}) @rules = rules || begin shape = StructureShape.new shape.struct_class = EmptyStructure ShapeRef.new(shape: shape) end @validate_required = [:validate_required] != false @input = [:input].nil? ? true : !![:input] end |
Class Method Details
.validate!(rules, params) ⇒ void
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.
This method returns an undefined value.
14 15 16 |
# File 'lib/aws-sdk-core/param_validator.rb', line 14 def self.validate!(rules, params) new(rules).validate!(params) end |
Instance Method Details
#validate!(params) ⇒ void
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.
This method returns an undefined value.
32 33 34 35 36 |
# File 'lib/aws-sdk-core/param_validator.rb', line 32 def validate!(params) errors = [] structure(@rules, params, errors, 'params') if @rules raise ArgumentError, (errors) unless errors.empty? end |