Class: OCI::Onesubscription::Models::InvoicingLocation
- Inherits:
-
Object
- Object
- OCI::Onesubscription::Models::InvoicingLocation
- Defined in:
- lib/oci/onesubscription/models/invoicing_location.rb
Overview
Address location.
Instance Attribute Summary collapse
-
#address1 ⇒ String
Address first line.
-
#address2 ⇒ String
Address second line.
-
#city ⇒ String
City.
-
#country ⇒ String
Country.
-
#postal_code ⇒ String
Postal code.
-
#region ⇒ String
Region.
-
#tca_location_id ⇒ Integer
TCA Location identifier.
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 = {}) ⇒ InvoicingLocation
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 = {}) ⇒ InvoicingLocation
Initializes the object
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/oci/onesubscription/models/invoicing_location.rb', line 90 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.address1 = attributes[:'address1'] if attributes[:'address1'] self.address2 = attributes[:'address2'] if attributes[:'address2'] self.postal_code = attributes[:'postalCode'] if attributes[:'postalCode'] raise 'You cannot provide both :postalCode and :postal_code' if attributes.key?(:'postalCode') && attributes.key?(:'postal_code') self.postal_code = attributes[:'postal_code'] if attributes[:'postal_code'] self.city = attributes[:'city'] if attributes[:'city'] self.country = attributes[:'country'] if attributes[:'country'] self.region = attributes[:'region'] if attributes[:'region'] self.tca_location_id = attributes[:'tcaLocationId'] if attributes[:'tcaLocationId'] raise 'You cannot provide both :tcaLocationId and :tca_location_id' if attributes.key?(:'tcaLocationId') && attributes.key?(:'tca_location_id') self.tca_location_id = attributes[:'tca_location_id'] if attributes[:'tca_location_id'] end |
Instance Attribute Details
#address1 ⇒ String
Address first line.
15 16 17 |
# File 'lib/oci/onesubscription/models/invoicing_location.rb', line 15 def address1 @address1 end |
#address2 ⇒ String
Address second line.
20 21 22 |
# File 'lib/oci/onesubscription/models/invoicing_location.rb', line 20 def address2 @address2 end |
#city ⇒ String
City.
30 31 32 |
# File 'lib/oci/onesubscription/models/invoicing_location.rb', line 30 def city @city end |
#country ⇒ String
Country.
35 36 37 |
# File 'lib/oci/onesubscription/models/invoicing_location.rb', line 35 def country @country end |
#postal_code ⇒ String
Postal code.
25 26 27 |
# File 'lib/oci/onesubscription/models/invoicing_location.rb', line 25 def postal_code @postal_code end |
#region ⇒ String
Region.
40 41 42 |
# File 'lib/oci/onesubscription/models/invoicing_location.rb', line 40 def region @region end |
#tca_location_id ⇒ Integer
TCA Location identifier.
45 46 47 |
# File 'lib/oci/onesubscription/models/invoicing_location.rb', line 45 def tca_location_id @tca_location_id end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/oci/onesubscription/models/invoicing_location.rb', line 48 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'address1': :'address1', 'address2': :'address2', 'postal_code': :'postalCode', 'city': :'city', 'country': :'country', 'region': :'region', 'tca_location_id': :'tcaLocationId' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/oci/onesubscription/models/invoicing_location.rb', line 63 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'address1': :'String', 'address2': :'String', 'postal_code': :'String', 'city': :'String', 'country': :'String', 'region': :'String', 'tca_location_id': :'Integer' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/oci/onesubscription/models/invoicing_location.rb', line 126 def ==(other) return true if equal?(other) self.class == other.class && address1 == other.address1 && address2 == other.address2 && postal_code == other.postal_code && city == other.city && country == other.country && region == other.region && tca_location_id == other.tca_location_id end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/oci/onesubscription/models/invoicing_location.rb', line 162 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
142 143 144 |
# File 'lib/oci/onesubscription/models/invoicing_location.rb', line 142 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
151 152 153 |
# File 'lib/oci/onesubscription/models/invoicing_location.rb', line 151 def hash [address1, address2, postal_code, city, country, region, tca_location_id].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
195 196 197 198 199 200 201 202 203 204 |
# File 'lib/oci/onesubscription/models/invoicing_location.rb', line 195 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
189 190 191 |
# File 'lib/oci/onesubscription/models/invoicing_location.rb', line 189 def to_s to_hash.to_s end |