Class: ThePlaidApi::PartnerEndCustomerOauthStatusUpdatedWebhook

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

Overview

The webhook of type ‘PARTNER` and code `END_CUSTOMER_OAUTH_STATUS_UPDATED` will be fired when a partner’s end customer has an update on their OAuth registration status with an institution.

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(webhook_type:, webhook_code:, end_customer_client_id:, environment:, institution_id:, institution_name:, status:, additional_properties: nil) ⇒ PartnerEndCustomerOauthStatusUpdatedWebhook

Returns a new instance of PartnerEndCustomerOauthStatusUpdatedWebhook.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/the_plaid_api/models/partner_end_customer_oauth_status_updated_webhook.rb', line 65

def initialize(webhook_type:, webhook_code:, end_customer_client_id:,
               environment:, institution_id:, institution_name:, status:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @webhook_type = webhook_type
  @webhook_code = webhook_code
  @end_customer_client_id = end_customer_client_id
  @environment = environment
  @institution_id = institution_id
  @institution_name = institution_name
  @status = status
  @additional_properties = additional_properties
end

Instance Attribute Details

#end_customer_client_idString

The client ID of the end customer

Returns:

  • (String)


24
25
26
# File 'lib/the_plaid_api/models/partner_end_customer_oauth_status_updated_webhook.rb', line 24

def end_customer_client_id
  @end_customer_client_id
end

#environmentWebhookEnvironmentValues

The Plaid environment the webhook was sent from



28
29
30
# File 'lib/the_plaid_api/models/partner_end_customer_oauth_status_updated_webhook.rb', line 28

def environment
  @environment
end

#institution_idString

The institution ID

Returns:

  • (String)


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

def institution_id
  @institution_id
end

#institution_nameString

The institution name

Returns:

  • (String)


36
37
38
# File 'lib/the_plaid_api/models/partner_end_customer_oauth_status_updated_webhook.rb', line 36

def institution_name
  @institution_name
end

#statusPartnerEndCustomerOauthStatusUpdatedValues

The OAuth status of the update



40
41
42
# File 'lib/the_plaid_api/models/partner_end_customer_oauth_status_updated_webhook.rb', line 40

def status
  @status
end

#webhook_codeString

‘END_CUSTOMER_OAUTH_STATUS_UPDATED`

Returns:

  • (String)


20
21
22
# File 'lib/the_plaid_api/models/partner_end_customer_oauth_status_updated_webhook.rb', line 20

def webhook_code
  @webhook_code
end

#webhook_typeString

‘PARTNER`

Returns:

  • (String)


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

def webhook_type
  @webhook_type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/the_plaid_api/models/partner_end_customer_oauth_status_updated_webhook.rb', line 82

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  webhook_type = hash.key?('webhook_type') ? hash['webhook_type'] : nil
  webhook_code = hash.key?('webhook_code') ? hash['webhook_code'] : nil
  end_customer_client_id =
    hash.key?('end_customer_client_id') ? hash['end_customer_client_id'] : nil
  environment = hash.key?('environment') ? hash['environment'] : nil
  institution_id =
    hash.key?('institution_id') ? hash['institution_id'] : nil
  institution_name =
    hash.key?('institution_name') ? hash['institution_name'] : nil
  status = hash.key?('status') ? hash['status'] : nil

  # 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.
  PartnerEndCustomerOauthStatusUpdatedWebhook.new(webhook_type: webhook_type,
                                                  webhook_code: webhook_code,
                                                  end_customer_client_id: end_customer_client_id,
                                                  environment: environment,
                                                  institution_id: institution_id,
                                                  institution_name: institution_name,
                                                  status: status,
                                                  additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



43
44
45
46
47
48
49
50
51
52
53
# File 'lib/the_plaid_api/models/partner_end_customer_oauth_status_updated_webhook.rb', line 43

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['webhook_type'] = 'webhook_type'
  @_hash['webhook_code'] = 'webhook_code'
  @_hash['end_customer_client_id'] = 'end_customer_client_id'
  @_hash['environment'] = 'environment'
  @_hash['institution_id'] = 'institution_id'
  @_hash['institution_name'] = 'institution_name'
  @_hash['status'] = 'status'
  @_hash
end

.nullablesObject

An array for nullable fields



61
62
63
# File 'lib/the_plaid_api/models/partner_end_customer_oauth_status_updated_webhook.rb', line 61

def self.nullables
  []
end

.optionalsObject

An array for optional fields



56
57
58
# File 'lib/the_plaid_api/models/partner_end_customer_oauth_status_updated_webhook.rb', line 56

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



125
126
127
128
129
130
131
132
# File 'lib/the_plaid_api/models/partner_end_customer_oauth_status_updated_webhook.rb', line 125

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} webhook_type: #{@webhook_type.inspect}, webhook_code:"\
  " #{@webhook_code.inspect}, end_customer_client_id: #{@end_customer_client_id.inspect},"\
  " environment: #{@environment.inspect}, institution_id: #{@institution_id.inspect},"\
  " institution_name: #{@institution_name.inspect}, status: #{@status.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



116
117
118
119
120
121
122
# File 'lib/the_plaid_api/models/partner_end_customer_oauth_status_updated_webhook.rb', line 116

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} webhook_type: #{@webhook_type}, webhook_code: #{@webhook_code},"\
  " end_customer_client_id: #{@end_customer_client_id}, environment: #{@environment},"\
  " institution_id: #{@institution_id}, institution_name: #{@institution_name}, status:"\
  " #{@status}, additional_properties: #{@additional_properties}>"
end