Class: CredentialSummary

Inherits:
Object
  • Object
show all
Includes:
Thrift::Struct, Thrift::Struct_Union
Defined in:
lib/credential_store_data_models_types.rb

Constant Summary collapse

TYPE =
1
GATEWAYID =
2
USERNAME =
3
PUBLICKEY =
4
PERSISTEDTIME =
5
TOKEN =
6
DESCRIPTION =
7
FIELDS =
{
  TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :enum_class => ::SummaryType},
  GATEWAYID => {:type => ::Thrift::Types::STRING, :name => 'gatewayId'},
  # The username corresponds to the Credential's `portalUserName` which is the username of the user that
# created the credential.
  USERNAME => {:type => ::Thrift::Types::STRING, :name => 'username'},
  PUBLICKEY => {:type => ::Thrift::Types::STRING, :name => 'publicKey', :optional => true},
  PERSISTEDTIME => {:type => ::Thrift::Types::I64, :name => 'persistedTime', :optional => true},
  TOKEN => {:type => ::Thrift::Types::STRING, :name => 'token'},
  DESCRIPTION => {:type => ::Thrift::Types::STRING, :name => 'description', :optional => true}
}

Instance Method Summary collapse

Instance Method Details

#struct_fieldsObject



71
# File 'lib/credential_store_data_models_types.rb', line 71

def struct_fields; FIELDS; end

#validateObject

Raises:

  • (::Thrift::ProtocolException)


73
74
75
76
77
78
79
80
81
# File 'lib/credential_store_data_models_types.rb', line 73

def validate
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field type is unset!') unless @type
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field gatewayId is unset!') unless @gatewayId
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field username is unset!') unless @username
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field token is unset!') unless @token
  unless @type.nil? || ::SummaryType::VALID_VALUES.include?(@type)
    raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!')
  end
end