"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ActionGroup = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages an Action Group within Azure Monitor.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "monitoring-resources",
 *     location: "West Europe",
 * });
 * const current = azure.core.getClientConfig({});
 * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("example", {
 *     name: "workspace-01",
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleActionGroup = new azure.monitoring.ActionGroup("example", {
 *     name: "CriticalAlertsAction",
 *     resourceGroupName: example.name,
 *     shortName: "p0action",
 *     armRoleReceivers: [{
 *         name: "armroleaction",
 *         roleId: "de139f84-1756-47ae-9be6-808fbbe84772",
 *         useCommonAlertSchema: true,
 *     }],
 *     automationRunbookReceivers: [{
 *         name: "action_name_1",
 *         automationAccountId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-runbooks/providers/Microsoft.Automation/automationAccounts/aaa001",
 *         runbookName: "my runbook",
 *         webhookResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-runbooks/providers/Microsoft.Automation/automationAccounts/aaa001/webHooks/webhook_alert",
 *         isGlobalRunbook: true,
 *         serviceUri: "https://s13events.azure-automation.net/webhooks?token=randomtoken",
 *         useCommonAlertSchema: true,
 *     }],
 *     azureAppPushReceivers: [{
 *         name: "pushtoadmin",
 *         emailAddress: "admin@contoso.com",
 *     }],
 *     azureFunctionReceivers: [{
 *         name: "funcaction",
 *         functionAppResourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-funcapp/providers/Microsoft.Web/sites/funcapp",
 *         functionName: "myfunc",
 *         httpTriggerUrl: "https://example.com/trigger",
 *         useCommonAlertSchema: true,
 *     }],
 *     emailReceivers: [
 *         {
 *             name: "sendtoadmin",
 *             emailAddress: "admin@contoso.com",
 *         },
 *         {
 *             name: "sendtodevops",
 *             emailAddress: "devops@contoso.com",
 *             useCommonAlertSchema: true,
 *         },
 *     ],
 *     eventHubReceivers: [{
 *         name: "sendtoeventhub",
 *         eventHubNamespace: "eventhubnamespace",
 *         eventHubName: "eventhub1",
 *         subscriptionId: "00000000-0000-0000-0000-000000000000",
 *         useCommonAlertSchema: false,
 *     }],
 *     itsmReceivers: [{
 *         name: "createorupdateticket",
 *         workspaceId: pulumi.all([current, exampleAnalyticsWorkspace.workspaceId]).apply(([current, workspaceId]) => `${current.subscriptionId}|${workspaceId}`),
 *         connectionId: "53de6956-42b4-41ba-be3c-b154cdf17b13",
 *         ticketConfiguration: "{\"PayloadRevision\":0,\"WorkItemType\":\"Incident\",\"UseTemplate\":false,\"WorkItemData\":\"{}\",\"CreateOneWIPerCI\":false}",
 *         region: "southcentralus",
 *     }],
 *     logicAppReceivers: [{
 *         name: "logicappaction",
 *         resourceId: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-logicapp/providers/Microsoft.Logic/workflows/logicapp",
 *         callbackUrl: "https://logicapptriggerurl/...",
 *         useCommonAlertSchema: true,
 *     }],
 *     smsReceivers: [{
 *         name: "oncallmsg",
 *         countryCode: "1",
 *         phoneNumber: "1231231234",
 *     }],
 *     voiceReceivers: [{
 *         name: "remotesupport",
 *         countryCode: "86",
 *         phoneNumber: "13888888888",
 *     }],
 *     webhookReceivers: [{
 *         name: "callmyapiaswell",
 *         serviceUri: "http://example.com/alert",
 *         useCommonAlertSchema: true,
 *     }],
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Insights` - 2023-01-01
 *
 * ## Import
 *
 * Action Groups can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:monitoring/actionGroup:ActionGroup example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Insights/actionGroups/myagname
 * ```
 */
class ActionGroup extends pulumi.CustomResource {
    /**
     * Get an existing ActionGroup resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new ActionGroup(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:monitoring/actionGroup:ActionGroup';
    /**
     * Returns true if the given object is an instance of ActionGroup.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === ActionGroup.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["armRoleReceivers"] = state?.armRoleReceivers;
            resourceInputs["automationRunbookReceivers"] = state?.automationRunbookReceivers;
            resourceInputs["azureAppPushReceivers"] = state?.azureAppPushReceivers;
            resourceInputs["azureFunctionReceivers"] = state?.azureFunctionReceivers;
            resourceInputs["emailReceivers"] = state?.emailReceivers;
            resourceInputs["enabled"] = state?.enabled;
            resourceInputs["eventHubReceivers"] = state?.eventHubReceivers;
            resourceInputs["itsmReceivers"] = state?.itsmReceivers;
            resourceInputs["location"] = state?.location;
            resourceInputs["logicAppReceivers"] = state?.logicAppReceivers;
            resourceInputs["name"] = state?.name;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["shortName"] = state?.shortName;
            resourceInputs["smsReceivers"] = state?.smsReceivers;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["voiceReceivers"] = state?.voiceReceivers;
            resourceInputs["webhookReceivers"] = state?.webhookReceivers;
        }
        else {
            const args = argsOrState;
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            if (args?.shortName === undefined && !opts.urn) {
                throw new Error("Missing required property 'shortName'");
            }
            resourceInputs["armRoleReceivers"] = args?.armRoleReceivers;
            resourceInputs["automationRunbookReceivers"] = args?.automationRunbookReceivers;
            resourceInputs["azureAppPushReceivers"] = args?.azureAppPushReceivers;
            resourceInputs["azureFunctionReceivers"] = args?.azureFunctionReceivers;
            resourceInputs["emailReceivers"] = args?.emailReceivers;
            resourceInputs["enabled"] = args?.enabled;
            resourceInputs["eventHubReceivers"] = args?.eventHubReceivers;
            resourceInputs["itsmReceivers"] = args?.itsmReceivers;
            resourceInputs["location"] = args?.location;
            resourceInputs["logicAppReceivers"] = args?.logicAppReceivers;
            resourceInputs["name"] = args?.name;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["shortName"] = args?.shortName;
            resourceInputs["smsReceivers"] = args?.smsReceivers;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["voiceReceivers"] = args?.voiceReceivers;
            resourceInputs["webhookReceivers"] = args?.webhookReceivers;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ActionGroup.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ActionGroup = ActionGroup;
//# sourceMappingURL=actionGroup.js.map