Class: OCI::Onesubscription::Models::SubscribedServiceAddress

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/onesubscription/models/subscribed_service_address.rb

Overview

Address.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SubscribedServiceAddress

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
151
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 104

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_idInteger

Bill to site use Id.

Returns:

  • (Integer)


38
39
40
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 38

def bill_site_use_id
  @bill_site_use_id
end

#is_bill_toBOOLEAN

Identify as the customer shipping address.

Returns:

  • (BOOLEAN)


28
29
30
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 28

def is_bill_to
  @is_bill_to
end

#is_ship_toBOOLEAN

Identify as the customer invoicing address.

Returns:

  • (BOOLEAN)


33
34
35
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 33

def is_ship_to
  @is_ship_to
end

#locationOCI::Onesubscription::Models::SubscribedServiceLocation



13
14
15
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 13

def location
  @location
end

#nameString

Address name identifier.

Returns:

  • (String)


18
19
20
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 18

def name
  @name
end

#phoneString

Phone.

Returns:

  • (String)


23
24
25
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 23

def phone
  @phone
end

#service2_site_use_idInteger

Service to site use Id.

Returns:

  • (Integer)


43
44
45
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 43

def service2_site_use_id
  @service2_site_use_id
end

#tca_cust_acct_site_idInteger

TCA customer account site Id.

Returns:

  • (Integer)


48
49
50
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 48

def tca_cust_acct_site_id
  @tca_cust_acct_site_id
end

#tca_party_site_numberString

Party site number.

Returns:

  • (String)


53
54
55
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 53

def tca_party_site_number
  @tca_party_site_number
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 56

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_typesObject

Attribute type mapping.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 73

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.

Parameters:

  • other (Object)

    the other object to be compared



160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 160

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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 198

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


178
179
180
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 178

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



187
188
189
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 187

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_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



231
232
233
234
235
236
237
238
239
240
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 231

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



225
226
227
# File 'lib/oci/onesubscription/models/subscribed_service_address.rb', line 225

def to_s
  to_hash.to_s
end