Class: OCI::OspGateway::Models::BillingAddress
- Inherits:
-
Object
- Object
- OCI::OspGateway::Models::BillingAddress
- Defined in:
- lib/oci/osp_gateway/models/billing_address.rb
Overview
Billing address details model.
Instance Attribute Summary collapse
-
#address_key ⇒ String
Address identifier.
-
#city ⇒ String
Name of the city.
-
#company_name ⇒ String
Name of the customer company.
-
#country ⇒ String
Country of the address.
-
#email_address ⇒ String
Contact person email address.
-
#first_name ⇒ String
First name of the contact person.
-
#last_name ⇒ String
Last name of the contact person.
-
#line1 ⇒ String
Address line 1.
-
#line2 ⇒ String
Address line 2.
-
#postal_code ⇒ String
Post code of the address.
-
#state ⇒ String
State of the address.
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 = {}) ⇒ BillingAddress
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 = {}) ⇒ BillingAddress
Initializes the object
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 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/oci/osp_gateway/models/billing_address.rb', line 109 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.address_key = attributes[:'addressKey'] if attributes[:'addressKey'] raise 'You cannot provide both :addressKey and :address_key' if attributes.key?(:'addressKey') && attributes.key?(:'address_key') self.address_key = attributes[:'address_key'] if attributes[:'address_key'] self.line1 = attributes[:'line1'] if attributes[:'line1'] self.line2 = attributes[:'line2'] if attributes[:'line2'] self.city = attributes[:'city'] if attributes[:'city'] self.country = attributes[:'country'] if attributes[:'country'] 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.state = attributes[:'state'] if attributes[:'state'] self.email_address = attributes[:'emailAddress'] if attributes[:'emailAddress'] raise 'You cannot provide both :emailAddress and :email_address' if attributes.key?(:'emailAddress') && attributes.key?(:'email_address') self.email_address = attributes[:'email_address'] if attributes[:'email_address'] 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.first_name = attributes[:'firstName'] if attributes[:'firstName'] raise 'You cannot provide both :firstName and :first_name' if attributes.key?(:'firstName') && attributes.key?(:'first_name') self.first_name = attributes[:'first_name'] if attributes[:'first_name'] self.last_name = attributes[:'lastName'] if attributes[:'lastName'] raise 'You cannot provide both :lastName and :last_name' if attributes.key?(:'lastName') && attributes.key?(:'last_name') self.last_name = attributes[:'last_name'] if attributes[:'last_name'] end |
Instance Attribute Details
#address_key ⇒ String
Address identifier.
12 13 14 |
# File 'lib/oci/osp_gateway/models/billing_address.rb', line 12 def address_key @address_key end |
#city ⇒ String
Name of the city.
24 25 26 |
# File 'lib/oci/osp_gateway/models/billing_address.rb', line 24 def city @city end |
#company_name ⇒ String
Name of the customer company.
44 45 46 |
# File 'lib/oci/osp_gateway/models/billing_address.rb', line 44 def company_name @company_name end |
#country ⇒ String
Country of the address.
28 29 30 |
# File 'lib/oci/osp_gateway/models/billing_address.rb', line 28 def country @country end |
#email_address ⇒ String
Contact person email address.
40 41 42 |
# File 'lib/oci/osp_gateway/models/billing_address.rb', line 40 def email_address @email_address end |
#first_name ⇒ String
First name of the contact person.
48 49 50 |
# File 'lib/oci/osp_gateway/models/billing_address.rb', line 48 def first_name @first_name end |
#last_name ⇒ String
Last name of the contact person.
52 53 54 |
# File 'lib/oci/osp_gateway/models/billing_address.rb', line 52 def last_name @last_name end |
#line1 ⇒ String
Address line 1.
16 17 18 |
# File 'lib/oci/osp_gateway/models/billing_address.rb', line 16 def line1 @line1 end |
#line2 ⇒ String
Address line 2.
20 21 22 |
# File 'lib/oci/osp_gateway/models/billing_address.rb', line 20 def line2 @line2 end |
#postal_code ⇒ String
Post code of the address.
32 33 34 |
# File 'lib/oci/osp_gateway/models/billing_address.rb', line 32 def postal_code @postal_code end |
#state ⇒ String
State of the address.
36 37 38 |
# File 'lib/oci/osp_gateway/models/billing_address.rb', line 36 def state @state 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 70 71 |
# File 'lib/oci/osp_gateway/models/billing_address.rb', line 55 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'address_key': :'addressKey', 'line1': :'line1', 'line2': :'line2', 'city': :'city', 'country': :'country', 'postal_code': :'postalCode', 'state': :'state', 'email_address': :'emailAddress', 'company_name': :'companyName', 'first_name': :'firstName', 'last_name': :'lastName' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/oci/osp_gateway/models/billing_address.rb', line 74 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'address_key': :'String', 'line1': :'String', 'line2': :'String', 'city': :'String', 'country': :'String', 'postal_code': :'String', 'state': :'String', 'email_address': :'String', 'company_name': :'String', 'first_name': :'String', 'last_name': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/oci/osp_gateway/models/billing_address.rb', line 169 def ==(other) return true if equal?(other) self.class == other.class && address_key == other.address_key && line1 == other.line1 && line2 == other.line2 && city == other.city && country == other.country && postal_code == other.postal_code && state == other.state && email_address == other.email_address && company_name == other.company_name && first_name == other.first_name && last_name == other.last_name end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/oci/osp_gateway/models/billing_address.rb', line 209 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
189 190 191 |
# File 'lib/oci/osp_gateway/models/billing_address.rb', line 189 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
198 199 200 |
# File 'lib/oci/osp_gateway/models/billing_address.rb', line 198 def hash [address_key, line1, line2, city, country, postal_code, state, email_address, company_name, first_name, last_name].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
242 243 244 245 246 247 248 249 250 251 |
# File 'lib/oci/osp_gateway/models/billing_address.rb', line 242 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
236 237 238 |
# File 'lib/oci/osp_gateway/models/billing_address.rb', line 236 def to_s to_hash.to_s end |