Receive a single custom collection

@link   https://help.shopify.com/api/reference/customcollection#show
@param  integer $customCollectionId
@param  array   $fields
@return CustomCollection
976853
public function get($customCollectionId, array $fields = array())
    {
        $params = array();
        if (!empty($fields)) {
            $params['fields'] = $fields;
        }
        $endpoint = '/admin/custom_collections/'.$customCollectionId.'.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createObject(CustomCollection::class, $response['custom_collection']);
    }
247183
public function createCollectorResponse($collectorId, array $data = [])
	{
		return $this->sendRequest(
			$this->createRequest('POST', sprintf('collectors/%d/responses', $collectorId), [], $data)
		);
	}
882263
public function getCollectorRecipient($collectorId, $recipientId)
	{
		return $this->sendRequest(
			$this->createRequest('GET', sprintf('collectors/%s/recipients/%s', $collectorId,  $recipientId))
		);
	}
291235
public function select($collectionName, array $ids)
    {
        $mappedIds = array_map(function ($id) use ($collectionName) {
            return sprintf('%s:%s', $collectionName, $id);
        }, $ids);
        $params = ['foreign_ids' => join(',', $mappedIds)];
        $response = $this->doRequest('GET', 'meta/', $params);
        $body = $response->getBody()->getContents();
        return json_decode($body, true);
    }
958882
public function update(CustomField $customField): CustomField
    {
        $id = $customField->getId();

        $customField->setId(null);

        $response = $this->client->put($this->prepareUrlForKey('update-custom-field', ['id' => $id]), [], $customField->jsonSerialize());
        $responseData = $response->getDecodedBody();

        return new CustomField($responseData);
    }
313133
public function prependSelect($fields = [])
    {
        if (!is_array($fields)) {
            $fields = [$fields];
        }

        $collection = collect($this->select);
        foreach ($fields as $key => $field) {
            $collection->prepend($field, is_string($key) ? $key : null);
        }

        $this->select = $collection->all();

        return $this;
    }
966291
public function getCollectorResponse($collectorId, $responseId, $detailed = false)
	{
		if ($detailed) {
			return $this->sendRequest(
				$this->createRequest('GET', sprintf('collectors/%d/responses/%d', $collectorId, $responseId))
			);
		} else {
			return $this->sendRequest(
				$this->createRequest('GET', sprintf('collectors/%d/responses/%d/details', $collectorId, $responseId))
			);
		}
	}
1097947
protected function prepareProductCollection(\Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection $collection)
    {
        return $collection;
    }
703638
public function listCollections(array $options = [])
    {
        $this->setOptions($options);
        $coll = new Collection($this->client, $this->database);
        $coll->setHeaders($this->getHeaders());
        $rs = $coll->getAll();
        $this->checkResponse($rs);
        $colls = array_get($rs, 'DocumentCollections');
        $list = [];
        if (!empty($colls)) {
            foreach ($colls as $coll) {
                $list[] = array_get($coll, 'id');
            }
        }

        return $list;
    }
160106
public function findOneById($collection, $id, array $fields = [])
    {
        try {
            $id = new \MongoDB\BSON\ObjectID((string) $id);
        } catch (\Exception $e) {
            return;
        }

        $queryOptions = new QueryOptions();
        $queryOptions->setQueryParams([
            '_id' => $id,
        ]);

        return $this->findOne($collection, $queryOptions, $fields);
    }
821504
private function prepareProductCollection(ProductCollection $collection)
    {
        foreach ($this->collectionProcessors as $processor) {
            $collection = $processor->prepareCollection($collection);
        }

        return $collection;
    }
575771
public function askCollection(QuestionWithPredefinedResponse $questionResponseCollection)
    {
        try {
            // If a preselected response exist, try to retireve response and return her
            return $questionResponseCollection->getPredefinedResponseCollection()
                                              ->offsetGetById($questionResponseCollection->getPreselectedResponse())
                                              ->getResponse();
        } catch (PredefinedResponseException $e) {
            // preselected response does not exist

            $choises = array();

            foreach ($questionResponseCollection->getPredefinedResponseCollection() as $response) {
                $choises[] = $response->getLabel();
            }

            // Ask question
            $choise = $this->question->ask(
                $this->input,
                $this->output,
                new ChoiceQuestion(
                    $this->buildQuestionText($questionResponseCollection),
                    $choises,
                    $this->getPreResponse($questionResponseCollection)
                )
            );

            try {
                return $questionResponseCollection->getPredefinedResponseCollection()
                                                  ->offsetGetByLabel($choise)
                                                  ->getResponse();
            } catch (PredefinedResponseException $e) {
                throw new ResponseExpectedException(
                    sprintf(
                        'Response "%s" does not exist',
                        $choise
                    )
                );
            }
        }
    }
1283409
protected function processQueryFields($data, array $fields = array())
    {
        $base = new stdClass();

        if (count($fields) === 0) {
            return $base;
        }

        foreach ($fields as $key => $field) {

            $this->verifyFieldDefined($key, $field);

            if (in_array($field['name'], $this->customfieldgroups)
                || $field['type'] === 'customfield'
            ) {
            } else {
                $base->$field['name'] = $this->processQueryField($data, $field);
            }
        }

        return $this->sortObject($base);
    }
26615
public function addCustomFields($customFields)
    {
        if (!$this->getCustomFields()) {
            return $this->setCustomFields(array($customFields));
        } else {
            return $this->setCustomFields(
                array_merge($this->getCustomFields(), array($customFields))
            );
        }
    }
1355330
public static function create(array $cards, array $customHeaders = []): BunqResponseCardBatch
    {
        $apiClient = new ApiClient(static::getApiContext());
        $responseRaw = $apiClient->post(
            vsprintf(
                self::ENDPOINT_URL_CREATE,
                [static::determineUserId()]
            ),
            [self::FIELD_CARDS => $cards],
            $customHeaders
        );

        return BunqResponseCardBatch::castFromBunqResponse(
            static::fromJson($responseRaw, self::OBJECT_TYPE_POST)
        );
    }
335547
public function collection(Collection $collection)
    {
        $entries = new Entries();

        foreach ($collection as $product) {
            $entry = new Entry($product);

            $entry
                ->conditionalField('id', function () {
                    return Subbly::api('subbly.user')->hasAccess('subbly.backend.auth');
                })

                ->field('position')
                ->field('name')
                ->field('description')
                ->field('sku')
                ->field('status')
                ->field('price')
                ->field('sale_price')
                ->field('quantity')

                ->relationshipField('images', 'Subbly\\Presenter\\V1\\ProductImagePresenter')
                ->relationshipField('options', 'Subbly\\Presenter\\V1\\ProductOptionPresenter')
                ->relationshipField('categories', 'Subbly\\Presenter\\V1\\ProductCategoryPresenter')

                ->dateField('created_at')
                ->dateField('updated_at')
            ;

            $entries->addEntry($entry);
        }

        return $entries->toArray();
    }
193000
public function viewAction($collectionId, $slug)
    {
        $collection = $this->get('sonata.classification.manager.collection')->findOneBy(['id' => $collectionId]);

        if (!$collection) {
            throw new NotFoundHttpException(sprintf('Unable to find the collection with id=%d', $collectionId));
        }

        return $this->render('SonataProductBundle:Collection:view.html.twig', [
           'collection' => $collection,
        ]);
    }