Class: TencentCloud::Common::Credential
- Inherits:
-
Object
- Object
- TencentCloud::Common::Credential
- Defined in:
- lib/tencentcloud-sdk-common/credential.rb
Overview
common credential
Instance Attribute Summary collapse
-
#secret_id ⇒ Object
Returns the value of attribute secret_id.
-
#secret_key ⇒ Object
Returns the value of attribute secret_key.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
- #credential ⇒ Object
-
#initialize(secret_id, secret_key, token = nil) ⇒ Credential
constructor
A new instance of Credential.
Constructor Details
#initialize(secret_id, secret_key, token = nil) ⇒ Credential
Returns a new instance of Credential.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/tencentcloud-sdk-common/credential.rb', line 9 def initialize(secret_id, secret_key, token = nil) if secret_id.nil? || secret_id.strip.empty? raise TencentCloudSDKException.new('InvalidCredential', 'secret id should not be none or empty') elsif secret_id.strip != secret_id raise TencentCloudSDKException.new('InvalidCredential', 'secret id should not contain spaces') end @secret_id = secret_id if secret_key.nil? || secret_key.strip.empty? raise TencentCloudSDKException.new('InvalidCredential', 'secret id should not be none or empty') elsif secret_key.strip != secret_key raise TencentCloudSDKException.new('InvalidCredential', 'secret id should not contain spaces') end @secret_key = secret_key @token = token end |
Instance Attribute Details
#secret_id ⇒ Object
Returns the value of attribute secret_id.
7 8 9 |
# File 'lib/tencentcloud-sdk-common/credential.rb', line 7 def secret_id @secret_id end |
#secret_key ⇒ Object
Returns the value of attribute secret_key.
7 8 9 |
# File 'lib/tencentcloud-sdk-common/credential.rb', line 7 def secret_key @secret_key end |
#token ⇒ Object
Returns the value of attribute token.
7 8 9 |
# File 'lib/tencentcloud-sdk-common/credential.rb', line 7 def token @token end |
Instance Method Details
#credential ⇒ Object
28 29 30 |
# File 'lib/tencentcloud-sdk-common/credential.rb', line 28 def credential [@secret_id, @secret_key, @token] end |