@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
372 lines • 13.2 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.User = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a meeting user resource within HuaweiCloud.
*
* ## Example Usage
* ### Create a user using third-party application authorization and specifies the account parameters
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const appId = config.requireObject("appId");
* const appKey = config.requireObject("appKey");
* const userAccount = config.requireObject("userAccount");
* const thirdAccount = config.requireObject("thirdAccount");
* const userName = config.requireObject("userName");
* const userPassword = config.requireObject("userPassword");
* const englishName = config.requireObject("englishName");
* const signature = config.requireObject("signature");
* const title = config.requireObject("title");
* const test = new huaweicloud.meeting.User("test", {
* appId: appId,
* appKey: appKey,
* account: userAccount,
* thirdAccount: thirdAccount,
* password: userPassword,
* country: "chinaPR",
* description: "Created by script",
* email: "123456789@example.com",
* englishName: englishName,
* phone: "+8612345678987",
* signature: signature,
* title: title,
* sortLevel: 5,
* });
* ```
* ### Create a user using account authorization
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const accountName = config.requireObject("accountName");
* const accountPassword = config.requireObject("accountPassword");
* const userName = config.requireObject("userName");
* const userPassword = config.requireObject("userPassword");
* const englishName = config.requireObject("englishName");
* const signature = config.requireObject("signature");
* const title = config.requireObject("title");
* const test = new huaweicloud.meeting.User("test", {
* accountName: accountName,
* accountPassword: accountPassword,
* password: userPassword,
* country: "chinaPR",
* email: "123456789@example.com",
* englishName: englishName,
* phone: "+8612345678987",
* signature: signature,
* title: title,
* sortLevel: 5,
* });
* ```
* ## Appendix
*
* <a name="phoneNumberMapping"></a>
* The countries (or regions) and phone numbers mapping relationship supports:
*
* | Country Or Region | Country Code |
* | ---- | ---- |
* | chinaPR | +86 |
* | chinaHKG | +852|
* | chinaOMA | +853 |
* | chinaTPE | +886 |
* | BVl | +1284 |
* | Bolivia | +591 |
* | CZ | +420 |
* | GB | +245 |
* | SVGrenadines | +1784 |
* | TAT | +1868 |
* | UK | +44 |
* | afghanistan | +93 |
* | albania | +355 |
* | algeria | +213 |
* | andorra | +376 |
* | angola | +244 |
* | argentina | +54 |
* | armenia | +374 |
* | australia | +61 |
* | austria | +43 |
* | azerbaijan | +994 |
* | bahamas | +1242 |
* | bahrain | +973 |
* | bangladesh | +880 |
* | belarus | +375 |
* | belgium | +32 |
* | belize | +501 |
* | benin | +229 |
* | bosniaAndHerzegovina | +387 |
* | botswana | +267 |
* | brazil | +55 |
* | brunei | +673 |
* | bulgaria | +359 |
* | burkinaFaso | +226 |
* | burundi | +257 |
* | cambodia | +855 |
* | cameroon | +237 |
* | canada | +1 |
* | capeVerde | +238 |
* | caymanIslands | +1345 |
* | centralAfrican | +236 |
* | chad | +235 |
* | chile | +56 |
* | columbia | +57 |
* | comoros | +269 |
* | congoB | +242 |
* | congoJ | +243 |
* | costarica | +506 |
* | croatia | +385 |
* | curacao | +599 |
* | cyprus | +357 |
* | denmark | +45 |
* | djibouti | +253 |
* | dominica | +1809 |
* | ecuador | +593 |
* | egypt | +20 |
* | equatorialGuinea | +240 |
* | estonia | +372 |
* | finland | +358 |
* | france | +33 |
* | gabon | +241 |
* | gambia | +220 |
* | georgia | +995 |
* | germany | +49 |
* | ghana | +233 |
* | greece | +30 |
* | grenada | +1473 |
* | guatemala | +502 |
* | guinea | +224 |
* | guyana | +592 |
* | honduras | +504 |
* | hungary | +36 |
* | india | +91 |
* | indonesia | +62 |
* | iraq | +964 |
* | ireland | +353 |
* | israel | +972 |
* | italy | +39 |
* | ivoryCoast | +225 |
* | jamaica | +1876 |
* | japan | +81 |
* | jordan | +962 |
* | kazakhstan | +7 |
* | kenya | +254 |
* | kuwait | +965 |
* | kyrgyzstan | +996 |
* | laos | +856 |
* | latvia | +371 |
* | lebanon | +961 |
* | lesotho | +266 |
* | liberia | +231 |
* | libya | +218 |
* | lithuania | +370 |
* | luxembourg | +352 |
* | macedonia | +389 |
* | madagascar | +261 |
* | malawi | +265 |
* | malaysia | +60 |
* | maldives | +960 |
* | mali | +223 |
* | malta | +356 |
* | mauritania | +222 |
* | mauritius | +230 |
* | mexico | +52 |
* | moldova | +373 |
* | mongolia | +976 |
* | montenegro | +382 |
* | morocco | +212 |
* | mozambique | +258 |
* | myanmar | +95 |
* | namibia | +264 |
* | nepal | +977 |
* | netherlands | +31 |
* | newZealand | +64 |
* | nicaragua | +505 |
* | niger | +227 |
* | nigeria | +234 |
* | norway | +47 |
* | oman | +968 |
* | pakistan | +92 |
* | palestine | +970 |
* | panama | +507 |
* | papuaNewGuinea | +675 |
* | peru | +51 |
* | philippines | +63 |
* | poland | +48 |
* | portugal | +351 |
* | puertoRico | +1787 |
* | qatar | +974 |
* | romania | +40 |
* | russia | +7 |
* | rwanda | +250 |
* | saintMartin | +590 |
* | salvatore | +503 |
* | saudiArabia | +966 |
* | senegal | +221 |
* | serbia | +381 |
* | seychelles | +248 |
* | sierraLeone | +232 |
* | singapore | +65 |
* | slovakia | +421 |
* | slovenia | +386 |
* | somalia | +252 |
* | southAfrica | +27 |
* | southKorea | +82 |
* | spain | +34 |
* | sriLanka | +94 |
* | suriname | +597 |
* | swaziland | +268 |
* | sweden | +46 |
* | switzerland | +41 |
* | tajikistan | +992 |
* | tanzania | +255 |
* | thailand | +66 |
* | togo | +228 |
* | tunisia | +216 |
* | turkey | +90 |
* | turkmenistan | +993 |
* | uae | +971 |
* | uganda | +256 |
* | ukraine | +380 |
* | uruguay | +598 |
* | usa | +1 |
* | uzbekistan | +998 |
* | venezuela | +58 |
* | vietNam | +84 |
* | yemen | +967 |
* | zambia | +260 |
* | zimbabwe | +263 |
*
* ## Import
*
* Users can be imported using their `id` and authorization parameters, separated by slashes, e.g. Import a user and authenticated by account. bash
*
* ```sh
* $ pulumi import huaweicloud:Meeting/user:User test <id>/<account_name>/<account_password>
* ```
*
* Import a user and authenticated by `APP ID`/`APP Key`. bash
*
* ```sh
* $ pulumi import huaweicloud:Meeting/user:User test <id>/<app_id>/<app_key>/<corp_id>/<user_id>
* ```
*
* The slashes cannot be missing even corporation ID and user ID are empty. Note that some parameters do not support import due to missing API responses or privacy, such as `password`, `is_send_notify` and `is_admin`. You can ignore this change as below. hcl resource "huaweicloud_meeting_user" "test" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* password, is_send_notify,
*
* ]
*
* } }
*/
class User extends pulumi.CustomResource {
/**
* Get an existing User 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 User(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of User. 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'] === User.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["account"] = state ? state.account : undefined;
resourceInputs["accountName"] = state ? state.accountName : undefined;
resourceInputs["accountPassword"] = state ? state.accountPassword : undefined;
resourceInputs["appId"] = state ? state.appId : undefined;
resourceInputs["appKey"] = state ? state.appKey : undefined;
resourceInputs["corpId"] = state ? state.corpId : undefined;
resourceInputs["country"] = state ? state.country : undefined;
resourceInputs["departmentCode"] = state ? state.departmentCode : undefined;
resourceInputs["departmentName"] = state ? state.departmentName : undefined;
resourceInputs["departmentNamePath"] = state ? state.departmentNamePath : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["email"] = state ? state.email : undefined;
resourceInputs["englishName"] = state ? state.englishName : undefined;
resourceInputs["hidePhone"] = state ? state.hidePhone : undefined;
resourceInputs["isAdmin"] = state ? state.isAdmin : undefined;
resourceInputs["isSendNotify"] = state ? state.isSendNotify : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["password"] = state ? state.password : undefined;
resourceInputs["phone"] = state ? state.phone : undefined;
resourceInputs["signature"] = state ? state.signature : undefined;
resourceInputs["sipNumber"] = state ? state.sipNumber : undefined;
resourceInputs["sortLevel"] = state ? state.sortLevel : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["thirdAccount"] = state ? state.thirdAccount : undefined;
resourceInputs["title"] = state ? state.title : undefined;
resourceInputs["type"] = state ? state.type : undefined;
resourceInputs["userId"] = state ? state.userId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.password === undefined) && !opts.urn) {
throw new Error("Missing required property 'password'");
}
resourceInputs["account"] = args ? args.account : undefined;
resourceInputs["accountName"] = args ? args.accountName : undefined;
resourceInputs["accountPassword"] = args ? args.accountPassword : undefined;
resourceInputs["appId"] = args ? args.appId : undefined;
resourceInputs["appKey"] = args ? args.appKey : undefined;
resourceInputs["corpId"] = args ? args.corpId : undefined;
resourceInputs["country"] = args ? args.country : undefined;
resourceInputs["departmentCode"] = args ? args.departmentCode : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["email"] = args ? args.email : undefined;
resourceInputs["englishName"] = args ? args.englishName : undefined;
resourceInputs["hidePhone"] = args ? args.hidePhone : undefined;
resourceInputs["isAdmin"] = args ? args.isAdmin : undefined;
resourceInputs["isSendNotify"] = args ? args.isSendNotify : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["password"] = args ? args.password : undefined;
resourceInputs["phone"] = args ? args.phone : undefined;
resourceInputs["signature"] = args ? args.signature : undefined;
resourceInputs["sortLevel"] = args ? args.sortLevel : undefined;
resourceInputs["status"] = args ? args.status : undefined;
resourceInputs["thirdAccount"] = args ? args.thirdAccount : undefined;
resourceInputs["title"] = args ? args.title : undefined;
resourceInputs["userId"] = args ? args.userId : undefined;
resourceInputs["departmentName"] = undefined /*out*/;
resourceInputs["departmentNamePath"] = undefined /*out*/;
resourceInputs["sipNumber"] = undefined /*out*/;
resourceInputs["type"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(User.__pulumiType, name, resourceInputs, opts);
}
}
exports.User = User;
/** @internal */
User.__pulumiType = 'huaweicloud:Meeting/user:User';
//# sourceMappingURL=user.js.map