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_BOOLEAN = 'BOOLEAN'.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
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 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 133 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.
49 50 51 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 49 def default_value @default_value end |
#description ⇒ String
Description of the parameter.
37 38 39 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 37 def description @description end |
#direction ⇒ String
Is this parameter an input parameter, output parameter, or both?
65 66 67 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 65 def direction @direction end |
#is_required ⇒ BOOLEAN
Is this parameter required. Ignored for parameters with direction = OUTPUT.
41 42 43 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 41 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.)
45 46 47 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 45 def is_sensitive @is_sensitive end |
#max_length ⇒ Integer
Used for character string types such as STRING to constrain the length of the value
57 58 59 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 57 def max_length @max_length end |
#min_length ⇒ Integer
Used for character string types such as STRING to constrain the length of the value
53 54 55 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 53 def min_length @min_length end |
#name ⇒ String
[Required] The name of the parameter
29 30 31 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 29 def name @name end |
#pattern ⇒ String
Regular expression used to validate the value of a string type such as STRING
61 62 63 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 61 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.).
73 74 75 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 73 def @resource_type_metadata end |
#type ⇒ String
[Required] Enumerated parameter type.
33 34 35 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 33 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
69 70 71 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 69 def ui_placement_hint @ui_placement_hint end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 76 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.
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 96 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.
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 225 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
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 266 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
246 247 248 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 246 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
255 256 257 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 255 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
299 300 301 302 303 304 305 306 307 308 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 299 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
293 294 295 |
# File 'lib/oci/oda/models/parameter_definition.rb', line 293 def to_s to_hash.to_s end |