Class: Falcon::TypesInterface
- Inherits:
-
Object
- Object
- Falcon::TypesInterface
- Defined in:
- lib/crimson-falcon/models/types_interface.rb
Instance Attribute Summary collapse
-
#accessing_methods ⇒ Object
Returns the value of attribute accessing_methods.
-
#bean_class_name ⇒ Object
Returns the value of attribute bean_class_name.
-
#bean_name ⇒ Object
Returns the value of attribute bean_name.
-
#broker_host ⇒ Object
Returns the value of attribute broker_host.
-
#broker_port ⇒ Object
Returns the value of attribute broker_port.
-
#catalog ⇒ Object
Returns the value of attribute catalog.
-
#columns ⇒ Object
Returns the value of attribute columns.
-
#consumes ⇒ Object
Returns the value of attribute consumes.
-
#database ⇒ Object
Returns the value of attribute database.
-
#direction ⇒ Object
Returns the value of attribute direction.
-
#driver ⇒ Object
Returns the value of attribute driver.
-
#durable_subscription ⇒ Object
Returns the value of attribute durable_subscription.
-
#ejb_version ⇒ Object
Returns the value of attribute ejb_version.
-
#framework ⇒ Object
Returns the value of attribute framework.
-
#has_password ⇒ Object
Returns the value of attribute has_password.
-
#id ⇒ Object
Returns the value of attribute id.
-
#interface_name ⇒ Object
Returns the value of attribute interface_name.
-
#method ⇒ Object
Returns the value of attribute method.
-
#path ⇒ Object
Returns the value of attribute path.
-
#port ⇒ Object
Returns the value of attribute port.
-
#port_type ⇒ Object
Returns the value of attribute port_type.
-
#produces ⇒ Object
Returns the value of attribute produces.
-
#properties ⇒ Object
Returns the value of attribute properties.
-
#provider ⇒ Object
Returns the value of attribute provider.
-
#pu_name ⇒ Object
Returns the value of attribute pu_name.
-
#schema ⇒ Object
Returns the value of attribute schema.
-
#services ⇒ Object
Returns the value of attribute services.
-
#session_type ⇒ Object
Returns the value of attribute session_type.
-
#table ⇒ Object
Returns the value of attribute table.
-
#technology ⇒ Object
Returns the value of attribute technology.
-
#topic ⇒ Object
Returns the value of attribute topic.
-
#topic_type ⇒ Object
Returns the value of attribute topic_type.
-
#type ⇒ Object
Returns the value of attribute type.
-
#username ⇒ Object
Returns the value of attribute username.
Class Method Summary collapse
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ TypesInterface
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ TypesInterface
Initializes the object
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 195 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Falcon::TypesInterface` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Falcon::TypesInterface`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'properties') if (value = attributes[:'properties']).is_a?(Hash) self.properties = value end end if attributes.key?(:'accessing_methods') if (value = attributes[:'accessing_methods']).is_a?(Array) self.accessing_methods = value end end if attributes.key?(:'bean_class_name') self.bean_class_name = attributes[:'bean_class_name'] end if attributes.key?(:'bean_name') self.bean_name = attributes[:'bean_name'] end if attributes.key?(:'broker_host') self.broker_host = attributes[:'broker_host'] end if attributes.key?(:'broker_port') self.broker_port = attributes[:'broker_port'] end if attributes.key?(:'catalog') self.catalog = attributes[:'catalog'] end if attributes.key?(:'columns') if (value = attributes[:'columns']).is_a?(Array) self.columns = value end end if attributes.key?(:'consumes') if (value = attributes[:'consumes']).is_a?(Array) self.consumes = value end end if attributes.key?(:'database') self.database = attributes[:'database'] end if attributes.key?(:'direction') self.direction = attributes[:'direction'] end if attributes.key?(:'driver') self.driver = attributes[:'driver'] end if attributes.key?(:'durable_subscription') self.durable_subscription = attributes[:'durable_subscription'] end if attributes.key?(:'ejb_version') self.ejb_version = attributes[:'ejb_version'] end if attributes.key?(:'framework') self.framework = attributes[:'framework'] end if attributes.key?(:'has_password') self.has_password = attributes[:'has_password'] end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'interface_name') self.interface_name = attributes[:'interface_name'] end if attributes.key?(:'method') self.method = attributes[:'method'] end if attributes.key?(:'path') self.path = attributes[:'path'] end if attributes.key?(:'port') self.port = attributes[:'port'] end if attributes.key?(:'port_type') self.port_type = attributes[:'port_type'] end if attributes.key?(:'produces') if (value = attributes[:'produces']).is_a?(Array) self.produces = value end end if attributes.key?(:'provider') self.provider = attributes[:'provider'] end if attributes.key?(:'pu_name') self.pu_name = attributes[:'pu_name'] end if attributes.key?(:'schema') self.schema = attributes[:'schema'] end if attributes.key?(:'services') if (value = attributes[:'services']).is_a?(Array) self.services = value end end if attributes.key?(:'session_type') self.session_type = attributes[:'session_type'] end if attributes.key?(:'table') self.table = attributes[:'table'] end if attributes.key?(:'technology') self.technology = attributes[:'technology'] end if attributes.key?(:'topic') self.topic = attributes[:'topic'] end if attributes.key?(:'topic_type') self.topic_type = attributes[:'topic_type'] end if attributes.key?(:'type') self.type = attributes[:'type'] end if attributes.key?(:'username') self.username = attributes[:'username'] end end |
Instance Attribute Details
#accessing_methods ⇒ Object
Returns the value of attribute accessing_methods.
36 37 38 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 36 def accessing_methods @accessing_methods end |
#bean_class_name ⇒ Object
Returns the value of attribute bean_class_name.
38 39 40 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 38 def bean_class_name @bean_class_name end |
#bean_name ⇒ Object
Returns the value of attribute bean_name.
40 41 42 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 40 def bean_name @bean_name end |
#broker_host ⇒ Object
Returns the value of attribute broker_host.
42 43 44 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 42 def broker_host @broker_host end |
#broker_port ⇒ Object
Returns the value of attribute broker_port.
44 45 46 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 44 def broker_port @broker_port end |
#catalog ⇒ Object
Returns the value of attribute catalog.
46 47 48 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 46 def catalog @catalog end |
#columns ⇒ Object
Returns the value of attribute columns.
48 49 50 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 48 def columns @columns end |
#consumes ⇒ Object
Returns the value of attribute consumes.
50 51 52 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 50 def consumes @consumes end |
#database ⇒ Object
Returns the value of attribute database.
52 53 54 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 52 def database @database end |
#direction ⇒ Object
Returns the value of attribute direction.
54 55 56 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 54 def direction @direction end |
#driver ⇒ Object
Returns the value of attribute driver.
56 57 58 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 56 def driver @driver end |
#durable_subscription ⇒ Object
Returns the value of attribute durable_subscription.
58 59 60 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 58 def durable_subscription @durable_subscription end |
#ejb_version ⇒ Object
Returns the value of attribute ejb_version.
60 61 62 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 60 def ejb_version @ejb_version end |
#framework ⇒ Object
Returns the value of attribute framework.
62 63 64 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 62 def framework @framework end |
#has_password ⇒ Object
Returns the value of attribute has_password.
64 65 66 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 64 def has_password @has_password end |
#id ⇒ Object
Returns the value of attribute id.
66 67 68 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 66 def id @id end |
#interface_name ⇒ Object
Returns the value of attribute interface_name.
68 69 70 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 68 def interface_name @interface_name end |
#method ⇒ Object
Returns the value of attribute method.
70 71 72 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 70 def method @method end |
#path ⇒ Object
Returns the value of attribute path.
72 73 74 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 72 def path @path end |
#port ⇒ Object
Returns the value of attribute port.
74 75 76 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 74 def port @port end |
#port_type ⇒ Object
Returns the value of attribute port_type.
76 77 78 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 76 def port_type @port_type end |
#produces ⇒ Object
Returns the value of attribute produces.
78 79 80 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 78 def produces @produces end |
#properties ⇒ Object
Returns the value of attribute properties.
34 35 36 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 34 def properties @properties end |
#provider ⇒ Object
Returns the value of attribute provider.
80 81 82 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 80 def provider @provider end |
#pu_name ⇒ Object
Returns the value of attribute pu_name.
82 83 84 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 82 def pu_name @pu_name end |
#schema ⇒ Object
Returns the value of attribute schema.
84 85 86 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 84 def schema @schema end |
#services ⇒ Object
Returns the value of attribute services.
86 87 88 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 86 def services @services end |
#session_type ⇒ Object
Returns the value of attribute session_type.
88 89 90 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 88 def session_type @session_type end |
#table ⇒ Object
Returns the value of attribute table.
90 91 92 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 90 def table @table end |
#technology ⇒ Object
Returns the value of attribute technology.
92 93 94 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 92 def technology @technology end |
#topic ⇒ Object
Returns the value of attribute topic.
94 95 96 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 94 def topic @topic end |
#topic_type ⇒ Object
Returns the value of attribute topic_type.
96 97 98 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 96 def topic_type @topic_type end |
#type ⇒ Object
Returns the value of attribute type.
98 99 100 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 98 def type @type end |
#username ⇒ Object
Returns the value of attribute username.
100 101 102 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 100 def username @username end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
143 144 145 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 143 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 103 def self.attribute_map { :'properties' => :'Properties', :'accessing_methods' => :'accessingMethods', :'bean_class_name' => :'beanClassName', :'bean_name' => :'beanName', :'broker_host' => :'brokerHost', :'broker_port' => :'brokerPort', :'catalog' => :'catalog', :'columns' => :'columns', :'consumes' => :'consumes', :'database' => :'database', :'direction' => :'direction', :'driver' => :'driver', :'durable_subscription' => :'durableSubscription', :'ejb_version' => :'ejbVersion', :'framework' => :'framework', :'has_password' => :'hasPassword', :'id' => :'id', :'interface_name' => :'interfaceName', :'method' => :'method', :'path' => :'path', :'port' => :'port', :'port_type' => :'portType', :'produces' => :'produces', :'provider' => :'provider', :'pu_name' => :'puName', :'schema' => :'schema', :'services' => :'services', :'session_type' => :'sessionType', :'table' => :'table', :'technology' => :'technology', :'topic' => :'topic', :'topic_type' => :'topicType', :'type' => :'type', :'username' => :'username' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
431 432 433 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 431 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
188 189 190 191 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 188 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 148 def self.openapi_types { :'properties' => :'Hash<String, String>', :'accessing_methods' => :'Array<String>', :'bean_class_name' => :'String', :'bean_name' => :'String', :'broker_host' => :'String', :'broker_port' => :'Integer', :'catalog' => :'String', :'columns' => :'Array<String>', :'consumes' => :'Array<String>', :'database' => :'String', :'direction' => :'String', :'driver' => :'String', :'durable_subscription' => :'String', :'ejb_version' => :'String', :'framework' => :'String', :'has_password' => :'Boolean', :'id' => :'Integer', :'interface_name' => :'String', :'method' => :'String', :'path' => :'String', :'port' => :'Integer', :'port_type' => :'String', :'produces' => :'Array<String>', :'provider' => :'String', :'pu_name' => :'String', :'schema' => :'String', :'services' => :'Array<TypesInterfaceService>', :'session_type' => :'String', :'table' => :'String', :'technology' => :'String', :'topic' => :'String', :'topic_type' => :'String', :'type' => :'String', :'username' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 377 def ==(o) return true if self.equal?(o) self.class == o.class && properties == o.properties && accessing_methods == o.accessing_methods && bean_class_name == o.bean_class_name && bean_name == o.bean_name && broker_host == o.broker_host && broker_port == o.broker_port && catalog == o.catalog && columns == o.columns && consumes == o.consumes && database == o.database && direction == o.direction && driver == o.driver && durable_subscription == o.durable_subscription && ejb_version == o.ejb_version && framework == o.framework && has_password == o.has_password && id == o.id && interface_name == o.interface_name && method == o.method && path == o.path && port == o.port && port_type == o.port_type && produces == o.produces && provider == o.provider && pu_name == o.pu_name && schema == o.schema && services == o.services && session_type == o.session_type && table == o.table && technology == o.technology && topic == o.topic && topic_type == o.topic_type && type == o.type && username == o.username end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 462 def _deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = Falcon.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
533 534 535 536 537 538 539 540 541 542 543 544 545 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 533 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 438 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end end self end |
#eql?(o) ⇒ Boolean
418 419 420 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 418 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
424 425 426 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 424 def hash [properties, accessing_methods, bean_class_name, bean_name, broker_host, broker_port, catalog, columns, consumes, database, direction, driver, durable_subscription, ejb_version, framework, has_password, id, interface_name, method, path, port, port_type, produces, provider, pu_name, schema, services, session_type, table, technology, topic, topic_type, type, username].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
359 360 361 362 363 364 365 366 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 359 def list_invalid_properties invalid_properties = Array.new if @properties.nil? invalid_properties.push('invalid value for "properties", properties cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
509 510 511 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 509 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
515 516 517 518 519 520 521 522 523 524 525 526 527 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 515 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
503 504 505 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 503 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
370 371 372 373 |
# File 'lib/crimson-falcon/models/types_interface.rb', line 370 def valid? return false if @properties.nil? true end |