Class: OCI::OspGateway::Models::BillToAddress

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/osp_gateway/models/bill_to_address.rb

Overview

Address details model

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ BillToAddress

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :contact_name (String)

    The value to assign to the #contact_name property

  • :company_name (String)

    The value to assign to the #company_name property

  • :address_line1 (String)

    The value to assign to the #address_line1 property

  • :address_line2 (String)

    The value to assign to the #address_line2 property

  • :address_line3 (String)

    The value to assign to the #address_line3 property

  • :address_line4 (String)

    The value to assign to the #address_line4 property

  • :street_name (String)

    The value to assign to the #street_name property

  • :street_number (String)

    The value to assign to the #street_number property

  • :city (String)

    The value to assign to the #city property

  • :country (OCI::OspGateway::Models::Country)

    The value to assign to the #country property

  • :county (String)

    The value to assign to the #county property

  • :state (String)

    The value to assign to the #state property

  • :postal_code (String)

    The value to assign to the #postal_code property

  • :province (String)

    The value to assign to the #province property



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_line1String

Address line 1

Returns:

  • (String)


21
22
23
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 21

def address_line1
  @address_line1
end

#address_line2String

Address line 2

Returns:

  • (String)


25
26
27
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 25

def address_line2
  @address_line2
end

#address_line3String

Address line 3

Returns:

  • (String)


29
30
31
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 29

def address_line3
  @address_line3
end

#address_line4String

Address line 4

Returns:

  • (String)


33
34
35
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 33

def address_line4
  @address_line4
end

#cityString

Name of the city

Returns:

  • (String)


45
46
47
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 45

def city
  @city
end

#company_nameString

Name of the customer company

Returns:

  • (String)


17
18
19
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 17

def company_name
  @company_name
end

#contact_nameString

Name of the contact person

Returns:

  • (String)


13
14
15
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 13

def contact_name
  @contact_name
end

#countryOCI::OspGateway::Models::Country



48
49
50
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 48

def country
  @country
end

#countyString

County name

Returns:

  • (String)


52
53
54
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 52

def county
  @county
end

#postal_codeString

ZIP no

Returns:

  • (String)


60
61
62
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 60

def postal_code
  @postal_code
end

#provinceString

Name of the province

Returns:

  • (String)


64
65
66
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 64

def province
  @province
end

#stateString

Name of the state

Returns:

  • (String)


56
57
58
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 56

def state
  @state
end

#street_nameString

Street name

Returns:

  • (String)


37
38
39
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 37

def street_name
  @street_name
end

#street_numberString

House no

Returns:

  • (String)


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_mapObject

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_typesObject

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.

Parameters:

  • other (Object)

    the other object to be compared



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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



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

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


231
232
233
# File 'lib/oci/osp_gateway/models/bill_to_address.rb', line 231

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



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_hashHash

Returns the object in the form of hash

Returns:

  • (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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation 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