// 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.fluent.models.ConfigDataInner;
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 CreateInSubscription. */
public final class ConfigurationsCreateInSubscriptionSamples {
    /*
     * 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()
            .createInSubscriptionWithResponse(
                ConfigurationName.DEFAULT,
                new ConfigDataInner()
                    .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))),
                com.azure.core.util.Context.NONE);
    }
}
