@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
110 lines • 4.41 kB
JavaScript
// *** 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.Occurence = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* An occurrence is an instance of a Note, or type of analysis that
* can be done for a resource.
*
* To get more information about Occurrence, see:
*
* * [API documentation](https://cloud.google.com/container-analysis/api/reference/rest/)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/container-analysis/)
*
* ## Example Usage
*
* ## Import
*
* Occurrence can be imported using any of these accepted formats:
*
* * `projects/{{project}}/occurrences/{{name}}`
*
* * `{{project}}/{{name}}`
*
* * `{{name}}`
*
* When using the `pulumi import` command, Occurrence can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:containeranalysis/occurence:Occurence default projects/{{project}}/occurrences/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:containeranalysis/occurence:Occurence default {{project}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:containeranalysis/occurence:Occurence default {{name}}
* ```
*/
class Occurence extends pulumi.CustomResource {
/**
* Get an existing Occurence 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 Occurence(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Occurence. 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'] === Occurence.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["attestation"] = state?.attestation;
resourceInputs["createTime"] = state?.createTime;
resourceInputs["kind"] = state?.kind;
resourceInputs["name"] = state?.name;
resourceInputs["noteName"] = state?.noteName;
resourceInputs["project"] = state?.project;
resourceInputs["remediation"] = state?.remediation;
resourceInputs["resourceUri"] = state?.resourceUri;
resourceInputs["updateTime"] = state?.updateTime;
}
else {
const args = argsOrState;
if (args?.attestation === undefined && !opts.urn) {
throw new Error("Missing required property 'attestation'");
}
if (args?.noteName === undefined && !opts.urn) {
throw new Error("Missing required property 'noteName'");
}
if (args?.resourceUri === undefined && !opts.urn) {
throw new Error("Missing required property 'resourceUri'");
}
resourceInputs["attestation"] = args?.attestation;
resourceInputs["noteName"] = args?.noteName;
resourceInputs["project"] = args?.project;
resourceInputs["remediation"] = args?.remediation;
resourceInputs["resourceUri"] = args?.resourceUri;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["kind"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Occurence.__pulumiType, name, resourceInputs, opts);
}
}
exports.Occurence = Occurence;
/** @internal */
Occurence.__pulumiType = 'gcp:containeranalysis/occurence:Occurence';
//# sourceMappingURL=occurence.js.map
;