import * as color from '@heroku/heroku-cli-util/color';
import { ux } from '@oclif/core/ux';
export const inviteMemberToTeam = async function (email, role, team, heroku) {
    ux.action.start(`Inviting ${color.user(email)} to ${color.team(team)} as ${color.green(role)}`);
    await heroku.request(`/teams/${team}/invitations`, {
        body: { email, role }, headers: {
            Accept: 'application/vnd.heroku+json; version=3.team-invitations',
        },
        method: 'PUT',
    });
    ux.action.stop();
};
export const addMemberToTeam = async function (email, role, groupName, heroku, method = 'PUT') {
    ux.action.start(`Adding ${color.user(email)} to ${color.team(groupName)} as ${color.green(role)}`);
    await heroku.request(`/teams/${groupName}/members`, {
        body: { email, role },
        method,
    });
    ux.action.stop();
};
