Class: Seam::Http::WithoutWorkspace

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of WithoutWorkspace.



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/seam/http_without_workspace.rb', line 16

def initialize(personal_access_token: nil, endpoint: nil, wait_for_action_attempt: true, timeout: nil,
  faraday_options: {}, faraday_retry_options: {})
  @wait_for_action_attempt = wait_for_action_attempt
  @defaults = {"wait_for_action_attempt" => wait_for_action_attempt}

  options = Http::Options.parse_without_workspace_options(personal_access_token: personal_access_token,
    endpoint: endpoint)
  @endpoint = options[:endpoint]
  @auth_headers = options[:auth_headers]

  @client = Http::Request.create_faraday_client(@endpoint, @auth_headers, faraday_options,
    faraday_retry_options, timeout: timeout)
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



14
15
16
# File 'lib/seam/http_without_workspace.rb', line 14

def client
  @client
end

#defaultsObject (readonly)

Returns the value of attribute defaults.



14
15
16
# File 'lib/seam/http_without_workspace.rb', line 14

def defaults
  @defaults
end

Class Method Details

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



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/seam/http_without_workspace.rb', line 34

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

Instance Method Details

#workspacesObject



30
31
32
# File 'lib/seam/http_without_workspace.rb', line 30

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