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 = z.strictObject({
    ...globalOptionsZod.shape,
    password: z.string().alias('p')
});
class EntraUserPasswordValidateCommand extends GraphCommand {
    get name() {
        return commands.USER_PASSWORD_VALIDATE;
    }
    get description() {
        return "Checks a user's password against the organization's password validation policy";
    }
    get schema() {
        return options;
    }
    async commandAction(logger, args) {
        try {
            const requestOptions = {
                url: `${this.resource}/beta/users/validatePassword`,
                headers: {
                    accept: 'application/json;odata.metadata=none'
                },
                data: {
                    password: args.options.password
                },
                responseType: 'json'
            };
            const res = await request.post(requestOptions);
            await logger.log(res);
        }
        catch (err) {
            this.handleRejectedODataJsonPromise(err);
        }
    }
}
export default new EntraUserPasswordValidateCommand();
//# sourceMappingURL=user-password-validate.js.map