@maienm/pulumi-prowlarr
Version:
A Pulumi package for creating and managing Prowlarr resources. Based on terraform-provider-prowlarr: version v2.3.0
123 lines • 5.92 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.Freebox = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* <!-- subcategory:Download Clients -->Download Client Freebox resource.
* For more information refer to [Download Client](https://wiki.servarr.com/prowlarr/settings#download-clients) and [Freebox](https://wiki.servarr.com/prowlarr/supported#torrentfreeboxdownload).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as prowlarr from "@maienm/pulumi-prowlarr";
*
* const example = new prowlarr.downloadclients.Freebox("example", {
* apiUrl: "/api/v1/",
* appId: "freebox",
* appToken: "Token123",
* enable: true,
* host: "mafreebox.freebox.fr",
* port: 443,
* priority: 1,
* });
* ```
*
* ## Import
*
* import using the API/UI ID
*
* ```sh
* $ pulumi import prowlarr:DownloadClients/freebox:Freebox example 1
* ```
*/
class Freebox extends pulumi.CustomResource {
/**
* Get an existing Freebox 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 Freebox(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Freebox. 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'] === Freebox.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["addPaused"] = state ? state.addPaused : undefined;
resourceInputs["apiUrl"] = state ? state.apiUrl : undefined;
resourceInputs["appId"] = state ? state.appId : undefined;
resourceInputs["appToken"] = state ? state.appToken : undefined;
resourceInputs["categories"] = state ? state.categories : undefined;
resourceInputs["category"] = state ? state.category : undefined;
resourceInputs["destinationDirectory"] = state ? state.destinationDirectory : undefined;
resourceInputs["enable"] = state ? state.enable : undefined;
resourceInputs["host"] = state ? state.host : undefined;
resourceInputs["itemPriority"] = state ? state.itemPriority : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["port"] = state ? state.port : undefined;
resourceInputs["priority"] = state ? state.priority : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["useSsl"] = state ? state.useSsl : undefined;
}
else {
const args = argsOrState;
if ((!args || args.apiUrl === undefined) && !opts.urn) {
throw new Error("Missing required property 'apiUrl'");
}
if ((!args || args.appId === undefined) && !opts.urn) {
throw new Error("Missing required property 'appId'");
}
if ((!args || args.appToken === undefined) && !opts.urn) {
throw new Error("Missing required property 'appToken'");
}
if ((!args || args.host === undefined) && !opts.urn) {
throw new Error("Missing required property 'host'");
}
if ((!args || args.port === undefined) && !opts.urn) {
throw new Error("Missing required property 'port'");
}
resourceInputs["addPaused"] = args ? args.addPaused : undefined;
resourceInputs["apiUrl"] = args ? args.apiUrl : undefined;
resourceInputs["appId"] = args ? args.appId : undefined;
resourceInputs["appToken"] = (args === null || args === void 0 ? void 0 : args.appToken) ? pulumi.secret(args.appToken) : undefined;
resourceInputs["category"] = args ? args.category : undefined;
resourceInputs["destinationDirectory"] = args ? args.destinationDirectory : undefined;
resourceInputs["enable"] = args ? args.enable : undefined;
resourceInputs["host"] = args ? args.host : undefined;
resourceInputs["itemPriority"] = args ? args.itemPriority : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["port"] = args ? args.port : undefined;
resourceInputs["priority"] = args ? args.priority : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["useSsl"] = args ? args.useSsl : undefined;
resourceInputs["categories"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["appToken"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Freebox.__pulumiType, name, resourceInputs, opts);
}
}
exports.Freebox = Freebox;
/** @internal */
Freebox.__pulumiType = 'prowlarr:DownloadClients/freebox:Freebox';
//# sourceMappingURL=freebox.js.map