-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cccd52e
commit d9647e8
Showing
5 changed files
with
84 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
// TODO remove this it was a testing stub :V | ||
|
||
namespace Pagely\AtomicClient\Command\Accounts; | ||
|
||
use League\CLImate\TerminalObject\Dynamic\Input; | ||
use Pagely\AtomicClient\API\Accounts\AccountsClient; | ||
use Pagely\AtomicClient\API\AuthApi; | ||
use Pagely\AtomicClient\Command\Command; | ||
use Pagely\AtomicClient\Command\OauthCommandTrait; | ||
use Symfony\Component\Console\Input\InputArgument; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
class GetCollabRoleCommand extends Command | ||
{ | ||
use OauthCommandTrait; | ||
|
||
/** | ||
* @var AccountsClient | ||
*/ | ||
protected $api; | ||
|
||
public function __construct(AuthApi $authApi, AccountsClient $apps, $name = 'account:collabs:get-role') | ||
{ | ||
$this->authClient = $authApi; | ||
$this->api = $apps; | ||
parent::__construct($name); | ||
} | ||
|
||
public function configure() | ||
{ | ||
parent::configure(); | ||
$this | ||
->setDescription('Get collaborator role on account or specific app') | ||
->addArgument('accountId', InputArgument::REQUIRED, 'Account ID') | ||
->addArgument('collabId', InputArgument::REQUIRED, 'Collab user ID') | ||
->addArgument('appId', InputArgument::OPTIONAL, 'App ID', 0) | ||
; | ||
$this->addOauthOptions(); | ||
} | ||
|
||
public function execute(InputInterface $input, OutputInterface $output): int | ||
{ | ||
$accountId = $input->getArgument('accountId'); | ||
$collabId = $input->getArgument('collabId'); | ||
$appId = $input->getArgument('appId'); | ||
$token = $this->token->token; | ||
|
||
$r = $this->api->getCollabRole($token, $accountId, $collabId, $appId); | ||
print_r($r); | ||
|
||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters