Class: Seam::Http::MultiWorkspace

Inherits:
Object
  • Object
show all
Defined in:
lib/seam/http_multi_workspace.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(personal_access_token:, endpoint: nil, wait_for_action_attempt: true, faraday_options: {}, faraday_retry_options: {}) ⇒ MultiWorkspace

Returns a new instance of MultiWorkspace.



17
18
19
20
21
22
23
24
25
# File 'lib/seam/http_multi_workspace.rb', line 17

def initialize(personal_access_token:, endpoint: nil, wait_for_action_attempt: true, faraday_options: {},
  faraday_retry_options: {})
  @wait_for_action_attempt = wait_for_action_attempt
  @defaults = {"wait_for_action_attempt" => wait_for_action_attempt}
  @endpoint = Http::Options.get_endpoint(endpoint)
  @auth_headers = Http::Auth.get_auth_headers_for_multi_workspace_personal_access_token(personal_access_token)
  @client = Http::Request.create_faraday_client(@endpoint, @auth_headers, faraday_options,
    faraday_retry_options)
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



15
16
17
# File 'lib/seam/http_multi_workspace.rb', line 15

def client
  @client
end

#defaultsObject (readonly)

Returns the value of attribute defaults.



15
16
17
# File 'lib/seam/http_multi_workspace.rb', line 15

def defaults
  @defaults
end

Class Method Details

.from_personal_access_token(personal_access_token, endpoint: nil, wait_for_action_attempt: true, faraday_options: {}, faraday_retry_options: {}) ⇒ Object



39
40
41
42
43
44
45
46
47
# File 'lib/seam/http_multi_workspace.rb', line 39

def self.from_personal_access_token(personal_access_token, endpoint: nil, wait_for_action_attempt: true, faraday_options: {}, faraday_retry_options: {})
  new(
    personal_access_token: personal_access_token,
    endpoint: endpoint,
    wait_for_action_attempt: wait_for_action_attempt,
    faraday_options: faraday_options,
    faraday_retry_options: faraday_retry_options
  )
end

.lts_versionObject



27
28
29
# File 'lib/seam/http_multi_workspace.rb', line 27

def self.lts_version
  Seam::LTS_VERSION
end

Instance Method Details

#lts_versionObject



31
32
33
# File 'lib/seam/http_multi_workspace.rb', line 31

def lts_version
  Seam::LTS_VERSION
end

#workspacesObject



35
36
37
# File 'lib/seam/http_multi_workspace.rb', line 35

def workspaces
  @workspaces ||= WorkspacesProxy.new(Seam::Clients::Workspaces.new(client: @client, defaults: @defaults))
end