Class: FdxV660Api::PaymentInitiationPartyNameEntity

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/fdx_v660_api/models/payment_initiation_party_name_entity.rb

Overview

Generic entity that stores various names associated with a payment initiation party. Japanese participants should send 'Kana' values in name fields using the character set defined by Zengin (Japanese Banks' Payment Clearing Network)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(alias_name: SKIP, detail: SKIP, additional_properties: nil) ⇒ PaymentInitiationPartyNameEntity

Returns a new instance of PaymentInitiationPartyNameEntity.



44
45
46
47
48
49
50
51
# File 'lib/fdx_v660_api/models/payment_initiation_party_name_entity.rb', line 44

def initialize(alias_name: SKIP, detail: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @alias_name = alias_name unless alias_name == SKIP
  @detail = detail unless detail == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#alias_nameString

Alias name

Returns:

  • (String)


17
18
19
# File 'lib/fdx_v660_api/models/payment_initiation_party_name_entity.rb', line 17

def alias_name
  @alias_name
end

#detailObject

Details of the name

Returns:

  • (Object)


21
22
23
# File 'lib/fdx_v660_api/models/payment_initiation_party_name_entity.rb', line 21

def detail
  @detail
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/fdx_v660_api/models/payment_initiation_party_name_entity.rb', line 54

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  alias_name = hash.key?('aliasName') ? hash['aliasName'] : SKIP
  detail = hash.key?('detail') ? APIHelper.deserialize_union_type(
    UnionTypeLookUp.get(:PaymentInitiationPartyNameEntityDetail), hash['detail']
  ) : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  PaymentInitiationPartyNameEntity.new(alias_name: alias_name,
                                       detail: detail,
                                       additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



24
25
26
27
28
29
# File 'lib/fdx_v660_api/models/payment_initiation_party_name_entity.rb', line 24

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['alias_name'] = 'aliasName'
  @_hash['detail'] = 'detail'
  @_hash
end

.nullablesObject

An array for nullable fields



40
41
42
# File 'lib/fdx_v660_api/models/payment_initiation_party_name_entity.rb', line 40

def self.nullables
  []
end

.optionalsObject

An array for optional fields



32
33
34
35
36
37
# File 'lib/fdx_v660_api/models/payment_initiation_party_name_entity.rb', line 32

def self.optionals
  %w[
    alias_name
    detail
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



78
79
80
81
82
83
84
# File 'lib/fdx_v660_api/models/payment_initiation_party_name_entity.rb', line 78

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



94
95
96
97
98
# File 'lib/fdx_v660_api/models/payment_initiation_party_name_entity.rb', line 94

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} alias_name: #{@alias_name.inspect}, detail: #{@detail.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



87
88
89
90
91
# File 'lib/fdx_v660_api/models/payment_initiation_party_name_entity.rb', line 87

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} alias_name: #{@alias_name}, detail: #{@detail}, additional_properties:"\
  " #{@additional_properties}>"
end