Class: FdxV660Api::MerchantForUpdateEntity1

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

Overview

When payee is a merchant, typically a business from which goods or services are rendered, this field will be populated

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(display_name: SKIP, name: SKIP, address: SKIP, phone: SKIP, merchant_account_ids: SKIP, additional_properties: nil) ⇒ MerchantForUpdateEntity1

Returns a new instance of MerchantForUpdateEntity1.



61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/fdx_v660_api/models/merchant_for_update_entity1.rb', line 61

def initialize(display_name: SKIP, name: SKIP, address: SKIP, phone: SKIP,
               merchant_account_ids: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @display_name = display_name unless display_name == SKIP
  @name = name unless name == SKIP
  @address = address unless address == SKIP
  @phone = phone unless phone == SKIP
  @merchant_account_ids =  unless  == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#addressDeliveryAddress2

Address of the merchant used to execute the payment

Returns:



24
25
26
# File 'lib/fdx_v660_api/models/merchant_for_update_entity1.rb', line 24

def address
  @address
end

#display_nameString

User defined name for the merchant. Used by the customer to identify the merchant. Not used by the system to process payments

Returns:

  • (String)


16
17
18
# File 'lib/fdx_v660_api/models/merchant_for_update_entity1.rb', line 16

def display_name
  @display_name
end

#merchant_account_idsArray[String]

Account identifier(s) the customer has with the merchant

Returns:

  • (Array[String])


32
33
34
# File 'lib/fdx_v660_api/models/merchant_for_update_entity1.rb', line 32

def 
  @merchant_account_ids
end

#nameCustomerNameEntity2

Name of the merchant used to execute the payment

Returns:



20
21
22
# File 'lib/fdx_v660_api/models/merchant_for_update_entity1.rb', line 20

def name
  @name
end

#phoneTelephoneNumber2

Phone number of the merchant used to execute the payment

Returns:



28
29
30
# File 'lib/fdx_v660_api/models/merchant_for_update_entity1.rb', line 28

def phone
  @phone
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/fdx_v660_api/models/merchant_for_update_entity1.rb', line 75

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  display_name = hash.key?('displayName') ? hash['displayName'] : SKIP
  name = CustomerNameEntity2.from_hash(hash['name']) if hash['name']
  address = DeliveryAddress2.from_hash(hash['address']) if hash['address']
  phone = TelephoneNumber2.from_hash(hash['phone']) if hash['phone']
   =
    hash.key?('merchantAccountIds') ? hash['merchantAccountIds'] : 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.
  MerchantForUpdateEntity1.new(display_name: display_name,
                               name: name,
                               address: address,
                               phone: phone,
                               merchant_account_ids: ,
                               additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



35
36
37
38
39
40
41
42
43
# File 'lib/fdx_v660_api/models/merchant_for_update_entity1.rb', line 35

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['display_name'] = 'displayName'
  @_hash['name'] = 'name'
  @_hash['address'] = 'address'
  @_hash['phone'] = 'phone'
  @_hash['merchant_account_ids'] = 'merchantAccountIds'
  @_hash
end

.nullablesObject

An array for nullable fields



57
58
59
# File 'lib/fdx_v660_api/models/merchant_for_update_entity1.rb', line 57

def self.nullables
  []
end

.optionalsObject

An array for optional fields



46
47
48
49
50
51
52
53
54
# File 'lib/fdx_v660_api/models/merchant_for_update_entity1.rb', line 46

def self.optionals
  %w[
    display_name
    name
    address
    phone
    merchant_account_ids
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



111
112
113
114
115
116
# File 'lib/fdx_v660_api/models/merchant_for_update_entity1.rb', line 111

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

#to_sObject

Provides a human-readable string representation of the object.



103
104
105
106
107
108
# File 'lib/fdx_v660_api/models/merchant_for_update_entity1.rb', line 103

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