@natzka-oss/pulumi-netbox
Version:
A Pulumi package for creating and managing Netbox cloud resources.
88 lines • 3.97 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomFieldChoiceSet = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* From the [official documentation](https://docs.netbox.dev/en/stable/models/extras/customfieldchoiceset/):
*
* Single- and multi-selection custom fields must define a set of valid choices from which the user may choose when defining the field value. These choices are defined as sets that may be reused among multiple custom fields.
*
* A choice set must define a base choice set and/or a set of arbitrary extra choices.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as netbox from "@natzka-oss/pulumi-netbox";
*
* const test = new netbox.CustomFieldChoiceSet("test", {
* name: "my-custom-field-set",
* description: "Description",
* extraChoices: [
* [
* "choice1",
* "label1",
* ],
* [
* "choice2",
* "choice2",
* ],
* ],
* });
* ```
*/
class CustomFieldChoiceSet extends pulumi.CustomResource {
/**
* Get an existing CustomFieldChoiceSet 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 CustomFieldChoiceSet(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of CustomFieldChoiceSet. 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'] === CustomFieldChoiceSet.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["baseChoices"] = state ? state.baseChoices : undefined;
resourceInputs["customFields"] = state ? state.customFields : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["extraChoices"] = state ? state.extraChoices : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["orderAlphabetically"] = state ? state.orderAlphabetically : undefined;
}
else {
const args = argsOrState;
resourceInputs["baseChoices"] = args ? args.baseChoices : undefined;
resourceInputs["customFields"] = args ? args.customFields : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["extraChoices"] = args ? args.extraChoices : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["orderAlphabetically"] = args ? args.orderAlphabetically : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(CustomFieldChoiceSet.__pulumiType, name, resourceInputs, opts);
}
}
exports.CustomFieldChoiceSet = CustomFieldChoiceSet;
/** @internal */
CustomFieldChoiceSet.__pulumiType = 'netbox:index/customFieldChoiceSet:CustomFieldChoiceSet';
//# sourceMappingURL=customFieldChoiceSet.js.map