Executes `create_account` transaction.

@param CreateAccountCommand $command
@param bool $isDryRun if true, transaction won't be send to network
@return CreateAccountResponse
435710
public function createAccount(CreateAccountCommand $command, bool $isDryRun = false): CreateAccountResponse
    {
        $this->prepareTransaction($command);
        $response = $this->driver->executeTransaction($command, $isDryRun);

        return new CreateAccountResponse($response->getRawData());
    }
934454
public function execute($command, callable $next)
    {
        if ($this->user->getId() === null) {
            throw new NotAuthenticatedException();
        }

        if (!$this->user->can($this->permission)) {
            throw new InsufficientPermissionsException($this->permission);
        }

        return $next($command);
    }
312566
public function createAccountTransaction(Account $account, Transaction $transaction, array $params = [])
    {
        $data = $this->mapper->fromTransaction($transaction);
        $this->postAndMap($account->getResourcePath().'/transactions', $data + $params, 'toTransaction', $transaction);
    }
1312647
public function drush($command, array $arguments = array(), array $options = array()) {
    $arguments = implode(' ', $arguments);

    // Disable colored output from drush.
    if (isset(static::$isLegacyDrush) && static::$isLegacyDrush) {
      $options['nocolor'] = TRUE;
    }
    else {
      $options['no-ansi'] = NULL;
    }
    $string_options = $this->parseArguments($options);

    $alias = isset($this->alias) ? "@{$this->alias}" : '--root=' . $this->root;

    // Add any global arguments.
    $global = $this->getArguments();

    $process = new Process("{$this->binary} {$alias} {$string_options} {$global} {$command} {$arguments}");
    $process->setTimeout(3600);
    $process->run();

    if (!$process->isSuccessful()) {
      throw new \RuntimeException($process->getErrorOutput());
    }

    // Some drush commands write to standard error output (for example enable
    // use drush_log which default to _drush_print_log) instead of returning a
    // string (drush status use drush_print_pipe).
    if (!$process->getOutput()) {
      return $process->getErrorOutput();
    }
    else {
      return $process->getOutput();
    }

  }
828709
public function runCommand($command, array $options = [])
    {
        if (!is_array($command) && !is_object($command)) {
            throw new InvalidArgumentException(
                sprintf(
                    '$command must be an array or an object, %s given.',
                    \Tequila\MongoDB\getType($command)
                )
            );
        }

        $readPreference = isset($options['readPreference'])
            ? $options['readPreference']
            : $this->readPreference;

        if (!$readPreference instanceof ReadPreference) {
            throw new InvalidArgumentException(
                sprintf(
                    'Option "readPreference" is expected to be an instance of %s, %s given.',
                    ReadPreference::class,
                    \Tequila\MongoDB\getType($readPreference)
                )
            );
        }

        if (!$command instanceof \MongoDB\Driver\Command) {
            $command = new \MongoDB\Driver\Command($command);
        }
        $server = $this->manager->selectServer($readPreference);
        $cursor = $server->executeCommand($this->databaseName, $command);

        return new CommandCursor($cursor);
    }
55290
@Override
    public Request<AssociateSubnetCidrBlockRequest> getDryRunRequest() {
        Request<AssociateSubnetCidrBlockRequest> request = new AssociateSubnetCidrBlockRequestMarshaller().marshall(this);
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
387792
public function callCommand(string $command, array $arguments = [])
    {
        $newCommand = $this->getApplication()->find($command);

        $arguments['command'] = $command;

        return $newCommand->run(new ArrayInput($arguments), $this->getOutput());
    }
106909
public <R> R executeTransactionalCommand(final TransactionalCommand<R> command, final int retryCount)
            throws MithraBusinessException
    {
        return this.executeTransactionalCommand(command, new TransactionStyle(this.transactionTimeout, retryCount));
    }
828284
protected function createRequest(CommandInterface $command)
    {
        $operation = $this->description->getOperation($command->getName());

        // If command does not specify a template, assume the client's base URL.
        if (null === $operation->getUri()) {
            return new Request(
                $operation->getHttpMethod(),
                $this->description->getBaseUri()
            );
        }

        return $this->createCommandWithUri($operation, $command);
    }
611599
public function markRun($dryRun = 1)
	{
		$run = Run::blank();
		$run->set('import_id', $this->get('id'))
			->set('count', $this->get('count'))
			->set('ran_by', User::get('id'))
			->set('ran_at', Date::toSql())
			->set('dry_run', $dryRun)
			->save();
	}
1292827
protected function call(iApiCommand $command)
    {
        $recall = 1;

recall:

        if (method_exists($command, 'setToken')) {
            $token = $this->tokenProvider->getToken();
            $command->setToken($token);
        }


        $response = parent::call($command);

        if ($ex = $response->hasException()) {

            if ( $ex instanceof exTokenMismatch && $recall > 0 ) {
                // Token revoked or mismatch
                // Refresh Token
                // TODO Handle Errors while retrieve token (delete cache)
                try {
                    $this->tokenProvider->exchangeToken();

                } catch (\Exception $e) {
                    // Exchange Not Implemented
                }


                $recall--;

                goto recall;
            }

            throw $ex;
        }


        return $response;
    }
862033
protected function createRequest(CommandTransaction $trans)
    {
        $operation = $this->description->getOperation($trans->command->getName());

        // If the command does not specify a template, then assume the base URL
        // of the client
        if (null === ($uri = $operation->getUri())) {
            return $trans->client->createRequest(
                $operation->getHttpMethod(),
                $this->description->getBaseUrl(),
                $trans->command['request_options'] ?: []
            );
        }

        return $this->createCommandWithUri(
            $operation, $trans->command, $trans->serviceClient
        );
    }
1039282
@Override
    public Request<CreateKeyPairRequest> getDryRunRequest() {
        Request<CreateKeyPairRequest> request = new CreateKeyPairRequestMarshaller().marshall(this);
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
50324
public function handle(CreateUserCommand $command)
    {
        $user = User::create([
            'username' => $command->username,
            'password' => $command->password,
            'email'    => $command->email,
            'level'    => $command->level,
        ]);

        event(new UserWasCreatedEvent($user));

        return $user;
    }
235637
public function call($command, array $parameters = [], $outputBuffer = null)
    {
        if ($this->ajax() === true) {
            $this->lastOutput = $outputBuffer ?: new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true, new OutputFormatter(true));
            $this->setCatchExceptions(true);
        } else {
            $this->lastOutput = $outputBuffer ?: new BufferedOutput();
            $this->setCatchExceptions(false);
        }

        $command = $command.' '.implode(' ', $parameters);
        $input = new StringInput($command);
        $input->setInteractive(false);

        $result = $this->run($input, $this->lastOutput);

        $this->setCatchExceptions(true);

        return $result;
    }
1062516
function grantPermission (commandOptions, { accountId, grantablePermissionName }) {
  return command(
    commandOptions,
    txHelper.addCommand(
      txHelper.emptyTransaction(),
      'grantPermission',
      {
        accountId,
        grantablePermissionName
      }
    )
  )
}
336171
public function createWithdrawal(Withdrawal $withdrawal, array $params = [])
    {
        $this->getClient()->createAccountWithdrawal($this, $withdrawal, $params);
    }