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

package com.azure.resourcemanager.monitor.generated;

import com.azure.core.util.Context;
import java.time.Duration;

/** Samples for Metrics List. */
public final class MetricsListSamples {
    /*
     * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetric.json
     */
    /**
     * Sample code: Get Metric for data.
     *
     * @param azure The entry point for accessing resource management APIs in Azure.
     */
    public static void getMetricForData(com.azure.resourcemanager.AzureResourceManager azure) {
        azure
            .diagnosticSettings()
            .manager()
            .serviceClient()
            .getMetrics()
            .listWithResponse(
                "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default",
                "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z",
                Duration.parse("PT1M"),
                null,
                "Average,count",
                3,
                "Average asc",
                "BlobType eq '*'",
                null,
                "Microsoft.Storage/storageAccounts/blobServices",
                Context.NONE);
    }

    /*
     * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricMetadata.json
     */
    /**
     * Sample code: Get Metric for metadata.
     *
     * @param azure The entry point for accessing resource management APIs in Azure.
     */
    public static void getMetricForMetadata(com.azure.resourcemanager.AzureResourceManager azure) {
        azure
            .diagnosticSettings()
            .manager()
            .serviceClient()
            .getMetrics()
            .listWithResponse(
                "subscriptions/b324c52b-4073-4807-93af-e07d289c093e/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/larryshoebox/blobServices/default",
                "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z",
                Duration.parse("PT1M"),
                null,
                "Average,count",
                3,
                "Average asc",
                "BlobType eq '*'",
                null,
                "Microsoft.Storage/storageAccounts/blobServices",
                Context.NONE);
    }

    /*
     * x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2018-01-01/examples/GetMetricError.json
     */
    /**
     * Sample code: Get Metric with error.
     *
     * @param azure The entry point for accessing resource management APIs in Azure.
     */
    public static void getMetricWithError(com.azure.resourcemanager.AzureResourceManager azure) {
        azure
            .diagnosticSettings()
            .manager()
            .serviceClient()
            .getMetrics()
            .listWithResponse(
                "subscriptions/ac41e21f-afd6-4a79-8070-f01eba278f97/resourceGroups/todking/providers/Microsoft.DocumentDb/databaseAccounts/tk-cosmos-mongo",
                "2021-06-07T21:51:00Z/2021-06-08T01:51:00Z",
                Duration.parse("FULL"),
                "MongoRequestsCount,MongoRequests",
                "average",
                null,
                null,
                null,
                null,
                "microsoft.documentdb/databaseaccounts",
                Context.NONE);
    }
}
