AI-generated Key Takeaways
-
AutocompleteRequest
is a struct used to request autocomplete suggestions based on a partial query. -
It includes properties for the query, an optional session token for billing, and an optional filter to refine results.
-
You can use
AutocompleteRequest
withPlacesClient
to fetch autocomplete suggestions. -
The
filter
property uses theAutocompleteFilter
struct to narrow down the suggestions based on location or place type. -
The
sessionToken
property leveragesAutocompleteSessionToken
to track and manage billing for autocomplete requests within a session.
AutocompleteRequest
struct AutocompleteRequest
extension AutocompleteRequest : Sendable
The request for autocomplete suggestions based on a given partial query along with additional configuring properties.
-
The
AutocompleteFilter
to apply to the results.Declaration
Swift
var filter: AutocompleteFilter? { get }
-
Request object to use with
PlacesClient
to fetch autocomplete suggestions.Declaration
Swift
init(query: String, sessionToken: AutocompleteSessionToken? = nil, filter: AutocompleteFilter? = nil, inputOffset: Int = 0)
Parameters
query
The partial text to autocomplete.
sessionToken
The
AutocompleteSessionToken
to associate requests to a billing session.filter
The
AutocompleteFilter
to apply to the results.inputOffset
The character offset for the input string. Indicates the completion starting position.
-
The character offset for the input string. Indicates the completion starting position.
Declaration
Swift
var inputOffset: Int { get }
-
The partial text to autocomplete.
Declaration
Swift
var query: String { get }
-
The
AutocompleteSessionToken
to associate requests to a billing session.Declaration
Swift
var sessionToken: AutocompleteSessionToken? { get }