Class: ConnectWise::GLCaption
- Inherits:
-
Object
- Object
- ConnectWise::GLCaption
- Defined in:
- lib/connect_wise/models/gl_caption.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#_info ⇒ Object
Returns the value of attribute _info.
-
#cogs1 ⇒ Object
Max length: 255;.
-
#cogs10 ⇒ Object
Max length: 255;.
-
#cogs2 ⇒ Object
Max length: 255;.
-
#cogs3 ⇒ Object
Max length: 255;.
-
#cogs4 ⇒ Object
Max length: 255;.
-
#cogs5 ⇒ Object
Max length: 255;.
-
#cogs6 ⇒ Object
Max length: 255;.
-
#cogs7 ⇒ Object
Max length: 255;.
-
#cogs8 ⇒ Object
Max length: 255;.
-
#cogs9 ⇒ Object
Max length: 255;.
-
#id ⇒ Object
Returns the value of attribute id.
-
#segment1 ⇒ Object
Max length: 255;.
-
#segment10 ⇒ Object
Max length: 255;.
-
#segment10type ⇒ Object
Returns the value of attribute segment10type.
-
#segment1type ⇒ Object
Returns the value of attribute segment1type.
-
#segment2 ⇒ Object
Max length: 255;.
-
#segment2type ⇒ Object
Returns the value of attribute segment2type.
-
#segment3 ⇒ Object
Max length: 255;.
-
#segment3type ⇒ Object
Returns the value of attribute segment3type.
-
#segment4 ⇒ Object
Max length: 255;.
-
#segment4type ⇒ Object
Returns the value of attribute segment4type.
-
#segment5 ⇒ Object
Max length: 255;.
-
#segment5type ⇒ Object
Returns the value of attribute segment5type.
-
#segment6 ⇒ Object
Max length: 255;.
-
#segment6type ⇒ Object
Returns the value of attribute segment6type.
-
#segment7 ⇒ Object
Max length: 255;.
-
#segment7type ⇒ Object
Returns the value of attribute segment7type.
-
#segment8 ⇒ Object
Max length: 255;.
-
#segment8type ⇒ Object
Returns the value of attribute segment8type.
-
#segment9 ⇒ Object
Max length: 255;.
-
#segment9type ⇒ Object
Returns the value of attribute segment9type.
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
-
#==(other) ⇒ 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?(other) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ GLCaption
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 = {}) ⇒ GLCaption
Initializes the object
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 |
# File 'lib/connect_wise/models/gl_caption.rb', line 198 def initialize(attributes = {}) raise ArgumentError, 'The input argument (attributes) must be a hash in `ConnectWise::GLCaption` initialize method' unless attributes.is_a?(Hash) # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) do |(k, v), h| raise ArgumentError, "`#{k}` is not a valid attribute in `ConnectWise::GLCaption`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect unless self.class.attribute_map.key?(k.to_sym) h[k.to_sym] = v end self.id = attributes[:id] if attributes.key?(:id) self.segment1 = attributes[:segment1] if attributes.key?(:segment1) self.segment2 = attributes[:segment2] if attributes.key?(:segment2) self.segment3 = attributes[:segment3] if attributes.key?(:segment3) self.segment4 = attributes[:segment4] if attributes.key?(:segment4) self.segment5 = attributes[:segment5] if attributes.key?(:segment5) self.segment6 = attributes[:segment6] if attributes.key?(:segment6) self.segment7 = attributes[:segment7] if attributes.key?(:segment7) self.segment8 = attributes[:segment8] if attributes.key?(:segment8) self.segment9 = attributes[:segment9] if attributes.key?(:segment9) self.segment10 = attributes[:segment10] if attributes.key?(:segment10) self.segment1type = attributes[:segment1type] if attributes.key?(:segment1type) self.segment2type = attributes[:segment2type] if attributes.key?(:segment2type) self.segment3type = attributes[:segment3type] if attributes.key?(:segment3type) self.segment4type = attributes[:segment4type] if attributes.key?(:segment4type) self.segment5type = attributes[:segment5type] if attributes.key?(:segment5type) self.segment6type = attributes[:segment6type] if attributes.key?(:segment6type) self.segment7type = attributes[:segment7type] if attributes.key?(:segment7type) self.segment8type = attributes[:segment8type] if attributes.key?(:segment8type) self.segment9type = attributes[:segment9type] if attributes.key?(:segment9type) self.segment10type = attributes[:segment10type] if attributes.key?(:segment10type) self.cogs1 = attributes[:cogs1] if attributes.key?(:cogs1) self.cogs2 = attributes[:cogs2] if attributes.key?(:cogs2) self.cogs3 = attributes[:cogs3] if attributes.key?(:cogs3) self.cogs4 = attributes[:cogs4] if attributes.key?(:cogs4) self.cogs5 = attributes[:cogs5] if attributes.key?(:cogs5) self.cogs6 = attributes[:cogs6] if attributes.key?(:cogs6) self.cogs7 = attributes[:cogs7] if attributes.key?(:cogs7) self.cogs8 = attributes[:cogs8] if attributes.key?(:cogs8) self.cogs9 = attributes[:cogs9] if attributes.key?(:cogs9) self.cogs10 = attributes[:cogs10] if attributes.key?(:cogs10) return unless attributes.key?(:_info) return unless (value = attributes[:_info]).is_a?(Hash) self._info = value end |
Instance Attribute Details
#_info ⇒ Object
Returns the value of attribute _info.
16 17 18 |
# File 'lib/connect_wise/models/gl_caption.rb', line 16 def _info @_info end |
#cogs1 ⇒ Object
Max length: 255;
49 50 51 |
# File 'lib/connect_wise/models/gl_caption.rb', line 49 def cogs1 @cogs1 end |
#cogs10 ⇒ Object
Max length: 255;
76 77 78 |
# File 'lib/connect_wise/models/gl_caption.rb', line 76 def cogs10 @cogs10 end |
#cogs2 ⇒ Object
Max length: 255;
52 53 54 |
# File 'lib/connect_wise/models/gl_caption.rb', line 52 def cogs2 @cogs2 end |
#cogs3 ⇒ Object
Max length: 255;
55 56 57 |
# File 'lib/connect_wise/models/gl_caption.rb', line 55 def cogs3 @cogs3 end |
#cogs4 ⇒ Object
Max length: 255;
58 59 60 |
# File 'lib/connect_wise/models/gl_caption.rb', line 58 def cogs4 @cogs4 end |
#cogs5 ⇒ Object
Max length: 255;
61 62 63 |
# File 'lib/connect_wise/models/gl_caption.rb', line 61 def cogs5 @cogs5 end |
#cogs6 ⇒ Object
Max length: 255;
64 65 66 |
# File 'lib/connect_wise/models/gl_caption.rb', line 64 def cogs6 @cogs6 end |
#cogs7 ⇒ Object
Max length: 255;
67 68 69 |
# File 'lib/connect_wise/models/gl_caption.rb', line 67 def cogs7 @cogs7 end |
#cogs8 ⇒ Object
Max length: 255;
70 71 72 |
# File 'lib/connect_wise/models/gl_caption.rb', line 70 def cogs8 @cogs8 end |
#cogs9 ⇒ Object
Max length: 255;
73 74 75 |
# File 'lib/connect_wise/models/gl_caption.rb', line 73 def cogs9 @cogs9 end |
#id ⇒ Object
Returns the value of attribute id.
16 17 18 |
# File 'lib/connect_wise/models/gl_caption.rb', line 16 def id @id end |
#segment1 ⇒ Object
Max length: 255;
19 20 21 |
# File 'lib/connect_wise/models/gl_caption.rb', line 19 def segment1 @segment1 end |
#segment10 ⇒ Object
Max length: 255;
46 47 48 |
# File 'lib/connect_wise/models/gl_caption.rb', line 46 def segment10 @segment10 end |
#segment10type ⇒ Object
Returns the value of attribute segment10type.
16 17 18 |
# File 'lib/connect_wise/models/gl_caption.rb', line 16 def segment10type @segment10type end |
#segment1type ⇒ Object
Returns the value of attribute segment1type.
16 17 18 |
# File 'lib/connect_wise/models/gl_caption.rb', line 16 def segment1type @segment1type end |
#segment2 ⇒ Object
Max length: 255;
22 23 24 |
# File 'lib/connect_wise/models/gl_caption.rb', line 22 def segment2 @segment2 end |
#segment2type ⇒ Object
Returns the value of attribute segment2type.
16 17 18 |
# File 'lib/connect_wise/models/gl_caption.rb', line 16 def segment2type @segment2type end |
#segment3 ⇒ Object
Max length: 255;
25 26 27 |
# File 'lib/connect_wise/models/gl_caption.rb', line 25 def segment3 @segment3 end |
#segment3type ⇒ Object
Returns the value of attribute segment3type.
16 17 18 |
# File 'lib/connect_wise/models/gl_caption.rb', line 16 def segment3type @segment3type end |
#segment4 ⇒ Object
Max length: 255;
28 29 30 |
# File 'lib/connect_wise/models/gl_caption.rb', line 28 def segment4 @segment4 end |
#segment4type ⇒ Object
Returns the value of attribute segment4type.
16 17 18 |
# File 'lib/connect_wise/models/gl_caption.rb', line 16 def segment4type @segment4type end |
#segment5 ⇒ Object
Max length: 255;
31 32 33 |
# File 'lib/connect_wise/models/gl_caption.rb', line 31 def segment5 @segment5 end |
#segment5type ⇒ Object
Returns the value of attribute segment5type.
16 17 18 |
# File 'lib/connect_wise/models/gl_caption.rb', line 16 def segment5type @segment5type end |
#segment6 ⇒ Object
Max length: 255;
34 35 36 |
# File 'lib/connect_wise/models/gl_caption.rb', line 34 def segment6 @segment6 end |
#segment6type ⇒ Object
Returns the value of attribute segment6type.
16 17 18 |
# File 'lib/connect_wise/models/gl_caption.rb', line 16 def segment6type @segment6type end |
#segment7 ⇒ Object
Max length: 255;
37 38 39 |
# File 'lib/connect_wise/models/gl_caption.rb', line 37 def segment7 @segment7 end |
#segment7type ⇒ Object
Returns the value of attribute segment7type.
16 17 18 |
# File 'lib/connect_wise/models/gl_caption.rb', line 16 def segment7type @segment7type end |
#segment8 ⇒ Object
Max length: 255;
40 41 42 |
# File 'lib/connect_wise/models/gl_caption.rb', line 40 def segment8 @segment8 end |
#segment8type ⇒ Object
Returns the value of attribute segment8type.
16 17 18 |
# File 'lib/connect_wise/models/gl_caption.rb', line 16 def segment8type @segment8type end |
#segment9 ⇒ Object
Max length: 255;
43 44 45 |
# File 'lib/connect_wise/models/gl_caption.rb', line 43 def segment9 @segment9 end |
#segment9type ⇒ Object
Returns the value of attribute segment9type.
16 17 18 |
# File 'lib/connect_wise/models/gl_caption.rb', line 16 def segment9type @segment9type end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
138 139 140 |
# File 'lib/connect_wise/models/gl_caption.rb', line 138 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
100 101 102 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 |
# File 'lib/connect_wise/models/gl_caption.rb', line 100 def self.attribute_map { id: :id, segment1: :segment1, segment2: :segment2, segment3: :segment3, segment4: :segment4, segment5: :segment5, segment6: :segment6, segment7: :segment7, segment8: :segment8, segment9: :segment9, segment10: :segment10, segment1type: :segment1type, segment2type: :segment2type, segment3type: :segment3type, segment4type: :segment4type, segment5type: :segment5type, segment6type: :segment6type, segment7type: :segment7type, segment8type: :segment8type, segment9type: :segment9type, segment10type: :segment10type, cogs1: :cogs1, cogs2: :cogs2, cogs3: :cogs3, cogs4: :cogs4, cogs5: :cogs5, cogs6: :cogs6, cogs7: :cogs7, cogs8: :cogs8, cogs9: :cogs9, cogs10: :cogs10, _info: :_info } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
463 464 465 |
# File 'lib/connect_wise/models/gl_caption.rb', line 463 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/connect_wise/models/gl_caption.rb', line 181 def self.openapi_nullable Set.new(i[ segment1type segment2type segment3type segment4type segment5type segment6type segment7type segment8type segment9type segment10type ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/connect_wise/models/gl_caption.rb', line 143 def self.openapi_types { id: :Integer, segment1: :String, segment2: :String, segment3: :String, segment4: :String, segment5: :String, segment6: :String, segment7: :String, segment8: :String, segment9: :String, segment10: :String, segment1type: :String, segment2type: :String, segment3type: :String, segment4type: :String, segment5type: :String, segment6type: :String, segment7type: :String, segment8type: :String, segment9type: :String, segment10type: :String, cogs1: :String, cogs2: :String, cogs3: :String, cogs4: :String, cogs5: :String, cogs6: :String, cogs7: :String, cogs8: :String, cogs9: :String, cogs10: :String, _info: :'Hash<String, String>' } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 |
# File 'lib/connect_wise/models/gl_caption.rb', line 410 def ==(other) return true if equal?(other) self.class == other.class && id == other.id && segment1 == other.segment1 && segment2 == other.segment2 && segment3 == other.segment3 && segment4 == other.segment4 && segment5 == other.segment5 && segment6 == other.segment6 && segment7 == other.segment7 && segment8 == other.segment8 && segment9 == other.segment9 && segment10 == other.segment10 && segment1type == other.segment1type && segment2type == other.segment2type && segment3type == other.segment3type && segment4type == other.segment4type && segment5type == other.segment5type && segment6type == other.segment6type && segment7type == other.segment7type && segment8type == other.segment8type && segment9type == other.segment9type && segment10type == other.segment10type && cogs1 == other.cogs1 && cogs2 == other.cogs2 && cogs3 == other.cogs3 && cogs4 == other.cogs4 && cogs5 == other.cogs5 && cogs6 == other.cogs6 && cogs7 == other.cogs7 && cogs8 == other.cogs8 && cogs9 == other.cogs9 && cogs10 == other.cogs10 && _info == other._info end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 |
# File 'lib/connect_wise/models/gl_caption.rb', line 493 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 = ConnectWise.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
564 565 566 567 568 569 570 571 572 573 574 575 576 |
# File 'lib/connect_wise/models/gl_caption.rb', line 564 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
470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 |
# File 'lib/connect_wise/models/gl_caption.rb', line 470 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) 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 send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }) if attributes[self.class.attribute_map[key]].is_a?(Array) elsif !attributes[self.class.attribute_map[key]].nil? send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end end self end |
#eql?(other) ⇒ Boolean
450 451 452 |
# File 'lib/connect_wise/models/gl_caption.rb', line 450 def eql?(other) self == other end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
456 457 458 |
# File 'lib/connect_wise/models/gl_caption.rb', line 456 def hash [id, segment1, segment2, segment3, segment4, segment5, segment6, segment7, segment8, segment9, segment10, segment1type, segment2type, segment3type, segment4type, segment5type, segment6type, segment7type, segment8type, segment9type, segment10type, cogs1, cogs2, cogs3, cogs4, cogs5, cogs6, cogs7, cogs8, cogs9, cogs10, _info].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
278 279 280 |
# File 'lib/connect_wise/models/gl_caption.rb', line 278 def list_invalid_properties [] end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
540 541 542 |
# File 'lib/connect_wise/models/gl_caption.rb', line 540 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
546 547 548 549 550 551 552 553 554 555 556 557 558 |
# File 'lib/connect_wise/models/gl_caption.rb', line 546 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = 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
534 535 536 |
# File 'lib/connect_wise/models/gl_caption.rb', line 534 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
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 |
# File 'lib/connect_wise/models/gl_caption.rb', line 284 def valid? segment1type_validator = EnumAttributeValidator.new('String', %w[Account Class]) return false unless segment1type_validator.valid?(@segment1type) segment2type_validator = EnumAttributeValidator.new('String', %w[Account Class]) return false unless segment2type_validator.valid?(@segment2type) segment3type_validator = EnumAttributeValidator.new('String', %w[Account Class]) return false unless segment3type_validator.valid?(@segment3type) segment4type_validator = EnumAttributeValidator.new('String', %w[Account Class]) return false unless segment4type_validator.valid?(@segment4type) segment5type_validator = EnumAttributeValidator.new('String', %w[Account Class]) return false unless segment5type_validator.valid?(@segment5type) segment6type_validator = EnumAttributeValidator.new('String', %w[Account Class]) return false unless segment6type_validator.valid?(@segment6type) segment7type_validator = EnumAttributeValidator.new('String', %w[Account Class]) return false unless segment7type_validator.valid?(@segment7type) segment8type_validator = EnumAttributeValidator.new('String', %w[Account Class]) return false unless segment8type_validator.valid?(@segment8type) segment9type_validator = EnumAttributeValidator.new('String', %w[Account Class]) return false unless segment9type_validator.valid?(@segment9type) segment10type_validator = EnumAttributeValidator.new('String', %w[Account Class]) return false unless segment10type_validator.valid?(@segment10type) true end |