import { Command, flags } from '@heroku-cli/command';
import * as color from '@heroku/heroku-cli-util/color';
import { ux } from '@oclif/core/ux';
export default class AccessRemove extends Command {
    static description = 'remove users from a team app';
    static example = `${color.command('heroku access:remove user@email.com --app APP')}`;
    static flags = {
        app: flags.app({ required: true }),
        remote: flags.remote({ char: 'r' }),
    };
    static strict = false;
    static topic = 'access';
    async run() {
        const { argv, flags } = await this.parse(AccessRemove);
        const { app } = flags;
        const email = argv[0];
        const appName = app;
        ux.action.start(`Removing ${color.user(email)} access from the app ${color.app(appName)}`);
        await this.heroku.delete(`/apps/${appName}/collaborators/${email}`);
        ux.action.stop();
    }
}
