@maienm/pulumi-readarr
Version:
A Pulumi package for creating and managing Readarr resources. Based on terraform-provider-readarr: version v2.1.0
150 lines • 8.1 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.Indexer = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* <!-- subcategory:Indexers -->Generic Indexer resource. When possible use a specific resource instead.
* For more information refer to [Indexer](https://wiki.servarr.com/readarr/settings#indexers) documentation.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as readarr from "@maienm/pulumi-readarr";
*
* const example = new readarr.indexers.Indexer("example", {
* apiPath: "/api",
* baseUrl: "https://lolo.sickbeard.com",
* categories: [
* 8000,
* 5000,
* ],
* configContract: "NewznabSettings",
* enableAutomaticSearch: true,
* implementation: "Newznab",
* protocol: "usenet",
* tags: [
* 1,
* 2,
* ],
* });
* ```
*
* ## Import
*
* import using the API/UI ID
*
* ```sh
* $ pulumi import readarr:Indexers/indexer:Indexer example 1
* ```
*/
class Indexer extends pulumi.CustomResource {
/**
* Get an existing Indexer 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 Indexer(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Indexer. 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'] === Indexer.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["additionalParameters"] = state ? state.additionalParameters : undefined;
resourceInputs["allowZeroSize"] = state ? state.allowZeroSize : undefined;
resourceInputs["apiKey"] = state ? state.apiKey : undefined;
resourceInputs["apiPath"] = state ? state.apiPath : undefined;
resourceInputs["apiUser"] = state ? state.apiUser : undefined;
resourceInputs["authorSeedTime"] = state ? state.authorSeedTime : undefined;
resourceInputs["baseUrl"] = state ? state.baseUrl : undefined;
resourceInputs["captchaToken"] = state ? state.captchaToken : undefined;
resourceInputs["categories"] = state ? state.categories : undefined;
resourceInputs["configContract"] = state ? state.configContract : undefined;
resourceInputs["cookie"] = state ? state.cookie : undefined;
resourceInputs["delay"] = state ? state.delay : undefined;
resourceInputs["earlyReleaseLimit"] = state ? state.earlyReleaseLimit : undefined;
resourceInputs["enableAutomaticSearch"] = state ? state.enableAutomaticSearch : undefined;
resourceInputs["enableInteractiveSearch"] = state ? state.enableInteractiveSearch : undefined;
resourceInputs["enableRss"] = state ? state.enableRss : undefined;
resourceInputs["implementation"] = state ? state.implementation : undefined;
resourceInputs["minimumSeeders"] = state ? state.minimumSeeders : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["passkey"] = state ? state.passkey : undefined;
resourceInputs["password"] = state ? state.password : undefined;
resourceInputs["priority"] = state ? state.priority : undefined;
resourceInputs["protocol"] = state ? state.protocol : undefined;
resourceInputs["rankedOnly"] = state ? state.rankedOnly : undefined;
resourceInputs["seedRatio"] = state ? state.seedRatio : undefined;
resourceInputs["seedTime"] = state ? state.seedTime : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["username"] = state ? state.username : undefined;
}
else {
const args = argsOrState;
if ((!args || args.configContract === undefined) && !opts.urn) {
throw new Error("Missing required property 'configContract'");
}
if ((!args || args.implementation === undefined) && !opts.urn) {
throw new Error("Missing required property 'implementation'");
}
if ((!args || args.protocol === undefined) && !opts.urn) {
throw new Error("Missing required property 'protocol'");
}
resourceInputs["additionalParameters"] = args ? args.additionalParameters : undefined;
resourceInputs["allowZeroSize"] = args ? args.allowZeroSize : undefined;
resourceInputs["apiKey"] = args ? args.apiKey : undefined;
resourceInputs["apiPath"] = args ? args.apiPath : undefined;
resourceInputs["apiUser"] = args ? args.apiUser : undefined;
resourceInputs["authorSeedTime"] = args ? args.authorSeedTime : undefined;
resourceInputs["baseUrl"] = args ? args.baseUrl : undefined;
resourceInputs["captchaToken"] = args ? args.captchaToken : undefined;
resourceInputs["categories"] = args ? args.categories : undefined;
resourceInputs["configContract"] = args ? args.configContract : undefined;
resourceInputs["cookie"] = args ? args.cookie : undefined;
resourceInputs["delay"] = args ? args.delay : undefined;
resourceInputs["earlyReleaseLimit"] = args ? args.earlyReleaseLimit : undefined;
resourceInputs["enableAutomaticSearch"] = args ? args.enableAutomaticSearch : undefined;
resourceInputs["enableInteractiveSearch"] = args ? args.enableInteractiveSearch : undefined;
resourceInputs["enableRss"] = args ? args.enableRss : undefined;
resourceInputs["implementation"] = args ? args.implementation : undefined;
resourceInputs["minimumSeeders"] = args ? args.minimumSeeders : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["passkey"] = (args === null || args === void 0 ? void 0 : args.passkey) ? pulumi.secret(args.passkey) : undefined;
resourceInputs["password"] = (args === null || args === void 0 ? void 0 : args.password) ? pulumi.secret(args.password) : undefined;
resourceInputs["priority"] = args ? args.priority : undefined;
resourceInputs["protocol"] = args ? args.protocol : undefined;
resourceInputs["rankedOnly"] = args ? args.rankedOnly : undefined;
resourceInputs["seedRatio"] = args ? args.seedRatio : undefined;
resourceInputs["seedTime"] = args ? args.seedTime : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["username"] = args ? args.username : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["passkey", "password"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Indexer.__pulumiType, name, resourceInputs, opts);
}
}
exports.Indexer = Indexer;
/** @internal */
Indexer.__pulumiType = 'readarr:Indexers/indexer:Indexer';
//# sourceMappingURL=indexer.js.map