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



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

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



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

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_ids: nil, limit: nil, page_cursor: nil, user_identifier_key: nil) ⇒ Object



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

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

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

#sync(connected_account_id:) ⇒ Object



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

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

  nil
end

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



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

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

  nil
end