"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! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.HostingRelease = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A Release is a particular collection of configurations that is set to be public at a particular time.
 *
 * To get more information about Release, see:
 *
 * * [API documentation](https://firebase.google.com/docs/reference/hosting/rest/v1beta1/sites.releases)
 * * How-to Guides
 *     * [Official Documentation](https://firebase.google.com/docs/hosting)
 *
 * ## Example Usage
 *
 * ### Firebasehosting Release In Site
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const _default = new gcp.firebase.HostingSite("default", {
 *     project: "my-project-name",
 *     siteId: "site-id",
 * });
 * const defaultHostingVersion = new gcp.firebase.HostingVersion("default", {
 *     siteId: _default.siteId,
 *     config: {
 *         redirects: [{
 *             glob: "/google/**",
 *             statusCode: 302,
 *             location: "https://www.google.com",
 *         }],
 *     },
 * });
 * const defaultHostingRelease = new gcp.firebase.HostingRelease("default", {
 *     siteId: _default.siteId,
 *     versionName: defaultHostingVersion.name,
 *     message: "Test release",
 * });
 * ```
 * ### Firebasehosting Release In Channel
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const _default = new gcp.firebase.HostingSite("default", {
 *     project: "my-project-name",
 *     siteId: "site-with-channel",
 * });
 * const defaultHostingVersion = new gcp.firebase.HostingVersion("default", {
 *     siteId: _default.siteId,
 *     config: {
 *         redirects: [{
 *             glob: "/google/**",
 *             statusCode: 302,
 *             location: "https://www.google.com",
 *         }],
 *     },
 * });
 * const defaultHostingChannel = new gcp.firebase.HostingChannel("default", {
 *     siteId: _default.siteId,
 *     channelId: "channel-id",
 * });
 * const defaultHostingRelease = new gcp.firebase.HostingRelease("default", {
 *     siteId: _default.siteId,
 *     channelId: defaultHostingChannel.channelId,
 *     versionName: defaultHostingVersion.name,
 *     message: "Test release in channel",
 * });
 * ```
 * ### Firebasehosting Release Disable
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const _default = new gcp.firebase.HostingSite("default", {
 *     project: "my-project-name",
 *     siteId: "site-id",
 * });
 * const defaultHostingRelease = new gcp.firebase.HostingRelease("default", {
 *     siteId: _default.siteId,
 *     type: "SITE_DISABLE",
 *     message: "Take down site",
 * });
 * ```
 *
 * ## Import
 *
 * Release can be imported using any of these accepted formats:
 *
 * * `sites/{{site_id}}/channels/{{channel_id}}/releases/{{release_id}}`
 *
 * * `sites/{{site_id}}/releases/{{release_id}}`
 *
 * * `{{site_id}}/{{channel_id}}/{{release_id}}`
 *
 * * `{{site_id}}/{{release_id}}`
 *
 * When using the `pulumi import` command, Release can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:firebase/hostingRelease:HostingRelease default sites/{{site_id}}/channels/{{channel_id}}/releases/{{release_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:firebase/hostingRelease:HostingRelease default sites/{{site_id}}/releases/{{release_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:firebase/hostingRelease:HostingRelease default {{site_id}}/{{channel_id}}/{{release_id}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:firebase/hostingRelease:HostingRelease default {{site_id}}/{{release_id}}
 * ```
 */
class HostingRelease extends pulumi.CustomResource {
    /**
     * Get an existing HostingRelease 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 HostingRelease(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of HostingRelease.  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'] === HostingRelease.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["channelId"] = state?.channelId;
            resourceInputs["message"] = state?.message;
            resourceInputs["name"] = state?.name;
            resourceInputs["releaseId"] = state?.releaseId;
            resourceInputs["siteId"] = state?.siteId;
            resourceInputs["type"] = state?.type;
            resourceInputs["versionName"] = state?.versionName;
        }
        else {
            const args = argsOrState;
            if (args?.siteId === undefined && !opts.urn) {
                throw new Error("Missing required property 'siteId'");
            }
            resourceInputs["channelId"] = args?.channelId;
            resourceInputs["message"] = args?.message;
            resourceInputs["siteId"] = args?.siteId;
            resourceInputs["type"] = args?.type;
            resourceInputs["versionName"] = args?.versionName;
            resourceInputs["name"] = undefined /*out*/;
            resourceInputs["releaseId"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(HostingRelease.__pulumiType, name, resourceInputs, opts);
    }
}
exports.HostingRelease = HostingRelease;
/** @internal */
HostingRelease.__pulumiType = 'gcp:firebase/hostingRelease:HostingRelease';
//# sourceMappingURL=hostingRelease.js.map