Class: OCI::Onesubscription::Models::SubscribedServiceAddress
- Inherits:
-
Object
- Object
- OCI::Onesubscription::Models::SubscribedServiceAddress
- Defined in:
- lib/oci/onesubscription/models/subscribed_service_address.rb
Overview
Address.
Instance Attribute Summary collapse
-
#bill_site_use_id ⇒ Integer
Bill to site use Id.
-
#is_bill_to ⇒ BOOLEAN
Identify as the customer shipping address.
-
#is_ship_to ⇒ BOOLEAN
Identify as the customer invoicing address.
- #location ⇒ OCI::Onesubscription::Models::SubscribedServiceLocation
-
#name ⇒ String
Address name identifier.
-
#phone ⇒ String
Phone.
-
#service2_site_use_id ⇒ Integer
Service to site use Id.
-
#tca_cust_acct_site_id ⇒ Integer
TCA customer account site Id.
-
#tca_party_site_number ⇒ String
Party site number.
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 = {}) ⇒ SubscribedServiceAddress
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 = {}) ⇒ SubscribedServiceAddress
Initializes the object
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 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 103 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.location = attributes[:'location'] if attributes[:'location'] self.name = attributes[:'name'] if attributes[:'name'] self.phone = attributes[:'phone'] if attributes[:'phone'] self.is_bill_to = attributes[:'isBillTo'] unless attributes[:'isBillTo'].nil? raise 'You cannot provide both :isBillTo and :is_bill_to' if attributes.key?(:'isBillTo') && attributes.key?(:'is_bill_to') self.is_bill_to = attributes[:'is_bill_to'] unless attributes[:'is_bill_to'].nil? self.is_ship_to = attributes[:'isShipTo'] unless attributes[:'isShipTo'].nil? raise 'You cannot provide both :isShipTo and :is_ship_to' if attributes.key?(:'isShipTo') && attributes.key?(:'is_ship_to') self.is_ship_to = attributes[:'is_ship_to'] unless attributes[:'is_ship_to'].nil? self.bill_site_use_id = attributes[:'billSiteUseId'] if attributes[:'billSiteUseId'] raise 'You cannot provide both :billSiteUseId and :bill_site_use_id' if attributes.key?(:'billSiteUseId') && attributes.key?(:'bill_site_use_id') self.bill_site_use_id = attributes[:'bill_site_use_id'] if attributes[:'bill_site_use_id'] self.service2_site_use_id = attributes[:'service2SiteUseId'] if attributes[:'service2SiteUseId'] raise 'You cannot provide both :service2SiteUseId and :service2_site_use_id' if attributes.key?(:'service2SiteUseId') && attributes.key?(:'service2_site_use_id') self.service2_site_use_id = attributes[:'service2_site_use_id'] if attributes[:'service2_site_use_id'] self.tca_cust_acct_site_id = attributes[:'tcaCustAcctSiteId'] if attributes[:'tcaCustAcctSiteId'] raise 'You cannot provide both :tcaCustAcctSiteId and :tca_cust_acct_site_id' if attributes.key?(:'tcaCustAcctSiteId') && attributes.key?(:'tca_cust_acct_site_id') self.tca_cust_acct_site_id = attributes[:'tca_cust_acct_site_id'] if attributes[:'tca_cust_acct_site_id'] self.tca_party_site_number = attributes[:'tcaPartySiteNumber'] if attributes[:'tcaPartySiteNumber'] raise 'You cannot provide both :tcaPartySiteNumber and :tca_party_site_number' if attributes.key?(:'tcaPartySiteNumber') && attributes.key?(:'tca_party_site_number') self.tca_party_site_number = attributes[:'tca_party_site_number'] if attributes[:'tca_party_site_number'] end |
Instance Attribute Details
#bill_site_use_id ⇒ Integer
Bill to site use Id.
37 38 39 |
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 37 def bill_site_use_id @bill_site_use_id end |
#is_bill_to ⇒ BOOLEAN
Identify as the customer shipping address.
27 28 29 |
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 27 def is_bill_to @is_bill_to end |
#is_ship_to ⇒ BOOLEAN
Identify as the customer invoicing address.
32 33 34 |
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 32 def is_ship_to @is_ship_to end |
#location ⇒ OCI::Onesubscription::Models::SubscribedServiceLocation
12 13 14 |
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 12 def location @location end |
#name ⇒ String
Address name identifier.
17 18 19 |
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 17 def name @name end |
#phone ⇒ String
Phone.
22 23 24 |
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 22 def phone @phone end |
#service2_site_use_id ⇒ Integer
Service to site use Id.
42 43 44 |
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 42 def service2_site_use_id @service2_site_use_id end |
#tca_cust_acct_site_id ⇒ Integer
TCA customer account site Id.
47 48 49 |
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 47 def tca_cust_acct_site_id @tca_cust_acct_site_id end |
#tca_party_site_number ⇒ String
Party site number.
52 53 54 |
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 52 def tca_party_site_number @tca_party_site_number end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 55 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'location': :'location', 'name': :'name', 'phone': :'phone', 'is_bill_to': :'isBillTo', 'is_ship_to': :'isShipTo', 'bill_site_use_id': :'billSiteUseId', 'service2_site_use_id': :'service2SiteUseId', 'tca_cust_acct_site_id': :'tcaCustAcctSiteId', 'tca_party_site_number': :'tcaPartySiteNumber' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 72 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'location': :'OCI::Onesubscription::Models::SubscribedServiceLocation', 'name': :'String', 'phone': :'String', 'is_bill_to': :'BOOLEAN', 'is_ship_to': :'BOOLEAN', 'bill_site_use_id': :'Integer', 'service2_site_use_id': :'Integer', 'tca_cust_acct_site_id': :'Integer', 'tca_party_site_number': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 159 def ==(other) return true if equal?(other) self.class == other.class && location == other.location && name == other.name && phone == other.phone && is_bill_to == other.is_bill_to && is_ship_to == other.is_ship_to && bill_site_use_id == other.bill_site_use_id && service2_site_use_id == other.service2_site_use_id && tca_cust_acct_site_id == other.tca_cust_acct_site_id && tca_party_site_number == other.tca_party_site_number end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 197 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
177 178 179 |
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 177 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
186 187 188 |
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 186 def hash [location, name, phone, is_bill_to, is_ship_to, bill_site_use_id, service2_site_use_id, tca_cust_acct_site_id, tca_party_site_number].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
230 231 232 233 234 235 236 237 238 239 |
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 230 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
224 225 226 |
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 224 def to_s to_hash.to_s end |