"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.FunctionAppFunction = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a Function App Function.
 *
 * ## Example Usage
 *
 * ### Basic HTTP Trigger
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-group",
 *     location: "West Europe",
 * });
 * const exampleAccount = new azure.storage.Account("example", {
 *     name: "examplesa",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     accountTier: "Standard",
 *     accountReplicationType: "LRS",
 * });
 * const exampleServicePlan = new azure.appservice.ServicePlan("example", {
 *     name: "example-service-plan",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     osType: "Linux",
 *     skuName: "S1",
 * });
 * const exampleLinuxFunctionApp = new azure.appservice.LinuxFunctionApp("example", {
 *     name: "example-function-app",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     servicePlanId: exampleServicePlan.id,
 *     storageAccountName: exampleAccount.name,
 *     storageAccountAccessKey: exampleAccount.primaryAccessKey,
 *     siteConfig: {
 *         applicationStack: {
 *             pythonVersion: "3.9",
 *         },
 *     },
 * });
 * const exampleFunctionAppFunction = new azure.appservice.FunctionAppFunction("example", {
 *     name: "example-function-app-function",
 *     functionAppId: exampleLinuxFunctionApp.id,
 *     language: "Python",
 *     testData: JSON.stringify({
 *         name: "Azure",
 *     }),
 *     configJson: JSON.stringify({
 *         bindings: [
 *             {
 *                 authLevel: "function",
 *                 direction: "in",
 *                 methods: [
 *                     "get",
 *                     "post",
 *                 ],
 *                 name: "req",
 *                 type: "httpTrigger",
 *             },
 *             {
 *                 direction: "out",
 *                 name: "$return",
 *                 type: "http",
 *             },
 *         ],
 *     }),
 * });
 * ```
 *
 * ### HTTP Trigger With Code Upload
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * import * as std from "@pulumi/std";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-group",
 *     location: "West Europe",
 * });
 * const exampleAccount = new azure.storage.Account("example", {
 *     name: "examplesa",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     accountTier: "Standard",
 *     accountReplicationType: "LRS",
 * });
 * const exampleServicePlan = new azure.appservice.ServicePlan("example", {
 *     name: "example-service-plan",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     osType: "Windows",
 *     skuName: "S1",
 * });
 * const exampleWindowsFunctionApp = new azure.appservice.WindowsFunctionApp("example", {
 *     name: "example-function-app",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     servicePlanId: exampleServicePlan.id,
 *     storageAccountName: exampleAccount.name,
 *     storageAccountAccessKey: exampleAccount.primaryAccessKey,
 *     siteConfig: {
 *         applicationStack: {
 *             dotnetVersion: "6",
 *         },
 *     },
 * });
 * const exampleFunctionAppFunction = new azure.appservice.FunctionAppFunction("example", {
 *     name: "example-function-app-function",
 *     functionAppId: exampleWindowsFunctionApp.id,
 *     language: "CSharp",
 *     files: [{
 *         name: "run.csx",
 *         content: std.file({
 *             input: "exampledata/run.csx",
 *         }).then(invoke => invoke.result),
 *     }],
 *     testData: JSON.stringify({
 *         name: "Azure",
 *     }),
 *     configJson: JSON.stringify({
 *         bindings: [
 *             {
 *                 authLevel: "function",
 *                 direction: "in",
 *                 methods: [
 *                     "get",
 *                     "post",
 *                 ],
 *                 name: "req",
 *                 type: "httpTrigger",
 *             },
 *             {
 *                 direction: "out",
 *                 name: "$return",
 *                 type: "http",
 *             },
 *         ],
 *     }),
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Web` - 2023-12-01
 *
 * ## Import
 *
 * a Function App Function can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:appservice/functionAppFunction:FunctionAppFunction example "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Web/sites/site1/functions/function1"
 * ```
 */
class FunctionAppFunction extends pulumi.CustomResource {
    /**
     * Get an existing FunctionAppFunction 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 FunctionAppFunction(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:appservice/functionAppFunction:FunctionAppFunction';
    /**
     * Returns true if the given object is an instance of FunctionAppFunction.  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'] === FunctionAppFunction.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["configJson"] = state?.configJson;
            resourceInputs["configUrl"] = state?.configUrl;
            resourceInputs["enabled"] = state?.enabled;
            resourceInputs["files"] = state?.files;
            resourceInputs["functionAppId"] = state?.functionAppId;
            resourceInputs["invocationUrl"] = state?.invocationUrl;
            resourceInputs["language"] = state?.language;
            resourceInputs["name"] = state?.name;
            resourceInputs["scriptRootPathUrl"] = state?.scriptRootPathUrl;
            resourceInputs["scriptUrl"] = state?.scriptUrl;
            resourceInputs["secretsFileUrl"] = state?.secretsFileUrl;
            resourceInputs["testData"] = state?.testData;
            resourceInputs["testDataUrl"] = state?.testDataUrl;
            resourceInputs["url"] = state?.url;
        }
        else {
            const args = argsOrState;
            if (args?.configJson === undefined && !opts.urn) {
                throw new Error("Missing required property 'configJson'");
            }
            if (args?.functionAppId === undefined && !opts.urn) {
                throw new Error("Missing required property 'functionAppId'");
            }
            resourceInputs["configJson"] = args?.configJson;
            resourceInputs["enabled"] = args?.enabled;
            resourceInputs["files"] = args?.files;
            resourceInputs["functionAppId"] = args?.functionAppId;
            resourceInputs["language"] = args?.language;
            resourceInputs["name"] = args?.name;
            resourceInputs["testData"] = args?.testData;
            resourceInputs["configUrl"] = undefined /*out*/;
            resourceInputs["invocationUrl"] = undefined /*out*/;
            resourceInputs["scriptRootPathUrl"] = undefined /*out*/;
            resourceInputs["scriptUrl"] = undefined /*out*/;
            resourceInputs["secretsFileUrl"] = undefined /*out*/;
            resourceInputs["testDataUrl"] = undefined /*out*/;
            resourceInputs["url"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(FunctionAppFunction.__pulumiType, name, resourceInputs, opts);
    }
}
exports.FunctionAppFunction = FunctionAppFunction;
//# sourceMappingURL=functionAppFunction.js.map