Class: ThePlaidApi::PartnerEndCustomer

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

Overview

The details for an end customer.

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, company_name: SKIP, status: SKIP, additional_properties: nil) ⇒ PartnerEndCustomer

Returns a new instance of PartnerEndCustomer.



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

def initialize(client_id: SKIP, company_name: SKIP, status: 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
  @company_name = company_name unless company_name == SKIP
  @status = status unless status == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#client_idString

The ‘client_id` of the end customer.

Returns:

  • (String)


14
15
16
# File 'lib/the_plaid_api/models/partner_end_customer.rb', line 14

def client_id
  @client_id
end

#company_nameString

The company name associated with the end customer.

Returns:

  • (String)


18
19
20
# File 'lib/the_plaid_api/models/partner_end_customer.rb', line 18

def company_name
  @company_name
end

#statusPartnerEndCustomerStatus

The status of the given end customer. ‘UNDER_REVIEW`: The end customer has been created and enabled in the Sandbox environment. The end customer must be manually reviewed by the Plaid team before it can be enabled in Production, at which point its status will automatically transition to `PENDING_ENABLEMENT` or `DENIED`. `PENDING_ENABLEMENT`: The end customer is ready to be fully enabled in the Production environment. Call the `/partner/customer/enable` endpoint to enable the end customer in full Production. `ACTIVE`: The end customer has been fully enabled in all environments. `DENIED`: The end customer has been created and enabled in the Sandbox environment, but it did not pass review by the Plaid team and therefore cannot be enabled for Production access. Talk to your Account Manager for more information.



34
35
36
# File 'lib/the_plaid_api/models/partner_end_customer.rb', line 34

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/the_plaid_api/models/partner_end_customer.rb', line 71

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  client_id = hash.key?('client_id') ? hash['client_id'] : SKIP
  company_name = hash.key?('company_name') ? hash['company_name'] : SKIP
  status = hash.key?('status') ? hash['status'] : 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.
  PartnerEndCustomer.new(client_id: client_id,
                         company_name: company_name,
                         status: status,
                         additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



37
38
39
40
41
42
43
# File 'lib/the_plaid_api/models/partner_end_customer.rb', line 37

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['client_id'] = 'client_id'
  @_hash['company_name'] = 'company_name'
  @_hash['status'] = 'status'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/the_plaid_api/models/partner_end_customer.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



46
47
48
49
50
51
52
# File 'lib/the_plaid_api/models/partner_end_customer.rb', line 46

def self.optionals
  %w[
    client_id
    company_name
    status
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



101
102
103
104
105
# File 'lib/the_plaid_api/models/partner_end_customer.rb', line 101

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

#to_sObject

Provides a human-readable string representation of the object.



94
95
96
97
98
# File 'lib/the_plaid_api/models/partner_end_customer.rb', line 94

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