"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.OrganizationFeed = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Describes a Cloud Asset Inventory feed used to to listen to asset updates.
 *
 * To get more information about OrganizationFeed, see:
 *
 * * [API documentation](https://cloud.google.com/asset-inventory/docs/reference/rest/)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/asset-inventory/docs)
 *
 * ## Example Usage
 *
 * ### Cloud Asset Organization Feed
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * // The topic where the resource change notifications will be sent.
 * const feedOutput = new gcp.pubsub.Topic("feed_output", {
 *     project: "my-project-name",
 *     name: "network-updates",
 * });
 * // Create a feed that sends notifications about network resource updates under a
 * // particular organization.
 * const organizationFeed = new gcp.cloudasset.OrganizationFeed("organization_feed", {
 *     billingProject: "my-project-name",
 *     orgId: "123456789",
 *     feedId: "network-updates",
 *     contentType: "RESOURCE",
 *     assetTypes: [
 *         "compute.googleapis.com/Subnetwork",
 *         "compute.googleapis.com/Network",
 *     ],
 *     feedOutputConfig: {
 *         pubsubDestination: {
 *             topic: feedOutput.id,
 *         },
 *     },
 *     condition: {
 *         expression: `!temporal_asset.deleted &&
 * temporal_asset.prior_asset_state == google.cloud.asset.v1.TemporalAsset.PriorAssetState.DOES_NOT_EXIST
 * `,
 *         title: "created",
 *         description: "Send notifications on creation events",
 *     },
 * });
 * // Find the project number of the project whose identity will be used for sending
 * // the asset change notifications.
 * const project = gcp.organizations.getProject({
 *     projectId: "my-project-name",
 * });
 * ```
 *
 * ## Import
 *
 * OrganizationFeed can be imported using any of these accepted formats:
 *
 * * `organizations/{{org_id}}/feeds/{{name}}`
 *
 * * `{{org_id}}/{{name}}`
 *
 * When using the `pulumi import` command, OrganizationFeed can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:cloudasset/organizationFeed:OrganizationFeed default organizations/{{org_id}}/feeds/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:cloudasset/organizationFeed:OrganizationFeed default {{org_id}}/{{name}}
 * ```
 */
class OrganizationFeed extends pulumi.CustomResource {
    /**
     * Get an existing OrganizationFeed 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 OrganizationFeed(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of OrganizationFeed.  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'] === OrganizationFeed.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["assetNames"] = state?.assetNames;
            resourceInputs["assetTypes"] = state?.assetTypes;
            resourceInputs["billingProject"] = state?.billingProject;
            resourceInputs["condition"] = state?.condition;
            resourceInputs["contentType"] = state?.contentType;
            resourceInputs["feedId"] = state?.feedId;
            resourceInputs["feedOutputConfig"] = state?.feedOutputConfig;
            resourceInputs["name"] = state?.name;
            resourceInputs["orgId"] = state?.orgId;
        }
        else {
            const args = argsOrState;
            if (args?.billingProject === undefined && !opts.urn) {
                throw new Error("Missing required property 'billingProject'");
            }
            if (args?.feedId === undefined && !opts.urn) {
                throw new Error("Missing required property 'feedId'");
            }
            if (args?.feedOutputConfig === undefined && !opts.urn) {
                throw new Error("Missing required property 'feedOutputConfig'");
            }
            if (args?.orgId === undefined && !opts.urn) {
                throw new Error("Missing required property 'orgId'");
            }
            resourceInputs["assetNames"] = args?.assetNames;
            resourceInputs["assetTypes"] = args?.assetTypes;
            resourceInputs["billingProject"] = args?.billingProject;
            resourceInputs["condition"] = args?.condition;
            resourceInputs["contentType"] = args?.contentType;
            resourceInputs["feedId"] = args?.feedId;
            resourceInputs["feedOutputConfig"] = args?.feedOutputConfig;
            resourceInputs["orgId"] = args?.orgId;
            resourceInputs["name"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(OrganizationFeed.__pulumiType, name, resourceInputs, opts);
    }
}
exports.OrganizationFeed = OrganizationFeed;
/** @internal */
OrganizationFeed.__pulumiType = 'gcp:cloudasset/organizationFeed:OrganizationFeed';
//# sourceMappingURL=organizationFeed.js.map