Sha256: d0bf98d3e286fef2d416d1f5423922cdc75c97ece139a63b2d12d93174cbdd59

Contents?: true

Size: 982 Bytes

Versions: 763

Compression:

Stored size: 982 Bytes

Contents

# frozen_string_literal: true

module TencentCloud
  module Common
    # common credential
    class Credential
      attr_accessor :secret_id, :secret_key, :token

      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
    end
  end
end

Version data entries

763 entries across 763 versions & 1 rubygems

Version Path
tencentcloud-sdk-common-3.0.935 lib/tencentcloud-sdk-common/credential.rb
tencentcloud-sdk-common-3.0.934 lib/tencentcloud-sdk-common/credential.rb
tencentcloud-sdk-common-3.0.933 lib/tencentcloud-sdk-common/credential.rb
tencentcloud-sdk-common-3.0.932 lib/tencentcloud-sdk-common/credential.rb
tencentcloud-sdk-common-3.0.931 lib/tencentcloud-sdk-common/credential.rb
tencentcloud-sdk-common-3.0.930 lib/tencentcloud-sdk-common/credential.rb
tencentcloud-sdk-common-3.0.929 lib/tencentcloud-sdk-common/credential.rb
tencentcloud-sdk-common-3.0.928 lib/tencentcloud-sdk-common/credential.rb
tencentcloud-sdk-common-3.0.927 lib/tencentcloud-sdk-common/credential.rb
tencentcloud-sdk-common-3.0.926 lib/tencentcloud-sdk-common/credential.rb
tencentcloud-sdk-common-3.0.925 lib/tencentcloud-sdk-common/credential.rb
tencentcloud-sdk-common-3.0.924 lib/tencentcloud-sdk-common/credential.rb
tencentcloud-sdk-common-3.0.923 lib/tencentcloud-sdk-common/credential.rb
tencentcloud-sdk-common-3.0.922 lib/tencentcloud-sdk-common/credential.rb
tencentcloud-sdk-common-3.0.921 lib/tencentcloud-sdk-common/credential.rb
tencentcloud-sdk-common-3.0.920 lib/tencentcloud-sdk-common/credential.rb
tencentcloud-sdk-common-3.0.919 lib/tencentcloud-sdk-common/credential.rb
tencentcloud-sdk-common-3.0.918 lib/tencentcloud-sdk-common/credential.rb
tencentcloud-sdk-common-3.0.917 lib/tencentcloud-sdk-common/credential.rb
tencentcloud-sdk-common-3.0.916 lib/tencentcloud-sdk-common/credential.rb