Share via


StorageProviderSuggestionsQueryOptions Class

Definition

Provides options for a suggestions query.

Important

The Windows.Storage.Provider.StorageProviderSuggestionsQueryOptions API is part of a Limited Access Feature (see LimitedAccessFeatures class). For more information or to request an unlock token, please use the LAF Access Token Request Form.

public ref class StorageProviderSuggestionsQueryOptions sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Storage.Provider.CloudFilesContract, 458752)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class StorageProviderSuggestionsQueryOptions final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Storage.Provider.CloudFilesContract, 458752)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Experimental]
class StorageProviderSuggestionsQueryOptions final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Storage.Provider.CloudFilesContract), 458752)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class StorageProviderSuggestionsQueryOptions
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Storage.Provider.CloudFilesContract), 458752)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Experimental]
public sealed class StorageProviderSuggestionsQueryOptions
Public NotInheritable Class StorageProviderSuggestionsQueryOptions
Inheritance
Object Platform::Object IInspectable StorageProviderSuggestionsQueryOptions
Attributes

Windows requirements

Requirements Description
Device family
Windows 11 Insider Preview (introduced in 10.0.23504.0)
API contract
Windows.Storage.Provider.CloudFilesContract (introduced in v7.0)

Examples

The following is an example of how Windows would make a request for recent files using the suggestions handler:

auto propertiesToFetch = single_threaded_vector<hstring>(
    {
        L"System.ItemNameDisplayWithoutExtension",
        L"System.FileExtension",
        L"System.ContentUri",
        L"System.DateAccessed"
    });

auto options = winrt::make_self<implementation::StorageProviderSuggestionsQueryOptions>();
options->SuggestionsKind(StorageProviderResultKind::Recent);
options->MaxResults(100);
options->PropertiesToFetch(propertiesToFetch.GetView());

MockSuggestionsHandler suggestionsHandler;
auto queryResult = suggestionsHandler.GetSuggestions(options.as<StorageProviderSuggestionsQueryOptions>());
if (queryResult.Status() == StorageProviderSearchQueryStatus::Success)
{
    auto results = queryResult.GetResults();
    for (auto result : results)
    {
        auto suggestionResult = result.as<StorageProviderSuggestionResult>();
        // Use the result
    }
}
else
{
    // Handle error
}

Properties

Name Description
MaxResults

Gets the maximum number of results to return.

Important

The Windows.Storage.Provider.StorageProviderSuggestionsQueryOptions API is part of a Limited Access Feature (see LimitedAccessFeatures class). For more information or to request an unlock token, please use the LAF Access Token Request Form.

PropertiesToFetch

Gets the vector of additional properties to return for each query result. These are canonical property names from the Windows Property System (e.g. System.FileName or System.DateModified).

Important

The Windows.Storage.Provider.StorageProviderSuggestionsQueryOptions API is part of a Limited Access Feature (see LimitedAccessFeatures class). For more information or to request an unlock token, please use the LAF Access Token Request Form.

QueryId

Gets the unique identifier for the query. This is a telemetry ID provided by the caller that allows the request to be tracked across the client and service for reliability proposes.

Important

The Windows.Storage.Provider.StorageProviderSuggestionsQueryOptions API is part of a Limited Access Feature (see LimitedAccessFeatures class). For more information or to request an unlock token, please use the LAF Access Token Request Form.

RemoteFileId

Gets the remote file ID for the file or folder for which suggestions are being requested.

Important

The Windows.Storage.Provider.StorageProviderSuggestionsQueryOptions API is part of a Limited Access Feature (see LimitedAccessFeatures class). For more information or to request an unlock token, please use the LAF Access Token Request Form.

SuggestionsKind

Gets the kind of suggestions to retrieve as a StorageProviderResultKind value.

Important

The Windows.Storage.Provider.StorageProviderSuggestionsQueryOptions API is part of a Limited Access Feature (see LimitedAccessFeatures class). For more information or to request an unlock token, please use the LAF Access Token Request Form.

Applies to