Class: CityPayApiClient::AirlineAdvice
- Inherits:
-
Object
- Object
- CityPayApiClient::AirlineAdvice
- Defined in:
- lib/citypay_api_client/models/airline_advice.rb
Instance Attribute Summary collapse
-
#carrier_name ⇒ Object
The name of the airline carrier that generated the tickets for airline travel.
-
#conjunction_ticket_indicator ⇒ Object
true if a conjunction ticket (with additional coupons) was issued for an itinerary with more than four segments.
-
#eticket_indicator ⇒ Object
The Electronic Ticket Indicator, a code that indicates if an electronic ticket was issued.
-
#no_air_segments ⇒ Object
A value that indicates the number of air travel segments included on this ticket.
-
#number_in_party ⇒ Object
The number of people in the party.
-
#original_ticket_no ⇒ Object
Required if transaction type is EXC.
-
#passenger_name ⇒ Object
The name of the passenger when the traveller is not the card member that purchased the ticket.
-
#segment1 ⇒ Object
Returns the value of attribute segment1.
-
#segment2 ⇒ Object
Returns the value of attribute segment2.
-
#segment3 ⇒ Object
Returns the value of attribute segment3.
-
#segment4 ⇒ Object
Returns the value of attribute segment4.
-
#ticket_issue_city ⇒ Object
The name of the city town or village where the transaction took place.
-
#ticket_issue_date ⇒ Object
The date the ticket was issued in ISO Date format (yyyy-MM-dd).
-
#ticket_issue_name ⇒ Object
The name of the agency generating the ticket.
-
#ticket_no ⇒ Object
This must be a valid ticket number, i.e.
-
#transaction_type ⇒ Object
This field contains the Transaction Type code assigned to this transaction.
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.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.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ AirlineAdvice
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 = {}) ⇒ AirlineAdvice
Initializes the object
118 119 120 121 122 123 124 125 126 127 128 129 130 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 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 118 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `CityPayApiClient::AirlineAdvice` 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 `CityPayApiClient::AirlineAdvice`. 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?(:'carrier_name') self.carrier_name = attributes[:'carrier_name'] else self.carrier_name = nil end if attributes.key?(:'conjunction_ticket_indicator') self.conjunction_ticket_indicator = attributes[:'conjunction_ticket_indicator'] end if attributes.key?(:'eticket_indicator') self.eticket_indicator = attributes[:'eticket_indicator'] end if attributes.key?(:'no_air_segments') self.no_air_segments = attributes[:'no_air_segments'] end if attributes.key?(:'number_in_party') self.number_in_party = attributes[:'number_in_party'] end if attributes.key?(:'original_ticket_no') self.original_ticket_no = attributes[:'original_ticket_no'] end if attributes.key?(:'passenger_name') self.passenger_name = attributes[:'passenger_name'] end if attributes.key?(:'segment1') self.segment1 = attributes[:'segment1'] else self.segment1 = nil end if attributes.key?(:'segment2') self.segment2 = attributes[:'segment2'] end if attributes.key?(:'segment3') self.segment3 = attributes[:'segment3'] end if attributes.key?(:'segment4') self.segment4 = attributes[:'segment4'] end if attributes.key?(:'ticket_issue_city') self.ticket_issue_city = attributes[:'ticket_issue_city'] else self.ticket_issue_city = nil end if attributes.key?(:'ticket_issue_date') self.ticket_issue_date = attributes[:'ticket_issue_date'] else self.ticket_issue_date = nil end if attributes.key?(:'ticket_issue_name') self.ticket_issue_name = attributes[:'ticket_issue_name'] else self.ticket_issue_name = nil end if attributes.key?(:'ticket_no') self.ticket_no = attributes[:'ticket_no'] else self.ticket_no = nil end if attributes.key?(:'transaction_type') self.transaction_type = attributes[:'transaction_type'] else self.transaction_type = nil end end |
Instance Attribute Details
#carrier_name ⇒ Object
The name of the airline carrier that generated the tickets for airline travel.
18 19 20 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 18 def carrier_name @carrier_name end |
#conjunction_ticket_indicator ⇒ Object
true if a conjunction ticket (with additional coupons) was issued for an itinerary with more than four segments. Defaults to false.
21 22 23 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 21 def conjunction_ticket_indicator @conjunction_ticket_indicator end |
#eticket_indicator ⇒ Object
The Electronic Ticket Indicator, a code that indicates if an electronic ticket was issued. Defaults to true.
24 25 26 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 24 def eticket_indicator @eticket_indicator end |
#no_air_segments ⇒ Object
A value that indicates the number of air travel segments included on this ticket. Valid entries include the numerals “0” through “4”. Required only if the transaction type is TKT or EXC.
27 28 29 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 27 def no_air_segments @no_air_segments end |
#number_in_party ⇒ Object
The number of people in the party.
30 31 32 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 30 def number_in_party @number_in_party end |
#original_ticket_no ⇒ Object
Required if transaction type is EXC.
33 34 35 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 33 def original_ticket_no @original_ticket_no end |
#passenger_name ⇒ Object
The name of the passenger when the traveller is not the card member that purchased the ticket. Required only if the transaction type is TKT or EXC.
36 37 38 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 36 def passenger_name @passenger_name end |
#segment1 ⇒ Object
Returns the value of attribute segment1.
38 39 40 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 38 def segment1 @segment1 end |
#segment2 ⇒ Object
Returns the value of attribute segment2.
40 41 42 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 40 def segment2 @segment2 end |
#segment3 ⇒ Object
Returns the value of attribute segment3.
42 43 44 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 42 def segment3 @segment3 end |
#segment4 ⇒ Object
Returns the value of attribute segment4.
44 45 46 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 44 def segment4 @segment4 end |
#ticket_issue_city ⇒ Object
The name of the city town or village where the transaction took place.
47 48 49 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 47 def ticket_issue_city @ticket_issue_city end |
#ticket_issue_date ⇒ Object
The date the ticket was issued in ISO Date format (yyyy-MM-dd).
50 51 52 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 50 def ticket_issue_date @ticket_issue_date end |
#ticket_issue_name ⇒ Object
The name of the agency generating the ticket.
53 54 55 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 53 def ticket_issue_name @ticket_issue_name end |
#ticket_no ⇒ Object
This must be a valid ticket number, i.e. numeric (the first 3 digits must represent the valid IATA plate carrier code). The final check digit should be validated prior to submission. On credit charges, this field should contain the number of the original ticket, and not of a replacement.
56 57 58 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 56 def ticket_no @ticket_no end |
#transaction_type ⇒ Object
This field contains the Transaction Type code assigned to this transaction. Valid codes include: - ‘TKT` = Ticket Purchase - `REF` = Refund - `EXC` = Exchange Ticket - `MSC` = Miscellaneous (non-Ticket Purchase- and non-Exchange Ticket-related transactions only).
59 60 61 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 59 def transaction_type @transaction_type end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
492 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 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 492 def self._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 = CityPayApiClient.const_get(type) klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
84 85 86 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 84 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 62 def self.attribute_map { :'carrier_name' => :'carrier_name', :'conjunction_ticket_indicator' => :'conjunction_ticket_indicator', :'eticket_indicator' => :'eticket_indicator', :'no_air_segments' => :'no_air_segments', :'number_in_party' => :'number_in_party', :'original_ticket_no' => :'original_ticket_no', :'passenger_name' => :'passenger_name', :'segment1' => :'segment1', :'segment2' => :'segment2', :'segment3' => :'segment3', :'segment4' => :'segment4', :'ticket_issue_city' => :'ticket_issue_city', :'ticket_issue_date' => :'ticket_issue_date', :'ticket_issue_name' => :'ticket_issue_name', :'ticket_no' => :'ticket_no', :'transaction_type' => :'transaction_type' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 468 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{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[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
111 112 113 114 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 111 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 89 def self.openapi_types { :'carrier_name' => :'String', :'conjunction_ticket_indicator' => :'Boolean', :'eticket_indicator' => :'Boolean', :'no_air_segments' => :'Integer', :'number_in_party' => :'Integer', :'original_ticket_no' => :'String', :'passenger_name' => :'String', :'segment1' => :'AirlineSegment', :'segment2' => :'AirlineSegment', :'segment3' => :'AirlineSegment', :'segment4' => :'AirlineSegment', :'ticket_issue_city' => :'String', :'ticket_issue_date' => :'Date', :'ticket_issue_name' => :'String', :'ticket_no' => :'String', :'transaction_type' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 432 def ==(o) return true if self.equal?(o) self.class == o.class && carrier_name == o.carrier_name && conjunction_ticket_indicator == o.conjunction_ticket_indicator && eticket_indicator == o.eticket_indicator && no_air_segments == o.no_air_segments && number_in_party == o.number_in_party && original_ticket_no == o.original_ticket_no && passenger_name == o.passenger_name && segment1 == o.segment1 && segment2 == o.segment2 && segment3 == o.segment3 && segment4 == o.segment4 && ticket_issue_city == o.ticket_issue_city && ticket_issue_date == o.ticket_issue_date && ticket_issue_name == o.ticket_issue_name && ticket_no == o.ticket_no && transaction_type == o.transaction_type end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
563 564 565 566 567 568 569 570 571 572 573 574 575 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 563 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 |
#eql?(o) ⇒ Boolean
455 456 457 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 455 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
461 462 463 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 461 def hash [carrier_name, conjunction_ticket_indicator, eticket_indicator, no_air_segments, number_in_party, original_ticket_no, passenger_name, segment1, segment2, segment3, segment4, ticket_issue_city, ticket_issue_date, ticket_issue_name, ticket_no, transaction_type].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 212 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @carrier_name.nil? invalid_properties.push('invalid value for "carrier_name", carrier_name cannot be nil.') end if @carrier_name.to_s.length > 25 invalid_properties.push('invalid value for "carrier_name", the character length must be smaller than or equal to 25.') end if !@no_air_segments.nil? && @no_air_segments > 4 invalid_properties.push('invalid value for "no_air_segments", must be smaller than or equal to 4.') end if !@no_air_segments.nil? && @no_air_segments < 0 invalid_properties.push('invalid value for "no_air_segments", must be greater than or equal to 0.') end if !@original_ticket_no.nil? && @original_ticket_no.to_s.length > 14 invalid_properties.push('invalid value for "original_ticket_no", the character length must be smaller than or equal to 14.') end if !@passenger_name.nil? && @passenger_name.to_s.length > 25 invalid_properties.push('invalid value for "passenger_name", the character length must be smaller than or equal to 25.') end if @segment1.nil? invalid_properties.push('invalid value for "segment1", segment1 cannot be nil.') end if @ticket_issue_city.nil? invalid_properties.push('invalid value for "ticket_issue_city", ticket_issue_city cannot be nil.') end if @ticket_issue_city.to_s.length > 18 invalid_properties.push('invalid value for "ticket_issue_city", the character length must be smaller than or equal to 18.') end if @ticket_issue_date.nil? invalid_properties.push('invalid value for "ticket_issue_date", ticket_issue_date cannot be nil.') end if @ticket_issue_name.nil? invalid_properties.push('invalid value for "ticket_issue_name", ticket_issue_name cannot be nil.') end if @ticket_issue_name.to_s.length > 26 invalid_properties.push('invalid value for "ticket_issue_name", the character length must be smaller than or equal to 26.') end if @ticket_no.nil? invalid_properties.push('invalid value for "ticket_no", ticket_no cannot be nil.') end if @ticket_no.to_s.length > 14 invalid_properties.push('invalid value for "ticket_no", the character length must be smaller than or equal to 14.') end if @transaction_type.nil? invalid_properties.push('invalid value for "transaction_type", transaction_type cannot be nil.') end if @transaction_type.to_s.length > 3 invalid_properties.push('invalid value for "transaction_type", the character length must be smaller than or equal to 3.') end if @transaction_type.to_s.length < 3 invalid_properties.push('invalid value for "transaction_type", the character length must be great than or equal to 3.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
539 540 541 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 539 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
545 546 547 548 549 550 551 552 553 554 555 556 557 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 545 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
533 534 535 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 533 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 |
# File 'lib/citypay_api_client/models/airline_advice.rb', line 288 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @carrier_name.nil? return false if @carrier_name.to_s.length > 25 return false if !@no_air_segments.nil? && @no_air_segments > 4 return false if !@no_air_segments.nil? && @no_air_segments < 0 return false if !@original_ticket_no.nil? && @original_ticket_no.to_s.length > 14 return false if !@passenger_name.nil? && @passenger_name.to_s.length > 25 return false if @segment1.nil? return false if @ticket_issue_city.nil? return false if @ticket_issue_city.to_s.length > 18 return false if @ticket_issue_date.nil? return false if @ticket_issue_name.nil? return false if @ticket_issue_name.to_s.length > 26 return false if @ticket_no.nil? return false if @ticket_no.to_s.length > 14 return false if @transaction_type.nil? return false if @transaction_type.to_s.length > 3 return false if @transaction_type.to_s.length < 3 true end |