"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.GatewayAdvertisedRoute = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A gateway advertised route is a route that a gateway spoke advertises somewhere.
 *
 * To get more information about GatewayAdvertisedRoute, see:
 *
 * * [API documentation](https://docs.cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1beta/projects.locations.spokes.gatewayAdvertisedRoutes)
 * * How-to Guides
 *     * [QUICKSTART_TITLE](https://docs.cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/ncc-gateway-overview)
 *
 * ## Example Usage
 *
 * ### Network Connectivity Gateway Advertised Route Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const network = new gcp.compute.Network("network", {
 *     name: "net-spoke",
 *     autoCreateSubnetworks: false,
 * });
 * const subnetwork = new gcp.compute.Subnetwork("subnetwork", {
 *     name: "tf-test-subnet_6529",
 *     ipCidrRange: "10.0.0.0/28",
 *     region: "us-central1",
 *     network: network.selfLink,
 * });
 * const basicHub = new gcp.networkconnectivity.Hub("basic_hub", {
 *     name: "hub",
 *     description: "A sample hub",
 *     labels: {
 *         "label-two": "value-one",
 *     },
 *     presetTopology: "HYBRID_INSPECTION",
 * });
 * const primary = new gcp.networkconnectivity.Spoke("primary", {
 *     name: "spoke-name",
 *     location: "us-central1",
 *     description: "A sample spoke of type Gateway",
 *     labels: {
 *         "label-one": "value-one",
 *     },
 *     hub: basicHub.id,
 *     gateway: {
 *         ipRangeReservations: [{
 *             ipRange: "10.0.0.0/23",
 *         }],
 *         capacity: "CAPACITY_1_GBPS",
 *     },
 *     group: "gateways",
 * });
 * const _default = new gcp.networkconnectivity.GatewayAdvertisedRoute("default", {
 *     spoke: primary.name,
 *     location: "us-central1",
 *     name: "gateway-advertised-route-name",
 *     labels: {
 *         "label-one": "value-one",
 *     },
 *     description: "description of the gateway advertised route",
 *     ipRange: "0.0.0.0/24",
 *     recipient: "ADVERTISE_TO_HUB",
 *     priority: 200,
 * });
 * ```
 *
 * ## Import
 *
 * GatewayAdvertisedRoute can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/locations/{{location}}/spokes/{{spoke}}/gatewayAdvertisedRoutes/{{name}}`
 *
 * * `{{project}}/{{location}}/{{spoke}}/{{name}}`
 *
 * * `{{location}}/{{spoke}}/{{name}}`
 *
 * When using the `pulumi import` command, GatewayAdvertisedRoute can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:networkconnectivity/gatewayAdvertisedRoute:GatewayAdvertisedRoute default projects/{{project}}/locations/{{location}}/spokes/{{spoke}}/gatewayAdvertisedRoutes/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:networkconnectivity/gatewayAdvertisedRoute:GatewayAdvertisedRoute default {{project}}/{{location}}/{{spoke}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:networkconnectivity/gatewayAdvertisedRoute:GatewayAdvertisedRoute default {{location}}/{{spoke}}/{{name}}
 * ```
 */
class GatewayAdvertisedRoute extends pulumi.CustomResource {
    /**
     * Get an existing GatewayAdvertisedRoute 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 GatewayAdvertisedRoute(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of GatewayAdvertisedRoute.  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'] === GatewayAdvertisedRoute.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["createTime"] = state?.createTime;
            resourceInputs["description"] = state?.description;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["ipRange"] = state?.ipRange;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["priority"] = state?.priority;
            resourceInputs["project"] = state?.project;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
            resourceInputs["recipient"] = state?.recipient;
            resourceInputs["spoke"] = state?.spoke;
            resourceInputs["state"] = state?.state;
            resourceInputs["uniqueId"] = state?.uniqueId;
            resourceInputs["updateTime"] = state?.updateTime;
        }
        else {
            const args = argsOrState;
            if (args?.location === undefined && !opts.urn) {
                throw new Error("Missing required property 'location'");
            }
            if (args?.spoke === undefined && !opts.urn) {
                throw new Error("Missing required property 'spoke'");
            }
            resourceInputs["description"] = args?.description;
            resourceInputs["ipRange"] = args?.ipRange;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["location"] = args?.location;
            resourceInputs["name"] = args?.name;
            resourceInputs["priority"] = args?.priority;
            resourceInputs["project"] = args?.project;
            resourceInputs["recipient"] = args?.recipient;
            resourceInputs["spoke"] = args?.spoke;
            resourceInputs["createTime"] = undefined /*out*/;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["pulumiLabels"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["uniqueId"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(GatewayAdvertisedRoute.__pulumiType, name, resourceInputs, opts);
    }
}
exports.GatewayAdvertisedRoute = GatewayAdvertisedRoute;
/** @internal */
GatewayAdvertisedRoute.__pulumiType = 'gcp:networkconnectivity/gatewayAdvertisedRoute:GatewayAdvertisedRoute';
//# sourceMappingURL=gatewayAdvertisedRoute.js.map