Class: OCI::OspGateway::Models::BillToAddress
- Inherits:
-
Object
- Object
- OCI::OspGateway::Models::BillToAddress
- Defined in:
- lib/oci/osp_gateway/models/bill_to_address.rb
Overview
Address details model
Instance Attribute Summary collapse
-
#address_line1 ⇒ String
Address line 1.
-
#address_line2 ⇒ String
Address line 2.
-
#address_line3 ⇒ String
Address line 3.
-
#address_line4 ⇒ String
Address line 4.
-
#city ⇒ String
Name of the city.
-
#company_name ⇒ String
Name of the customer company.
-
#contact_name ⇒ String
Name of the contact person.
- #country ⇒ OCI::OspGateway::Models::Country
-
#county ⇒ String
County name.
-
#postal_code ⇒ String
ZIP no.
-
#province ⇒ String
Name of the province.
-
#state ⇒ String
Name of the state.
-
#street_name ⇒ String
Street name.
-
#street_number ⇒ String
House no.
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 = {}) ⇒ BillToAddress
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 = {}) ⇒ BillToAddress
Initializes the object
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 |
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 130 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.contact_name = attributes[:'contactName'] if attributes[:'contactName'] raise 'You cannot provide both :contactName and :contact_name' if attributes.key?(:'contactName') && attributes.key?(:'contact_name') self.contact_name = attributes[:'contact_name'] if attributes[:'contact_name'] self.company_name = attributes[:'companyName'] if attributes[:'companyName'] raise 'You cannot provide both :companyName and :company_name' if attributes.key?(:'companyName') && attributes.key?(:'company_name') self.company_name = attributes[:'company_name'] if attributes[:'company_name'] self.address_line1 = attributes[:'addressLine1'] if attributes[:'addressLine1'] raise 'You cannot provide both :addressLine1 and :address_line1' if attributes.key?(:'addressLine1') && attributes.key?(:'address_line1') self.address_line1 = attributes[:'address_line1'] if attributes[:'address_line1'] self.address_line2 = attributes[:'addressLine2'] if attributes[:'addressLine2'] raise 'You cannot provide both :addressLine2 and :address_line2' if attributes.key?(:'addressLine2') && attributes.key?(:'address_line2') self.address_line2 = attributes[:'address_line2'] if attributes[:'address_line2'] self.address_line3 = attributes[:'addressLine3'] if attributes[:'addressLine3'] raise 'You cannot provide both :addressLine3 and :address_line3' if attributes.key?(:'addressLine3') && attributes.key?(:'address_line3') self.address_line3 = attributes[:'address_line3'] if attributes[:'address_line3'] self.address_line4 = attributes[:'addressLine4'] if attributes[:'addressLine4'] raise 'You cannot provide both :addressLine4 and :address_line4' if attributes.key?(:'addressLine4') && attributes.key?(:'address_line4') self.address_line4 = attributes[:'address_line4'] if attributes[:'address_line4'] self.street_name = attributes[:'streetName'] if attributes[:'streetName'] raise 'You cannot provide both :streetName and :street_name' if attributes.key?(:'streetName') && attributes.key?(:'street_name') self.street_name = attributes[:'street_name'] if attributes[:'street_name'] self.street_number = attributes[:'streetNumber'] if attributes[:'streetNumber'] raise 'You cannot provide both :streetNumber and :street_number' if attributes.key?(:'streetNumber') && attributes.key?(:'street_number') self.street_number = attributes[:'street_number'] if attributes[:'street_number'] self.city = attributes[:'city'] if attributes[:'city'] self.country = attributes[:'country'] if attributes[:'country'] self.county = attributes[:'county'] if attributes[:'county'] self.state = attributes[:'state'] if attributes[:'state'] 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.province = attributes[:'province'] if attributes[:'province'] end |
Instance Attribute Details
#address_line1 ⇒ String
Address line 1
21 22 23 |
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 21 def address_line1 @address_line1 end |
#address_line2 ⇒ String
Address line 2
25 26 27 |
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 25 def address_line2 @address_line2 end |
#address_line3 ⇒ String
Address line 3
29 30 31 |
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 29 def address_line3 @address_line3 end |
#address_line4 ⇒ String
Address line 4
33 34 35 |
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 33 def address_line4 @address_line4 end |
#city ⇒ String
Name of the city
45 46 47 |
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 45 def city @city end |
#company_name ⇒ String
Name of the customer company
17 18 19 |
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 17 def company_name @company_name end |
#contact_name ⇒ String
Name of the contact person
13 14 15 |
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 13 def contact_name @contact_name end |
#country ⇒ OCI::OspGateway::Models::Country
48 49 50 |
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 48 def country @country end |
#county ⇒ String
County name
52 53 54 |
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 52 def county @county end |
#postal_code ⇒ String
ZIP no
60 61 62 |
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 60 def postal_code @postal_code end |
#province ⇒ String
Name of the province
64 65 66 |
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 64 def province @province end |
#state ⇒ String
Name of the state
56 57 58 |
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 56 def state @state end |
#street_name ⇒ String
Street name
37 38 39 |
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 37 def street_name @street_name end |
#street_number ⇒ String
House no
41 42 43 |
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 41 def street_number @street_number end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 67 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'contact_name': :'contactName', 'company_name': :'companyName', 'address_line1': :'addressLine1', 'address_line2': :'addressLine2', 'address_line3': :'addressLine3', 'address_line4': :'addressLine4', 'street_name': :'streetName', 'street_number': :'streetNumber', 'city': :'city', 'country': :'country', 'county': :'county', 'state': :'state', 'postal_code': :'postalCode', 'province': :'province' # rubocop:enable Style/SymbolLiteral } end |
.swagger_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/oci/osp_gateway/models/bill_to_address.rb', line 89 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'contact_name': :'String', 'company_name': :'String', 'address_line1': :'String', 'address_line2': :'String', 'address_line3': :'String', 'address_line4': :'String', 'street_name': :'String', 'street_number': :'String', 'city': :'String', 'country': :'OCI::OspGateway::Models::Country', 'county': :'String', 'state': :'String', 'postal_code': :'String', 'province': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 208 def ==(other) return true if equal?(other) self.class == other.class && contact_name == other.contact_name && company_name == other.company_name && address_line1 == other.address_line1 && address_line2 == other.address_line2 && address_line3 == other.address_line3 && address_line4 == other.address_line4 && street_name == other.street_name && street_number == other.street_number && city == other.city && country == other.country && county == other.county && state == other.state && postal_code == other.postal_code && province == other.province end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 251 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
231 232 233 |
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 231 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
240 241 242 |
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 240 def hash [contact_name, company_name, address_line1, address_line2, address_line3, address_line4, street_name, street_number, city, country, county, state, postal_code, province].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
284 285 286 287 288 289 290 291 292 293 |
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 284 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
278 279 280 |
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 278 def to_s to_hash.to_s end |