"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.ServicesCommunicationsGateway = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a Voice Services Communications Gateways.
 *
 * !> **Note:** You must have signed an Operator Connect agreement with Microsoft to use this resource. For more information, see [`Prerequisites`](https://learn.microsoft.com/en-us/azure/communications-gateway/prepare-to-deploy#prerequisites).
 *
 * !> **Note:** Access to Azure Communications Gateway is restricted, see [`Get access to Azure Communications Gateway for your Azure subscription`](https://learn.microsoft.com/en-us/azure/communications-gateway/prepare-to-deploy#9-get-access-to-azure-communications-gateway-for-your-azure-subscription) for details.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleServicesCommunicationsGateway = new azure.voice.ServicesCommunicationsGateway("example", {
 *     name: "example-vcg",
 *     location: "West Europe",
 *     resourceGroupName: example.name,
 *     connectivity: "PublicAddress",
 *     codecs: "PCMA",
 *     e911Type: "DirectToEsrp",
 *     platforms: [
 *         "OperatorConnect",
 *         "TeamsPhoneMobile",
 *     ],
 *     serviceLocations: [
 *         {
 *             location: "eastus",
 *             allowedMediaSourceAddressPrefixes: ["10.1.2.0/24"],
 *             allowedSignalingSourceAddressPrefixes: ["10.1.1.0/24"],
 *             esrpAddresses: ["198.51.100.3"],
 *             operatorAddresses: ["198.51.100.1"],
 *         },
 *         {
 *             location: "eastus2",
 *             allowedMediaSourceAddressPrefixes: ["10.2.2.0/24"],
 *             allowedSignalingSourceAddressPrefixes: ["10.2.1.0/24"],
 *             esrpAddresses: ["198.51.100.4"],
 *             operatorAddresses: ["198.51.100.2"],
 *         },
 *     ],
 *     autoGeneratedDomainNameLabelScope: "SubscriptionReuse",
 *     apiBridge: JSON.stringify({}),
 *     emergencyDialStrings: [
 *         "911",
 *         "933",
 *     ],
 *     onPremMcpEnabled: false,
 *     tags: {
 *         key: "value",
 *     },
 *     microsoftTeamsVoicemailPilotNumber: "1",
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.VoiceServices` - 2023-04-03
 *
 * ## Import
 *
 * Voice Services Communications Gateways can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:voice/servicesCommunicationsGateway:ServicesCommunicationsGateway example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.VoiceServices/communicationsGateways/communicationsGateway1
 * ```
 */
class ServicesCommunicationsGateway extends pulumi.CustomResource {
    /**
     * Get an existing ServicesCommunicationsGateway 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 ServicesCommunicationsGateway(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:voice/servicesCommunicationsGateway:ServicesCommunicationsGateway';
    /**
     * Returns true if the given object is an instance of ServicesCommunicationsGateway.  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'] === ServicesCommunicationsGateway.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["apiBridge"] = state?.apiBridge;
            resourceInputs["autoGeneratedDomainNameLabelScope"] = state?.autoGeneratedDomainNameLabelScope;
            resourceInputs["codecs"] = state?.codecs;
            resourceInputs["connectivity"] = state?.connectivity;
            resourceInputs["e911Type"] = state?.e911Type;
            resourceInputs["emergencyDialStrings"] = state?.emergencyDialStrings;
            resourceInputs["location"] = state?.location;
            resourceInputs["microsoftTeamsVoicemailPilotNumber"] = state?.microsoftTeamsVoicemailPilotNumber;
            resourceInputs["name"] = state?.name;
            resourceInputs["onPremMcpEnabled"] = state?.onPremMcpEnabled;
            resourceInputs["platforms"] = state?.platforms;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["serviceLocations"] = state?.serviceLocations;
            resourceInputs["tags"] = state?.tags;
        }
        else {
            const args = argsOrState;
            if (args?.codecs === undefined && !opts.urn) {
                throw new Error("Missing required property 'codecs'");
            }
            if (args?.connectivity === undefined && !opts.urn) {
                throw new Error("Missing required property 'connectivity'");
            }
            if (args?.e911Type === undefined && !opts.urn) {
                throw new Error("Missing required property 'e911Type'");
            }
            if (args?.platforms === undefined && !opts.urn) {
                throw new Error("Missing required property 'platforms'");
            }
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            if (args?.serviceLocations === undefined && !opts.urn) {
                throw new Error("Missing required property 'serviceLocations'");
            }
            resourceInputs["apiBridge"] = args?.apiBridge;
            resourceInputs["autoGeneratedDomainNameLabelScope"] = args?.autoGeneratedDomainNameLabelScope;
            resourceInputs["codecs"] = args?.codecs;
            resourceInputs["connectivity"] = args?.connectivity;
            resourceInputs["e911Type"] = args?.e911Type;
            resourceInputs["emergencyDialStrings"] = args?.emergencyDialStrings;
            resourceInputs["location"] = args?.location;
            resourceInputs["microsoftTeamsVoicemailPilotNumber"] = args?.microsoftTeamsVoicemailPilotNumber;
            resourceInputs["name"] = args?.name;
            resourceInputs["onPremMcpEnabled"] = args?.onPremMcpEnabled;
            resourceInputs["platforms"] = args?.platforms;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["serviceLocations"] = args?.serviceLocations;
            resourceInputs["tags"] = args?.tags;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ServicesCommunicationsGateway.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ServicesCommunicationsGateway = ServicesCommunicationsGateway;
//# sourceMappingURL=servicesCommunicationsGateway.js.map