import { z } from 'zod';
import { globalOptionsZod } from '../../../../Command.js';
import request from '../../../../request.js';
import GraphCommand from '../../../base/GraphCommand.js';
import commands from '../../commands.js';
export const options = globalOptionsZod
    .extend({
    displayName: z.string().optional().alias('n'),
    description: z.string().optional().alias('d')
}).strict();
class EntraMultitenantSetCommand extends GraphCommand {
    get name() {
        return commands.MULTITENANT_SET;
    }
    get description() {
        return 'Updates the properties of a multitenant organization';
    }
    get schema() {
        return options;
    }
    getRefinedSchema(schema) {
        return schema
            .refine(options => options.displayName || options.description, {
            error: 'Specify either displayName or description or both'
        });
    }
    async commandAction(logger, args) {
        if (this.verbose) {
            await logger.logToStderr('Updating 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 {
            await request.patch(requestOptions);
        }
        catch (err) {
            this.handleRejectedODataJsonPromise(err);
        }
    }
}
export default new EntraMultitenantSetCommand();
//# sourceMappingURL=multitenant-set.js.map