Class: OCI::Onesubscription::Models::SubscribedServiceBusinessPartner

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

Overview

Business partner.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SubscribedServiceBusinessPartner

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :name (String)

    The value to assign to the #name property

  • :name_phonetic (String)

    The value to assign to the #name_phonetic property

  • :tca_cust_account_number (String)

    The value to assign to the #tca_cust_account_number property

  • :is_public_sector (BOOLEAN)

    The value to assign to the #is_public_sector property

  • :is_chain_customer (BOOLEAN)

    The value to assign to the #is_chain_customer property

  • :customer_chain_type (String)

    The value to assign to the #customer_chain_type property

  • :tca_party_number (String)

    The value to assign to the #tca_party_number property

  • :tca_party_id (Integer)

    The value to assign to the #tca_party_id property

  • :tca_customer_account_id (Integer)

    The value to assign to the #tca_customer_account_id property



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
152
153
154
155
156
157
158
159
160
161
# File 'lib/oci/onesubscription/models/subscribed_service_business_partner.rb', line 106

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.name = attributes[:'name'] if attributes[:'name']

  self.name_phonetic = attributes[:'namePhonetic'] if attributes[:'namePhonetic']

  raise 'You cannot provide both :namePhonetic and :name_phonetic' if attributes.key?(:'namePhonetic') && attributes.key?(:'name_phonetic')

  self.name_phonetic = attributes[:'name_phonetic'] if attributes[:'name_phonetic']

  self. = attributes[:'tcaCustAccountNumber'] if attributes[:'tcaCustAccountNumber']

  raise 'You cannot provide both :tcaCustAccountNumber and :tca_cust_account_number' if attributes.key?(:'tcaCustAccountNumber') && attributes.key?(:'tca_cust_account_number')

  self. = attributes[:'tca_cust_account_number'] if attributes[:'tca_cust_account_number']

  self.is_public_sector = attributes[:'isPublicSector'] unless attributes[:'isPublicSector'].nil?

  raise 'You cannot provide both :isPublicSector and :is_public_sector' if attributes.key?(:'isPublicSector') && attributes.key?(:'is_public_sector')

  self.is_public_sector = attributes[:'is_public_sector'] unless attributes[:'is_public_sector'].nil?

  self.is_chain_customer = attributes[:'isChainCustomer'] unless attributes[:'isChainCustomer'].nil?

  raise 'You cannot provide both :isChainCustomer and :is_chain_customer' if attributes.key?(:'isChainCustomer') && attributes.key?(:'is_chain_customer')

  self.is_chain_customer = attributes[:'is_chain_customer'] unless attributes[:'is_chain_customer'].nil?

  self.customer_chain_type = attributes[:'customerChainType'] if attributes[:'customerChainType']

  raise 'You cannot provide both :customerChainType and :customer_chain_type' if attributes.key?(:'customerChainType') && attributes.key?(:'customer_chain_type')

  self.customer_chain_type = attributes[:'customer_chain_type'] if attributes[:'customer_chain_type']

  self.tca_party_number = attributes[:'tcaPartyNumber'] if attributes[:'tcaPartyNumber']

  raise 'You cannot provide both :tcaPartyNumber and :tca_party_number' if attributes.key?(:'tcaPartyNumber') && attributes.key?(:'tca_party_number')

  self.tca_party_number = attributes[:'tca_party_number'] if attributes[:'tca_party_number']

  self.tca_party_id = attributes[:'tcaPartyId'] if attributes[:'tcaPartyId']

  raise 'You cannot provide both :tcaPartyId and :tca_party_id' if attributes.key?(:'tcaPartyId') && attributes.key?(:'tca_party_id')

  self.tca_party_id = attributes[:'tca_party_id'] if attributes[:'tca_party_id']

  self. = attributes[:'tcaCustomerAccountId'] if attributes[:'tcaCustomerAccountId']

  raise 'You cannot provide both :tcaCustomerAccountId and :tca_customer_account_id' if attributes.key?(:'tcaCustomerAccountId') && attributes.key?(:'tca_customer_account_id')

  self. = attributes[:'tca_customer_account_id'] if attributes[:'tca_customer_account_id']
end

Instance Attribute Details

#customer_chain_typeString

Customer chain type.

Returns:

  • (String)


40
41
42
# File 'lib/oci/onesubscription/models/subscribed_service_business_partner.rb', line 40

def customer_chain_type
  @customer_chain_type
end

#is_chain_customerBOOLEAN

The business partner is chain customer or not.

Returns:

  • (BOOLEAN)


35
36
37
# File 'lib/oci/onesubscription/models/subscribed_service_business_partner.rb', line 35

def is_chain_customer
  @is_chain_customer
end

#is_public_sectorBOOLEAN

The business partner is part of the public sector or not.

Returns:

  • (BOOLEAN)


30
31
32
# File 'lib/oci/onesubscription/models/subscribed_service_business_partner.rb', line 30

def is_public_sector
  @is_public_sector
end

#nameString

Commercial name also called customer name.

Returns:

  • (String)


15
16
17
# File 'lib/oci/onesubscription/models/subscribed_service_business_partner.rb', line 15

def name
  @name
end

#name_phoneticString

Phonetic name.

Returns:

  • (String)


20
21
22
# File 'lib/oci/onesubscription/models/subscribed_service_business_partner.rb', line 20

def name_phonetic
  @name_phonetic
end

#tca_cust_account_numberString

TCA customer account number.

Returns:

  • (String)


25
26
27
# File 'lib/oci/onesubscription/models/subscribed_service_business_partner.rb', line 25

def 
  @tca_cust_account_number
end

#tca_customer_account_idInteger

TCA customer account ID.

Returns:

  • (Integer)


55
56
57
# File 'lib/oci/onesubscription/models/subscribed_service_business_partner.rb', line 55

def 
  @tca_customer_account_id
end

#tca_party_idInteger

TCA party ID.

Returns:

  • (Integer)


50
51
52
# File 'lib/oci/onesubscription/models/subscribed_service_business_partner.rb', line 50

def tca_party_id
  @tca_party_id
end

#tca_party_numberString

TCA party number.

Returns:

  • (String)


45
46
47
# File 'lib/oci/onesubscription/models/subscribed_service_business_partner.rb', line 45

def tca_party_number
  @tca_party_number
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'name',
    'name_phonetic': :'namePhonetic',
    'tca_cust_account_number': :'tcaCustAccountNumber',
    'is_public_sector': :'isPublicSector',
    'is_chain_customer': :'isChainCustomer',
    'customer_chain_type': :'customerChainType',
    'tca_party_number': :'tcaPartyNumber',
    'tca_party_id': :'tcaPartyId',
    'tca_customer_account_id': :'tcaCustomerAccountId'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'String',
    'name_phonetic': :'String',
    'tca_cust_account_number': :'String',
    'is_public_sector': :'BOOLEAN',
    'is_chain_customer': :'BOOLEAN',
    'customer_chain_type': :'String',
    'tca_party_number': :'String',
    'tca_party_id': :'Integer',
    'tca_customer_account_id': :'Integer'
    # 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



170
171
172
173
174
175
176
177
178
179
180
181
182
183
# File 'lib/oci/onesubscription/models/subscribed_service_business_partner.rb', line 170

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    name == other.name &&
    name_phonetic == other.name_phonetic &&
     == other. &&
    is_public_sector == other.is_public_sector &&
    is_chain_customer == other.is_chain_customer &&
    customer_chain_type == other.customer_chain_type &&
    tca_party_number == other.tca_party_number &&
    tca_party_id == other.tca_party_id &&
     == other.
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



208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/oci/onesubscription/models/subscribed_service_business_partner.rb', line 208

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


188
189
190
# File 'lib/oci/onesubscription/models/subscribed_service_business_partner.rb', line 188

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



197
198
199
# File 'lib/oci/onesubscription/models/subscribed_service_business_partner.rb', line 197

def hash
  [name, name_phonetic, , is_public_sector, is_chain_customer, customer_chain_type, tca_party_number, tca_party_id, ].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



241
242
243
244
245
246
247
248
249
250
# File 'lib/oci/onesubscription/models/subscribed_service_business_partner.rb', line 241

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



235
236
237
# File 'lib/oci/onesubscription/models/subscribed_service_business_partner.rb', line 235

def to_s
  to_hash.to_s
end