Providers¶
Utilties and base classes to use when writing providers.
-
class
AddressResult
()¶ A result returned by
:meth:Provider.search
.Arguments: - label (string) – A human-friendly label for the search result.
- data (object) – A map of key-value pairs to store on a person’s contact object if they
select this result. See
LocationState.store_contact_data()
for a description of how this data is stored.
-
class
FixtureParameterMissingError
()¶ Error raised when a parameter required to create a fixture was not provided.
Arguments: - message (string) – An explanation of which parameter was not provided.
-
class
Provider
()¶ A base class for address search providers.
Extensions to this class should implement
init()
andsearch()
.-
static
init
()¶ Initialization function invoked during state initialization.
Arguments: - im (InteractionMachine) – The state’s
InteractionMachine()
instance.
Returns: May return a promise that fires once initialization is complete.
- im (InteractionMachine) – The state’s
-
static
search
(query_text)¶ Return an ordered list of locations matching the query via a promise that is fulfilled when the search results are ready.
Arguments: - query_text (string) – The search query.
Returns: A promise that yields the list of
AddressResult()
instances.
-
static
-
class
ProviderNotImplementedError
()¶ Error raised when a method on a provider has not been implemented.
Arguments: - message (string) – An explanation of which method was not implemented.