Class: BtpsClient::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/btps_client/client.rb

Overview

User-facing entry point. Instantiate with per-client config overrides or rely on the global BtpsClient.configure block.

Instance Method Summary collapse

Constructor Details

#initialize(**opts) ⇒ Client

Returns a new instance of Client.



7
8
9
10
# File 'lib/btps_client/client.rb', line 7

def initialize(**opts)
  base    = BtpsClient.configuration.to_h
  @config = Configuration.new(base.merge(opts))
end

Instance Method Details

#authObject

Returns the AuthService for sign-in, sign-out, and OAuth token acquisition.



18
19
20
# File 'lib/btps_client/client.rb', line 18

def auth
  @auth ||= Services::AuthService.new(@config)
end

#credentialsObject

Returns the CredentialsService.



33
34
35
# File 'lib/btps_client/client.rb', line 33

def credentials
  @credentials ||= Services::CredentialsService.new(@config)
end

#managed_accountsObject

Returns the ManagedAccountsService.



23
24
25
# File 'lib/btps_client/client.rb', line 23

def managed_accounts
  @managed_accounts ||= Services::ManagedAccountsService.new(@config)
end

#requestsObject

Returns the RequestsService.



28
29
30
# File 'lib/btps_client/client.rb', line 28

def requests
  @requests ||= Services::RequestsService.new(@config)
end

#secrets_safeObject

Returns the SecretsSafeService aggregator (folders / safes / secrets).



13
14
15
# File 'lib/btps_client/client.rb', line 13

def secrets_safe
  @secrets_safe ||= Services::SecretsSafeService.new(@config)
end