seamapi 0.0.4 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb9b5fc62548919c49b3e041cd434e724c29174a1daa15ad736185f7eb689a2c
4
- data.tar.gz: 3a9177165da484078b1a14f54afc3846da4757809527c188b3453c936eb40d41
3
+ metadata.gz: b75624031efa404f2e8e77741924bd65f2ab53c1f863c5ce284af9c256fc7037
4
+ data.tar.gz: 1a305eb6484a18a3dcd2a97a2fa9750d7ebb6617ddcc27995141b72c105390bb
5
5
  SHA512:
6
- metadata.gz: d4f042c9d1f59f9eed7df5d769f693776f0627f85172515cc59bace00e6b0cbb4253767b6da114221fd66e92c847ab38de511ae4b2d3c5f3364a2d0cd325b729
7
- data.tar.gz: 18791847ad1ac03910091bdf4a4525b9ac9cd86515bf0b169ad0d9c41e7d01beca978efe9bf642d5bd3545c9c90cf0e86fd2cfc5d2a042e687a48cd29babe855
6
+ metadata.gz: 24a3e47f02c7b3b919858c685b3699c52bf729d699fec20f0f007f50d9b5d8da60aaafaea5ee7d1d85dc5fffee5f0efb56b572e0c23fb386608255f0dda7756e
7
+ data.tar.gz: 1cb2af2c236959d902695a830f78b8db65725a30545a3f544062a1a2c6b01b1748a9f0bfdaaf55325d2a2c853fd69f71efdc9cc38c8b095d1e9584157de2a4e6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- seamapi (0.0.4)
4
+ seamapi (0.1.0)
5
5
  http (~> 5.0.0)
6
6
 
7
7
  GEM
data/lib/seam/client.rb CHANGED
@@ -4,10 +4,12 @@ module Seam
4
4
  class Client
5
5
  attr_accessor :api_key, :base_uri, :debug
6
6
 
7
- def initialize(api_key:, base_uri: "https://connect.getseam.com", debug: false)
8
- @api_key = api_key
7
+ def initialize(api_key: nil, base_uri: "https://connect.getseam.com", debug: false)
8
+ @api_key = api_key || ENV.fetch("SEAM_API_KEY", nil)
9
9
  @base_uri = base_uri
10
10
  @debug = debug
11
+
12
+ raise ArgumentError, "SEAM_API_KEY not found in environment, and api_key not provided" unless @api_key
11
13
  end
12
14
 
13
15
  def health
@@ -3,13 +3,29 @@
3
3
  module Seam
4
4
  module Clients
5
5
  class ConnectedAccounts < BaseClient
6
- def get(connected_account_id = nil)
6
+ def get(connected_account_id_or_params)
7
+ params = if connected_account_id_or_params.is_a?(String)
8
+ { connected_account_id: connected_account_id_or_params }
9
+ else
10
+ connected_account_id_or_params
11
+ end
12
+
7
13
  request_seam_object(
8
14
  :get,
9
15
  "/connected_accounts/get",
10
16
  Seam::ConnectedAccount,
11
17
  "connected_account",
12
- params: { connected_account_id: connected_account_id }
18
+ params: params
19
+ )
20
+ end
21
+
22
+ def list(params = {})
23
+ request_seam_object(
24
+ :get,
25
+ "/connected_accounts/list",
26
+ Seam::ConnectedAccount,
27
+ "connected_accounts",
28
+ params: params
13
29
  )
14
30
  end
15
31
  end
@@ -2,9 +2,9 @@
2
2
 
3
3
  module Seam
4
4
  class ConnectWebview < BaseResource
5
- attr_accessor :connect_webview_id, :custom_redirect_url, :url, :workspace_id, :device_selection_mode,
6
- :accepted_providers, :accepted_devices, :any_provider_allowed, :any_device_allowed,
7
- :login_successful, :status
5
+ attr_accessor :connect_webview_id, :custom_redirect_url, :custom_redirect_failure_url, :url,
6
+ :workspace_id, :device_selection_mode, :accepted_providers, :accepted_devices,
7
+ :any_provider_allowed, :any_device_allowed, :login_successful, :status
8
8
 
9
9
  date_accessor :created_at
10
10
  end
data/lib/seam/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Seam
4
- VERSION = "0.0.4"
4
+ VERSION = "0.1.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seamapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abimael Martell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-26 00:00:00.000000000 Z
11
+ date: 2022-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http