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

package com.azure.resourcemanager.advisor.generated;

import com.azure.resourcemanager.advisor.models.Category;
import com.azure.resourcemanager.advisor.models.ConfigurationName;
import com.azure.resourcemanager.advisor.models.CpuThreshold;
import com.azure.resourcemanager.advisor.models.DigestConfig;
import com.azure.resourcemanager.advisor.models.DigestConfigState;
import java.util.Arrays;

/** Samples for Configurations CreateInResourceGroup. */
public final class ConfigurationsCreateInResourceGroupSamples {
    /*
     * x-ms-original-file: specification/advisor/resource-manager/Microsoft.Advisor/stable/2020-01-01/examples/CreateConfiguration.json
     */
    /**
     * Sample code: PutConfigurations.
     *
     * @param manager Entry point to AdvisorManager.
     */
    public static void putConfigurations(com.azure.resourcemanager.advisor.AdvisorManager manager) {
        manager
            .configurations()
            .define(ConfigurationName.DEFAULT)
            .withExistingResourceGroup("resourceGroup")
            .withExclude(true)
            .withLowCpuThreshold(CpuThreshold.FIVE)
            .withDigests(
                Arrays
                    .asList(
                        new DigestConfig()
                            .withName("digestConfigName")
                            .withActionGroupResourceId(
                                "/subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/microsoft.insights/actionGroups/actionGroupName")
                            .withFrequency(30)
                            .withCategories(
                                Arrays
                                    .asList(
                                        Category.HIGH_AVAILABILITY,
                                        Category.SECURITY,
                                        Category.PERFORMANCE,
                                        Category.COST,
                                        Category.OPERATIONAL_EXCELLENCE))
                            .withLanguage("en")
                            .withState(DigestConfigState.ACTIVE)))
            .create();
    }
}
