import { Command, flags } from '@heroku-cli/command';
import { Args } from '@oclif/core';
import { hux } from '@heroku/heroku-cli-util';
import { display } from '../../lib/authorizations/authorizations.js';
export default class AuthorizationsInfo extends Command {
    static description = 'show an existing OAuth authorization';
    static flags = {
        json: flags.boolean({ char: 'j', description: 'output in json format' }),
    };
    static args = {
        id: Args.string({ required: true, description: 'ID of the authorization' }),
    };
    async run() {
        const { args, flags } = await this.parse(AuthorizationsInfo);
        const { body: authentication } = await this.heroku.get(`/oauth/authorizations/${args.id}`);
        if (flags.json) {
            hux.styledJSON(authentication);
        }
        else {
            display(authentication);
        }
    }
}
