@maienm/pulumi-readarr
Version:
A Pulumi package for creating and managing Readarr resources. Based on terraform-provider-readarr: version v2.1.0
142 lines • 7.09 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.RootFolder = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* <!-- subcategory:Media Management -->Root Folder resource.
* For more information refer to [Root Folders](https://wiki.servarr.com/readarr/settings#root-folders) documentation.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as readarr from "@maienm/pulumi-readarr";
*
* const example = new readarr.mediamanagement.RootFolder("example", {
* defaultMetadataProfileId: 1,
* defaultMonitorOption: "all",
* defaultQualityProfileId: 1,
* isCalibreLibrary: false,
* outputProfile: "default",
* path: "/example",
* });
* // with calibre
* const calibreExample = new readarr.mediamanagement.RootFolder("calibreExample", {
* defaultMetadataProfileId: 1,
* defaultMonitorOption: "all",
* defaultQualityProfileId: 1,
* host: "calibre-host",
* isCalibreLibrary: true,
* library: "Calibre_Library",
* outputProfile: "default",
* password: "Pass",
* path: "/calibre",
* port: 8081,
* useSsl: false,
* username: "User",
* });
* ```
*
* ## Import
*
* import using the API/UI ID
*
* ```sh
* $ pulumi import readarr:MediaManagement/rootFolder:RootFolder example 10
* ```
*/
class RootFolder extends pulumi.CustomResource {
/**
* Get an existing RootFolder 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 RootFolder(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of RootFolder. 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'] === RootFolder.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accessible"] = state ? state.accessible : undefined;
resourceInputs["defaultMetadataProfileId"] = state ? state.defaultMetadataProfileId : undefined;
resourceInputs["defaultMonitorNewItemOption"] = state ? state.defaultMonitorNewItemOption : undefined;
resourceInputs["defaultMonitorOption"] = state ? state.defaultMonitorOption : undefined;
resourceInputs["defaultQualityProfileId"] = state ? state.defaultQualityProfileId : undefined;
resourceInputs["defaultTags"] = state ? state.defaultTags : undefined;
resourceInputs["host"] = state ? state.host : undefined;
resourceInputs["isCalibreLibrary"] = state ? state.isCalibreLibrary : undefined;
resourceInputs["library"] = state ? state.library : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["outputProfile"] = state ? state.outputProfile : undefined;
resourceInputs["password"] = state ? state.password : undefined;
resourceInputs["path"] = state ? state.path : undefined;
resourceInputs["port"] = state ? state.port : undefined;
resourceInputs["useSsl"] = state ? state.useSsl : undefined;
resourceInputs["username"] = state ? state.username : undefined;
}
else {
const args = argsOrState;
if ((!args || args.defaultMetadataProfileId === undefined) && !opts.urn) {
throw new Error("Missing required property 'defaultMetadataProfileId'");
}
if ((!args || args.defaultMonitorNewItemOption === undefined) && !opts.urn) {
throw new Error("Missing required property 'defaultMonitorNewItemOption'");
}
if ((!args || args.defaultMonitorOption === undefined) && !opts.urn) {
throw new Error("Missing required property 'defaultMonitorOption'");
}
if ((!args || args.defaultQualityProfileId === undefined) && !opts.urn) {
throw new Error("Missing required property 'defaultQualityProfileId'");
}
if ((!args || args.isCalibreLibrary === undefined) && !opts.urn) {
throw new Error("Missing required property 'isCalibreLibrary'");
}
if ((!args || args.path === undefined) && !opts.urn) {
throw new Error("Missing required property 'path'");
}
resourceInputs["defaultMetadataProfileId"] = args ? args.defaultMetadataProfileId : undefined;
resourceInputs["defaultMonitorNewItemOption"] = args ? args.defaultMonitorNewItemOption : undefined;
resourceInputs["defaultMonitorOption"] = args ? args.defaultMonitorOption : undefined;
resourceInputs["defaultQualityProfileId"] = args ? args.defaultQualityProfileId : undefined;
resourceInputs["defaultTags"] = args ? args.defaultTags : undefined;
resourceInputs["host"] = args ? args.host : undefined;
resourceInputs["isCalibreLibrary"] = args ? args.isCalibreLibrary : undefined;
resourceInputs["library"] = args ? args.library : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["outputProfile"] = args ? args.outputProfile : undefined;
resourceInputs["password"] = (args === null || args === void 0 ? void 0 : args.password) ? pulumi.secret(args.password) : undefined;
resourceInputs["path"] = args ? args.path : undefined;
resourceInputs["port"] = args ? args.port : undefined;
resourceInputs["useSsl"] = args ? args.useSsl : undefined;
resourceInputs["username"] = args ? args.username : undefined;
resourceInputs["accessible"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["password"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(RootFolder.__pulumiType, name, resourceInputs, opts);
}
}
exports.RootFolder = RootFolder;
/** @internal */
RootFolder.__pulumiType = 'readarr:MediaManagement/rootFolder:RootFolder';
//# sourceMappingURL=rootFolder.js.map