Class: Aws::Crt::Auth::CredentialsOptions
- Inherits:
-
Object
- Object
- Aws::Crt::Auth::CredentialsOptions
- Includes:
- ManagedNative
- Defined in:
- lib/aws-crt/auth/credentials.rb
Overview
CRT CredentialOptions
Constant Summary collapse
- UINT64_MAX =
18_446_744_073_709_551_615
Instance Method Summary collapse
-
#initialize(access_key_id, secret_access_key, session_token = nil, expiration = nil) ⇒ CredentialsOptions
constructor
A new instance of CredentialsOptions.
Methods included from ManagedNative
included, #manage_native, #native, #native_set?, #release
Constructor Details
#initialize(access_key_id, secret_access_key, session_token = nil, expiration = nil) ⇒ CredentialsOptions
Returns a new instance of CredentialsOptions.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/aws-crt/auth/credentials.rb', line 18 def initialize(access_key_id, secret_access_key, session_token = nil, expiration = nil) if !access_key_id || access_key_id.empty? raise ArgumentError, 'access_key_id must be set' end if !secret_access_key || secret_access_key.empty? raise ArgumentError, 'secret_access_key must be set' end manage_native do Aws::Crt::Native. end Aws::Crt::Native.( native, access_key_id, access_key_id.length ) Aws::Crt::Native.( native, secret_access_key, secret_access_key.length ) if session_token && !session_token.empty? Aws::Crt::Native.( native, session_token, session_token.length ) end Aws::Crt::Native.( native, expiration&.to_i || UINT64_MAX ) end |