Class: Infrawrench::AuthNamespace

Inherits:
Object
  • Object
show all
Defined in:
lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs

Overview

client.auth

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ AuthNamespace

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of AuthNamespace.

Parameters:



777
778
779
# File 'lib/infrawrench/client.rb', line 777

def initialize(transport)
  @transport = transport
end

Instance Method Details

#me(request_options: nil) ⇒ Hash

Current session + onboarding status

GET /api/auth/me

Raises on 401: Unauthenticated

Parameters:

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as Session — see sig/infrawrench/sdk.rbs.

Raises:



790
791
792
793
794
795
796
# File 'lib/infrawrench/client.rb', line 790

def me(request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/auth/me",
    request_options: request_options
  )
end

#orgs(request_options: nil) ⇒ Array<Hash>

Organizations the current user belongs to

GET /api/auth/orgs

Raises on 401: Unauthenticated

Parameters:

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Array<Hash>)

    Parsed JSON, shaped as Array<OrgMembership> — see sig/infrawrench/sdk.rbs.

Raises:



808
809
810
811
812
813
814
# File 'lib/infrawrench/client.rb', line 808

def orgs(request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/auth/orgs",
    request_options: request_options
  )
end