Class: OCI::Onesubscription::Models::InvoicingBusinessPartner
- Inherits:
-
Object
- Object
- OCI::Onesubscription::Models::InvoicingBusinessPartner
- Defined in:
- lib/oci/onesubscription/models/invoicing_business_partner.rb
Overview
Business partner.
Instance Attribute Summary collapse
-
#customer_chain_type ⇒ String
Customer chain type.
-
#is_chain_customer ⇒ BOOLEAN
The business partner is chain customer or not.
-
#is_public_sector ⇒ BOOLEAN
The business partner is part of the public sector or not.
-
#name ⇒ String
Commercial name also called customer name.
-
#name_phonetic ⇒ String
Phonetic name.
-
#tca_customer_account_id ⇒ Integer
TCA customer account ID.
-
#tca_customer_account_number ⇒ String
TCA customer account number.
-
#tca_party_id ⇒ Integer
TCA party ID.
-
#tca_party_number ⇒ String
TCA party number.
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 = {}) ⇒ InvoicingBusinessPartner
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 = {}) ⇒ InvoicingBusinessPartner
Initializes the object
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/invoicing_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.tca_customer_account_number = attributes[:'tcaCustomerAccountNumber'] if attributes[:'tcaCustomerAccountNumber'] raise 'You cannot provide both :tcaCustomerAccountNumber and :tca_customer_account_number' if attributes.key?(:'tcaCustomerAccountNumber') && attributes.key?(:'tca_customer_account_number') self.tca_customer_account_number = attributes[:'tca_customer_account_number'] if attributes[:'tca_customer_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.tca_customer_account_id = 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.tca_customer_account_id = attributes[:'tca_customer_account_id'] if attributes[:'tca_customer_account_id'] end |
Instance Attribute Details
#customer_chain_type ⇒ String
Customer chain type.
40 41 42 |
# File 'lib/oci/onesubscription/models/invoicing_business_partner.rb', line 40 def customer_chain_type @customer_chain_type end |
#is_chain_customer ⇒ BOOLEAN
The business partner is chain customer or not.
35 36 37 |
# File 'lib/oci/onesubscription/models/invoicing_business_partner.rb', line 35 def is_chain_customer @is_chain_customer end |
#is_public_sector ⇒ BOOLEAN
The business partner is part of the public sector or not.
30 31 32 |
# File 'lib/oci/onesubscription/models/invoicing_business_partner.rb', line 30 def is_public_sector @is_public_sector end |
#name ⇒ String
Commercial name also called customer name.
15 16 17 |
# File 'lib/oci/onesubscription/models/invoicing_business_partner.rb', line 15 def name @name end |
#name_phonetic ⇒ String
Phonetic name.
20 21 22 |
# File 'lib/oci/onesubscription/models/invoicing_business_partner.rb', line 20 def name_phonetic @name_phonetic end |
#tca_customer_account_id ⇒ Integer
TCA customer account ID.
55 56 57 |
# File 'lib/oci/onesubscription/models/invoicing_business_partner.rb', line 55 def tca_customer_account_id @tca_customer_account_id end |
#tca_customer_account_number ⇒ String
TCA customer account number.
25 26 27 |
# File 'lib/oci/onesubscription/models/invoicing_business_partner.rb', line 25 def tca_customer_account_number @tca_customer_account_number end |
#tca_party_id ⇒ Integer
TCA party ID.
50 51 52 |
# File 'lib/oci/onesubscription/models/invoicing_business_partner.rb', line 50 def tca_party_id @tca_party_id end |
#tca_party_number ⇒ String
TCA party number.
45 46 47 |
# File 'lib/oci/onesubscription/models/invoicing_business_partner.rb', line 45 def tca_party_number @tca_party_number end |
Class Method Details
.attribute_map ⇒ Object
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/invoicing_business_partner.rb', line 58 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'name': :'name', 'name_phonetic': :'namePhonetic', 'tca_customer_account_number': :'tcaCustomerAccountNumber', '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_types ⇒ Object
Attribute type mapping.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/oci/onesubscription/models/invoicing_business_partner.rb', line 75 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'name': :'String', 'name_phonetic': :'String', 'tca_customer_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.
170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/oci/onesubscription/models/invoicing_business_partner.rb', line 170 def ==(other) return true if equal?(other) self.class == other.class && name == other.name && name_phonetic == other.name_phonetic && tca_customer_account_number == other.tca_customer_account_number && 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 && tca_customer_account_id == other.tca_customer_account_id end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
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/invoicing_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
188 189 190 |
# File 'lib/oci/onesubscription/models/invoicing_business_partner.rb', line 188 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
197 198 199 |
# File 'lib/oci/onesubscription/models/invoicing_business_partner.rb', line 197 def hash [name, name_phonetic, tca_customer_account_number, is_public_sector, is_chain_customer, customer_chain_type, tca_party_number, tca_party_id, tca_customer_account_id].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
241 242 243 244 245 246 247 248 249 250 |
# File 'lib/oci/onesubscription/models/invoicing_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_s ⇒ String
Returns the string representation of the object
235 236 237 |
# File 'lib/oci/onesubscription/models/invoicing_business_partner.rb', line 235 def to_s to_hash.to_s end |