Class: Seam::Clients::ConnectedAccounts

Inherits:
Object
  • Object
show all
Defined in:
lib/seam/routes/clients/connected_accounts.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:, defaults:) ⇒ ConnectedAccounts

Returns a new instance of ConnectedAccounts.



6
7
8
9
# File 'lib/seam/routes/clients/connected_accounts.rb', line 6

def initialize(client:, defaults:)
  @client = client
  @defaults = defaults
end

Instance Method Details

#delete(connected_account_id:, sync: nil) ⇒ Object



15
16
17
18
19
# File 'lib/seam/routes/clients/connected_accounts.rb', line 15

def delete(connected_account_id:, sync: nil)
  @client.post("/connected_accounts/delete", {connected_account_id: , sync: sync}.compact)

  nil
end

#get(connected_account_id: nil, email: nil) ⇒ Object



21
22
23
24
25
# File 'lib/seam/routes/clients/connected_accounts.rb', line 21

def get(connected_account_id: nil, email: nil)
  res = @client.post("/connected_accounts/get", {connected_account_id: , email: email}.compact)

  Seam::Resources::ConnectedAccount.load_from_response(res.body["connected_account"])
end

#list(custom_metadata_has: nil, customer_key: nil, limit: nil, page_cursor: nil, search: nil, user_identifier_key: nil) ⇒ Object



27
28
29
30
31
# File 'lib/seam/routes/clients/connected_accounts.rb', line 27

def list(custom_metadata_has: nil, customer_key: nil, limit: nil, page_cursor: nil, search: nil, user_identifier_key: nil)
  res = @client.post("/connected_accounts/list", {custom_metadata_has: , customer_key: customer_key, limit: limit, page_cursor: page_cursor, search: search, user_identifier_key: user_identifier_key}.compact)

  Seam::Resources::ConnectedAccount.load_from_response(res.body["connected_accounts"])
end

#simulateObject



11
12
13
# File 'lib/seam/routes/clients/connected_accounts.rb', line 11

def simulate
  @simulate ||= Seam::Clients::ConnectedAccountsSimulate.new(client: @client, defaults: @defaults)
end

#sync(connected_account_id:) ⇒ Object



33
34
35
36
37
# File 'lib/seam/routes/clients/connected_accounts.rb', line 33

def sync(connected_account_id:)
  @client.post("/connected_accounts/sync", {connected_account_id: }.compact)

  nil
end

#update(connected_account_id:, accepted_capabilities: nil, automatically_manage_new_devices: nil, custom_metadata: nil, customer_key: nil) ⇒ Object



39
40
41
42
43
# File 'lib/seam/routes/clients/connected_accounts.rb', line 39

def update(connected_account_id:, accepted_capabilities: nil, automatically_manage_new_devices: nil, custom_metadata: nil, customer_key: nil)
  @client.post("/connected_accounts/update", {connected_account_id: , accepted_capabilities: accepted_capabilities, automatically_manage_new_devices: automatically_manage_new_devices, custom_metadata: , customer_key: customer_key}.compact)

  nil
end