Class: OCI::Onesubscription::Models::SubscribedServiceLocation
- Inherits:
-
Object
- Object
- OCI::Onesubscription::Models::SubscribedServiceLocation
- Defined in:
- lib/oci/onesubscription/models/subscribed_service_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
Region.
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 = {}) ⇒ SubscribedServiceLocation
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 = {}) ⇒ SubscribedServiceLocation
Initializes the object
89 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 |
# File 'lib/oci/onesubscription/models/subscribed_service_location.rb', line 89 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.
14 15 16 |
# File 'lib/oci/onesubscription/models/subscribed_service_location.rb', line 14 def address1 @address1 end |
#address2 ⇒ String
Address second line.
19 20 21 |
# File 'lib/oci/onesubscription/models/subscribed_service_location.rb', line 19 def address2 @address2 end |
#city ⇒ String
City.
29 30 31 |
# File 'lib/oci/onesubscription/models/subscribed_service_location.rb', line 29 def city @city end |
#country ⇒ String
Country.
34 35 36 |
# File 'lib/oci/onesubscription/models/subscribed_service_location.rb', line 34 def country @country end |
#postal_code ⇒ String
Postal code.
24 25 26 |
# File 'lib/oci/onesubscription/models/subscribed_service_location.rb', line 24 def postal_code @postal_code end |
#region ⇒ String
Region.
39 40 41 |
# File 'lib/oci/onesubscription/models/subscribed_service_location.rb', line 39 def region @region end |
#tca_location_id ⇒ Integer
Region.
44 45 46 |
# File 'lib/oci/onesubscription/models/subscribed_service_location.rb', line 44 def tca_location_id @tca_location_id end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/oci/onesubscription/models/subscribed_service_location.rb', line 47 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.
62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/oci/onesubscription/models/subscribed_service_location.rb', line 62 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.
125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/oci/onesubscription/models/subscribed_service_location.rb', line 125 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
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/oci/onesubscription/models/subscribed_service_location.rb', line 161 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
141 142 143 |
# File 'lib/oci/onesubscription/models/subscribed_service_location.rb', line 141 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
150 151 152 |
# File 'lib/oci/onesubscription/models/subscribed_service_location.rb', line 150 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
194 195 196 197 198 199 200 201 202 203 |
# File 'lib/oci/onesubscription/models/subscribed_service_location.rb', line 194 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
188 189 190 |
# File 'lib/oci/onesubscription/models/subscribed_service_location.rb', line 188 def to_s to_hash.to_s end |