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):



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_idInteger

Bill to site use Id.

Returns:

  • (Integer)


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_toBOOLEAN

Identify as the customer shipping address.

Returns:

  • (BOOLEAN)


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

def is_bill_to
  @is_bill_to
end

#is_ship_toBOOLEAN

Identify as the customer invoicing address.

Returns:

  • (BOOLEAN)


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

def is_ship_to
  @is_ship_to
end

#locationOCI::Onesubscription::Models::SubscribedServiceLocation



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

def location
  @location
end

#nameString

Address name identifier.

Returns:

  • (String)


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

def name
  @name
end

#phoneString

Phone.

Returns:

  • (String)


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

def phone
  @phone
end

#service2_site_use_idInteger

Service to site use Id.

Returns:

  • (Integer)


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_idInteger

TCA customer account site Id.

Returns:

  • (Integer)


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_numberString

Party site number.

Returns:

  • (String)


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_mapObject

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_typesObject

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.

Parameters:

  • other (Object)

    the other object to be compared



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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



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

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


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

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



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_hashHash

Returns the object in the form of hash

Returns:

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

Returns the string representation of the object

Returns:

  • (String)

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