@maienm/pulumi-lidarr
Version:
A Pulumi package for creating and managing Lidarr resources. Based on terraform-provider-lidarr: version v1.11.0
113 lines • 5.12 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.Artist = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* <!-- subcategory:Artists -->Artist resource.
* For more information refer to [Artists](https://wiki.servarr.com/lidarr/library#artists) documentation.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as lidarr from "@maienm/pulumi-lidarr";
*
* const example = new lidarr.artists.Artist("example", {
* artistName: "Queen",
* foreignArtistId: "0383dadf-2a4e-4d10-a46a-e9e041da8eb3",
* metadataProfileId: 1,
* monitored: true,
* path: "/music/Queen",
* qualityProfileId: 1,
* });
* ```
*
* ## Import
*
* import using the API/UI ID
*
* ```sh
* $ pulumi import lidarr:Artists/artist:Artist example 10
* ```
*/
class Artist extends pulumi.CustomResource {
/**
* Get an existing Artist 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 Artist(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Artist. 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'] === Artist.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["artistName"] = state ? state.artistName : undefined;
resourceInputs["foreignArtistId"] = state ? state.foreignArtistId : undefined;
resourceInputs["genres"] = state ? state.genres : undefined;
resourceInputs["metadataProfileId"] = state ? state.metadataProfileId : undefined;
resourceInputs["monitored"] = state ? state.monitored : undefined;
resourceInputs["overview"] = state ? state.overview : undefined;
resourceInputs["path"] = state ? state.path : undefined;
resourceInputs["qualityProfileId"] = state ? state.qualityProfileId : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
}
else {
const args = argsOrState;
if ((!args || args.artistName === undefined) && !opts.urn) {
throw new Error("Missing required property 'artistName'");
}
if ((!args || args.foreignArtistId === undefined) && !opts.urn) {
throw new Error("Missing required property 'foreignArtistId'");
}
if ((!args || args.metadataProfileId === undefined) && !opts.urn) {
throw new Error("Missing required property 'metadataProfileId'");
}
if ((!args || args.monitored === undefined) && !opts.urn) {
throw new Error("Missing required property 'monitored'");
}
if ((!args || args.path === undefined) && !opts.urn) {
throw new Error("Missing required property 'path'");
}
if ((!args || args.qualityProfileId === undefined) && !opts.urn) {
throw new Error("Missing required property 'qualityProfileId'");
}
resourceInputs["artistName"] = args ? args.artistName : undefined;
resourceInputs["foreignArtistId"] = args ? args.foreignArtistId : undefined;
resourceInputs["metadataProfileId"] = args ? args.metadataProfileId : undefined;
resourceInputs["monitored"] = args ? args.monitored : undefined;
resourceInputs["path"] = args ? args.path : undefined;
resourceInputs["qualityProfileId"] = args ? args.qualityProfileId : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["genres"] = undefined /*out*/;
resourceInputs["overview"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Artist.__pulumiType, name, resourceInputs, opts);
}
}
exports.Artist = Artist;
/** @internal */
Artist.__pulumiType = 'lidarr:Artists/artist:Artist';
//# sourceMappingURL=artist.js.map