UNPKG

@pnp/cli-microsoft365

Version:

Manage Microsoft 365 and SharePoint Framework projects on any platform

65 lines 3.21 kB
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); }; var _EntraMultitenantAddCommand_instances, _EntraMultitenantAddCommand_initTelemetry, _EntraMultitenantAddCommand_initOptions, _EntraMultitenantAddCommand_initTypes; import request from '../../../../request.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; class EntraMultitenantAddCommand extends GraphCommand { get name() { return commands.MULTITENANT_ADD; } get description() { return 'Creates a new multitenant organization'; } constructor() { super(); _EntraMultitenantAddCommand_instances.add(this); __classPrivateFieldGet(this, _EntraMultitenantAddCommand_instances, "m", _EntraMultitenantAddCommand_initTelemetry).call(this); __classPrivateFieldGet(this, _EntraMultitenantAddCommand_instances, "m", _EntraMultitenantAddCommand_initOptions).call(this); __classPrivateFieldGet(this, _EntraMultitenantAddCommand_instances, "m", _EntraMultitenantAddCommand_initTypes).call(this); } async commandAction(logger, args) { if (this.verbose) { await logger.logToStderr('Creating multitenant organization...'); } const requestOptions = { url: `${this.resource}/v1.0/tenantRelationships/multiTenantOrganization`, headers: { accept: 'application/json;odata.metadata=none' }, responseType: 'json', data: { description: args.options.description, displayName: args.options.displayName } }; try { const multitenantOrg = await request.put(requestOptions); await logger.log(multitenantOrg); } catch (err) { this.handleRejectedODataJsonPromise(err); } } } _EntraMultitenantAddCommand_instances = new WeakSet(), _EntraMultitenantAddCommand_initTelemetry = function _EntraMultitenantAddCommand_initTelemetry() { this.telemetry.push((args) => { Object.assign(this.telemetryProperties, { displayName: typeof args.options.displayName !== 'undefined', description: typeof args.options.description !== 'undefined' }); }); }, _EntraMultitenantAddCommand_initOptions = function _EntraMultitenantAddCommand_initOptions() { this.options.unshift({ option: '-n, --displayName <displayName>' }, { option: '-d, --description [description]' }); }, _EntraMultitenantAddCommand_initTypes = function _EntraMultitenantAddCommand_initTypes() { this.types.string.push('displayName', 'description'); }; export default new EntraMultitenantAddCommand(); //# sourceMappingURL=multitenant-add.js.map