API reference
API reference
Select your platform
No SDKs available
No versions available

ParameterProvider Class

Resolves parameters for invoking callbacks. This can be derived to support additional parameter types.
Meta::Conduit::ParameterProvider extends Meta.Conduit.IParameterProvider.

Overview

Data Fields

const string
const string
List< string >
The list of the names of all parameters in the provider.

Object Data

readonly Dictionary< string, object >
Maps the parameters to their supplied values. The keys are normalized to lowercase.

Public Member Functions

void
AddCustomType
( string name,
Type type )
Add a custom known type (typically enum) to the provider. This should be called BEFORE calling any of the population methods.
void
AddParameter
( string parameterName,
object value )
Explicitly adds, or replaces, a parameter.
void
Extracts Conduit parameters from a Wit.Ai response.
void
SetSpecializedParameter
( string reservedParameterName,
Type parameterType )
Registers a certain keyword as reserved for a specialized parameter.
void
PopulateParameters
( Dictionary< string, ConduitParameterValue > actualParameters )
Populates the parameters. Must be called after all parameters have been obtained and mapped but before any are read.
void
PopulateRoles
( Dictionary< string, string > parameterToRoleMap )
Populates the roles mappings between actual parameters and their roles.. Must be called after all parameters have been populated using PopulateParameters but before any are read.
bool
ContainsParameter
( ParameterInfo parameter,
StringBuilder log )
Returns true if a parameter with the specified name can be provided.
object
GetRawParameterValue
( string parameterName )
object
GetParameterValue
( ParameterInfo formalParameter,
Dictionary< string, string > parameterMap,
bool relaxed )
Provides the actual parameter value matching the supplied formal parameter.
T
GetParameterValue< T >
( string parameterName,
Dictionary< string, string > parameterMap,
bool relaxed )
Provides the actual parameter value matching the supplied formal parameter.
List< string >
GetParameterNamesOfType
( Type targetType )
Returns a list of parameter names that hold values of the specified type. Note: This is an expensive operation.
override string

Object Data

bool
SupportedSpecializedParameter
( ParameterInfo formalParameter )
Returns true if the specified parameter can be resolved. GetSpecializedParameter must be able to return a valid value if this method returns true.
object
GetSpecializedParameter
( ParameterInfo formalParameter )
Returns the value of the specified parameter.

Details

Fields

const string Meta.Conduit.ParameterProvider.WitResponseNodeReservedName
No description available.
const string Meta.Conduit.ParameterProvider.VoiceSessionReservedName
No description available.
List<string> Meta.Conduit.ParameterProvider.AllParameterNames
The list of the names of all parameters in the provider.

Object Data

readonly Dictionary<string, object> Meta.Conduit.ParameterProvider.ActualParameters
Maps the parameters to their supplied values. The keys are normalized to lowercase.

Member Functions

void Meta.Conduit.ParameterProvider.AddCustomType
( string name,
Type type )
Add a custom known type (typically enum) to the provider. This should be called BEFORE calling any of the population methods.
Parameters
name
The internal name of the type.
type
The data type.
void Meta.Conduit.ParameterProvider.AddParameter
( string parameterName,
object value )
Explicitly adds, or replaces, a parameter.
Parameters
parameterName
The parameter name.
value
The parameter value.
void Meta.Conduit.ParameterProvider.PopulateParametersFromNode
( WitResponseNode responseNode )
Extracts Conduit parameters from a Wit.Ai response.
Parameters
responseNode
The response node from Wit.Ai
void Meta.Conduit.ParameterProvider.SetSpecializedParameter
( string reservedParameterName,
Type parameterType )
Registers a certain keyword as reserved for a specialized parameter.
Parameters
reservedParameterName
The name of the specialized parameter. For example
parameterType
The data type of the parameter
void Meta.Conduit.ParameterProvider.PopulateParameters
( Dictionary< string, ConduitParameterValue > actualParameters )
Populates the parameters. Must be called after all parameters have been obtained and mapped but before any are read.
void Meta.Conduit.ParameterProvider.PopulateRoles
( Dictionary< string, string > parameterToRoleMap )
Populates the roles mappings between actual parameters and their roles.. Must be called after all parameters have been populated using PopulateParameters but before any are read.
Parameters
parameterToRoleMap
Keys are normalized lowercase internal (code) names. Values are fully qualified parameter names (roles).
bool Meta.Conduit.ParameterProvider.ContainsParameter
( ParameterInfo parameter,
StringBuilder log )
Returns true if a parameter with the specified name can be provided.
Parameters
parameter
The name of the parameter.
log
The log to write to.
Returns
True if a parameter with the specified name can be provided.
object Meta.Conduit.ParameterProvider.GetRawParameterValue
( string parameterName )
No description available.
object Meta.Conduit.ParameterProvider.GetParameterValue
( ParameterInfo formalParameter,
Dictionary< string, string > parameterMap,
bool relaxed )
Provides the actual parameter value matching the supplied formal parameter.
Parameters
formalParameter
The formal parameter.
parameterMap
A map from actual parameter names to formal parameter names. Used when parameters have been resolved using type, to identify their mapped names.
relaxed
When true, will match by type when name matching fails.
Returns
The actual parameter value matching the formal parameter or null if an error occurs.
T Meta.Conduit.ParameterProvider.GetParameterValue< T >
( string parameterName,
Dictionary< string, string > parameterMap,
bool relaxed )
Provides the actual parameter value matching the supplied formal parameter.
Parameters
parameterName
The name of the parameter to extract.
parameterMap
A map from actual parameter names to formal parameter names. Used when parameters have been resolved using type, to identify their mapped names.
relaxed
When true, will match by type when name matching fails.
Returns
The actual parameter value matching the formal parameter or null if an error occurs.
List<string> Meta.Conduit.ParameterProvider.GetParameterNamesOfType
( Type targetType )
Returns a list of parameter names that hold values of the specified type. Note: This is an expensive operation.
Parameters
targetType
The type we are querying.
Returns
The names of the parameters that match this type.
override string Meta.Conduit.ParameterProvider.ToString ( )
No description available.

Object Data

virtual bool Meta.Conduit.ParameterProvider.SupportedSpecializedParameter
( ParameterInfo formalParameter )
Returns true if the specified parameter can be resolved. GetSpecializedParameter must be able to return a valid value if this method returns true.
Parameters
formalParameter
The formal parameter.
Returns
True if this parameter can be resolved. False otherwise.
virtual object Meta.Conduit.ParameterProvider.GetSpecializedParameter
( ParameterInfo formalParameter )
Returns the value of the specified parameter.
Parameters
formalParameter
The formal parameter.
Returns
The actual (supplied) invocation value for the parameter.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon