// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.sql.generated;

import com.azure.core.util.Context;
import com.azure.resourcemanager.sql.models.QueryTimeGrainType;

/** Samples for ManagedDatabaseQueries ListByQuery. */
public final class ManagedDatabaseQueriesListByQuerySamples {
    /*
     * x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2021-11-01/examples/ManagedInstanceQueryStatisticsListMax.json
     */
    /**
     * Sample code: Obtain query execution statistics. Example with all request parameters.
     *
     * @param azure The entry point for accessing resource management APIs in Azure.
     */
    public static void obtainQueryExecutionStatisticsExampleWithAllRequestParameters(
        com.azure.resourcemanager.AzureResourceManager azure) {
        azure
            .sqlServers()
            .manager()
            .serviceClient()
            .getManagedDatabaseQueries()
            .listByQuery(
                "sqlcrudtest-7398",
                "sqlcrudtest-4645",
                "database_1",
                "42",
                "03/01/2020 16:23:09",
                "03/11/2020 14:00:00",
                QueryTimeGrainType.P1D,
                Context.NONE);
    }

    /*
     * x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2021-11-01/examples/ManagedInstanceQueryStatisticsList.json
     */
    /**
     * Sample code: Obtain query execution statistics.
     *
     * @param azure The entry point for accessing resource management APIs in Azure.
     */
    public static void obtainQueryExecutionStatistics(com.azure.resourcemanager.AzureResourceManager azure) {
        azure
            .sqlServers()
            .manager()
            .serviceClient()
            .getManagedDatabaseQueries()
            .listByQuery("sqlcrudtest-7398", "sqlcrudtest-4645", "database_1", "42", null, null, null, Context.NONE);
    }

    /*
     * x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2021-11-01/examples/ManagedInstanceQueryStatisticsListMin.json
     */
    /**
     * Sample code: Obtain query execution statistics. Minimal example with only mandatory request parameters.
     *
     * @param azure The entry point for accessing resource management APIs in Azure.
     */
    public static void obtainQueryExecutionStatisticsMinimalExampleWithOnlyMandatoryRequestParameters(
        com.azure.resourcemanager.AzureResourceManager azure) {
        azure
            .sqlServers()
            .manager()
            .serviceClient()
            .getManagedDatabaseQueries()
            .listByQuery(
                "sqlcrudtest-7398",
                "sqlcrudtest-4645",
                "database_1",
                "42",
                null,
                null,
                QueryTimeGrainType.PT1H,
                Context.NONE);
    }
}
