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.

Fields

const string WitResponseNodeReservedName[Get]
const string VoiceSessionReservedName[Get]
The list of the names of all parameters in the provider.

Protected Fields

Maps the parameters to their supplied values. The keys are normalized to lowercase.

Member Functions

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.
Explicitly adds, or replaces, a parameter.
Parameters
parameterName
The parameter name.
value
The parameter value.
Extracts Conduit parameters from a Wit.Ai response.
Parameters
responseNode
The response node from Wit.Ai
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
Populates the parameters. Must be called after all parameters have been obtained and mapped but before any are read.
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).
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 GetRawParameterValue
( string parameterName )
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.
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.
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 ToString ( )

Protected Functions

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