Class: OCI::Oda::Models::ParameterDefinition
- Inherits:
-
Object
- Object
- OCI::Oda::Models::ParameterDefinition
- Defined in:
- lib/oci/oda/models/parameter_definition.rb
Overview
A parameter to a resource.
Constant Summary collapse
- TYPE_ENUM =
[ TYPE_STRING = 'STRING'.freeze, TYPE_URI = 'URI'.freeze, TYPE_URL = 'URL'.freeze, TYPE_NUMBER = 'NUMBER'.freeze, TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- DIRECTION_ENUM =
[ DIRECTION_INPUT = 'INPUT'.freeze, DIRECTION_OUTPUT = 'OUTPUT'.freeze, DIRECTION_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#default_value ⇒ String
Default value for the parameter.
-
#description ⇒ String
Description of the parameter.
-
#direction ⇒ String
Is this parameter an input parameter, output parameter, or both?.
-
#is_required ⇒ BOOLEAN
Is this parameter required.
-
#is_sensitive ⇒ BOOLEAN
Is the data for this parameter sensitive (e.g. should the data be hidden in UI, encrypted if stored, etc.).
-
#max_length ⇒ Integer
Used for character string types such as STRING to constrain the length of the value.
-
#min_length ⇒ Integer
Used for character string types such as STRING to constrain the length of the value.
-
#name ⇒ String
**[Required]** The name of the parameter.
-
#pattern ⇒ String
Regular expression used to validate the value of a string type such as STRING.
-
#resource_type_metadata ⇒ Object
Any configuration needed to help the resource type process this parameter (e.g. link to manifest, etc.).
-
#type ⇒ String
**[Required]** Enumerated parameter type.
-
#ui_placement_hint ⇒ String
A forward-slash-delimited 'path' in an imaginary hierarchy, at which this parameter's UI widgets should be placed.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ ParameterDefinition
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ ParameterDefinition
Initializes the object
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 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 131 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.name = attributes[:'name'] if attributes[:'name'] self.type = attributes[:'type'] if attributes[:'type'] self.description = attributes[:'description'] if attributes[:'description'] self.is_required = attributes[:'isRequired'] unless attributes[:'isRequired'].nil? raise 'You cannot provide both :isRequired and :is_required' if attributes.key?(:'isRequired') && attributes.key?(:'is_required') self.is_required = attributes[:'is_required'] unless attributes[:'is_required'].nil? self.is_sensitive = attributes[:'isSensitive'] unless attributes[:'isSensitive'].nil? raise 'You cannot provide both :isSensitive and :is_sensitive' if attributes.key?(:'isSensitive') && attributes.key?(:'is_sensitive') self.is_sensitive = attributes[:'is_sensitive'] unless attributes[:'is_sensitive'].nil? self.default_value = attributes[:'defaultValue'] if attributes[:'defaultValue'] raise 'You cannot provide both :defaultValue and :default_value' if attributes.key?(:'defaultValue') && attributes.key?(:'default_value') self.default_value = attributes[:'default_value'] if attributes[:'default_value'] self.min_length = attributes[:'minLength'] if attributes[:'minLength'] raise 'You cannot provide both :minLength and :min_length' if attributes.key?(:'minLength') && attributes.key?(:'min_length') self.min_length = attributes[:'min_length'] if attributes[:'min_length'] self.max_length = attributes[:'maxLength'] if attributes[:'maxLength'] raise 'You cannot provide both :maxLength and :max_length' if attributes.key?(:'maxLength') && attributes.key?(:'max_length') self.max_length = attributes[:'max_length'] if attributes[:'max_length'] self.pattern = attributes[:'pattern'] if attributes[:'pattern'] self.direction = attributes[:'direction'] if attributes[:'direction'] self.ui_placement_hint = attributes[:'uiPlacementHint'] if attributes[:'uiPlacementHint'] raise 'You cannot provide both :uiPlacementHint and :ui_placement_hint' if attributes.key?(:'uiPlacementHint') && attributes.key?(:'ui_placement_hint') self.ui_placement_hint = attributes[:'ui_placement_hint'] if attributes[:'ui_placement_hint'] self. = attributes[:'resourceTypeMetadata'] if attributes[:'resourceTypeMetadata'] raise 'You cannot provide both :resourceTypeMetadata and :resource_type_metadata' if attributes.key?(:'resourceTypeMetadata') && attributes.key?(:'resource_type_metadata') self. = attributes[:'resource_type_metadata'] if attributes[:'resource_type_metadata'] end |
Instance Attribute Details
#default_value ⇒ String
Default value for the parameter.
47 48 49 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 47 def default_value @default_value end |
#description ⇒ String
Description of the parameter.
35 36 37 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 35 def description @description end |
#direction ⇒ String
Is this parameter an input parameter, output parameter, or both?
63 64 65 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 63 def direction @direction end |
#is_required ⇒ BOOLEAN
Is this parameter required. Ignored for parameters with direction = OUTPUT.
39 40 41 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 39 def is_required @is_required end |
#is_sensitive ⇒ BOOLEAN
Is the data for this parameter sensitive (e.g. should the data be hidden in UI, encrypted if stored, etc.)
43 44 45 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 43 def is_sensitive @is_sensitive end |
#max_length ⇒ Integer
Used for character string types such as STRING to constrain the length of the value
55 56 57 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 55 def max_length @max_length end |
#min_length ⇒ Integer
Used for character string types such as STRING to constrain the length of the value
51 52 53 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 51 def min_length @min_length end |
#name ⇒ String
**[Required]** The name of the parameter
27 28 29 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 27 def name @name end |
#pattern ⇒ String
Regular expression used to validate the value of a string type such as STRING
59 60 61 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 59 def pattern @pattern end |
#resource_type_metadata ⇒ Object
Any configuration needed to help the resource type process this parameter (e.g. link to manifest, etc.).
71 72 73 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 71 def @resource_type_metadata end |
#type ⇒ String
**[Required]** Enumerated parameter type.
31 32 33 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 31 def type @type end |
#ui_placement_hint ⇒ String
A forward-slash-delimited 'path' in an imaginary hierarchy, at which this parameter's UI widgets should be placed
67 68 69 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 67 def ui_placement_hint @ui_placement_hint end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 74 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'name': :'name', 'type': :'type', 'description': :'description', 'is_required': :'isRequired', 'is_sensitive': :'isSensitive', 'default_value': :'defaultValue', 'min_length': :'minLength', 'max_length': :'maxLength', 'pattern': :'pattern', 'direction': :'direction', 'ui_placement_hint': :'uiPlacementHint', 'resource_type_metadata': :'resourceTypeMetadata' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 94 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'name': :'String', 'type': :'String', 'description': :'String', 'is_required': :'BOOLEAN', 'is_sensitive': :'BOOLEAN', 'default_value': :'String', 'min_length': :'Integer', 'max_length': :'Integer', 'pattern': :'String', 'direction': :'String', 'ui_placement_hint': :'String', 'resource_type_metadata': :'Object' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 223 def ==(other) return true if equal?(other) self.class == other.class && name == other.name && type == other.type && description == other.description && is_required == other.is_required && is_sensitive == other.is_sensitive && default_value == other.default_value && min_length == other.min_length && max_length == other.max_length && pattern == other.pattern && direction == other.direction && ui_placement_hint == other.ui_placement_hint && == other. end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 264 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
244 245 246 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 244 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
253 254 255 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 253 def hash [name, type, description, is_required, is_sensitive, default_value, min_length, max_length, pattern, direction, ui_placement_hint, ].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
297 298 299 300 301 302 303 304 305 306 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 297 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
291 292 293 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 291 def to_s to_hash.to_s end |