@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
124 lines • 5.93 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.WatermarkTemplate = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a VOD watermark template resource within HuaweiCloud.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as huaweicloud from "@pulumi/huaweicloud";
*
* const test = new huaweicloud.Vod.WatermarkTemplate("test", {
* height: "0.1",
* horizontalOffset: "0.05",
* imageFile: "./test.PNG",
* imageProcess: "ORIGINAL",
* imageType: "PNG",
* position: "TOPLEFT",
* verticalOffset: "0.05",
* width: "0.1",
* });
* ```
*
* ## Import
*
* The template can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Vod/watermarkTemplate:WatermarkTemplate test 81ac58796e25842ee2e90a904aa8a719
* ```
*
* Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response, security or some other reason. The missing attributes include`image_file`. It is generally recommended running `terraform plan` after importing a watermark template. You can then decide if changes should be applied to the watermark template, or the resource definition should be updated to align with the watermark template. Also you can ignore changes as below. hcl resource "huaweicloud_vod_watermark_template" "test" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* image_file,
*
* ]
*
* } }
*/
class WatermarkTemplate extends pulumi.CustomResource {
/**
* Get an existing WatermarkTemplate 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 WatermarkTemplate(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of WatermarkTemplate. 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'] === WatermarkTemplate.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["height"] = state ? state.height : undefined;
resourceInputs["horizontalOffset"] = state ? state.horizontalOffset : undefined;
resourceInputs["imageFile"] = state ? state.imageFile : undefined;
resourceInputs["imageProcess"] = state ? state.imageProcess : undefined;
resourceInputs["imageType"] = state ? state.imageType : undefined;
resourceInputs["imageUrl"] = state ? state.imageUrl : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["position"] = state ? state.position : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["timelineDuration"] = state ? state.timelineDuration : undefined;
resourceInputs["timelineStart"] = state ? state.timelineStart : undefined;
resourceInputs["verticalOffset"] = state ? state.verticalOffset : undefined;
resourceInputs["watermarkType"] = state ? state.watermarkType : undefined;
resourceInputs["width"] = state ? state.width : undefined;
}
else {
const args = argsOrState;
if ((!args || args.imageFile === undefined) && !opts.urn) {
throw new Error("Missing required property 'imageFile'");
}
if ((!args || args.imageType === undefined) && !opts.urn) {
throw new Error("Missing required property 'imageType'");
}
resourceInputs["height"] = args ? args.height : undefined;
resourceInputs["horizontalOffset"] = args ? args.horizontalOffset : undefined;
resourceInputs["imageFile"] = args ? args.imageFile : undefined;
resourceInputs["imageProcess"] = args ? args.imageProcess : undefined;
resourceInputs["imageType"] = args ? args.imageType : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["position"] = args ? args.position : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["timelineDuration"] = args ? args.timelineDuration : undefined;
resourceInputs["timelineStart"] = args ? args.timelineStart : undefined;
resourceInputs["verticalOffset"] = args ? args.verticalOffset : undefined;
resourceInputs["width"] = args ? args.width : undefined;
resourceInputs["imageUrl"] = undefined /*out*/;
resourceInputs["watermarkType"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(WatermarkTemplate.__pulumiType, name, resourceInputs, opts);
}
}
exports.WatermarkTemplate = WatermarkTemplate;
/** @internal */
WatermarkTemplate.__pulumiType = 'huaweicloud:Vod/watermarkTemplate:WatermarkTemplate';
//# sourceMappingURL=watermarkTemplate.js.map