Sha256: c07aabfa88b0205256f478a690703b57ec2b04f73bc6290ff9cfc8a6bb03c25b

Contents?: true

Size: 1.3 KB

Versions: 12

Compression:

Stored size: 1.3 KB

Contents

# frozen_string_literal: true

module Seam
  module Clients
    class ConnectedAccounts
      def initialize(client:, defaults:)
        @client = client
        @defaults = defaults
      end

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

        nil
      end

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

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

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

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

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

        nil
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
seam-2.3.0 lib/seam/routes/clients/connected_accounts.rb
seam-2.2.0 lib/seam/routes/clients/connected_accounts.rb
seam-2.1.0 lib/seam/routes/clients/connected_accounts.rb
seam-2.0.1 lib/seam/routes/clients/connected_accounts.rb
seam-2.0.0 lib/seam/routes/clients/connected_accounts.rb
seam-2.0.0rc0 lib/seam/routes/clients/connected_accounts.rb
seam-2.0.0b5 lib/seam/routes/clients/connected_accounts.rb
seam-2.0.0b4 lib/seam/routes/clients/connected_accounts.rb
seam-2.0.0b3 lib/seam/routes/clients/connected_accounts.rb
seam-2.0.0b2 lib/seam/routes/clients/connected_accounts.rb
seam-2.0.0b1 lib/seam/routes/clients/connected_accounts.rb
seam-2.0.0b0 lib/seam/routes/clients/connected_accounts.rb