@natzka-oss/pulumi-netbox
Version:
A Pulumi package for creating and managing Netbox cloud resources.
77 lines • 3.49 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.Contact = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* From the [official documentation](https://docs.netbox.dev/en/stable/features/contacts/#contacts_1):
*
* > A contact should represent an individual or permanent point of contact. Each contact must define a name, and may optionally include a title, phone number, email address, and related details.
* >
* > Contacts are reused for assignments, so each unique contact must be created only once and can be assigned to any number of NetBox objects, and there is no limit to the number of assigned contacts an object may have. Most core objects in NetBox can have contacts assigned to them.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as netbox from "@natzka-oss/pulumi-netbox";
*
* const test = new netbox.tenancy.Contact("test", {
* name: "John Doe",
* email: "test@example.com",
* phone: "123-123123",
* });
* ```
*/
class Contact extends pulumi.CustomResource {
/**
* Get an existing Contact 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 Contact(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Contact. 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'] === Contact.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["email"] = state ? state.email : undefined;
resourceInputs["groupId"] = state ? state.groupId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["phone"] = state ? state.phone : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
}
else {
const args = argsOrState;
resourceInputs["email"] = args ? args.email : undefined;
resourceInputs["groupId"] = args ? args.groupId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["phone"] = args ? args.phone : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Contact.__pulumiType, name, resourceInputs, opts);
}
}
exports.Contact = Contact;
/** @internal */
Contact.__pulumiType = 'netbox:tenancy/contact:Contact';
//# sourceMappingURL=contact.js.map