List buckets of user.

@param array $options Supported options:
<ul>
<li>config: The optional bce configuration, which will overwrite
the default client configuration that was passed in constructor.
</li>
</ul>
@return object the server response.
345454
public function listBuckets($options = array())
    {
        list($config) = $this->parseOptions($options, BosOptions::CONFIG);

        return $this->sendRequest(
            HttpMethod::GET,
            array(
                BosOptions::CONFIG => $config
            )
        );
    }
355201
public function listStash($options = null)
    {
        $this->arguments[] = 'list';
        if ($options) {
            $this->arguments[] = $options;
        }
        return $this->run();
    }
885871
public function getBucketAcl($bucketName, $options = array())
    {
        list($config) = $this->parseOptions($options, BosOptions::CONFIG);

        return $this->sendRequest(
            HttpMethod::GET,
            array(
                BosOptions::CONFIG => $config,
                'bucket_name' => $bucketName,
                'params' => array(
                    BosOptions::ACL => '',
                )
            )
        );
    }
1322984
private function checkOptions($options)
    {
        if (empty($options['username'])) {
            throw new \Exception('Username is not set', 2301);
        }
        if (empty($options['password'])) {
            throw new \Exception('Password or hash is not set', 2302);
        }
        if (empty($options['host'])) {
            throw new \Exception('CPanel Host is not set', 2303);
        }

        return $this;
    }
958998
public function createBucket($bucketName, array $options = [])
    {
        $this->openManager();

        $this->manager->createBucket($bucketName, $options);

        // ToDo: https://github.com/matrozov/yii2-couchbase/issues/1
        sleep(5);
    }
1001423
public function searchChannels($options)
    {
        $availableOptions = ['query', 'limit', 'offset'];

        $parameters = [];

        //  Filter the available options
        foreach ($availableOptions as $option) {

            if (isset($options[ $option ])) {

                $parameters[ $option ] = $options[ $option ];
            }
        }

        $response = $this->client->get('/kraken/search/channels', ['query' => $parameters]);

        return $response->json();
    }
1071404
public function options(array $options = null)
    {
        if (null === $options) {
            return $this->options;
        }

        $this->options = [];
        foreach($options as $option)
            $this->options[$option] = false;

        return $this;
    }
271442
public static function configure_server($options = array())
    {
        self::$solr_options = array_merge(self::$solr_options, $options);
        self::$merged_solr_options = null;

        self::$service_singleton = null;
        self::$service_core_singletons = array();
    }
303550
private function getRequest($options)
    {
        $headers = isset($options['headers']) ? $options['headers'] : [];
        $headers['User-Agent'] = 'sanity-php ' . Version::VERSION;

        if (!empty($this->clientConfig['token'])) {
            $headers['Authorization'] = 'Bearer ' . $this->clientConfig['token'];
        }

        $method = isset($options['method']) ? $options['method'] : 'GET';
        $body = isset($options['body']) ? $options['body'] : null;
        $cdnAllowed = (
            isset($options['cdnAllowed']) &&
            $options['cdnAllowed'] &&
            $this->clientConfig['useCdn']
        );

        $baseUrl = $cdnAllowed
            ? $this->clientConfig['cdnUrl']
            : $this->clientConfig['url'];

        $url = $baseUrl . $options['url'];

        return new Request($method, $url, $headers, $body);
    }
957753
public static function listing(array $params = [], array $customHeaders = []): BunqResponseMonetaryAccountJointList
    {
        $apiClient = new ApiClient(static::getApiContext());
        $responseRaw = $apiClient->get(
            vsprintf(
                self::ENDPOINT_URL_LISTING,
                [static::determineUserId()]
            ),
            $params,
            $customHeaders
        );

        return BunqResponseMonetaryAccountJointList::castFromBunqResponse(
            static::fromJsonList($responseRaw, self::OBJECT_TYPE_GET)
        );
    }
1113782
public function queryOrder(array $options)
    {
        $pay = new Order($this->config->get());
        return $pay->query($options);
    }
451698
protected static function getBitBucketClient(array $options = [])
    {
        if (null === static::$client || static::$client->getOptions() !== $options) {
            static::$client = new BitBucketClient($options);
        }

        return static::$client;
    }
542472
public function getBucketLocation($bucketName, $options = array())
    {
        list($config) = $this->parseOptions($options, BosOptions::CONFIG);
        $response = $this->sendRequest(
            HttpMethod::GET,
            array(
                BosOptions::CONFIG => $config,
                'bucket_name' => $bucketName,
                'params' => array(
                    BosOptions::LOCATION => '',
                ),
            )
        );
        return $response->locationConstraint;
    }
1213022
public function createBucket(array $options)
    {
        if (!in_array($options['BucketType'], [Bucket::TYPE_PUBLIC, Bucket::TYPE_PRIVATE])) {
            throw new ValidationException(
                sprintf('Bucket type must be %s or %s', Bucket::TYPE_PRIVATE, Bucket::TYPE_PUBLIC)
            );
        }

        $response = $this->client->request('POST', $this->apiUrl.'/b2_create_bucket', [
            'headers' => [
                'Authorization' => $this->authToken,
            ],
            'json' => [
                'accountId' => $this->accountId,
                'bucketName' => $options['BucketName'],
                'bucketType' => $options['BucketType']
            ]
        ]);

        return new Bucket($response['bucketId'], $response['bucketName'], $response['bucketType']);
    }
700136
public static function browseByUser($options = [])
    {
        $find = $options['user']->roles();
        $total = $find->count();

        if (!empty($options['order'])) {
            foreach ($options['order'] as $field => $direction) {

                $find = $find->orderBy($field, $direction);
            }
        }

        if (!empty($options['offset'])) {
            $find = $find->skip($options['offset']);
        }

        if (!empty($options['limit'])) {
            $find = $find->take($options['limit']);
        }

        return [
            'total'  => $total,
            'offset' => empty($options['offset']) ? 0 : $options['offset'],
            'limit'  => empty($options['limit']) ? 0 : $options['limit'],
            'data'   => $find->get(),
        ];
    }
209605
public function usertypes($options = array())
    {
        $viewer = get_viewer();
        $options = new AnConfig($options);

        $options->append(array(
            'id' => 'person-userType',
            'selected' => 'registered',
            'name' => 'usertype',
            'class' => 'input-block-level',
        ));

        $selected = $options->selected;

        unset($options->selected);

        $usertypes = array(
            ComPeopleDomainEntityPerson::USERTYPE_REGISTERED => AnTranslator::_('COM-PEOPLE-USERTYPE-REGISTERED'),
            ComPeopleDomainEntityPerson::USERTYPE_ADMINISTRATOR => AnTranslator::_('COM-PEOPLE-USERTYPE-ADMINISTRATOR'),
        );

        if ($viewer->superadmin()) {
            $usertypes[ComPeopleDomainEntityPerson::USERTYPE_SUPER_ADMINISTRATOR] = AnTranslator::_('COM-PEOPLE-USERTYPE-SUPER-ADMINISTRATOR');
        }

        $html = $this->getService('com:base.template.helper.html');

        return $html->select($options->name, array('options' => $usertypes, 'selected' => $selected), AnConfig::unbox($options));
    }
1064356
public function listBucketsCommand()
    {
        try {
            $s3Client = new S3Client($this->s3DefaultProfile);
            $result = $s3Client->listBuckets();
        } catch (\Exception $e) {
            $this->outputLine($e->getMessage());
            $this->quit(1);
            exit;
        }

        if (count($result['Buckets']) === 0) {
            $this->outputLine('The account currently does not have any buckets.');
        }

        $tableRows = array();
        $headerRow = array('Bucket Name', 'Creation Date');

        foreach ($result['Buckets'] as $bucket) {
            $tableRows[] = array($bucket['Name'], $bucket['CreationDate']);
        }

        $this->output->outputTable($tableRows, $headerRow);
    }