Class: ThePlaidApi::SandboxTransferLedgerSimulateAvailableRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/sandbox_transfer_ledger_simulate_available_request.rb

Overview

Defines the request schema for ‘/sandbox/transfer/ledger/simulate_available`

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(client_id: SKIP, secret: SKIP, ledger_id: SKIP, originator_client_id: SKIP, test_clock_id: SKIP, webhook: SKIP, additional_properties: nil) ⇒ SandboxTransferLedgerSimulateAvailableRequest

Returns a new instance of SandboxTransferLedgerSimulateAvailableRequest.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/the_plaid_api/models/sandbox_transfer_ledger_simulate_available_request.rb', line 78

def initialize(client_id: SKIP, secret: SKIP, ledger_id: SKIP,
               originator_client_id: SKIP, test_clock_id: SKIP,
               webhook: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @client_id = client_id unless client_id == SKIP
  @secret = secret unless secret == SKIP
  @ledger_id = ledger_id unless ledger_id == SKIP
  @originator_client_id = originator_client_id unless originator_client_id == SKIP
  @test_clock_id = test_clock_id unless test_clock_id == SKIP
  @webhook = webhook unless webhook == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#client_idString

Your Plaid API ‘client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body.

Returns:

  • (String)


16
17
18
# File 'lib/the_plaid_api/models/sandbox_transfer_ledger_simulate_available_request.rb', line 16

def client_id
  @client_id
end

#ledger_idString

Specify which ledger balance to simulate converting pending balance to available balance. If this field is left blank, this will default to id of the default ledger balance.

Returns:

  • (String)


27
28
29
# File 'lib/the_plaid_api/models/sandbox_transfer_ledger_simulate_available_request.rb', line 27

def ledger_id
  @ledger_id
end

#originator_client_idString

Client ID of the end customer (i.e. the originator). Only applicable to Transfer for Platforms customers.

Returns:

  • (String)


32
33
34
# File 'lib/the_plaid_api/models/sandbox_transfer_ledger_simulate_available_request.rb', line 32

def originator_client_id
  @originator_client_id
end

#secretString

Your Plaid API ‘secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body.

Returns:

  • (String)


21
22
23
# File 'lib/the_plaid_api/models/sandbox_transfer_ledger_simulate_available_request.rb', line 21

def secret
  @secret
end

#test_clock_idString

Plaid’s unique identifier for a test clock. If provided, only the pending balance that is due before the ‘virtual_timestamp` on the test clock will be converted.

Returns:

  • (String)


38
39
40
# File 'lib/the_plaid_api/models/sandbox_transfer_ledger_simulate_available_request.rb', line 38

def test_clock_id
  @test_clock_id
end

#webhookString

The webhook URL to which a ‘TRANSFER_EVENTS_UPDATE` webhook should be sent.

Returns:

  • (String)


43
44
45
# File 'lib/the_plaid_api/models/sandbox_transfer_ledger_simulate_available_request.rb', line 43

def webhook
  @webhook
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/the_plaid_api/models/sandbox_transfer_ledger_simulate_available_request.rb', line 94

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  client_id = hash.key?('client_id') ? hash['client_id'] : SKIP
  secret = hash.key?('secret') ? hash['secret'] : SKIP
  ledger_id = hash.key?('ledger_id') ? hash['ledger_id'] : SKIP
  originator_client_id =
    hash.key?('originator_client_id') ? hash['originator_client_id'] : SKIP
  test_clock_id = hash.key?('test_clock_id') ? hash['test_clock_id'] : SKIP
  webhook = hash.key?('webhook') ? hash['webhook'] : 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.
  SandboxTransferLedgerSimulateAvailableRequest.new(client_id: client_id,
                                                    secret: secret,
                                                    ledger_id: ledger_id,
                                                    originator_client_id: originator_client_id,
                                                    test_clock_id: test_clock_id,
                                                    webhook: webhook,
                                                    additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



46
47
48
49
50
51
52
53
54
55
# File 'lib/the_plaid_api/models/sandbox_transfer_ledger_simulate_available_request.rb', line 46

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['client_id'] = 'client_id'
  @_hash['secret'] = 'secret'
  @_hash['ledger_id'] = 'ledger_id'
  @_hash['originator_client_id'] = 'originator_client_id'
  @_hash['test_clock_id'] = 'test_clock_id'
  @_hash['webhook'] = 'webhook'
  @_hash
end

.nullablesObject

An array for nullable fields



70
71
72
73
74
75
76
# File 'lib/the_plaid_api/models/sandbox_transfer_ledger_simulate_available_request.rb', line 70

def self.nullables
  %w[
    ledger_id
    originator_client_id
    test_clock_id
  ]
end

.optionalsObject

An array for optional fields



58
59
60
61
62
63
64
65
66
67
# File 'lib/the_plaid_api/models/sandbox_transfer_ledger_simulate_available_request.rb', line 58

def self.optionals
  %w[
    client_id
    secret
    ledger_id
    originator_client_id
    test_clock_id
    webhook
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



132
133
134
135
136
137
138
# File 'lib/the_plaid_api/models/sandbox_transfer_ledger_simulate_available_request.rb', line 132

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id.inspect}, secret: #{@secret.inspect}, ledger_id:"\
  " #{@ledger_id.inspect}, originator_client_id: #{@originator_client_id.inspect},"\
  " test_clock_id: #{@test_clock_id.inspect}, webhook: #{@webhook.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



124
125
126
127
128
129
# File 'lib/the_plaid_api/models/sandbox_transfer_ledger_simulate_available_request.rb', line 124

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id}, secret: #{@secret}, ledger_id: #{@ledger_id},"\
  " originator_client_id: #{@originator_client_id}, test_clock_id: #{@test_clock_id}, webhook:"\
  " #{@webhook}, additional_properties: #{@additional_properties}>"
end